Package pl.edu.icm.unity.engine.api
Interface EntityManagement
-
public interface EntityManagement
Engine API for (closely related) entities and identities management.- Author:
- K. Benedyczak
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description Identity
addEntity(IdentityParam toAdd, String credReqIdId, EntityState initialState)
AsaddEntity(IdentityParam, String, EntityState, List)
with the empty list of attributes.default Identity
addEntity(IdentityParam toAdd, String credReqIdId, EntityState initialState, boolean extractAttributes, List<Attribute> attributes)
Deprecated.Identity
addEntity(IdentityParam toAdd, String credReqIdId, EntityState initialState, List<Attribute> attributes)
Adds a new entity with an initial identity.Identity
addEntity(IdentityParam toAdd, EntityState initialState)
AsaddEntity(IdentityParam, EntityState, List)
with the empty list of attributes and default credential requirements.default Identity
addEntity(IdentityParam toAdd, EntityState initialState, boolean extractAttributes)
Deprecated.default Identity
addEntity(IdentityParam toAdd, EntityState initialState, boolean extractAttributes, List<Attribute> attributes)
Deprecated.Identity
addEntity(IdentityParam toAdd, EntityState initialState, List<Attribute> attributes)
AsaddEntity(IdentityParam, String, EntityState, List)
with the empty list of attributes and default credential requirements.Identity
addIdentity(IdentityParam toAdd, EntityParam parentEntity)
Adds a new identity under existing entity.default Identity
addIdentity(IdentityParam toAdd, EntityParam parentEntity, boolean extractAttributes)
Deprecated.Set<EntityWithContactInfo>
getAllEntitiesWithContactEmails(Set<String> contactEmails)
Returns entities with assigned e-mail - as attribute or identityEntity
getEntity(EntityParam entity)
Returns information about an entity along with its all identities with authorization in '/'.Entity
getEntity(EntityParam entity, String target, boolean allowCreate, String group)
Returns information about an entity along with its all identities.String
getEntityLabel(EntityParam entity)
Entity
getEntityNoContext(EntityParam entity, String group)
Returns information about an entity along with its identities.Map<String,GroupMembership>
getGroups(EntityParam entity)
Returns a collection with all groups where the entity is a member.Collection<Group>
getGroupsForPresentation(EntityParam entity)
Returns a collection with all groups where the entity is a member.void
mergeEntities(EntityParam target, EntityParam merged, boolean safeMode)
Merge the 2nd entity with the first one.void
removeEntity(EntityParam toRemove)
void
removeIdentity(IdentityTaV toRemove)
Deletes identity.void
resetIdentity(EntityParam entity, String typeIdToReset, String realm, String target)
Reset a possibly targeted value of a dynamic identity.void
scheduleEntityChange(EntityParam toChange, Date changeTime, EntityScheduledOperation operation)
Schedules an operation to be invoked at a given time on an entity.void
scheduleRemovalByUser(EntityParam toChange, Date changeTime)
Sets the entity in theEntityState.onlyLoginPermitted
and schedules the entity removal at given time unless the user logs in before this time.void
setEntityStatus(EntityParam toChange, EntityState state)
void
setIdentities(EntityParam entity, Collection<String> updatedTypes, Collection<? extends IdentityParam> newIdentities)
Updates identities of a single entity.void
updateIdentity(IdentityTaV original, IdentityParam updated)
Updates a given identity.
-
-
-
Method Detail
-
addEntity
Identity addEntity(IdentityParam toAdd, String credReqIdId, EntityState initialState, List<Attribute> attributes) throws EngineException
Adds a new entity with an initial identity.- Parameters:
toAdd
- new identitycredReqId
- LocalCredentialRequirements
idinitialState
- the initial state of the newly created entityattributes
- initial attributes to be added for the entity. This is especially useful when the root group (to which the entity is automatically added) has someAttributesClass
es assigned with mandatory attributes.- Returns:
- newly created identity
- Throws:
EngineException
-
addEntity
Identity addEntity(IdentityParam toAdd, String credReqIdId, EntityState initialState) throws EngineException
AsaddEntity(IdentityParam, String, EntityState, List)
with the empty list of attributes.- Throws:
EngineException
-
addEntity
Identity addEntity(IdentityParam toAdd, EntityState initialState, List<Attribute> attributes) throws EngineException
AsaddEntity(IdentityParam, String, EntityState, List)
with the empty list of attributes and default credential requirements.- Throws:
EngineException
-
addEntity
Identity addEntity(IdentityParam toAdd, EntityState initialState) throws EngineException
AsaddEntity(IdentityParam, EntityState, List)
with the empty list of attributes and default credential requirements.- Throws:
EngineException
-
addIdentity
Identity addIdentity(IdentityParam toAdd, EntityParam parentEntity) throws EngineException
Adds a new identity under existing entity.- Throws:
EngineException
-
removeIdentity
void removeIdentity(IdentityTaV toRemove) throws EngineException
Deletes identity. It must not be the last identity of the entity. Certain system Identities can not be removed.- Throws:
EngineException
-
setIdentities
void setIdentities(EntityParam entity, Collection<String> updatedTypes, Collection<? extends IdentityParam> newIdentities) throws EngineException
Updates identities of a single entity. The identities of the types provided with the first argument are replaced with the identities given as the second argument. The set of new identities can contain only identities of types enumerated in the first argument (which can have more types, if some needs to be cleared). Certain system identity types can not be modified using this method, only theresetIdentity(EntityParam, String, String, String)
is available for them.- Parameters:
entity
- all identities must belong to this entityupdatedTypes
- set of all types that shall be modifiednewIdentities
- a new, complete set of identities for the given types- Throws:
EngineException
-
updateIdentity
void updateIdentity(IdentityTaV original, IdentityParam updated) throws EngineException
Updates a given identity. Useful to change details of an identity like confirmation status. Note that updated identity must have the same comparable representation as the original one, i.e. must have the same type and value parts which are part of comparable representation must be unchanged. Operation only available with full permissions.- Throws:
EngineException
-
resetIdentity
void resetIdentity(EntityParam entity, String typeIdToReset, String realm, String target) throws EngineException
Reset a possibly targeted value of a dynamic identity. For the identities which are fixed this method throws an exception.- Parameters:
entity
- subjecttypeIdToReset
- which id type should be reset, must be dynamicrealm
- if null then all realms should be clearedtarget
- if null then all targets should be cleared- Throws:
EngineException
-
removeEntity
void removeEntity(EntityParam toRemove) throws EngineException
- Throws:
EngineException
-
setEntityStatus
void setEntityStatus(EntityParam toChange, EntityState state) throws EngineException
- Throws:
EngineException
-
scheduleEntityChange
void scheduleEntityChange(EntityParam toChange, Date changeTime, EntityScheduledOperation operation) throws EngineException
Schedules an operation to be invoked at a given time on an entity. Requires regular identityModify capability (not assigned for self access).- Throws:
EngineException
-
scheduleRemovalByUser
void scheduleRemovalByUser(EntityParam toChange, Date changeTime) throws EngineException
Sets the entity in theEntityState.onlyLoginPermitted
and schedules the entity removal at given time unless the user logs in before this time. Requires only the attributeModify capability (allowed for selfAccess).- Throws:
EngineException
-
getEntity
Entity getEntity(EntityParam entity) throws EngineException
Returns information about an entity along with its all identities with authorization in '/'.- Throws:
EngineException
-
getEntity
Entity getEntity(EntityParam entity, String target, boolean allowCreate, String group) throws EngineException
Returns information about an entity along with its all identities. This version supports dynamic identities as it allows for specifying a receiver of the information and whether it is allowed to establish a new identifier.- Parameters:
entity
- who to resolvetarget
- for whom the information is targetedallowCreate
- whether dynamic identities can be createdgroup
- group wrt which authorization should be performed.- Returns:
- Throws:
EngineException
-
getEntityNoContext
Entity getEntityNoContext(EntityParam entity, String group) throws EngineException
Returns information about an entity along with its identities. This version requires higher privileges and returns all identities, also those targeted for anybody in any realm.- Throws:
EngineException
-
getAllEntitiesWithContactEmails
Set<EntityWithContactInfo> getAllEntitiesWithContactEmails(Set<String> contactEmails) throws EngineException
Returns entities with assigned e-mail - as attribute or identity- Parameters:
contactEmail
- email assigned to the entity- Throws:
EngineException
-
getGroups
Map<String,GroupMembership> getGroups(EntityParam entity) throws EngineException
Returns a collection with all groups where the entity is a member. For convenience returned as map indexed with group paths.- Parameters:
entity
-- Returns:
- Throws:
EngineException
-
getGroupsForPresentation
Collection<Group> getGroupsForPresentation(EntityParam entity) throws EngineException
Returns a collection with all groups where the entity is a member. This method returns resolved groups with description and displayed name, however without information on attribute statements and other data which might be secret.- Throws:
EngineException
-
mergeEntities
void mergeEntities(EntityParam target, EntityParam merged, boolean safeMode) throws EngineException
Merge the 2nd entity with the first one. Only non conflicting information is moved. In particular the information of the merged entity is processed as follows:- static identities are added to the base entity
- dynamic identities are added to the base entity only if it has no identities of a particular identity type and the identity is removable
- credential requirement and attribute classes are ignored
- credentials are added, however only if the target identity has no credential defined of the same type
- group memberships are copied
- attributes are copied, however only if the target has no attribute of the same type in the same group. Also attributes not allowed by the target's attribute policy are ignored
- Throws:
EngineException
-
getEntityLabel
String getEntityLabel(EntityParam entity) throws EngineException
- Returns:
- displayed name of the entity or null if undefined
- Throws:
EngineException
-
addEntity
@Deprecated default Identity addEntity(IdentityParam toAdd, String credReqIdId, EntityState initialState, boolean extractAttributes, List<Attribute> attributes) throws EngineException
Deprecated.- Throws:
EngineException
-
addEntity
@Deprecated default Identity addEntity(IdentityParam toAdd, EntityState initialState, boolean extractAttributes, List<Attribute> attributes) throws EngineException
Deprecated.- Throws:
EngineException
-
addEntity
@Deprecated default Identity addEntity(IdentityParam toAdd, EntityState initialState, boolean extractAttributes) throws EngineException
Deprecated.- Throws:
EngineException
-
addIdentity
@Deprecated default Identity addIdentity(IdentityParam toAdd, EntityParam parentEntity, boolean extractAttributes) throws EngineException
Deprecated.- Throws:
EngineException
-
-