org.ow2.bonita.identity
Interface IdentityServiceOp

All Known Implementing Classes:
InMemoryIdentityService, PersistentIdentityService, PlainIdentityService, SerializedIdentityService, XMLIdentityService

public interface IdentityServiceOp

This is the main interface for UserOp, GroupOp and Membership management.

Author:
"Pierre Vigneras"

Method Summary
 void commit()
          Commit all modifications to the backing store.
 java.lang.String createGroup()
          Create a GroupOp in the identity service backing store and returns the generated id.
 java.lang.String createGroup(GroupOp parent)
          Create a GroupOp in the identity service backing store and returns the generated id.
 java.lang.String createUser()
          Create a UserOp in the identity service backing store and returns the generated id.
 void deleteGroup(java.lang.String id)
          Delete the group mapped to the given id from this service.
 void deleteUser(java.lang.String id)
          Delete the user mapped to the given id from this service.
 java.util.Collection<GroupOp> getAllGroups()
          Returns a copy of all groupOps present in the backing store Modifications made on the returned collection or on any of its contained GroupOp instances are not propagated to the backing store
 java.util.Collection<UserOp> getAllUsers()
          Returns a copy of all users present in the backing store Modifications made on the returned collection or on any of its contained UserOp instances are not propagated to the backing store
 GroupOp getGroup(java.lang.String id)
          Returns a copy of the group mapped to the given id Modifications made on the return GroupOp instance are not propagated to the backing store
 UserOp getUser(java.lang.String id)
          Returns a copy of the user mapped to the given id Modifications made on the return UserOp instance are not propagated to the backing store
 boolean modifyGroup(GroupOp groupOp)
          Modify the given group.
 boolean modifyUser(UserOp userOp)
          Modify the given user.
 Membership setMembership(UserOp user, GroupOp group)
          Make the given user a member of the given group.
 

Method Detail

createUser

java.lang.String createUser()
Create a UserOp in the identity service backing store and returns the generated id.

Returns:
the generated id

deleteUser

void deleteUser(java.lang.String id)
                throws UserNotFoundException
Delete the user mapped to the given id from this service.

Parameters:
id - the user id
Throws:
UserNotFoundException - if no user is currently mapped to the given id in this IdentityServiceOp

modifyUser

boolean modifyUser(UserOp userOp)
                   throws UserNotFoundException
Modify the given user.

Parameters:
userOp - the modified user
Returns:
true if the given user has been successfully updated, false otherwise
Throws:
UserNotFoundException - if the given user is not currently mapped in this IdentityServiceOp

createGroup

java.lang.String createGroup()
Create a GroupOp in the identity service backing store and returns the generated id. The returned group, call it g, will be a child of its root group. Formally, this means that the following expression:
g.getRoot().getChildren().contains(g) will return true.

Returns:
the generated id

createGroup

java.lang.String createGroup(GroupOp parent)
Create a GroupOp in the identity service backing store and returns the generated id. The returned group, call it g, will be a child of the given group. Formally, this means that the following expression:
g.getParent().getChildren().contains(g) will return true.

Returns:
the generated id

deleteGroup

void deleteGroup(java.lang.String id)
                 throws GroupNotFoundException
Delete the group mapped to the given id from this service.

Parameters:
id - the group id
Throws:
GroupNotFoundException - if no group is currently mapped to the given id in this IdentityServiceOp

modifyGroup

boolean modifyGroup(GroupOp groupOp)
                    throws GroupNotFoundException
Modify the given group.

Parameters:
groupOp - the modified group
Returns:
true if the given group has been successfully updated, false otherwise
Throws:
GroupNotFoundException - if the given group is not currently mapped in this IdentityServiceOp

getUser

UserOp getUser(java.lang.String id)
               throws UserNotFoundException
Returns a copy of the user mapped to the given id Modifications made on the return UserOp instance are not propagated to the backing store

Parameters:
id -
Returns:
a copy of the user mapped to the given id, null if no user is currently mapped to the given id.
Throws:
UserNotFoundException - if no user is currently mapped to the given id in this IdentityServiceOp

getGroup

GroupOp getGroup(java.lang.String id)
                 throws GroupNotFoundException
Returns a copy of the group mapped to the given id Modifications made on the return GroupOp instance are not propagated to the backing store

Parameters:
id -
Returns:
a copy of the group mapped to the given id
Throws:
UserNotFoundException - if no group is currently mapped to the given id in this IdentityServiceOp
GroupNotFoundException - if no group is currently mapped to the given id in this IdentityServiceOp

setMembership

Membership setMembership(UserOp user,
                         GroupOp group)
                         throws UserNotFoundException,
                                GroupNotFoundException
Make the given user a member of the given group.

Parameters:
userOp - the user
groupOp - the group
Returns:
the new membership
Throws:
UserNotFoundException - if the given user is not currently mapped in this IdentityServiceOp
GroupNotFoundException - if the given group is not currently mapped in this IdentityServiceOp
See Also:
Membership

getAllUsers

java.util.Collection<UserOp> getAllUsers()
Returns a copy of all users present in the backing store Modifications made on the returned collection or on any of its contained UserOp instances are not propagated to the backing store

Returns:
a copy of all users present in the backing store

getAllGroups

java.util.Collection<GroupOp> getAllGroups()
Returns a copy of all groupOps present in the backing store Modifications made on the returned collection or on any of its contained GroupOp instances are not propagated to the backing store

Returns:
a copy of all groupOps present in the backing store

commit

void commit()
            throws CommitException
Commit all modifications to the backing store.

Throws:
CommitException


Copyright © 2009 OW2 Consortium. All Rights Reserved.