|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.oakgrovesystems.reactor.client.ClientLabelPathToIdMapper
Maps LabelPaths to ReactorObjectIds. Uses a Map to dereference ReactorObjectIds as necessary to do the mapping. This class was written with the assumption that the Map contains properly initialized ProcessMediation objects. For example, an Operand's getProcess() method should not return the id of a Status. However, this precondition is not enforced and errors that result from this precondition not being met were not taken into consideration when writing the class. This class should be improved to either enforce this precondition or gracefully handle errors that result from it not being met.
Constructor Summary | |
ClientLabelPathToIdMapper()
Constructs a ClientLabelPathToIdMapperthat utilizes caching to improve performance. |
|
ClientLabelPathToIdMapper(java.util.Map objectMap)
Constructs a mapper that uses objectMap to look up objects by their ids and utilizes caching to improve performance. |
Method Summary | |
protected void |
addToCache(com.oakgrovesystems.reactor.LabelPath pathToMap,
java.lang.Class filterClass,
com.oakgrovesystems.reactor.ReactorObjectId id)
Adds ReactorObjectId corresponding to LabelPath to cache |
void |
emptyCache()
Clears the mapper's cache and reinitializes the root naming context. |
com.oakgrovesystems.reactor.ReactorObjectId |
getId(com.oakgrovesystems.reactor.LabelPath pathToMap)
Maps a LabelPath to a ReactorObjectId. |
com.oakgrovesystems.reactor.ReactorObjectId |
getId(com.oakgrovesystems.reactor.LabelPath pathToMap,
java.lang.Class filterClass)
Maps a LabelPath to a ReactorObjectId. |
com.oakgrovesystems.reactor.ReactorObjectId |
getId(com.oakgrovesystems.reactor.LabelPath pathToMap,
java.lang.Class filterClass,
com.oakgrovesystems.reactor.ReactorObjectId root)
Maps a LabelPath to a ReactorObjectId with the id specified as the starting point for label path resolution. |
com.oakgrovesystems.reactor.ReactorObjectId |
getId(com.oakgrovesystems.reactor.LabelPath pathToMap,
com.oakgrovesystems.reactor.ReactorObjectId root)
Maps a LabelPath to a ReactorObjectId with the id specified as the starting point for label path resolution. |
com.oakgrovesystems.reactor.ReactorObjectId |
getIdForUniqueLabelPath(com.oakgrovesystems.reactor.LabelPath uniquePathToMap)
Maps a LabelPath to a ReactorObjectId. |
com.oakgrovesystems.reactor.ReactorObjectId |
getIdForUniqueLabelPath(com.oakgrovesystems.reactor.LabelPath uniquePathToMap,
java.lang.Class filterClass)
Maps a LabelPath to a ReactorObjectId. |
com.oakgrovesystems.reactor.ReactorObjectId |
getIdForUniqueLabelPath(com.oakgrovesystems.reactor.LabelPath uniquePathToMap,
java.lang.Class filterClass,
com.oakgrovesystems.reactor.ReactorObjectId root)
Maps a LabelPath to a ReactorObjectId with the id specified as the starting point for label path resolution. |
com.oakgrovesystems.reactor.ReactorObjectId |
getIdForUniqueLabelPath(com.oakgrovesystems.reactor.LabelPath uniquePathToMap,
com.oakgrovesystems.reactor.ReactorObjectId root)
Maps a LabelPath to a ReactorObjectId with the id specified as the starting point for label path resolution. |
java.util.Set |
getIdSet(com.oakgrovesystems.reactor.LabelPath pathToMap)
Maps a LabelPath to a Set of ReactorObjectIds |
java.util.Set |
getIdSet(com.oakgrovesystems.reactor.LabelPath pathToMap,
java.lang.Class filterClass)
Maps a LabelPath to a Set of ReactorObjectIds |
java.util.Set |
getIdSet(com.oakgrovesystems.reactor.LabelPath pathToMap,
java.lang.Class filterClass,
boolean definitionsOnly)
Maps a LabelPath to a Set of ReactorObjectIds |
java.util.Set |
getIdSet(com.oakgrovesystems.reactor.LabelPath pathToMap,
java.lang.Class filterClass,
com.oakgrovesystems.reactor.ReactorObjectId root)
Maps a LabelPath to a Set of ReactorObjectIds with the id specified as the starting point for label path resolution |
java.util.Set |
getIdSet(com.oakgrovesystems.reactor.LabelPath pathToMap,
java.lang.Class filterClass,
com.oakgrovesystems.reactor.ReactorObjectId root,
boolean definitionsOnly)
|
java.util.Set |
getIdSet(com.oakgrovesystems.reactor.LabelPath pathToMap,
com.oakgrovesystems.reactor.ReactorObjectId root)
Maps a LabelPath to a Set of ReactorObjectIds using the Process with the id specified as the starting point for label path resolution |
java.util.Map |
getObjectMap()
Returns the Map being used to look up ProcessMediationObjects. |
void |
setObjectMap(java.util.Map objectMap)
Sets the Map for this mapper to use to look up ProcessMediationObjects by their ids. |
void |
setUseCaching(boolean useCaching)
Sets whether or not the Mapper will use caching to improve performance. |
boolean |
usesCaching()
Returns a boolean indicating whether or not this mapper is using caching to improve perfomance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ClientLabelPathToIdMapper()
public ClientLabelPathToIdMapper(java.util.Map objectMap) throws ProcessMediationException
objectMap
- the Map to use to look up objects by their ids
ProcessMediationException
- if the Map contains values other than ProcessMediationObjects or
Maps an id to an object with a different id.Method Detail |
public void setObjectMap(java.util.Map objectMap) throws ProcessMediationException
objectMap
- The map that should be used to lookup ProcessMediationObjects
by their ids. The Map should have with keys that are Strings
and values that are ProcessMediationObjects.
ProcessMediationException
- if the Map contains values other than ProcessMediationObjects or
Maps an id to an object with a different id.public java.util.Map getObjectMap()
public void setUseCaching(boolean useCaching)
useCaching
- whether or not the Mapper will use cachingpublic boolean usesCaching()
public void emptyCache() throws ProcessMediationException
ProcessMediationException
- If the objectMap contains errorspublic java.util.Set getIdSet(com.oakgrovesystems.reactor.LabelPath pathToMap, java.lang.Class filterClass)
getIdSet
in interface LabelPathToIdMapper
pathToMap
- The LabelPath that must resolve to an object for
that object to be included in the returned Set.filterClass
- The Class with which an object must be assignment compatible
in order to be included in the returned Set.
public java.util.Set getIdSet(com.oakgrovesystems.reactor.LabelPath pathToMap, java.lang.Class filterClass, boolean definitionsOnly)
LabelPathToIdMapper
getIdSet
in interface LabelPathToIdMapper
pathToMap
- The LabelPath that must resolve to an object for
that object to be included in the returned Set.filterClass
- The Class with which an object must be assignment compatible
in order to be included in the returned Set.definitionsOnly
- If true, the objects must be in a process definition tree.
public java.util.Set getIdSet(com.oakgrovesystems.reactor.LabelPath pathToMap, java.lang.Class filterClass, com.oakgrovesystems.reactor.ReactorObjectId root)
LabelPathToIdMapper
getIdSet
in interface LabelPathToIdMapper
pathToMap
- The LabelPath that must resolve to an object for
that object to be included in the returned Set.filterClass
- The Class with which an object must be assignment compatible
in order to be included in the returned Set.
public java.util.Set getIdSet(com.oakgrovesystems.reactor.LabelPath pathToMap, java.lang.Class filterClass, com.oakgrovesystems.reactor.ReactorObjectId root, boolean definitionsOnly)
public java.util.Set getIdSet(com.oakgrovesystems.reactor.LabelPath pathToMap)
getIdSet
in interface LabelPathToIdMapper
pathToMap
- The LabelPath that must resolve to an object for
that object to be included in the returned Set.
public java.util.Set getIdSet(com.oakgrovesystems.reactor.LabelPath pathToMap, com.oakgrovesystems.reactor.ReactorObjectId root)
LabelPathToIdMapper
getIdSet
in interface LabelPathToIdMapper
pathToMap
- The LabelPath that must resolve to an object for
that object to be included in the returned Set.
protected void addToCache(com.oakgrovesystems.reactor.LabelPath pathToMap, java.lang.Class filterClass, com.oakgrovesystems.reactor.ReactorObjectId id)
public com.oakgrovesystems.reactor.ReactorObjectId getId(com.oakgrovesystems.reactor.LabelPath pathToMap)
getId
in interface LabelPathToIdMapper
pathToMap
- The LabelPath that must resolve to an object for
that object to be included in the returned Set.
public com.oakgrovesystems.reactor.ReactorObjectId getId(com.oakgrovesystems.reactor.LabelPath pathToMap, com.oakgrovesystems.reactor.ReactorObjectId root)
LabelPathToIdMapper
getId
in interface LabelPathToIdMapper
pathToMap
- The LabelPath that must resolve to an object for
that object to be included in the returned Set.
public com.oakgrovesystems.reactor.ReactorObjectId getId(com.oakgrovesystems.reactor.LabelPath pathToMap, java.lang.Class filterClass)
getId
in interface LabelPathToIdMapper
pathToMap
- The LabelPath that must resolve to an object for
that object to be included in the returned Set.filterClass
-
public com.oakgrovesystems.reactor.ReactorObjectId getId(com.oakgrovesystems.reactor.LabelPath pathToMap, java.lang.Class filterClass, com.oakgrovesystems.reactor.ReactorObjectId root)
LabelPathToIdMapper
getId
in interface LabelPathToIdMapper
pathToMap
- The LabelPath that must resolve to an object for
that object to be included in the returned Set.filterClass
-
public com.oakgrovesystems.reactor.ReactorObjectId getIdForUniqueLabelPath(com.oakgrovesystems.reactor.LabelPath uniquePathToMap) throws IdentifierMappingException
getIdForUniqueLabelPath
in interface LabelPathToIdMapper
uniquePathToMap
- The LabelPath that must resolve to an object for
that object to be included in the returned Set.
IdentifierMappingException
- If the LabelPath provided maps to more than one object.public com.oakgrovesystems.reactor.ReactorObjectId getIdForUniqueLabelPath(com.oakgrovesystems.reactor.LabelPath uniquePathToMap, com.oakgrovesystems.reactor.ReactorObjectId root) throws IdentifierMappingException
LabelPathToIdMapper
getIdForUniqueLabelPath
in interface LabelPathToIdMapper
uniquePathToMap
- The LabelPath that must resolve to an object for
that object to be included in the returned Set.
IdentifierMappingException
- If the LabelPath provided maps to more than one object.public com.oakgrovesystems.reactor.ReactorObjectId getIdForUniqueLabelPath(com.oakgrovesystems.reactor.LabelPath uniquePathToMap, java.lang.Class filterClass) throws IdentifierMappingException
getIdForUniqueLabelPath
in interface LabelPathToIdMapper
uniquePathToMap
- The LabelPath that must resolve to an object for
that object to be included in the returned Set.filterClass
- The Class with which an object must be assignment compatible
in order to be included in the returned Set.
IdentifierMappingException
- If the LabelPath provided maps to more than one object that is
assignment compatible with the given class.public com.oakgrovesystems.reactor.ReactorObjectId getIdForUniqueLabelPath(com.oakgrovesystems.reactor.LabelPath uniquePathToMap, java.lang.Class filterClass, com.oakgrovesystems.reactor.ReactorObjectId root) throws IdentifierMappingException
LabelPathToIdMapper
getIdForUniqueLabelPath
in interface LabelPathToIdMapper
uniquePathToMap
- The LabelPath that must resolve to an object for
that object to be included in the returned Set.filterClass
- The Class with which an object must be assignment compatible
in order to be included in the returned Set.
IdentifierMappingException
- If the LabelPath provided maps to more than one object that is
assignment compatible with the given class.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |