uk.ac.ic.doc.automed
Class IntegrityException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by uk.ac.ic.doc.automed.AutoMedException
              extended by uk.ac.ic.doc.automed.IntegrityException
All Implemented Interfaces:
java.io.Serializable

public class IntegrityException
extends AutoMedException

An attempt has be made to alter the repository (or data structure representing it) in a way that would make it inconsistent. This most often occurs when a user attempts to delete an object (e.g. a Construct) for which other objects (e.g. SchemaObject) If the above is not the case, then there must be a bug in the AutoMed system, which should be reported.

Author:
Peter McBrien (pjm@doc.ic.ac.uk)
See Also:
Serialized Form

Field Summary
static int ADD
          Exception caused by an operation doing some sort of addition to the repository.
static int DELETE
          Exception caused by an operation doing some sort of deletion from the repository.
static int NOT_EQUAL
          Exception caused by an operation doing some sort comparison where .
static int UPDATE
          Exception caused by an operation doing some sort of update on an exisinting object in the repository.
 
Constructor Summary
IntegrityException(java.lang.String msg)
          A simpler constructor for convenience
IntegrityException(java.lang.String msg, java.lang.String className, int operation, int objectID)
          Creates an IntegrityException, recording details of what operation was being attempted
IntegrityException(java.lang.String msg, java.lang.String className, int operation, int objectID1, int objectID2)
          Creates an IntegrityException, recording details of what operation was being attempted
 
Method Summary
 java.lang.String getClassName()
          Return the className of the object that the manipulation of caused this exception.
 int getObjectID()
          Return the object indentifier of the the object, that the manipulation of caused this exception.
 int getOperation()
          Return the operation attempted on the object that caused this exception.
 
Methods inherited from class uk.ac.ic.doc.automed.AutoMedException
getCause, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ADD

public static final int ADD
Exception caused by an operation doing some sort of addition to the repository.

See Also:
Constant Field Values

DELETE

public static final int DELETE
Exception caused by an operation doing some sort of deletion from the repository.

See Also:
Constant Field Values

UPDATE

public static final int UPDATE
Exception caused by an operation doing some sort of update on an exisinting object in the repository.

See Also:
Constant Field Values

NOT_EQUAL

public static final int NOT_EQUAL
Exception caused by an operation doing some sort comparison where .

See Also:
Constant Field Values
Constructor Detail

IntegrityException

public IntegrityException(java.lang.String msg,
                          java.lang.String className,
                          int operation,
                          int objectID)
Creates an IntegrityException, recording details of what operation was being attempted

Parameters:
msg - message for the exception.
className - the name of the repository class that was being added, deleted, or renamed. (Should be Model, Construct, SchemaObject, ...)
operation - should be one of ADD, DELETE, RENAME
objectID - is the identifier number of the object (e.g. the SID if className where Schema. This may be set to -1 if the identifier does not exist or is not known.

IntegrityException

public IntegrityException(java.lang.String msg)
A simpler constructor for convenience


IntegrityException

public IntegrityException(java.lang.String msg,
                          java.lang.String className,
                          int operation,
                          int objectID1,
                          int objectID2)
Creates an IntegrityException, recording details of what operation was being attempted

Parameters:
msg - message for the exception.
className - the name of the repository class that was being added, deleted, or renamed. (Should be Model, Construct, SchemaObject, ...)
operation - should be one of NOT_EQUAL
objectID1 - is the identifier number of one being object (e.g. the SID if className where Schema. This may be set to -1 if the identifier does not exist or is not known.
objectID2 - is the identifier number of the other object being compared
Method Detail

getClassName

public java.lang.String getClassName()
Return the className of the object that the manipulation of caused this exception.


getOperation

public int getOperation()
Return the operation attempted on the object that caused this exception.

Returns:
one of @link ADD, @link DELETE, or @link UPDATE

getObjectID

public int getObjectID()
Return the object indentifier of the the object, that the manipulation of caused this exception.

Returns:
-1 if the object indentified was unknown or did not exist