wt.vc.config
Class EffectivityConfigSpec

java.lang.Object
  extended bywt.vc.config.EffectivityConfigSpec
All Implemented Interfaces:
ConfigSpec, Externalizable, NetFactor, ObjectMappable, Serializable

public class EffectivityConfigSpec
extends Object
implements ConfigSpec, ObjectMappable, Externalizable

The EffectivityConfigSpec can be used to filter elements to return only those that are effective, given a date/unit value and (possibly) a configuration item.

Use the newEffectivityConfigSpec static factory method(s), not the EffectivityConfigSpec constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
EffectivityManageable, Serialized Form

Field Summary
private static String CLASSNAME
           
static String EFFECTIVE_CONFIG_ITEM
          Label for the attribute; The ConfigurationItem that constrains the effectiveDate/effectiveUnit values.
static String EFFECTIVE_DATE
          Label for the attribute; When a date value is specified, only versions with a date range that includes the value are considered.
static String EFFECTIVE_UNIT
          Label for the attribute; The string value that must fit in the range of a version using the standard string comparison (which would yield 9 > 10).
private static int EFFECTIVE_UNIT_UPPER_LIMIT
           
private  ConfigurationItemReference effectiveConfigItemRef
           
private  Timestamp effectiveDate
           
private  String effectiveUnit
           
static String EFFECTIVITY_TYPE
          Label for the attribute; The effectivityType can be any of the EffectivityType values.
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
 
Constructor Summary
EffectivityConfigSpec()
           
 
Method Summary
 QuerySpec appendSearchCriteria(QuerySpec querySpec)
          For a non-null date value with no effectiveConfigItem, appends a "configItemRef = NULL AND getEffectiveDate() >= startDate AND (getEffectiveDate() <= endDate OR endDate = WTDatedEffectivity.END_DATE)".
private  void effectiveUnitValidate(String a_EffectiveUnit)
           
 ClassInfo getClassInfo()
          Returns the ClassInfo object for this class.
 String getConceptualClassname()
          Deprecated.  
 ConfigurationItem getEffectiveConfigItem()
          Gets the value of the attribute: EFFECTIVE_CONFIG_ITEM.
 Timestamp getEffectiveDate()
          Gets the value of the attribute: EFFECTIVE_DATE.
 String getEffectiveUnit()
          Gets the value of the attribute: EFFECTIVE_UNIT.
 EffectivityType getEffectivityType()
          Gets the value of the attribute: EFFECTIVITY_TYPE.
protected  void initialize(ConfigurationItem effectiveConfigItem, String effectiveUnit)
          Supports initialization, following construction of an instance.
protected  void initialize(ConfigurationItem effectiveConfigItem, Timestamp effectiveDate)
          Supports initialization, following construction of an instance.
protected  void initialize(Timestamp effectiveDate)
          Supports initialization, following construction of an instance.
static EffectivityConfigSpec newEffectivityConfigSpec(ConfigurationItem effectiveConfigItem, String effectiveUnit)
          Constructs a unit-based EffectivityConfigSpec with the given configuration item and effective value.
static EffectivityConfigSpec newEffectivityConfigSpec(ConfigurationItem effectiveConfigItem, Timestamp effectiveDate)
          Constructs an EffectivityConfigSpec with a configuration item-based date effective value.
static EffectivityConfigSpec newEffectivityConfigSpec(Timestamp effectiveDate)
          Constructs an EffectivityConfigSpec with a global effective date value.
 QueryResult process(QueryResult results)
          Returns the latest version for each master if more than one version for a particular master is effective.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
 void readExternal(PersistentRetrieveIfc input)
          Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.
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(EffectivityConfigSpec thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setEffectiveConfigItem(ConfigurationItem a_EffectiveConfigItem)
          Sets the value of the attribute: EFFECTIVE_CONFIG_ITEM.
 void setEffectiveDate(Timestamp a_EffectiveDate)
          Sets the value of the attribute: EFFECTIVE_DATE.
 void setEffectiveUnit(String a_EffectiveUnit)
          Sets the value of the attribute: EFFECTIVE_UNIT.
 String toString()
          Returns the conceptual (modeled) name for the class.
 void validateInstance()
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 void writeExternal(PersistentStoreIfc output)
          Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

EFFECTIVE_DATE

public static final String EFFECTIVE_DATE
Label for the attribute; When a date value is specified, only versions with a date range that includes the value are considered. Versions that are global (have a date effectivity that is not constrained by a configuration item) or based on the effectiveConfigurationItem (if there is one) are processed.

Supported API: true

See Also:
Constant Field Values

effectiveDate

private Timestamp effectiveDate

EFFECTIVE_UNIT

public static final String EFFECTIVE_UNIT
Label for the attribute; The string value that must fit in the range of a version using the standard string comparison (which would yield 9 > 10). This value is always in relation to a configuration item (i.e., this config spec would be invalid if the effectiveUnit had a value, but the effectiveConfigItem was null).

Supported API: true

See Also:
Constant Field Values

EFFECTIVE_UNIT_UPPER_LIMIT

private static int EFFECTIVE_UNIT_UPPER_LIMIT

effectiveUnit

private String effectiveUnit

EFFECTIVITY_TYPE

public static final String EFFECTIVITY_TYPE
Label for the attribute; The effectivityType can be any of the EffectivityType values.

Supported API: true

See Also:
EffectivityType, Constant Field Values

EFFECTIVE_CONFIG_ITEM

public static final String EFFECTIVE_CONFIG_ITEM
Label for the attribute; The ConfigurationItem that constrains the effectiveDate/effectiveUnit values.

Supported API: true

See Also:
Constant Field Values

effectiveConfigItemRef

private ConfigurationItemReference effectiveConfigItemRef

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
Constructor Detail

EffectivityConfigSpec

public EffectivityConfigSpec()
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(EffectivityConfigSpec 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

writeExternal

public void writeExternal(PersistentStoreIfc output)
                   throws SQLException,
                          DatastoreException
Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
writeExternal in interface ObjectMappable
Parameters:
output -
Throws:
SQLException
DatastoreException

readExternal

public void readExternal(PersistentRetrieveIfc input)
                  throws SQLException,
                         DatastoreException
Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
readExternal in interface ObjectMappable
Parameters:
input -
Throws:
SQLException
DatastoreException

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Returns:
String

toString

public String toString()
Returns the conceptual (modeled) name for the class.

Supported API: false

Returns:
String

getClassInfo

public ClassInfo getClassInfo()
                       throws WTIntrospectionException
Returns the ClassInfo object for this class.

Supported API: false

Specified by:
getClassInfo in interface NetFactor
Returns:
ClassInfo
Throws:
WTIntrospectionException

getEffectiveDate

public Timestamp getEffectiveDate()
Gets the value of the attribute: EFFECTIVE_DATE. When a date value is specified, only versions with a date range that includes the value are considered. Versions that are global (have a date effectivity that is not constrained by a configuration item) or based on the effectiveConfigurationItem (if there is one) are processed.

Supported API: true

Returns:
Timestamp

setEffectiveDate

public void setEffectiveDate(Timestamp a_EffectiveDate)
                      throws WTPropertyVetoException
Sets the value of the attribute: EFFECTIVE_DATE. When a date value is specified, only versions with a date range that includes the value are considered. Versions that are global (have a date effectivity that is not constrained by a configuration item) or based on the effectiveConfigurationItem (if there is one) are processed.

Supported API: true

Parameters:
a_EffectiveDate -
Throws:
WTPropertyVetoException

getEffectiveUnit

public String getEffectiveUnit()
Gets the value of the attribute: EFFECTIVE_UNIT. The string value that must fit in the range of a version using the standard string comparison (which would yield 9 > 10). This value is always in relation to a configuration item (i.e., this config spec would be invalid if the effectiveUnit had a value, but the effectiveConfigItem was null).

Supported API: true

Returns:
String

setEffectiveUnit

public void setEffectiveUnit(String a_EffectiveUnit)
                      throws WTPropertyVetoException
Sets the value of the attribute: EFFECTIVE_UNIT. The string value that must fit in the range of a version using the standard string comparison (which would yield 9 > 10). This value is always in relation to a configuration item (i.e., this config spec would be invalid if the effectiveUnit had a value, but the effectiveConfigItem was null).

Supported API: true

Parameters:
a_EffectiveUnit -
Throws:
WTPropertyVetoException

effectiveUnitValidate

private void effectiveUnitValidate(String a_EffectiveUnit)
                            throws WTPropertyVetoException
Parameters:
a_EffectiveUnit -
Throws:
WTPropertyVetoException

getEffectivityType

public EffectivityType getEffectivityType()
                                   throws ObjectNoLongerExistsException
Gets the value of the attribute: EFFECTIVITY_TYPE. The effectivityType can be any of the EffectivityType values.

Supported API: true

Returns:
EffectivityType
Throws:
ObjectNoLongerExistsException
See Also:
EffectivityType

getEffectiveConfigItem

public ConfigurationItem getEffectiveConfigItem()
                                         throws ObjectNoLongerExistsException
Gets the value of the attribute: EFFECTIVE_CONFIG_ITEM. The ConfigurationItem that constrains the effectiveDate/effectiveUnit values.

Supported API: true

Returns:
ConfigurationItem
Throws:
ObjectNoLongerExistsException

setEffectiveConfigItem

public void setEffectiveConfigItem(ConfigurationItem a_EffectiveConfigItem)
                            throws WTPropertyVetoException
Sets the value of the attribute: EFFECTIVE_CONFIG_ITEM. The ConfigurationItem that constrains the effectiveDate/effectiveUnit values.

Supported API: true

Parameters:
a_EffectiveConfigItem -
Throws:
WTPropertyVetoException

appendSearchCriteria

public QuerySpec appendSearchCriteria(QuerySpec querySpec)
                               throws WTException,
                                      QueryException
For a non-null date value with no effectiveConfigItem, appends a "configItemRef = NULL AND getEffectiveDate() >= startDate AND (getEffectiveDate() <= endDate OR endDate = WTDatedEffectivity.END_DATE)". For a date value with an effectiveConfigItem, appends a "(configItemRef = NULL OR configItemRef = getEffectiveConfigItem()) AND getEffectiveDate() >= startDate AND (getEffectiveDate() <= endDate OR endDate = WTDatedEffectivity.END_DATE)".

For a non-null unit value, appends a "configItemRef = getEffectiveConfigItem() AND getEffectiveUnit() >= startNumber AND (getEffectiveUnit() <= endNumber OR endNumber = UnitEffectivity.END_NUMBER)".



Supported API: true

Specified by:
appendSearchCriteria in interface ConfigSpec
Parameters:
querySpec - A QuerySpec with a target class that is Iterated.
Returns:
QuerySpec
Throws:
WTException
QueryException
See Also:
QuerySpec, SearchCondition

process

public QueryResult process(QueryResult results)
                    throws WTException
Returns the latest version for each master if more than one version for a particular master is effective.

Supported API: true

Specified by:
process in interface ConfigSpec
Parameters:
results - QueryResult of iterations to filter. Assumed to be the result of a query that included the additional search conditions applied by appendSearchCriteria. Note that after enumerating through the elements of this QueryResult, it should be reset.
Returns:
QueryResult
Throws:
WTException
See Also:
QueryResult, Iterated

newEffectivityConfigSpec

public static EffectivityConfigSpec newEffectivityConfigSpec(Timestamp effectiveDate)
                                                      throws WTPropertyVetoException
Constructs an EffectivityConfigSpec with a global effective date value.

Supported API: true

Parameters:
effectiveDate -
Returns:
EffectivityConfigSpec
Throws:
WTPropertyVetoException

initialize

protected void initialize(Timestamp effectiveDate)
                   throws WTPropertyVetoException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: true

Parameters:
effectiveDate -
Throws:
WTPropertyVetoException

newEffectivityConfigSpec

public static EffectivityConfigSpec newEffectivityConfigSpec(ConfigurationItem effectiveConfigItem,
                                                             Timestamp effectiveDate)
                                                      throws WTPropertyVetoException
Constructs an EffectivityConfigSpec with a configuration item-based date effective value.

Supported API: true

Parameters:
effectiveConfigItem -
effectiveDate -
Returns:
EffectivityConfigSpec
Throws:
WTPropertyVetoException

initialize

protected void initialize(ConfigurationItem effectiveConfigItem,
                          Timestamp effectiveDate)
                   throws WTPropertyVetoException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: true

Parameters:
effectiveConfigItem -
effectiveDate -
Throws:
WTPropertyVetoException

newEffectivityConfigSpec

public static EffectivityConfigSpec newEffectivityConfigSpec(ConfigurationItem effectiveConfigItem,
                                                             String effectiveUnit)
                                                      throws WTPropertyVetoException
Constructs a unit-based EffectivityConfigSpec with the given configuration item and effective value.

Supported API: true

Parameters:
effectiveConfigItem -
effectiveUnit -
Returns:
EffectivityConfigSpec
Throws:
WTPropertyVetoException

initialize

protected void initialize(ConfigurationItem effectiveConfigItem,
                          String effectiveUnit)
                   throws WTPropertyVetoException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: true

Parameters:
effectiveConfigItem -
effectiveUnit -
Throws:
WTPropertyVetoException

validateInstance

public void validateInstance()
                      throws WTException
Throws:
WTException