View Javadoc

1   package com.atlassian.user;
2   
3   import com.atlassian.user.repository.RepositoryIdentifier;
4   
5   public interface EntityManager
6   {
7       /**
8        * @return the {@link RepositoryIdentifier} for the repository which is managed by this instance.
9        */
10      RepositoryIdentifier getIdentifier();
11  
12      /**
13       * @return the {@link RepositoryIdentifier} of the repository in which the entity is stored, or <tt>null</tt>
14       * if the entity cannot be found.
15       * @throws EntityException if the entity cannot be found, or trying to retrieve it results in an error
16       */
17      RepositoryIdentifier getRepository(Entity entity) throws EntityException;
18  
19      /**
20       * Used to detemine whether an entity can be created (eg, can call {@link UserManager#createUser(String)} or
21       * {@link GroupManager#createGroup(String)}.
22       *
23       * @return true to indicate that {@link Entity} objects can be created by this manager, or false to indicate
24       * not. 
25       */
26      boolean isCreative();
27  }