wt.eff
Class EffGroupAssistant

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

public class EffGroupAssistant
extends Object
implements RemoteAccess, ApplicationContextChild, Externalizable

Assistant for getting EffGroups, converting EffRanges to and from Strings, and adding the Effs associated to EffManagedVersions to EffGroups. Provides client- and server-side APIs to assign Effs to EffManagedVersions. This assistant provides a client/customization-friendly API to work with Effs without interacting with the data model directly.

Supported API: true

Extendable: false

See Also:
EffGroupAssistantEvent, EffGroupRangeDelegate, Serialized Form

Nested Class Summary
private  class EffGroupAssistant.EffRangePredicate
           
private static class EffGroupAssistant.Key
          This implementation class implements a hashable key for an Eff or EffGroup object, based on the intersection of version branch id, context object id, and effectivity type.
 
Field Summary
private  ApplicationContext applicationContext
           
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
private static EffGroupAssistant factory
           
private static String FC_RESOURCE
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
(package private) static boolean SERVER
           
private static ManagerService service
           
 
Fields inherited from interface wt.method.RemoteAccess
versionID
 
Fields inherited from interface wt.services.applicationcontext.ApplicationContextChild
APPLICATION_CONTEXT
 
Constructor Summary
EffGroupAssistant()
           
 
Method Summary
protected static EffManagedVersion[] _appendEffGroups(EffManagedVersion[] effManagedVersions, EffGroup[] effGroups)
          Adds the EffGroups to each of the EffManagedVersions.
protected static EffManagedVersion[] _appendEffGroups(EffManagedVersion[] effManagedVersions, EffGroup[] effGroups, ChangeActivityIfc authorizedBy)
          Adds the EffGroups to each of the EffManagedVersions.
protected static EffManagedVersion[] _appendEffGroupsQuietly(EffManagedVersion[] effManagedVersions, EffGroup[] effGroups)
          Adds the EffGroups to each of the EffManagedVersions.
protected static EffManagedVersion[] _appendEffGroupsQuietly(EffManagedVersion[] effManagedVersions, EffGroup[] effGroups, ChangeActivityIfc authorizedBy)
          Adds the EffGroups to each of the EffManagedVersions.
protected static EffManagedVersion _appendEffVector(EffManagedVersion effManagedVersion)
          Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersion.
protected static EffManagedVersion[] _appendEffVector(EffManagedVersion[] effManagedVersions)
          Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions.
protected static EffManagedVersion[] _appendEffVector(EffManagedVersion[] effManagedVersions, ChangeActivityIfc authorizedBy)
          Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions.
protected static EffManagedVersion _appendEffVector(EffManagedVersion effManagedVersion, ChangeActivityIfc authorizedBy)
          Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersion.
protected static EffManagedVersion[] _appendEffVectorQuietly(EffManagedVersion[] effManagedVersions)
          Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions.
protected static EffManagedVersion[] _appendEffVectorQuietly(EffManagedVersion[] effManagedVersions, ChangeActivityIfc authorizedBy)
          Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions.
protected static EffManagedVersion _populateEffVector(EffManagedVersion effManagedVersion)
          Populate the effVector of the EffManagedVersion by querying the database for all the version's effectivities and converting them to EffGroups.
protected static EffManagedVersion[] _populateEffVector(EffManagedVersion[] effManagedVersions)
          Populate the effVectors of the EffManagedVersions by querying the database for all the version's effectivities and converting them to EffGroups.
protected static EffManagedVersion[] _populateEffVectorWithoutRefreshing(EffManagedVersion[] effManagedVersions)
          Populate the effVectors of the EffManagedVersions by querying the database for all the version's effectivities and converting them to EffGroups.
protected static EffManagedVersion _replaceEffVector(EffManagedVersion effManagedVersion)
          Replaces the current effectivities stored in the DB for this EffManagedVersion with the effectivities represented in the EffGroups in the effVector.
protected static EffManagedVersion[] _replaceEffVector(EffManagedVersion[] effManagedVersions)
          Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector.
protected static EffManagedVersion[] _replaceEffVector(EffManagedVersion[] effManagedVersions, ChangeActivityIfc authorizedBy)
          Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector.
protected static EffManagedVersion _replaceEffVector(EffManagedVersion effManagedVersion, ChangeActivityIfc authorizedBy)
          Replaces the current effectivities stored in the DB for this EffManagedVersion with the effectivities represented in the EffGroups in the effVector.
protected static EffManagedVersion[] _replaceEffVectorQuietly(EffManagedVersion[] effManagedVersions)
          Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector.
protected static EffManagedVersion[] _replaceEffVectorQuietly(EffManagedVersion[] effManagedVersions, ChangeActivityIfc authorizedBy)
          Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector.
private static EffManagedVersion[] _updateEffVectorQuietly(EffManagedVersion[] effManagedVersions, ChangeActivityIfc authorizedBy, boolean isReplace)
          Updates the effectivity vectors of the specified EffManagedVersion objects without dispatching any persistence or effectivity service events.
static EffManagedVersion[] appendEffGroups(EffManagedVersion[] effManagedVersions, EffGroup[] effGroups)
          Adds the EffGroups to each of the EffManagedVersions.
static EffManagedVersion[] appendEffGroups(EffManagedVersion[] effManagedVersions, EffGroup[] effGroups, ChangeActivityIfc authorizedBy)
          Adds the EffGroups to each of the EffManagedVersions.
static EffManagedVersion[] appendEffGroupsQuietly(EffManagedVersion[] effManagedVersions, EffGroup[] effGroups)
          Adds the EffGroups to each of the EffManagedVersions.
static EffManagedVersion[] appendEffGroupsQuietly(EffManagedVersion[] effManagedVersions, EffGroup[] effGroups, ChangeActivityIfc authorizedBy)
          Adds the EffGroups to each of the EffManagedVersions.
static EffManagedVersion appendEffVector(EffManagedVersion effManagedVersion)
          Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersion.
static EffManagedVersion[] appendEffVector(EffManagedVersion[] effManagedVersions)
          Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions.
static EffManagedVersion[] appendEffVector(EffManagedVersion[] effManagedVersions, ChangeActivityIfc authorizedBy)
          Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions.
static EffManagedVersion appendEffVector(EffManagedVersion effManagedVersion, ChangeActivityIfc authorizedBy)
          Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersion.
static EffManagedVersion[] appendEffVectorQuietly(EffManagedVersion[] effManagedVersions)
          Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions.
static EffManagedVersion[] appendEffVectorQuietly(EffManagedVersion[] effManagedVersions, ChangeActivityIfc authorizedBy)
          Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions.
private static long[][] chunkIds(Set idSet)
          Chunks the specified set of IDs (instances of Long objects) into blocks of 254, suitable for use in an SQL IN clause.
private static void dispatchVetoableEvent(String eventType, EffManagedVersion[] effManagedVersions)
           
private static void dispatchVetoableEvent(String eventType, EffManagedVersion[] effManagedVersions, EffGroup[] effGroups)
           
static String effRangesToRange(EffRange[] effRanges)
          Converts an array of EffRanges to a string representation of them.
private static QueryResult findEffsQuietly(long[][] bids, long[][] oids)
          Retrieves from the database the Eff objects whose 'target' branch IDs and 'effContext' OIDs match those specified.
 ApplicationContext getApplicationContext()
          Gets the object for the association that plays role: applicationContext.
static String getDash()
          Gets the value of the attribute: dash; The string value representing the dash for the range.
private static EffGroupRangeDelegate getEffGroupRangeDelegate(Class rangeType)
           
private static Map getPredHistorySizeMap(Set bidSet)
          Constructs a map relating Key objects to Integer objects representing the cardinalities of effectivity histories.
private static Set getPrivateBidSet(EffManagedVersion[] versions)
          Constructs a set of the branch identifiers of the specified EffManagedVersion objects that are private (refer to the definition of the isPrivate() method).
static String getSeparator()
          Gets the value of the attribute: separator; The string value representing the separator for the range.
static EffGroup[] getValidEffGroups(EffContext effContext)
          Gets all the EffGroups (based on the valid Effs) for this context, and assigns the contex to it.
static EffGroup[] getValidEffGroups(EffManagedVersion target, EffContext effContext)
          Gets all the EffGroups (based on the valid Effs) for this context, and assigns the context and the version to it.
private static QueryResult inflateObjectReferences(QueryResult qr, EffManagedVersion[] versions, boolean inflateContexts, boolean inflateAudits, boolean inflatePrincipals, boolean inflateChangeActivities)
          Inflates the specified object references in the given QueryResult of Eff objects.
private static Map inflateOids(Class target, Set oidSet, boolean ac)
          Inflates the specified set of OIDs for the specified target class, enforcing access control as specified.
(package private) static boolean isPrivate(EffManagedVersion emv)
          Returns true if and only if the specified EffManagedVersion is a private object.
static EffManagedVersion populateEffVector(EffManagedVersion effManagedVersion)
          Populate the effVector of the EffManagedVersion by querying the database for all the version's effectivities and converting them to EffGroups.
static EffManagedVersion[] populateEffVector(EffManagedVersion[] effManagedVersions)
          Populate the effVectors of the EffManagedVersions by querying the database for all the version's effectivities and converting them to EffGroups.
static EffManagedVersion[] populateEffVectorWithoutRefreshing(EffManagedVersion[] effManagedVersions)
          Populate the effVectors of the EffManagedVersions by querying the database for all the version's effectivities and converting them to EffGroups.
static EffRange[] rangeToEffRanges(Class effRange, String range)
          Converts a range to an array of EffRanges.
 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(EffGroupAssistant thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
private static void refreshVersions(EffManagedVersion[] effManagedVersions)
           
static EffManagedVersion replaceEffVector(EffManagedVersion effManagedVersion)
          Replaces the current effectivities stored in the DB for this EffManagedVersion with the effectivities represented in the EffGroups in the effVector.
static EffManagedVersion[] replaceEffVector(EffManagedVersion[] effManagedVersions)
          Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector.
static EffManagedVersion[] replaceEffVector(EffManagedVersion[] effManagedVersions, ChangeActivityIfc authorizedBy)
          Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector.
static EffManagedVersion replaceEffVector(EffManagedVersion effManagedVersion, ChangeActivityIfc authorizedBy)
          Replaces the current effectivities stored in the DB for this EffManagedVersion with the effectivities represented in the EffGroups in the effVector.
static EffManagedVersion[] replaceEffVectorQuietly(EffManagedVersion[] effManagedVersions)
          Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector.
static EffManagedVersion[] replaceEffVectorQuietly(EffManagedVersion[] effManagedVersions, ChangeActivityIfc authorizedBy)
          Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector.
 void setApplicationContext(ApplicationContext a_ApplicationContext)
          Sets the object for the association that plays role: applicationContext.
private static EffRange[] truncateEffRanges(EffRange[] effRanges)
           
static void validateRange(Class effRange, String range)
          Validates the range.
private static void validateVersions(EffManagedVersion[] versions)
          Validates the specified EffManagedVersion objects for suitability as targets in Eff operations.
 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 EffGroupAssistant factory

service

private static ManagerService service
Constructor Detail

EffGroupAssistant

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

getSeparator

public static String getSeparator()
Gets the value of the attribute: separator; The string value representing the separator for the range. For example, the comma in the following string is the separator "8, 10".

The value for the separator is locale-specific and is obtained from effResource's SEPARATOR constant.

Supported API: true

Returns:
String
See Also:
effResource

getDash

public static String getDash()
Gets the value of the attribute: dash; The string value representing the dash for the range. For example, the hyphen in the following string is the dash "8- 10".

The value for the separator is locale-specific and is obtained from effResource's DASH constant.

Supported API: true

Returns:
String
See Also:
effResource

getValidEffGroups

public static EffGroup[] getValidEffGroups(EffManagedVersion target,
                                           EffContext effContext)
Gets all the EffGroups (based on the valid Effs) for this context, and assigns the context and the version to it.

Supported API: true

Parameters:
target -
effContext -
Returns:
EffGroup[]

getValidEffGroups

public static EffGroup[] getValidEffGroups(EffContext effContext)
Gets all the EffGroups (based on the valid Effs) for this context, and assigns the contex to it.

Supported API: true

Parameters:
effContext -
Returns:
EffGroup[]

rangeToEffRanges

public static EffRange[] rangeToEffRanges(Class effRange,
                                          String range)
                                   throws WTPropertyVetoException
Converts a range to an array of EffRanges.

The following range would be converted to start-end values as follows:
8, 10-12, 15-

8-8
10-12
15-

Supported API: true

Parameters:
effRange -
range -
Returns:
EffRange[]
Throws:
WTPropertyVetoException
See Also:
EffGroupRangeDelegate

effRangesToRange

public static String effRangesToRange(EffRange[] effRanges)
                               throws WTPropertyVetoException
Converts an array of EffRanges to a string representation of them.

Supported API: true

Parameters:
effRanges -
Returns:
String
Throws:
WTPropertyVetoException
See Also:
EffGroupRangeDelegate

validateRange

public static void validateRange(Class effRange,
                                 String range)
                          throws WTPropertyVetoException
Validates the range.

Supported API: true

Parameters:
effRange -
range -
Throws:
WTPropertyVetoException
See Also:
EffGroupRangeDelegate

populateEffVector

public static EffManagedVersion populateEffVector(EffManagedVersion effManagedVersion)
                                           throws WTException
Populate the effVector of the EffManagedVersion by querying the database for all the version's effectivities and converting them to EffGroups. The version is refreshed.

Supported API: true

Parameters:
effManagedVersion -
Returns:
EffManagedVersion
Throws:
WTException

_populateEffVector

protected static EffManagedVersion _populateEffVector(EffManagedVersion effManagedVersion)
                                               throws WTException
Populate the effVector of the EffManagedVersion by querying the database for all the version's effectivities and converting them to EffGroups. The version is refreshed.

Supported API: true

Parameters:
effManagedVersion -
Returns:
EffManagedVersion
Throws:
WTException

populateEffVector

public static EffManagedVersion[] populateEffVector(EffManagedVersion[] effManagedVersions)
                                             throws WTException
Populate the effVectors of the EffManagedVersions by querying the database for all the version's effectivities and converting them to EffGroups. The versions are refreshed.

Supported API: true

Parameters:
effManagedVersions -
Returns:
EffManagedVersion[]
Throws:
WTException

_populateEffVector

protected static EffManagedVersion[] _populateEffVector(EffManagedVersion[] effManagedVersions)
                                                 throws WTException
Populate the effVectors of the EffManagedVersions by querying the database for all the version's effectivities and converting them to EffGroups. The versions are refreshed.

Supported API: true

Parameters:
effManagedVersions -
Returns:
EffManagedVersion[]
Throws:
WTException

replaceEffVector

public static EffManagedVersion replaceEffVector(EffManagedVersion effManagedVersion,
                                                 ChangeActivityIfc authorizedBy)
                                          throws WTException
Replaces the current effectivities stored in the DB for this EffManagedVersion with the effectivities represented in the EffGroups in the effVector. populateEffVector should be used to get the existing ones first, then the user would edit the contents by adding and deleting EffGroups and updating the ranges. This allows simple interaction without batch containers. Returns a fully-populated effVector.

Dispatches EffGroupAssistantEvent's PRE_REPLACE_EFF_VECTOR and POST_REPLACE_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersion -
authorizedBy -
Returns:
EffManagedVersion
Throws:
WTException
See Also:
EffGroupAssistantEvent

_replaceEffVector

protected static EffManagedVersion _replaceEffVector(EffManagedVersion effManagedVersion,
                                                     ChangeActivityIfc authorizedBy)
                                              throws WTException
Replaces the current effectivities stored in the DB for this EffManagedVersion with the effectivities represented in the EffGroups in the effVector. populateEffVector should be used to get the existing ones first, then the user would edit the contents by adding and deleting EffGroups and updating the ranges. This allows simple interaction without batch containers. Returns a fully-populated effVector.

Dispatches EffGroupAssistantEvent's PRE_REPLACE_EFF_VECTOR and POST_REPLACE_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersion -
authorizedBy -
Returns:
EffManagedVersion
Throws:
WTException
See Also:
EffGroupAssistantEvent

replaceEffVector

public static EffManagedVersion[] replaceEffVector(EffManagedVersion[] effManagedVersions,
                                                   ChangeActivityIfc authorizedBy)
                                            throws WTException
Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector. populateEffVector should be used to get the existing ones first, then the user would edit the contents by adding and deleting EffGroups and updating the ranges. This allows simple interaction without batch containers. Returns a fully-populated effVector in each EffManagedVersion.

Dispatches EffGroupAssistantEvent's PRE_REPLACE_EFF_VECTOR and POST_REPLACE_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersions -
authorizedBy -
Returns:
EffManagedVersion[]
Throws:
WTException
See Also:
EffGroupAssistantEvent

_replaceEffVector

protected static EffManagedVersion[] _replaceEffVector(EffManagedVersion[] effManagedVersions,
                                                       ChangeActivityIfc authorizedBy)
                                                throws WTException
Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector. populateEffVector should be used to get the existing ones first, then the user would edit the contents by adding and deleting EffGroups and updating the ranges. This allows simple interaction without batch containers. Returns a fully-populated effVector in each EffManagedVersion.

Dispatches EffGroupAssistantEvent's PRE_REPLACE_EFF_VECTOR and POST_REPLACE_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersions -
authorizedBy -
Returns:
EffManagedVersion[]
Throws:
WTException
See Also:
EffGroupAssistantEvent

appendEffVector

public static EffManagedVersion appendEffVector(EffManagedVersion effManagedVersion,
                                                ChangeActivityIfc authorizedBy)
                                         throws WTException
Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersion. Returns a fully-populated effVector.

Dispatches EffGroupAssistantEvent's PRE_APPEND_EFF_VECTOR and POST_APPEND_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersion -
authorizedBy -
Returns:
EffManagedVersion
Throws:
WTException
See Also:
EffGroupAssistantEvent

_appendEffVector

protected static EffManagedVersion _appendEffVector(EffManagedVersion effManagedVersion,
                                                    ChangeActivityIfc authorizedBy)
                                             throws WTException
Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersion. Returns a fully-populated effVector.

Dispatches EffGroupAssistantEvent's PRE_APPEND_EFF_VECTOR and POST_APPEND_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersion -
authorizedBy -
Returns:
EffManagedVersion
Throws:
WTException
See Also:
EffGroupAssistantEvent

appendEffVector

public static EffManagedVersion[] appendEffVector(EffManagedVersion[] effManagedVersions,
                                                  ChangeActivityIfc authorizedBy)
                                           throws WTException
Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

Emits EffGroupAssistantEvent's PRE_APPEND_EFF_VECTOR and POST_APPEND_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersions -
authorizedBy -
Returns:
EffManagedVersion[]
Throws:
WTException
See Also:
EffGroupAssistantEvent

_appendEffVector

protected static EffManagedVersion[] _appendEffVector(EffManagedVersion[] effManagedVersions,
                                                      ChangeActivityIfc authorizedBy)
                                               throws WTException
Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

Emits EffGroupAssistantEvent's PRE_APPEND_EFF_VECTOR and POST_APPEND_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersions -
authorizedBy -
Returns:
EffManagedVersion[]
Throws:
WTException
See Also:
EffGroupAssistantEvent

appendEffGroups

public static EffManagedVersion[] appendEffGroups(EffManagedVersion[] effManagedVersions,
                                                  EffGroup[] effGroups,
                                                  ChangeActivityIfc authorizedBy)
                                           throws WTException
Adds the EffGroups to each of the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

Emits EffGroupAssistantEvent's PRE_APPEND_EFF_GROUPS and POST_APPEND_EFF_GROUPS.



Supported API: true

Parameters:
effManagedVersions -
effGroups -
authorizedBy -
Returns:
EffManagedVersion[]
Throws:
WTException
See Also:
EffGroupAssistantEvent

_appendEffGroups

protected static EffManagedVersion[] _appendEffGroups(EffManagedVersion[] effManagedVersions,
                                                      EffGroup[] effGroups,
                                                      ChangeActivityIfc authorizedBy)
                                               throws WTException
Adds the EffGroups to each of the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

Emits EffGroupAssistantEvent's PRE_APPEND_EFF_GROUPS and POST_APPEND_EFF_GROUPS.



Supported API: true

Parameters:
effManagedVersions -
effGroups -
authorizedBy -
Returns:
EffManagedVersion[]
Throws:
WTException
See Also:
EffGroupAssistantEvent

populateEffVectorWithoutRefreshing

public static EffManagedVersion[] populateEffVectorWithoutRefreshing(EffManagedVersion[] effManagedVersions)
                                                              throws WTException
Populate the effVectors of the EffManagedVersions by querying the database for all the version's effectivities and converting them to EffGroups. The versions are not refreshed.

Supported API: true

Parameters:
effManagedVersions -
Returns:
EffManagedVersion[]
Throws:
WTException

_populateEffVectorWithoutRefreshing

protected static EffManagedVersion[] _populateEffVectorWithoutRefreshing(EffManagedVersion[] effManagedVersions)
                                                                  throws WTException
Populate the effVectors of the EffManagedVersions by querying the database for all the version's effectivities and converting them to EffGroups. The versions are not refreshed.

Supported API: true

Parameters:
effManagedVersions -
Returns:
EffManagedVersion[]
Throws:
WTException

replaceEffVectorQuietly

public static EffManagedVersion[] replaceEffVectorQuietly(EffManagedVersion[] effManagedVersions,
                                                          ChangeActivityIfc authorizedBy)
                                                   throws WTException
Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector. populateEffVector should be used to get the existing ones first, then the user would edit the contents by adding and deleting EffGroups and updating the ranges. This allows simple interaction without batch containers. Returns a fully-populated effVector in each EffManagedVersion.

No events are emitted by this call.



Supported API: true

Parameters:
effManagedVersions -
authorizedBy -
Returns:
EffManagedVersion[]
Throws:
WTException

_replaceEffVectorQuietly

protected static EffManagedVersion[] _replaceEffVectorQuietly(EffManagedVersion[] effManagedVersions,
                                                              ChangeActivityIfc authorizedBy)
                                                       throws WTException
Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector. populateEffVector should be used to get the existing ones first, then the user would edit the contents by adding and deleting EffGroups and updating the ranges. This allows simple interaction without batch containers. Returns a fully-populated effVector in each EffManagedVersion.

No events are emitted by this call.



Supported API: true

Parameters:
effManagedVersions -
authorizedBy -
Returns:
EffManagedVersion[]
Throws:
WTException

appendEffVectorQuietly

public static EffManagedVersion[] appendEffVectorQuietly(EffManagedVersion[] effManagedVersions,
                                                         ChangeActivityIfc authorizedBy)
                                                  throws WTException
Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

No events are emitted by this call.



Supported API: true

Parameters:
effManagedVersions -
authorizedBy -
Returns:
EffManagedVersion[]
Throws:
WTException

_appendEffVectorQuietly

protected static EffManagedVersion[] _appendEffVectorQuietly(EffManagedVersion[] effManagedVersions,
                                                             ChangeActivityIfc authorizedBy)
                                                      throws WTException
Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

No events are emitted by this call.



Supported API: true

Parameters:
effManagedVersions -
authorizedBy -
Returns:
EffManagedVersion[]
Throws:
WTException

appendEffGroupsQuietly

public static EffManagedVersion[] appendEffGroupsQuietly(EffManagedVersion[] effManagedVersions,
                                                         EffGroup[] effGroups,
                                                         ChangeActivityIfc authorizedBy)
                                                  throws WTException
Adds the EffGroups to each of the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

No events are emitted by this call.



Supported API: true

Parameters:
effManagedVersions -
effGroups -
authorizedBy -
Returns:
EffManagedVersion[]
Throws:
WTException

_appendEffGroupsQuietly

protected static EffManagedVersion[] _appendEffGroupsQuietly(EffManagedVersion[] effManagedVersions,
                                                             EffGroup[] effGroups,
                                                             ChangeActivityIfc authorizedBy)
                                                      throws WTException
Adds the EffGroups to each of the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

No events are emitted by this call.



Supported API: true

Parameters:
effManagedVersions -
effGroups -
authorizedBy -
Returns:
EffManagedVersion[]
Throws:
WTException

replaceEffVector

public static EffManagedVersion replaceEffVector(EffManagedVersion effManagedVersion)
                                          throws WTException
Replaces the current effectivities stored in the DB for this EffManagedVersion with the effectivities represented in the EffGroups in the effVector. populateEffVector should be used to get the existing ones first, then the user would edit the contents by adding and deleting EffGroups and updating the ranges. This allows simple interaction without batch containers. Returns a fully-populated effVector.

Dispatches EffGroupAssistantEvent's PRE_REPLACE_EFF_VECTOR and POST_REPLACE_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersion -
Returns:
EffManagedVersion
Throws:
WTException
See Also:
EffGroupAssistantEvent

_replaceEffVector

protected static EffManagedVersion _replaceEffVector(EffManagedVersion effManagedVersion)
                                              throws WTException
Replaces the current effectivities stored in the DB for this EffManagedVersion with the effectivities represented in the EffGroups in the effVector. populateEffVector should be used to get the existing ones first, then the user would edit the contents by adding and deleting EffGroups and updating the ranges. This allows simple interaction without batch containers. Returns a fully-populated effVector.

Dispatches EffGroupAssistantEvent's PRE_REPLACE_EFF_VECTOR and POST_REPLACE_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersion -
Returns:
EffManagedVersion
Throws:
WTException
See Also:
EffGroupAssistantEvent

replaceEffVector

public static EffManagedVersion[] replaceEffVector(EffManagedVersion[] effManagedVersions)
                                            throws WTException
Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector. populateEffVector should be used to get the existing ones first, then the user would edit the contents by adding and deleting EffGroups and updating the ranges. This allows simple interaction without batch containers. Returns a fully-populated effVector in each EffManagedVersion.

Dispatches EffGroupAssistantEvent's PRE_REPLACE_EFF_VECTOR and POST_REPLACE_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersions -
Returns:
EffManagedVersion[]
Throws:
WTException
See Also:
EffGroupAssistantEvent

_replaceEffVector

protected static EffManagedVersion[] _replaceEffVector(EffManagedVersion[] effManagedVersions)
                                                throws WTException
Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector. populateEffVector should be used to get the existing ones first, then the user would edit the contents by adding and deleting EffGroups and updating the ranges. This allows simple interaction without batch containers. Returns a fully-populated effVector in each EffManagedVersion.

Dispatches EffGroupAssistantEvent's PRE_REPLACE_EFF_VECTOR and POST_REPLACE_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersions -
Returns:
EffManagedVersion[]
Throws:
WTException
See Also:
EffGroupAssistantEvent

appendEffVector

public static EffManagedVersion appendEffVector(EffManagedVersion effManagedVersion)
                                         throws WTException
Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersion. Returns a fully-populated effVector.

Dispatches EffGroupAssistantEvent's PRE_APPEND_EFF_VECTOR and POST_APPEND_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersion -
Returns:
EffManagedVersion
Throws:
WTException
See Also:
EffGroupAssistantEvent

_appendEffVector

protected static EffManagedVersion _appendEffVector(EffManagedVersion effManagedVersion)
                                             throws WTException
Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersion. Returns a fully-populated effVector.

Dispatches EffGroupAssistantEvent's PRE_APPEND_EFF_VECTOR and POST_APPEND_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersion -
Returns:
EffManagedVersion
Throws:
WTException
See Also:
EffGroupAssistantEvent

appendEffVector

public static EffManagedVersion[] appendEffVector(EffManagedVersion[] effManagedVersions)
                                           throws WTException
Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

Emits EffGroupAssistantEvent's PRE_APPEND_EFF_VECTOR and POST_APPEND_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersions -
Returns:
EffManagedVersion[]
Throws:
WTException
See Also:
EffGroupAssistantEvent

_appendEffVector

protected static EffManagedVersion[] _appendEffVector(EffManagedVersion[] effManagedVersions)
                                               throws WTException
Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

Emits EffGroupAssistantEvent's PRE_APPEND_EFF_VECTOR and POST_APPEND_EFF_VECTOR.



Supported API: true

Parameters:
effManagedVersions -
Returns:
EffManagedVersion[]
Throws:
WTException
See Also:
EffGroupAssistantEvent

appendEffGroups

public static EffManagedVersion[] appendEffGroups(EffManagedVersion[] effManagedVersions,
                                                  EffGroup[] effGroups)
                                           throws WTException
Adds the EffGroups to each of the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

Emits EffGroupAssistantEvent's PRE_APPEND_EFF_GROUPS and POST_APPEND_EFF_GROUPS.



Supported API: true

Parameters:
effManagedVersions -
effGroups -
Returns:
EffManagedVersion[]
Throws:
WTException
See Also:
EffGroupAssistantEvent

_appendEffGroups

protected static EffManagedVersion[] _appendEffGroups(EffManagedVersion[] effManagedVersions,
                                                      EffGroup[] effGroups)
                                               throws WTException
Adds the EffGroups to each of the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

Emits EffGroupAssistantEvent's PRE_APPEND_EFF_GROUPS and POST_APPEND_EFF_GROUPS.



Supported API: true

Parameters:
effManagedVersions -
effGroups -
Returns:
EffManagedVersion[]
Throws:
WTException
See Also:
EffGroupAssistantEvent

replaceEffVectorQuietly

public static EffManagedVersion[] replaceEffVectorQuietly(EffManagedVersion[] effManagedVersions)
                                                   throws WTException
Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector. populateEffVector should be used to get the existing ones first, then the user would edit the contents by adding and deleting EffGroups and updating the ranges. This allows simple interaction without batch containers. Returns a fully-populated effVector in each EffManagedVersion.

No events are emitted by this call.



Supported API: true

Parameters:
effManagedVersions -
Returns:
EffManagedVersion[]
Throws:
WTException

_replaceEffVectorQuietly

protected static EffManagedVersion[] _replaceEffVectorQuietly(EffManagedVersion[] effManagedVersions)
                                                       throws WTException
Replaces the current effectivities stored in the DB for these EffManagedVersions with the effectivities represented in the EffGroups in the effVector. populateEffVector should be used to get the existing ones first, then the user would edit the contents by adding and deleting EffGroups and updating the ranges. This allows simple interaction without batch containers. Returns a fully-populated effVector in each EffManagedVersion.

No events are emitted by this call.



Supported API: true

Parameters:
effManagedVersions -
Returns:
EffManagedVersion[]
Throws:
WTException

appendEffVectorQuietly

public static EffManagedVersion[] appendEffVectorQuietly(EffManagedVersion[] effManagedVersions)
                                                  throws WTException
Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

No events are emitted by this call.



Supported API: true

Parameters:
effManagedVersions -
Returns:
EffManagedVersion[]
Throws:
WTException

_appendEffVectorQuietly

protected static EffManagedVersion[] _appendEffVectorQuietly(EffManagedVersion[] effManagedVersions)
                                                      throws WTException
Adds the effectivities represented by the EffGroups in the effVector to the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

No events are emitted by this call.



Supported API: true

Parameters:
effManagedVersions -
Returns:
EffManagedVersion[]
Throws:
WTException

appendEffGroupsQuietly

public static EffManagedVersion[] appendEffGroupsQuietly(EffManagedVersion[] effManagedVersions,
                                                         EffGroup[] effGroups)
                                                  throws WTException
Adds the EffGroups to each of the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

No events are emitted by this call.



Supported API: true

Parameters:
effManagedVersions -
effGroups -
Returns:
EffManagedVersion[]
Throws:
WTException

_appendEffGroupsQuietly

protected static EffManagedVersion[] _appendEffGroupsQuietly(EffManagedVersion[] effManagedVersions,
                                                             EffGroup[] effGroups)
                                                      throws WTException
Adds the EffGroups to each of the EffManagedVersions. Returns a fully-populated effVector in each EffManagedVersion.

No events are emitted by this call.



Supported API: true

Parameters:
effManagedVersions -
effGroups -
Returns:
EffManagedVersion[]
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 rangeType)

truncateEffRanges

private static EffRange[] truncateEffRanges(EffRange[] effRanges)
                                     throws WTPropertyVetoException
Throws:
WTPropertyVetoException

refreshVersions

private static void refreshVersions(EffManagedVersion[] effManagedVersions)
                             throws WTException
Throws:
WTException

dispatchVetoableEvent

private static void dispatchVetoableEvent(String eventType,
                                          EffManagedVersion[] effManagedVersions)
                                   throws WTException
Throws:
WTException

dispatchVetoableEvent

private static void dispatchVetoableEvent(String eventType,
                                          EffManagedVersion[] effManagedVersions,
                                          EffGroup[] effGroups)
                                   throws WTException
Throws:
WTException

inflateObjectReferences

private static QueryResult inflateObjectReferences(QueryResult qr,
                                                   EffManagedVersion[] versions,
                                                   boolean inflateContexts,
                                                   boolean inflateAudits,
                                                   boolean inflatePrincipals,
                                                   boolean inflateChangeActivities)
                                            throws WTException,
                                                   WTPropertyVetoException
Inflates the specified object references in the given QueryResult of Eff objects. Uses a previously retrieved array of EffManagedVersion objects, to avoid an unnecessary DB hit.

Parameters:
qr - QueryResult whose (Eff) elements' object references are to be inflated versions array of EffManagedVersion objects that are the 'target' references of the Eff objects in the QueryResult (included to avoid unnecessary re-retrieval from the database) inflateContexts boolean specifying whether or not to inflate 'effContext' references inflateAudits boolean specifying whether to inflate references to EffChangeAudit objects inflatePrincipals boolean specifying whether to inflate references to WTPrincipal objects inflateChangeActivities boolean specifying whether to inflate references to ChangeActivityIfc objects (via EffChangeAudit objects)
Returns:
the argument QueryResult (same ordering), with contents' object references inflated as specified
Throws:
WTException
WTPropertyVetoException

inflateOids

private static Map inflateOids(Class target,
                               Set oidSet,
                               boolean ac)
                        throws WTException
Inflates the specified set of OIDs for the specified target class, enforcing access control as specified.

Parameters:
target - Class of the objects whose OIDs are to be inflated oidSet Set of OIDs to be inflated ac boolean specifying whether or not to enforce access control for the inflation
Returns:
a Map relating the argument OIDs to the (inflated) objects they respectively identify
Throws:
WTException

validateVersions

private static void validateVersions(EffManagedVersion[] versions)
                              throws WTException,
                                     WTPropertyVetoException
Validates the specified EffManagedVersion objects for suitability as targets in Eff operations. Throws a WTException if any EffManagedVersion fails validation.

Parameters:
versions - array of EffManagedVersion objects to be validated
Throws:
WTException
WTPropertyVetoException

chunkIds

private static long[][] chunkIds(Set idSet)
Chunks the specified set of IDs (instances of Long objects) into blocks of 254, suitable for use in an SQL IN clause.

Parameters:
idSet - Set of Long objects
Returns:
array of arrays of long values specified in the argument; each array is either 254 elements wide, or possibly less if it is the last array

findEffsQuietly

private static QueryResult findEffsQuietly(long[][] bids,
                                           long[][] oids)
                                    throws WTException
Retrieves from the database the Eff objects whose 'target' branch IDs and 'effContext' OIDs match those specified. No persistence events are dispatched, and access control is not enforced (Eff objects are not expected to be access-controlled).

Parameters:
bids - array of arrays of long values representing the 'target' branch identifiers oids array of arrays of long values representing the 'effContext' OIDs
Returns:
QueryResult of the Eff objects satisfying the argument criteria
Throws:
WTException

getPrivateBidSet

private static Set getPrivateBidSet(EffManagedVersion[] versions)
                             throws WTException
Constructs a set of the branch identifiers of the specified EffManagedVersion objects that are private (refer to the definition of the isPrivate() method).

Parameters:
versions - array of EffManagedVersion objects from which the branch identifiers of private versions are to be collected
Throws:
WTException

getPredHistorySizeMap

private static Map getPredHistorySizeMap(Set bidSet)
                                  throws WTException
Constructs a map relating Key objects to Integer objects representing the cardinalities of effectivity histories. Each Key maps an EffManagedVersion whose branch identifier is specified, along with each EffContext and effectivity type for which an effectivity history exists, to the cardinality of the effectivity history (for the same EffContext and effectivity type) of the EffManagedVersion's predecessor version, if it exists. For example, if one of the specified branch identifiers represents a checked out EffManagedVersion that has an effectivity history for some EffContext and effectivity type, then a Key object for that version, EffContext, and effectivity type will be a key in the resulting map, and will be mapped to an Integer object representing he size of the effectivity history of the predecessor version (i.e., the original copy of the checked out version) for the same EffContext and effectivity type.

Parameters:
bidSet - Set of Long objects representing the branch identifiers of EffManagedVersion objects to be mapped to their respective predecessor's effectivity histories' sizes
Returns:
Map relating Key objects for each argument EffManagedVersion (and appropriate EffContext and effectivity types) to Integer objects representing the cardinality of the versions' predecessor versions' effectivity histories (for the same EffContexts and effectivity types)
Throws:
WTException

_updateEffVectorQuietly

private static EffManagedVersion[] _updateEffVectorQuietly(EffManagedVersion[] effManagedVersions,
                                                           ChangeActivityIfc authorizedBy,
                                                           boolean isReplace)
                                                    throws WTException,
                                                           WTPropertyVetoException
Updates the effectivity vectors of the specified EffManagedVersion objects without dispatching any persistence or effectivity service events. Each version is first validated for suitability for effectivity modification; an exception is thrown if any version fails validation.

Parameters:
effManagedVersions - array of EffManagedVersion objects whose effectivity vectors are to be updated authorizedBy change activity via which the effectivity updated is being effected isReplace boolean specifying whether the operation is an effectivity replacement or not (i.e., effectivity is being appended)
Returns:
array of the argument EffManagedVersions with their effectivity vectors updated
Throws:
WTException
WTPropertyVetoException

isPrivate

static boolean isPrivate(EffManagedVersion emv)
                  throws WTException
Returns true if and only if the specified EffManagedVersion is a private object.

Throws:
WTException