public class NameInUseException extends ValidationException
getRelatedObjects()| Constructor and Description | 
|---|
| NameInUseException(java.util.Collection<? extends DBObject> objs)Constructs a NameInUseException to indicate that all the given objects
 cannot be created because objects already exists with the same names. | 
| NameInUseException(DBObject obj)Constructs a NameInUseException to indicate that the given object
 is invalid because its name is already in use. | 
| NameInUseException(DBObject object,
                  DBObject existing)Constructs a NameInUseException for a name clash with  a known existing
 object in the DBObjectProvider. | 
| NameInUseException(DBObject object,
                  java.lang.String existingName,
                  java.lang.String existingType)Constructs a NameInUseException for the given object that clashes with
 an existing object in the DBObjectProvider. | 
| NameInUseException(java.lang.String name)Deprecated. 
 - use a constructor that takes the object that is invalid. | 
| NameInUseException(java.lang.String name,
                  java.lang.String existingName,
                  java.lang.String existingType)Deprecated. 
 - use a constructor that takes the object that is invalid. | 
| NameInUseException(java.lang.String name,
                  java.lang.String userName,
                  java.lang.String userType,
                  java.lang.String subUserType)Deprecated. 
 - use a constructor that takes the object that is invalid. | 
| Modifier and Type | Method and Description | 
|---|---|
| java.lang.String | getExistingName()Gets the name of the existing object that clashes with
  getName(). | 
| java.lang.String | getExistingType()Gets the type of the existing object that is using the name. | 
| java.lang.String | getMessage()Gets the message for this exception. | 
| java.lang.String | getName()Gets the name that is invalid because it clashes with an existinb
 object name. | 
| java.lang.String | getSubUserType()Deprecated.  | 
| java.lang.String | getUserName()Deprecated. 
 replaced with  getExistingName() | 
| java.lang.String | getUserType()Deprecated. 
 replaced with  getExistingType() | 
getPropertyName, getTitle, setPropertyNameappend, getAllMessages, getNextException, getObject, getRelatedObjects, setNextException, setRelatedObjectspublic NameInUseException(DBObject obj)
obj - the invalid object whose name is in use (cannot be null).public NameInUseException(java.util.Collection<? extends DBObject> objs)
objs - the objects that all have invalid names@Deprecated public NameInUseException(java.lang.String name)
@Deprecated
public NameInUseException(java.lang.String name,
                                      java.lang.String existingName,
                                      java.lang.String existingType)
public NameInUseException(DBObject object, java.lang.String existingName, java.lang.String existingType)
object - the object whose name clashes with that of an existing
 object.existingName - the name of the existing object that the name clash
 has occured with.existingType - the type of the existing object that the name clash
 has occured with.public NameInUseException(DBObject object, DBObject existing)
object - the object whose name clashes with that of an existing
 object.existing - the existing object that the name clashes with (cannot
 be null).@Deprecated
public NameInUseException(java.lang.String name,
                                      java.lang.String userName,
                                      java.lang.String userType,
                                      java.lang.String subUserType)
public java.lang.String getName()
public java.lang.String getExistingName()
getName(). Depending on the naming conventions of the database
 the "name" and "existing name" might not be identical.public java.lang.String getExistingType()
@Deprecated public java.lang.String getUserName()
getExistingName()@Deprecated public java.lang.String getUserType()
getExistingType()@Deprecated public java.lang.String getSubUserType()
public java.lang.String getMessage()
DBExceptiongetAllMessages()getMessage in class DBExceptionDBException.getAllMessages()