JBoss Community Archive (Read Only)

PicketLink

PicketLink IDM - Group Management

This page will describe the API for managing groups.

Group Management (CRUD Operations)

Create Groups

//Create a Group instance as object
Group newGroupInstance = new SimpleGroup("someGroup");

// Create the new group in the store
identityManager.add(newGroupInstance);

// let's retrieve the group information and see if they are properly stored
Group storedGroupInstance = identityManager.getGroup(newGroupInstance.getName());
assertNotNull(storedGroupInstance);
assertEquals(newGroupInstance.getKey(), storedGroupInstance.getKey());
assertEquals(newGroupInstance.getName(), storedGroupInstance.getName());

Read Groups

Group storedGroupInstance = identityManager.getGroup("Test Group");
assertNotNull(storedGroupInstance);

assertEquals("GROUP:///Test Parent Group/Test Group", storedGroupInstance.getKey());

assertEquals("Test Group", storedGroupInstance.getName());

Update Groups

If we have a Group instance called "groupinstance" and we want to update what is stored in the IdentityStore, we can use the updateGroup method on the IdentityManager.

identityManager.update(groupInstance);

Remove Groups

Group storedGroupInstance =identityManager.getGroup("Test Group");
assertNotNull(storedGroupInstance);

//Delete the group from the store
identityManager.remove(storedGroupInstance);

Group removedGroupInstance = identityManager.getGroup("Test Group");
assertNull(removedGroupInstance);
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 12:19:14 UTC, last content change 2012-12-14 22:21:42 UTC.