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
      pl.edu.icm.unity.types.basic.Identity addEntity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd, java.lang.String credReqIdId, pl.edu.icm.unity.types.basic.EntityState initialState)
      As addEntity(IdentityParam, String, EntityState, List) with the empty list of attributes.
      default pl.edu.icm.unity.types.basic.Identity addEntity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd, java.lang.String credReqIdId, pl.edu.icm.unity.types.basic.EntityState initialState, boolean extractAttributes, java.util.List<pl.edu.icm.unity.types.basic.Attribute> attributes)
      Deprecated.
      pl.edu.icm.unity.types.basic.Identity addEntity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd, java.lang.String credReqIdId, pl.edu.icm.unity.types.basic.EntityState initialState, java.util.List<pl.edu.icm.unity.types.basic.Attribute> attributes)
      Adds a new entity with an initial identity.
      pl.edu.icm.unity.types.basic.Identity addEntity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd, pl.edu.icm.unity.types.basic.EntityState initialState)
      As addEntity(IdentityParam, EntityState, List) with the empty list of attributes and default credential requirements.
      default pl.edu.icm.unity.types.basic.Identity addEntity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd, pl.edu.icm.unity.types.basic.EntityState initialState, boolean extractAttributes)
      Deprecated.
      default pl.edu.icm.unity.types.basic.Identity addEntity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd, pl.edu.icm.unity.types.basic.EntityState initialState, boolean extractAttributes, java.util.List<pl.edu.icm.unity.types.basic.Attribute> attributes)
      Deprecated.
      pl.edu.icm.unity.types.basic.Identity addEntity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd, pl.edu.icm.unity.types.basic.EntityState initialState, java.util.List<pl.edu.icm.unity.types.basic.Attribute> attributes)
      As addEntity(IdentityParam, String, EntityState, List) with the empty list of attributes and default credential requirements.
      pl.edu.icm.unity.types.basic.Identity addIdentity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd, pl.edu.icm.unity.types.basic.EntityParam parentEntity)
      Adds a new identity under existing entity.
      default pl.edu.icm.unity.types.basic.Identity addIdentity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd, pl.edu.icm.unity.types.basic.EntityParam parentEntity, boolean extractAttributes)
      Deprecated.
      pl.edu.icm.unity.types.basic.Entity getEntity​(pl.edu.icm.unity.types.basic.EntityParam entity)
      Returns information about an entity along with its all identities with authorization in '/'.
      pl.edu.icm.unity.types.basic.Entity getEntity​(pl.edu.icm.unity.types.basic.EntityParam entity, java.lang.String target, boolean allowCreate, java.lang.String group)
      Returns information about an entity along with its all identities.
      java.lang.String getEntityLabel​(pl.edu.icm.unity.types.basic.EntityParam entity)  
      pl.edu.icm.unity.types.basic.Entity getEntityNoContext​(pl.edu.icm.unity.types.basic.EntityParam entity, java.lang.String group)
      Returns information about an entity along with its identities.
      java.util.Map<java.lang.String,​pl.edu.icm.unity.types.basic.GroupMembership> getGroups​(pl.edu.icm.unity.types.basic.EntityParam entity)
      Returns a collection with all groups where the entity is a member.
      java.util.Collection<pl.edu.icm.unity.types.basic.Group> getGroupsForPresentation​(pl.edu.icm.unity.types.basic.EntityParam entity)
      Returns a collection with all groups where the entity is a member.
      void mergeEntities​(pl.edu.icm.unity.types.basic.EntityParam target, pl.edu.icm.unity.types.basic.EntityParam merged, boolean safeMode)
      Merge the 2nd entity with the first one.
      void removeEntity​(pl.edu.icm.unity.types.basic.EntityParam toRemove)  
      void removeIdentity​(pl.edu.icm.unity.types.basic.IdentityTaV toRemove)
      Deletes identity.
      void resetIdentity​(pl.edu.icm.unity.types.basic.EntityParam entity, java.lang.String typeIdToReset, java.lang.String realm, java.lang.String target)
      Reset a possibly targeted value of a dynamic identity.
      void scheduleEntityChange​(pl.edu.icm.unity.types.basic.EntityParam toChange, java.util.Date changeTime, pl.edu.icm.unity.types.basic.EntityScheduledOperation operation)
      Schedules an operation to be invoked at a given time on an entity.
      void scheduleRemovalByUser​(pl.edu.icm.unity.types.basic.EntityParam toChange, java.util.Date changeTime)
      Sets the entity in the EntityState.onlyLoginPermitted and schedules the entity removal at given time unless the user logs in before this time.
      void setEntityStatus​(pl.edu.icm.unity.types.basic.EntityParam toChange, pl.edu.icm.unity.types.basic.EntityState state)  
      void setIdentities​(pl.edu.icm.unity.types.basic.EntityParam entity, java.util.Collection<java.lang.String> updatedTypes, java.util.Collection<? extends pl.edu.icm.unity.types.basic.IdentityParam> newIdentities)
      Updates identities of a single entity.
      void updateIdentity​(pl.edu.icm.unity.types.basic.IdentityTaV original, pl.edu.icm.unity.types.basic.IdentityParam updated)
      Updates a given identity.
    • Method Detail

      • addEntity

        pl.edu.icm.unity.types.basic.Identity addEntity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd,
                                                        java.lang.String credReqIdId,
                                                        pl.edu.icm.unity.types.basic.EntityState initialState,
                                                        java.util.List<pl.edu.icm.unity.types.basic.Attribute> attributes)
                                                 throws pl.edu.icm.unity.exceptions.EngineException
        Adds a new entity with an initial identity.
        Parameters:
        toAdd - new identity
        credReqId - Local CredentialRequirements id
        initialState - the initial state of the newly created entity
        attributes - initial attributes to be added for the entity. This is especially useful when the root group (to which the entity is automatically added) has some AttributesClasses assigned with mandatory attributes.
        Returns:
        newly created identity
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • addEntity

        pl.edu.icm.unity.types.basic.Identity addEntity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd,
                                                        java.lang.String credReqIdId,
                                                        pl.edu.icm.unity.types.basic.EntityState initialState)
                                                 throws pl.edu.icm.unity.exceptions.EngineException
        As addEntity(IdentityParam, String, EntityState, List) with the empty list of attributes.
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • addEntity

        pl.edu.icm.unity.types.basic.Identity addEntity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd,
                                                        pl.edu.icm.unity.types.basic.EntityState initialState,
                                                        java.util.List<pl.edu.icm.unity.types.basic.Attribute> attributes)
                                                 throws pl.edu.icm.unity.exceptions.EngineException
        As addEntity(IdentityParam, String, EntityState, List) with the empty list of attributes and default credential requirements.
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • addEntity

        pl.edu.icm.unity.types.basic.Identity addEntity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd,
                                                        pl.edu.icm.unity.types.basic.EntityState initialState)
                                                 throws pl.edu.icm.unity.exceptions.EngineException
        As addEntity(IdentityParam, EntityState, List) with the empty list of attributes and default credential requirements.
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • addIdentity

        pl.edu.icm.unity.types.basic.Identity addIdentity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd,
                                                          pl.edu.icm.unity.types.basic.EntityParam parentEntity)
                                                   throws pl.edu.icm.unity.exceptions.EngineException
        Adds a new identity under existing entity.
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • removeIdentity

        void removeIdentity​(pl.edu.icm.unity.types.basic.IdentityTaV toRemove)
                     throws pl.edu.icm.unity.exceptions.EngineException
        Deletes identity. It must not be the last identity of the entity. Certain system Identities can not be removed.
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • setIdentities

        void setIdentities​(pl.edu.icm.unity.types.basic.EntityParam entity,
                           java.util.Collection<java.lang.String> updatedTypes,
                           java.util.Collection<? extends pl.edu.icm.unity.types.basic.IdentityParam> newIdentities)
                    throws pl.edu.icm.unity.exceptions.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 the resetIdentity(EntityParam, String, String, String) is available for them.
        Parameters:
        entity - all identities must belong to this entity
        updatedTypes - set of all types that shall be modified
        newIdentities - a new, complete set of identities for the given types
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • updateIdentity

        void updateIdentity​(pl.edu.icm.unity.types.basic.IdentityTaV original,
                            pl.edu.icm.unity.types.basic.IdentityParam updated)
                     throws pl.edu.icm.unity.exceptions.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:
        pl.edu.icm.unity.exceptions.EngineException
      • resetIdentity

        void resetIdentity​(pl.edu.icm.unity.types.basic.EntityParam entity,
                           java.lang.String typeIdToReset,
                           java.lang.String realm,
                           java.lang.String target)
                    throws pl.edu.icm.unity.exceptions.EngineException
        Reset a possibly targeted value of a dynamic identity. For the identities which are fixed this method throws an exception.

        Parameters:
        entity - subject
        typeIdToReset - which id type should be reset, must be dynamic
        realm - if null then all realms should be cleared
        target - if null then all targets should be cleared
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • removeEntity

        void removeEntity​(pl.edu.icm.unity.types.basic.EntityParam toRemove)
                   throws pl.edu.icm.unity.exceptions.EngineException
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • setEntityStatus

        void setEntityStatus​(pl.edu.icm.unity.types.basic.EntityParam toChange,
                             pl.edu.icm.unity.types.basic.EntityState state)
                      throws pl.edu.icm.unity.exceptions.EngineException
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • scheduleEntityChange

        void scheduleEntityChange​(pl.edu.icm.unity.types.basic.EntityParam toChange,
                                  java.util.Date changeTime,
                                  pl.edu.icm.unity.types.basic.EntityScheduledOperation operation)
                           throws pl.edu.icm.unity.exceptions.EngineException
        Schedules an operation to be invoked at a given time on an entity. Requires regular identityModify capability (not assigned for self access).
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • scheduleRemovalByUser

        void scheduleRemovalByUser​(pl.edu.icm.unity.types.basic.EntityParam toChange,
                                   java.util.Date changeTime)
                            throws pl.edu.icm.unity.exceptions.EngineException
        Sets the entity in the EntityState.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:
        pl.edu.icm.unity.exceptions.EngineException
      • getEntity

        pl.edu.icm.unity.types.basic.Entity getEntity​(pl.edu.icm.unity.types.basic.EntityParam entity)
                                               throws pl.edu.icm.unity.exceptions.EngineException
        Returns information about an entity along with its all identities with authorization in '/'.
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • getEntity

        pl.edu.icm.unity.types.basic.Entity getEntity​(pl.edu.icm.unity.types.basic.EntityParam entity,
                                                      java.lang.String target,
                                                      boolean allowCreate,
                                                      java.lang.String group)
                                               throws pl.edu.icm.unity.exceptions.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 resolve
        target - for whom the information is targeted
        allowCreate - whether dynamic identities can be created
        group - group wrt which authorization should be performed.
        Returns:
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • getEntityNoContext

        pl.edu.icm.unity.types.basic.Entity getEntityNoContext​(pl.edu.icm.unity.types.basic.EntityParam entity,
                                                               java.lang.String group)
                                                        throws pl.edu.icm.unity.exceptions.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:
        pl.edu.icm.unity.exceptions.EngineException
      • getGroups

        java.util.Map<java.lang.String,​pl.edu.icm.unity.types.basic.GroupMembership> getGroups​(pl.edu.icm.unity.types.basic.EntityParam entity)
                                                                                              throws pl.edu.icm.unity.exceptions.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:
        pl.edu.icm.unity.exceptions.EngineException
      • getGroupsForPresentation

        java.util.Collection<pl.edu.icm.unity.types.basic.Group> getGroupsForPresentation​(pl.edu.icm.unity.types.basic.EntityParam entity)
                                                                                   throws pl.edu.icm.unity.exceptions.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:
        pl.edu.icm.unity.exceptions.EngineException
      • mergeEntities

        void mergeEntities​(pl.edu.icm.unity.types.basic.EntityParam target,
                           pl.edu.icm.unity.types.basic.EntityParam merged,
                           boolean safeMode)
                    throws pl.edu.icm.unity.exceptions.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:
        1. static identities are added to the base entity
        2. dynamic identities are added to the base entity only if it has no identities of a particular identity type and the identity is removable
        3. credential requirement and attribute classes are ignored
        4. credentials are added, however only if the target identity has no credential defined of the same type
        5. group memberships are copied
        6. 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
        If the safe mode is activated then the operation will throw exception (without making any changes) if any of attributes, credentials or dynamic removable identity was not copied due to conflicts.
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • getEntityLabel

        java.lang.String getEntityLabel​(pl.edu.icm.unity.types.basic.EntityParam entity)
                                 throws pl.edu.icm.unity.exceptions.EngineException
        Returns:
        displayed name of the entity or null if undefined
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • addEntity

        @Deprecated
        default pl.edu.icm.unity.types.basic.Identity addEntity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd,
                                                                java.lang.String credReqIdId,
                                                                pl.edu.icm.unity.types.basic.EntityState initialState,
                                                                boolean extractAttributes,
                                                                java.util.List<pl.edu.icm.unity.types.basic.Attribute> attributes)
                                                         throws pl.edu.icm.unity.exceptions.EngineException
        Deprecated.
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • addEntity

        @Deprecated
        default pl.edu.icm.unity.types.basic.Identity addEntity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd,
                                                                pl.edu.icm.unity.types.basic.EntityState initialState,
                                                                boolean extractAttributes,
                                                                java.util.List<pl.edu.icm.unity.types.basic.Attribute> attributes)
                                                         throws pl.edu.icm.unity.exceptions.EngineException
        Deprecated.
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • addEntity

        @Deprecated
        default pl.edu.icm.unity.types.basic.Identity addEntity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd,
                                                                pl.edu.icm.unity.types.basic.EntityState initialState,
                                                                boolean extractAttributes)
                                                         throws pl.edu.icm.unity.exceptions.EngineException
        Deprecated.
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • addIdentity

        @Deprecated
        default pl.edu.icm.unity.types.basic.Identity addIdentity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd,
                                                                  pl.edu.icm.unity.types.basic.EntityParam parentEntity,
                                                                  boolean extractAttributes)
                                                           throws pl.edu.icm.unity.exceptions.EngineException
        Deprecated.
        Throws:
        pl.edu.icm.unity.exceptions.EngineException