com.openexchange.admin.rmi.dataobjects
Class EnforceableDataObject

java.lang.Object
  extended by com.openexchange.admin.rmi.dataobjects.EnforceableDataObject
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
Database, ExtendableDataObject

public abstract class EnforceableDataObject
extends Object
implements Serializable, Cloneable

Author:
choeger
See Also:
Serialized Form

Constructor Summary
EnforceableDataObject()
          The default constructor
 
Method Summary
 boolean equals(Object obj)
           
abstract  String[] getMandatoryMembersChange()
          This method must be implemented and it must return a String array containing all names of mandatory members of the corresponding class required to CHANGE data.
abstract  String[] getMandatoryMembersCreate()
          This method must be implemented and it must return a String array containing all names of mandatory members of the corresponding class required to CREATE data.
abstract  String[] getMandatoryMembersDelete()
          This method must be implemented and it must return a String array containing all names of mandatory members of the corresponding class required to DELETE data.
abstract  String[] getMandatoryMembersRegister()
          This method must be implemented and it must return a String array containing all names of mandatory members of the corresponding class required to REGISTER data.
 ArrayList<String> getUnsetMembers()
          Returns those fields which are failing during a mandatory members check.
 int hashCode()
           
 boolean mandatoryChangeMembersSet()
          Checks if the mandatory members for change are set for an object
 boolean mandatoryCreateMembersSet()
          Checks if the mandatory members for create are set for an object
 boolean mandatoryDeleteMembersSet()
          Checks if the mandatory members for delete are set for an object
 boolean mandatoryRegisterMembersSet()
          Checks if the mandatory members for register are set for an object
 void testMandatoryCreateFieldsNull()
          This method is used to check that the mandatory fields specified for create aren't set to null through a change
 String toString()
          
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnforceableDataObject

public EnforceableDataObject()
The default constructor

Method Detail

getMandatoryMembersCreate

public abstract String[] getMandatoryMembersCreate()
This method must be implemented and it must return a String array containing all names of mandatory members of the corresponding class required to CREATE data.

Returns:
String array containing names of mandatory members or null if unwanted

getMandatoryMembersChange

public abstract String[] getMandatoryMembersChange()
This method must be implemented and it must return a String array containing all names of mandatory members of the corresponding class required to CHANGE data.

Returns:
String array containing names of mandatory members or null if unwanted

getMandatoryMembersDelete

public abstract String[] getMandatoryMembersDelete()
This method must be implemented and it must return a String array containing all names of mandatory members of the corresponding class required to DELETE data.

Returns:
String array containing names of mandatory members or null if unwanted

getMandatoryMembersRegister

public abstract String[] getMandatoryMembersRegister()
This method must be implemented and it must return a String array containing all names of mandatory members of the corresponding class required to REGISTER data.

Returns:
String array containing names of mandatory members or null if unwanted

mandatoryCreateMembersSet

public boolean mandatoryCreateMembersSet()
                                  throws EnforceableDataObjectException
Checks if the mandatory members for create are set for an object

Returns:
true if they are set; false otherwise
Throws:
EnforceableDataObjectException

mandatoryChangeMembersSet

public boolean mandatoryChangeMembersSet()
                                  throws EnforceableDataObjectException
Checks if the mandatory members for change are set for an object

Returns:
true if they are set; false otherwise
Throws:
EnforceableDataObjectException

mandatoryDeleteMembersSet

public boolean mandatoryDeleteMembersSet()
                                  throws EnforceableDataObjectException
Checks if the mandatory members for delete are set for an object

Returns:
true if they are set; false otherwise
Throws:
EnforceableDataObjectException

mandatoryRegisterMembersSet

public boolean mandatoryRegisterMembersSet()
                                    throws EnforceableDataObjectException
Checks if the mandatory members for register are set for an object

Returns:
true if they are set; false otherwise
Throws:
EnforceableDataObjectException

getUnsetMembers

public ArrayList<String> getUnsetMembers()
Returns those fields which are failing during a mandatory members check. This method is intended to be used after a call of mandatoryCreateMembersSet(), mandatoryChangeMembersSet(), mandatoryDeleteMembersSet() or mandatoryRegisterMembersSet() to determine the missing fields

Returns:
An ArrayList containing the missing fields

toString

public String toString()

Overrides:
toString in class Object

testMandatoryCreateFieldsNull

public void testMandatoryCreateFieldsNull()
                                   throws InvalidDataException
This method is used to check that the mandatory fields specified for create aren't set to null through a change

Parameters:
enforcableobject -
Throws:
InvalidDataException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object