public interface ModelExplorer
ModelExplorer provides information about the OrgModel like which
entity types are used, which attributes they have, their data types etc. and
allows to retrieve a single entity or several entities according to
user-defined criteria.| Modifier and Type | Method and Description |
|---|---|
SerialisablePair<java.lang.Boolean,java.lang.Boolean> |
entityExistsEnabled(SessionToken session,
EntityType entType,
long id)
Returns whether the entity with the given type and id exists and whether it is enabled.
|
Entity |
getAgentForUserName(SessionToken session,
java.lang.String agentUserName)
Returns the agent for the specified user name.
|
DataType |
getAttributeDataType(SessionToken session,
EntityType entType,
java.lang.String attrName)
Returns the data type of the given attribute of the given entity type.
|
AttributeMetaData |
getAttributeMetaData(SessionToken session,
EntityType entType)
Returns an
AttributeMetaData-object, holding all available meta
information about each attribute of the given entity type. |
java.lang.String[] |
getAttributeNames(SessionToken session,
EntityType entType)
Returns all attribute names that are currently defined for the given entity
type.
|
java.util.List<Entity> |
getEntities(SessionToken session,
EntityType entType,
boolean excludeDisabled,
java.lang.String... attributes)
This method returns a list containing all entities of the given entity type.
|
java.util.List<Entity> |
getEntities(SessionToken session,
EntityType entType,
Filter filter,
boolean excludeDisabled,
java.lang.String... attributes)
This method returns a list of entities of the given entity type.
|
java.util.List<Entity> |
getEntities(SessionToken session,
EntityType entType,
java.lang.String attrName,
CmpOperator cmpOperator,
java.io.Serializable value,
boolean excludeDisabled,
java.lang.String... attributes)
This method returns a list of all entities where the given attribute matches the comparison.
|
java.util.List<Entity> |
getEntities(SessionToken session,
java.lang.String orgPolicy,
boolean excludeDisabled,
java.lang.String... attributes)
This method returns a list containing the entities which are the result of the given org
policy.
|
RemoteIterator<java.util.List<Entity>> |
getEntitiesIterator(SessionToken session,
EntityType entType,
boolean excludeDisabled,
java.lang.String... attributes)
The same as
getEntities(SessionToken, EntityType, boolean, String...) but with partial
retrieval of the entities. |
RemoteIterator<java.util.List<Entity>> |
getEntitiesIterator(SessionToken session,
EntityType entType,
Filter filter,
boolean excludeDisabled,
java.lang.String... attributes)
The same as
getEntities(SessionToken, EntityType, Filter, boolean, String...) but with
partial retrieval of the entities. |
RemoteIterator<java.util.List<Entity>> |
getEntitiesIterator(SessionToken session,
EntityType entType,
java.lang.String attrName,
CmpOperator cmpOperator,
java.io.Serializable value,
boolean excludeDisabled,
java.lang.String... attributes)
|
RemoteIterator<java.util.List<Entity>> |
getEntitiesIterator(SessionToken session,
java.lang.String orgPolicy,
boolean excludeDisabled,
java.lang.String... attributes)
The same as
getEntities(SessionToken, String, boolean, String...) but with partial
retrieval of the entities. |
Entity |
getEntity(SessionToken session,
EntityType entType,
long id,
java.lang.String... attributes)
Returns an
Entity-object containing all information about the entity of the given type
and with the given id. |
int |
getEntityCount(SessionToken session,
EntityType entType,
boolean excludeDisabled)
Returns the current count of entities of the specified type.
|
java.util.List<Entity> |
getRelatedEntities(SessionToken session,
EntityType entType,
long id,
NavFunction navFunction,
boolean excludeDisabled,
java.lang.String... attributes)
This method returns a list of all entities that are related to the given entity (of the given
type) through a relation of the type along which the given
NavFunction traverses the
OrgModel. |
java.util.List<Entity> |
getRelatedEntities(SessionToken session,
EntityType entType,
long id,
RelationType relType,
boolean leftToRight,
boolean excludeDisabled,
java.lang.String... attributes)
This method returns a list of all entities that are related to the given entity (of the given
type) through a relation of the given type in the given direction.
|
RemoteIterator<java.util.List<Entity>> |
getRelatedEntitiesIterator(SessionToken session,
EntityType entType,
long id,
NavFunction navFunction,
boolean excludeDisabled,
java.lang.String... attributes)
|
RemoteIterator<java.util.List<Entity>> |
getRelatedEntitiesIterator(SessionToken session,
EntityType entType,
long id,
RelationType relType,
boolean leftToRight,
boolean excludeDisabled,
java.lang.String... attributes)
|
java.util.Map<QualifiedAgent,RichAgent> |
getRichAgent(SessionToken session,
java.util.Collection<QualifiedAgent> agents)
Convenience method for retrieving all information on the designated
qualified agents.
|
RichAgent |
getRichAgent(SessionToken session,
QualifiedAgent agent)
Convenience method for retrieving all information on the designated
qualified agent.
|
boolean |
hasAttribute(SessionToken session,
EntityType entType,
java.lang.String attrName)
Returns whether the given entity type has an attribute with the given name.
|
boolean |
relationExists(SessionToken session,
RelationType relType,
long id1,
long id2,
boolean excludeDisabled)
Tests whether a relation of the given type exists between the two entities identified by the
given IDs.
|
RichAgent getRichAgent(SessionToken session, QualifiedAgent agent) throws OrgModelException, DataSourceException
session - The session which is used to check for access rights on this
method.agent - The qualified agent, identified by the IDs of the agent and
the corresponding organisational position as well as the
corresponding names.OrgModelException - If the agent specified by the given
QualifiedAgent object does not exist (any more), an
OrgModelException will be thrown.DataSourceException - If an an unrecoverable error occurs while
accessing the data source, a DataSourceException
will be thrown. This may happen, for instance, when accessing a
LDAP-directory which is currently unavailable.java.util.Map<QualifiedAgent,RichAgent> getRichAgent(SessionToken session, java.util.Collection<QualifiedAgent> agents) throws DataSourceException
session - The session which is used to check for access rights on this
method.agents - The qualified agents, identified by the IDs of the agents and
the corresponding organisational positions as well as the
corresponding names.RichAgent). If
one of the designated agents does not exist (any more), it will not
be in the map.DataSourceException - If an an unrecoverable error occurs while
accessing the data source, a DataSourceException
will be thrown. This may happen, for instance, when accessing a
LDAP-directory which is currently unavailable.java.lang.String[] getAttributeNames(SessionToken session, EntityType entType) throws DataSourceException
session - The session which is used to check for access rights on this
method.entType - the entity type to get the attribute names for; null
is not allowedDataSourceException - when an unrecoverable error occurs while
accessing the data sourceboolean hasAttribute(SessionToken session, EntityType entType, java.lang.String attrName) throws DataSourceException
session - The session which is used to check for access rights on this
method.entType - the entity type defining the attributeattrName - the attribute name to be checkedDataSourceException - when an unrecoverable error occurs while
accessing the data sourceDataType getAttributeDataType(SessionToken session, EntityType entType, java.lang.String attrName) throws OrgModelException, DataSourceException
session - The session which is used to check for access rights on this
method.entType - the entity type defining the attributeattrName - the attribute name for which the data type should be
returnedOrgModelException - when the attribute is not defined for this entity
typeDataSourceException - when an unrecoverable error occurs while
accessing the data sourceAttributeMetaData getAttributeMetaData(SessionToken session, EntityType entType) throws DataSourceException
AttributeMetaData-object, holding all available meta
information about each attribute of the given entity type.session - The session which is used to check for access rights on this
method.entType - the entity type for which to return the meta dataAttributeMetaData-object for the given entity typeDataSourceException - when an unrecoverable error occurs while
accessing the data sourceEntity getAgentForUserName(SessionToken session, java.lang.String agentUserName) throws OrgModelException, DataSourceException
session - The session which is used to check for access rights on this
method.agentUserName - the user name for which to retrieve the agentOrgModelException - if no agent with the specified user name existsDataSourceException - when an unrecoverable error occurs while
accessing the data sourceSerialisablePair<java.lang.Boolean,java.lang.Boolean> entityExistsEnabled(SessionToken session, EntityType entType, long id) throws DataSourceException
session - The session which is used to check for access rights on this method.entType - The type of the entity to be checked.id - The id of the entity to be checked.DataSourceException - When an unrecoverable error occurs while accessing the data source.Entity getEntity(SessionToken session, EntityType entType, long id, java.lang.String... attributes) throws OrgModelException, DataSourceException
Entity-object containing all information about the entity of the given type
and with the given id. Remember to check the entity for being enabled!session - The session which is used to check for access rights on this
method.entType - the type of the desired entityid - the id of the desired entityattributes - the attributes that will be contained in the returned
Entity-objects; all attributes will be returned if this
parameter is omittedEntity-object for the given type and id. This entity may be disabled.OrgModelException - when no entity with the given id existsDataSourceException - when an unrecoverable error occurs while
accessing the data sourcejava.util.List<Entity> getEntities(SessionToken session, EntityType entType, boolean excludeDisabled, java.lang.String... attributes) throws DataSourceException
getEntities(SessionToken, EntityType, String, CmpOperator, Serializable, boolean, String...)
or getEntities(SessionToken, EntityType, Filter, boolean, String...).session - The session which is used to check for access rights on this method.entType - The type of the desired entities.excludeDisabled - Whether to exclude disabled entities.attributes - The attributes that will be contained in the returned Entity-objects;
all attributes will be returned if this parameter is omitted.Entity-objects of the given entity type.DataSourceException - When an unrecoverable error occurs while accessing the data source.RemoteIterator<java.util.List<Entity>> getEntitiesIterator(SessionToken session, EntityType entType, boolean excludeDisabled, java.lang.String... attributes) throws DataSourceException
getEntities(SessionToken, EntityType, boolean, String...) but with partial
retrieval of the entities.session - The session which is used to check for access rights on this method.entType - The type of the desired entities.excludeDisabled - Whether to exclude disabled entities.attributes - The attributes that will be contained in the returned Entity-objects;
all attributes will be returned if this parameter is omitted.Entity-objects of the given entity type as iterator.DataSourceException - When an unrecoverable error occurs while accessing the data source.java.util.List<Entity> getEntities(SessionToken session, java.lang.String orgPolicy, boolean excludeDisabled, java.lang.String... attributes) throws OrgModelException, DataSourceException
Agent.session - The session which is used to check for access rights on this method.orgPolicy - The org policy to resolve.excludeDisabled - Whether to exclude disabled entities.attributes - The attributes that will be contained in the returned Entity-objects;
all attributes will be returned if this parameter is omitted.Entity-objects of the given entity type.OrgModelException - If the org policy contains errors.DataSourceException - When an unrecoverable error occurs while accessing the data source.RemoteIterator<java.util.List<Entity>> getEntitiesIterator(SessionToken session, java.lang.String orgPolicy, boolean excludeDisabled, java.lang.String... attributes) throws OrgModelException, DataSourceException
getEntities(SessionToken, String, boolean, String...) but with partial
retrieval of the entities.session - The session which is used to check for access rights on this method.orgPolicy - The org policy to resolve.excludeDisabled - Whether to exclude disabled entities.attributes - The attributes that will be contained in the returned Entity-objects;
all attributes will be returned if this parameter is omitted.Entity-objects of the given entity type as iterator.OrgModelException - If the org policy contains errors.DataSourceException - When an unrecoverable error occurs while accessing the data source.java.util.List<Entity> getEntities(SessionToken session, EntityType entType, java.lang.String attrName, CmpOperator cmpOperator, java.io.Serializable value, boolean excludeDisabled, java.lang.String... attributes) throws java.lang.IllegalArgumentException, OrgModelException, DataSourceException
session - The session which is used to check for access rights on this method.entType - The type of the desired entities.attrName - The attribute to be checked.cmpOperator - The comparison operator to be used.value - The value that all returned entities must have for the given attribute.excludeDisabled - Whether to exclude disabled entities.attributes - The attributes that will be contained in the returned Entity-objects;
all attributes will be returned if this parameter is omitted.java.lang.IllegalArgumentException - When the attribute name isn't valid or the value object is of
an unexpected/unknown data type (i.e. DataType.getDataTypeForObject(Object)
returns null).OrgModelException - When the given attribute doesn't exist or the given value can't be
compared to attribute's type.DataSourceException - When an unrecoverable error occurs while accessing the data source.RemoteIterator<java.util.List<Entity>> getEntitiesIterator(SessionToken session, EntityType entType, java.lang.String attrName, CmpOperator cmpOperator, java.io.Serializable value, boolean excludeDisabled, java.lang.String... attributes) throws java.lang.IllegalArgumentException, OrgModelException, DataSourceException
getEntities(SessionToken, EntityType, String, CmpOperator, Serializable, boolean, String...)
but with partial retrieval of the entities.session - The session which is used to check for access rights on this method.entType - The type of the desired entities.attrName - The attribute to be checked.cmpOperator - The comparison operator to be used.value - The value that all returned entities must have for the given attribute.excludeDisabled - Whether to exclude disabled entities.attributes - The attributes that will be contained in the returned Entity-objects;
all attributes will be returned if this parameter is omitted.java.lang.IllegalArgumentException - When the attribute name isn't valid or the value object is of
an unexpected/unknown data type (i.e. DataType.getDataTypeForObject(Object)
returns null).OrgModelException - When the given attribute doesn't exist or the given value can't be
compared to attribute's type.DataSourceException - When an unrecoverable error occurs while accessing the data source.java.util.List<Entity> getEntities(SessionToken session, EntityType entType, Filter filter, boolean excludeDisabled, java.lang.String... attributes) throws java.lang.IllegalArgumentException, OrgModelException, DataSourceException
Filter can be provided.session - The session which is used to check for access rights on this method.entType - The type of the desired entities.filter - A Filter to restrict the list of returned entities; use null if
you want all entities.excludeDisabled - Whether to exclude disabled entities.attributes - The attributes that will be contained in the returned Entity-objects;
all attributes will be returned if this parameter is omitted.Entity-objects of the given entity type.java.lang.IllegalArgumentException - When the attribute name isn't valid or any of the value
objects in the filter is of an unexpected/unknown data type (i.e.
DataType.getDataTypeForObject(Object) returns null).OrgModelException - When the filter tries to access unknown attributes or the provided
values for the filter have a type that can't be compared to the attributes' type.DataSourceException - When an unrecoverable error occurs while accessing the data source.RemoteIterator<java.util.List<Entity>> getEntitiesIterator(SessionToken session, EntityType entType, Filter filter, boolean excludeDisabled, java.lang.String... attributes) throws java.lang.IllegalArgumentException, OrgModelException, DataSourceException
getEntities(SessionToken, EntityType, Filter, boolean, String...) but with
partial retrieval of the entities.session - The session which is used to check for access rights on this method.entType - The type of the desired entities.filter - A Filter to restrict the list of returned entities; use null if
you want all entities.excludeDisabled - Whether to exclude disabled entities.attributes - The attributes that will be contained in the returned Entity-objects;
all attributes will be returned if this parameter is omitted.Entity-objects of the given entity type as iterator.java.lang.IllegalArgumentException - When the attribute name isn't valid or any of the value
objects in the filter is of an unexpected/unknown data type (i.e.
DataType.getDataTypeForObject(Object) returns null).OrgModelException - When the filter tries to access unknown attributes or the provided
values for the filter have a type that can't be compared to the attributes' type.DataSourceException - When an unrecoverable error occurs while accessing the data source.int getEntityCount(SessionToken session, EntityType entType, boolean excludeDisabled) throws DataSourceException
session - The session which is used to check for access rights on this method.entType - The type of the desired entities.excludeDisabled - Whether to exclude disabled entities.DataSourceException - When an unrecoverable error occurs while accessing the data source.boolean relationExists(SessionToken session, RelationType relType, long id1, long id2, boolean excludeDisabled) throws OrgModelException, DataSourceException
ModelChangeOperations.addRelation(SessionToken, RelationType, long, long).session - The session which is used to check for access rights on this method.relType - The type of the relation to be tested.id1 - The ID of the first entity.id2 - The ID of the second entity.excludeDisabled - Whether to exclude disabled entities.OrgModelException - When one of the entities does not exist.DataSourceException - When an unrecoverable error occurs while accessing the data source.java.util.List<Entity> getRelatedEntities(SessionToken session, EntityType entType, long id, RelationType relType, boolean leftToRight, boolean excludeDisabled, java.lang.String... attributes) throws OrgModelException, DataSourceException
session - The session which is used to check for access rights on this method.entType - The type of the entity to get the related entities for.id - The id of the entity to get the related entities for.relType - The type of the requested relations.leftToRight - Whether the relation type should be traversed from left to right or the
other way around.excludeDisabled - Whether to exclude disabled entities.attributes - The attributes that will be contained in the returned Entity-objects;
all attributes will be returned if this parameter is omitted.OrgModelException - When the given source entity does not exist.DataSourceException - When an unrecoverable error occurs while accessing the data source.RemoteIterator<java.util.List<Entity>> getRelatedEntitiesIterator(SessionToken session, EntityType entType, long id, RelationType relType, boolean leftToRight, boolean excludeDisabled, java.lang.String... attributes) throws OrgModelException, DataSourceException
getRelatedEntities(SessionToken, EntityType, long, RelationType, boolean, boolean, String...)
but with partial retrieval of the entities.session - The session which is used to check for access rights on this method.entType - The type of the entity to get the related entities for.id - The id of the entity to get the related entities for.relType - The type of the requested relations.leftToRight - Whether the relation type should be traversed from left to right or the
other way around.excludeDisabled - Whether to exclude disabled entities.attributes - The attributes that will be contained in the returned Entity-objects;
all attributes will be returned if this parameter is omitted.OrgModelException - When the given source entity does not exist.DataSourceException - When an unrecoverable error occurs while accessing the data source.java.util.List<Entity> getRelatedEntities(SessionToken session, EntityType entType, long id, NavFunction navFunction, boolean excludeDisabled, java.lang.String... attributes) throws OrgModelException, DataSourceException
NavFunction traverses the
OrgModel.session - The session which is used to check for access rights on this method.entType - The type of the entity to get the related entities for.id - The id of the entity to get the related entities for.navFunction - The navigational function describing the relation type and the direction.excludeDisabled - Whether to exclude disabled entities.attributes - The attributes that will be contained in the returned Entity-objects;
all attributes will be returned if this parameter is omitted.OrgModelException - When the given source entity does not exist.DataSourceException - When an unrecoverable error occurs while accessing the data source.RemoteIterator<java.util.List<Entity>> getRelatedEntitiesIterator(SessionToken session, EntityType entType, long id, NavFunction navFunction, boolean excludeDisabled, java.lang.String... attributes) throws OrgModelException, DataSourceException
getRelatedEntities(SessionToken, EntityType, long, NavFunction, boolean, String...)
but with partial retrieval of the entities.session - The session which is used to check for access rights on this method.entType - The type of the entity to get the related entities for.id - The id of the entity to get the related entities for.navFunction - The navigational function describing the relation type and the directionexcludeDisabled - Whether to exclude disabled entities.attributes - The attributes that will be contained in the returned Entity-objects;
all attributes will be returned if this parameter is omitted.OrgModelException - When the given source entity does not exist.DataSourceException - When an unrecoverable error occurs while accessing the data source.