wt.eff
Class EffConfigSpecAssistant

java.lang.Object
  extended bywt.eff.EffConfigSpecAssistant
All Implemented Interfaces:
ApplicationContextChild, Externalizable, RemoteAccess, Serializable

public class EffConfigSpecAssistant
extends Object
implements RemoteAccess, ApplicationContextChild, Externalizable

Assistant for handling type conversions for the start and end values of any subclass of of an EffRange, and providing client and server-side APIs useful for EffConfigSpec, PersistableEffConfigSpec and EffConfigSpecGroup.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private  ApplicationContext applicationContext
           
private static String CLASSNAME
           
private static Class ECS_GROUP_CLASS
           
private static int ECS_GROUP_POS
           
static long EXTERNALIZATION_VERSION_UID
           
private static EffConfigSpecAssistant factory
           
private static String FC_RESOURCE
           
private static String GROUP_ROLE
           
private static String ID
           
private static String OBJECT_IDENTIFIER
           
protected static long OLD_FORMAT_VERSION_UID
           
private static Class P_ECS_CLASS
           
private static int P_ECS_POS
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
(package private) static boolean SERVER
           
 
Fields inherited from interface wt.method.RemoteAccess
versionID
 
Fields inherited from interface wt.services.applicationcontext.ApplicationContextChild
APPLICATION_CONTEXT
 
Constructor Summary
EffConfigSpecAssistant()
           
 
Method Summary
protected static EffConfigSpecGroup _getEffConfigSpecGroup()
          Queries the DB for the EffConfigSpecGroup stored by the current principal.
protected static EffConfigSpecGroup _saveEffConfigSpecGroup(EffConfigSpecGroup effConfigSpecGroup)
          Stores or modifies the EffConfigSpecGroup on the behalf of the current principal.
 ApplicationContext getApplicationContext()
          Gets the object for the association that plays role: applicationContext.
static EffConfigSpecGroup getEffConfigSpecGroup()
          Queries the DB for the EffConfigSpecGroup stored by the current principal.
private static EffGroupRangeDelegate getEffGroupRangeDelegate(Class rangeClass)
           
static EffConfigSpec[] getValidEffConfigSpecs(EffContext effContext)
          Returns all the valid EffConfigSpecs for the context -- one for each valid Eff class.
static PersistableEffConfigSpec[] getValidPersistableEffConfigSpecs(EffContext effContext)
          Returns all the valid PersistableEffConfigSpecs for the context -- one for each valid Eff class.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(EffConfigSpecAssistant thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
static EffConfigSpecGroup saveEffConfigSpecGroup(EffConfigSpecGroup effConfigSpecGroup)
          Stores or modifies the EffConfigSpecGroup on the behalf of the current principal.
 void setApplicationContext(ApplicationContext a_ApplicationContext)
          Sets the object for the association that plays role: applicationContext.
static void validateValue(Class effType, Serializable value)
          Validates the value.
static void validateValueAsString(Class effType, String valueAsString)
          Validates the value as a string.
static Serializable valueAsStringToValue(Class effType, String valueAsString)
          Converts the String representation of a value to the serialized object represented by the type.
static String valueToValueAsString(Class effType, Serializable value)
          Converts a value to a String..
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

SERVER

static final boolean SERVER

FC_RESOURCE

private static final String FC_RESOURCE
See Also:
Constant Field Values

applicationContext

private ApplicationContext applicationContext

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

factory

private static EffConfigSpecAssistant factory

ECS_GROUP_CLASS

private static final Class ECS_GROUP_CLASS

ECS_GROUP_POS

private static final int ECS_GROUP_POS
See Also:
Constant Field Values

P_ECS_CLASS

private static final Class P_ECS_CLASS

P_ECS_POS

private static final int P_ECS_POS
See Also:
Constant Field Values

GROUP_ROLE

private static final String GROUP_ROLE
See Also:
Constant Field Values

OBJECT_IDENTIFIER

private static final String OBJECT_IDENTIFIER
See Also:
Constant Field Values

ID

private static final String ID
See Also:
Constant Field Values
Constructor Detail

EffConfigSpecAssistant

public EffConfigSpecAssistant()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(EffConfigSpecAssistant thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getValidEffConfigSpecs

public static EffConfigSpec[] getValidEffConfigSpecs(EffContext effContext)
Returns all the valid EffConfigSpecs for the context -- one for each valid Eff class.

Supported API: true

Parameters:
effContext -
Returns:
EffConfigSpec[]

getValidPersistableEffConfigSpecs

public static PersistableEffConfigSpec[] getValidPersistableEffConfigSpecs(EffContext effContext)
Returns all the valid PersistableEffConfigSpecs for the context -- one for each valid Eff class.

Supported API: true

Parameters:
effContext -
Returns:
PersistableEffConfigSpec[]

valueToValueAsString

public static String valueToValueAsString(Class effType,
                                          Serializable value)
                                   throws WTPropertyVetoException
Converts a value to a String.. Uses EffHelper.getEffRange(Class) and getEffGroupRangeDelegate(Class) to get an EffGroupRangeDelegate so it can figure out what type of value for start or end of a Range to convert to a String.

Supported API: true

Parameters:
effType -
value -
Returns:
String
Throws:
WTPropertyVetoException

valueAsStringToValue

public static Serializable valueAsStringToValue(Class effType,
                                                String valueAsString)
                                         throws WTPropertyVetoException
Converts the String representation of a value to the serialized object represented by the type. Uses EffHelper.getEffRange(Class) and getEffGroupRangeDelegate(Class) to get an EffGroupRangeDelegate so it can figure out what type of value for start or end of a Range to convert the value to.

Supported API: true

Parameters:
effType -
valueAsString -
Returns:
Serializable
Throws:
WTPropertyVetoException

validateValue

public static void validateValue(Class effType,
                                 Serializable value)
                          throws WTPropertyVetoException
Validates the value.

Supported API: true

Parameters:
effType -
value -
Throws:
WTPropertyVetoException
See Also:
valueToValueAsString(java.lang.Class, java.io.Serializable)

validateValueAsString

public static void validateValueAsString(Class effType,
                                         String valueAsString)
                                  throws WTPropertyVetoException
Validates the value as a string.

Supported API: true

Parameters:
effType -
valueAsString -
Throws:
WTPropertyVetoException
See Also:
valueAsStringToValue(java.lang.Class, java.lang.String)

getEffConfigSpecGroup

public static EffConfigSpecGroup getEffConfigSpecGroup()
                                                throws WTException
Queries the DB for the EffConfigSpecGroup stored by the current principal. Returns null if one does not exist.

Supported API: true

Returns:
EffConfigSpecGroup
Throws:
WTException

_getEffConfigSpecGroup

protected static EffConfigSpecGroup _getEffConfigSpecGroup()
                                                    throws WTException
Queries the DB for the EffConfigSpecGroup stored by the current principal. Returns null if one does not exist.

Supported API: true

Returns:
EffConfigSpecGroup
Throws:
WTException

saveEffConfigSpecGroup

public static EffConfigSpecGroup saveEffConfigSpecGroup(EffConfigSpecGroup effConfigSpecGroup)
                                                 throws WTException
Stores or modifies the EffConfigSpecGroup on the behalf of the current principal.

Supported API: true

Parameters:
effConfigSpecGroup -
Returns:
EffConfigSpecGroup
Throws:
WTException

_saveEffConfigSpecGroup

protected static EffConfigSpecGroup _saveEffConfigSpecGroup(EffConfigSpecGroup effConfigSpecGroup)
                                                     throws WTException
Stores or modifies the EffConfigSpecGroup on the behalf of the current principal.

Supported API: true

Parameters:
effConfigSpecGroup -
Returns:
EffConfigSpecGroup
Throws:
WTException

getApplicationContext

public ApplicationContext getApplicationContext()
Gets the object for the association that plays role: applicationContext.

Supported API: false

Specified by:
getApplicationContext in interface ApplicationContextChild
Returns:
ApplicationContext

setApplicationContext

public void setApplicationContext(ApplicationContext a_ApplicationContext)
                           throws WTPropertyVetoException
Sets the object for the association that plays role: applicationContext.

Supported API: false

Specified by:
setApplicationContext in interface ApplicationContextChild
Parameters:
a_ApplicationContext -
Throws:
WTPropertyVetoException

getEffGroupRangeDelegate

private static EffGroupRangeDelegate getEffGroupRangeDelegate(Class rangeClass)