|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ow2.bonita.identity.impl.InMemoryIdentityService
public class InMemoryIdentityService
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,GroupOp> |
groupOps
|
protected int |
next
|
static java.lang.String |
ROOT_ID
|
protected java.util.Map<java.lang.String,UserOp> |
users
|
Constructor Summary | |
---|---|
InMemoryIdentityService()
|
Method Summary | |
---|---|
java.lang.String |
authenticateUser(java.lang.String cname,
java.lang.String password)
|
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. |
protected GroupImpl |
freshGroup()
|
protected UserImpl |
freshUser()
|
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 |
protected void |
init()
|
boolean |
modifyGroup(GroupOp group)
Modify the given group. |
boolean |
modifyUser(UserOp user)
Modify the given user. |
protected void |
setMembership(MembershipImpl membership)
|
Membership |
setMembership(UserOp user,
GroupOp group)
Make the given user a member of the given group. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ROOT_ID
protected int next
protected java.util.Map<java.lang.String,UserOp> users
protected java.util.Map<java.lang.String,GroupOp> groupOps
Constructor Detail |
---|
public InMemoryIdentityService()
Method Detail |
---|
protected void init()
protected GroupImpl freshGroup()
public java.lang.String createGroup(GroupOp parent)
IdentityServiceOp
g
, will be a child of the given
group. Formally, this means that the following expression: g.getParent().getChildren().contains(g)
will return
true
.
createGroup
in interface IdentityServiceOp
public java.lang.String createGroup()
IdentityServiceOp
g
, will be a child of its root
group. Formally, this means that the following expression: g.getRoot().getChildren().contains(g)
will return
true
.
createGroup
in interface IdentityServiceOp
public void deleteGroup(java.lang.String id) throws GroupNotFoundException
IdentityServiceOp
deleteGroup
in interface IdentityServiceOp
id
- the group id
GroupNotFoundException
- if no group is currently mapped to the given id in this
IdentityServiceOp
protected UserImpl freshUser()
public java.lang.String createUser()
IdentityServiceOp
createUser
in interface IdentityServiceOp
public void deleteUser(java.lang.String id) throws UserNotFoundException
IdentityServiceOp
deleteUser
in interface IdentityServiceOp
id
- the user id
UserNotFoundException
- if no user is currently mapped to the given id in this
IdentityServiceOp
public boolean modifyGroup(GroupOp group) throws GroupNotFoundException
IdentityServiceOp
modifyGroup
in interface IdentityServiceOp
group
- the modified group
GroupNotFoundException
- if the given group is not currently mapped in this
IdentityServiceOp
public boolean modifyUser(UserOp user) throws UserNotFoundException
IdentityServiceOp
modifyUser
in interface IdentityServiceOp
user
- the modified user
UserNotFoundException
- if the given user is not currently mapped in this
IdentityServiceOp
public java.util.Collection<GroupOp> getAllGroups()
IdentityServiceOp
getAllGroups
in interface IdentityServiceOp
public java.util.Collection<UserOp> getAllUsers()
IdentityServiceOp
getAllUsers
in interface IdentityServiceOp
public GroupOp getGroup(java.lang.String id) throws GroupNotFoundException
IdentityServiceOp
getGroup
in interface IdentityServiceOp
GroupNotFoundException
- if no group is currently mapped to the given id in this
IdentityServiceOp
public UserOp getUser(java.lang.String id) throws UserNotFoundException
IdentityServiceOp
getUser
in interface IdentityServiceOp
UserNotFoundException
- if no user is currently mapped to the given id in this
IdentityServiceOp
public Membership setMembership(UserOp user, GroupOp group) throws UserNotFoundException, GroupNotFoundException
IdentityServiceOp
setMembership
in interface IdentityServiceOp
UserNotFoundException
- if the given user is not currently mapped in this
IdentityServiceOp
GroupNotFoundException
- if the given group is not currently mapped in this
IdentityServiceOp
Membership
protected void setMembership(MembershipImpl membership)
public void commit() throws CommitException
IdentityServiceOp
commit
in interface IdentityServiceOp
CommitException
public java.lang.String authenticateUser(java.lang.String cname, java.lang.String password)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |