|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--us.openinternet.luge.service.LugeFacade | +--us.openinternet.luge.service.GroupFacade
GroupFacade is used to search, add, delete and modify Groups.
Field Summary |
Fields inherited from class us.openinternet.luge.service.LugeFacade |
grpTransformer, lugeTransformer, personTransformer |
Constructor Summary | |
GroupFacade(LugeFacade lf)
|
|
GroupFacade(LugeTransformer lt)
|
|
GroupFacade(java.lang.String cn,
java.lang.String key)
Use this constructor to establish your connection to the ldap server. |
Method Summary | |
boolean |
addAttributeToGroup(java.lang.String grpCN,
java.lang.String attr,
java.util.ArrayList values)
This method will add an attribute with mutliple values to the group. |
boolean |
addAttributeToGroup(java.lang.String grpCN,
java.lang.String attr,
java.lang.String value)
This method will add an attribute with single value to the group. |
boolean |
addGroup(GroupVO gvo)
This method adds a GroupOfNames object with the attributes supplied in the GroupVO object. |
boolean |
addGroup(java.lang.String grpCN)
This method adds a GroupOfNames object . |
boolean |
addMemberAndAttribute(java.lang.String grpCN,
java.lang.String uid,
java.lang.String attrName,
java.lang.String attrValue)
This method is a shortcut if you want to add a Person to a Group and set a related attribute in the Person object. |
GroupVO |
addMembersAndAttributesBulk(java.lang.String grpCN,
java.util.ArrayList uids,
java.lang.String attrName,
java.lang.String attrValue)
This method adds an ArrayList of People to the Group, and sets the given attribute name for each user. |
GroupVO |
addPeopleToGroup(java.util.ArrayList uids,
java.lang.String grpCN)
This method is the same as addMemberToGroup method except it adds multiple persons. |
boolean |
addPersonToGroup(java.lang.String uid,
java.lang.String grpCN)
Same as addMemberToGroup, added for semantic consistency. |
boolean |
deleteAttributeFromGroup(java.lang.String grpCN,
java.lang.String attr)
This method allows all values of an attribute to be deleted. |
boolean |
deleteAttributeValueFromGroup(java.lang.String grpCN,
java.lang.String attr,
java.lang.String val)
This method allows a particular value to be deleted from an attribute. |
boolean |
deleteGroup(java.lang.String grpCN)
This method deletes a group object. |
protected void |
finalize()
|
java.util.ArrayList |
getAllGroupNames()
This method returns the names of the groups your application has permission to see. |
java.util.ArrayList |
getGroupAttributeMultiValue(java.lang.String grpCn,
java.lang.String attr)
This method is intended to be used as a quick method for retrieving a multi-valued attribute. |
java.lang.String |
getGroupAttributeSingleValue(java.lang.String grpCn,
java.lang.String attr)
This method is provided as a convenience. |
java.util.ArrayList |
getMembers(java.lang.String grpCN)
This method returns an ArrayList all the members(uids) for the specified group. |
java.util.ArrayList |
getMemberships(java.lang.String uid)
This method returns an ArrayList of the names of the groups a user belongs to that your application has permission to see. |
boolean |
groupExists(java.lang.String grpCN)
This method verifies that a group exists in the directory. |
GroupVO |
groupLookup(java.lang.String groupCN)
Returns a Hashtable of actual ldap attribute names as the keys and String[] as the values. |
java.util.Hashtable |
groupLookup(java.lang.String grpCn,
java.lang.String[] attrs)
This method returns specific attributes of a group in a Hashtable with the actual ldap attribute names as keys and the values returned as String arrays to accomodate multi-valued attributes. |
boolean |
isMember(java.lang.String uid,
java.lang.String grpCN)
This method verifies if the user is a member of the specified group. |
boolean |
modifyGroup(java.lang.String grpCN,
GroupVO gvo,
boolean AppendAttributes)
This method allows bulk attribute modifications. |
boolean |
removeMemberAndAttribute(java.lang.String grpCN,
java.lang.String uid,
java.lang.String attrName,
java.lang.String attrValue)
This method is a shortcut if you want to remove a Person from a Group and delete a related attribute in the Person object. |
GroupVO |
removeMembersAndAttributesBulk(java.lang.String grpCN,
java.util.ArrayList uids,
java.lang.String attrName,
java.lang.String attrValue)
This method removes an ArrayList of People from a Group, and removes the given attribute for each user. |
GroupVO |
removePeopleFromGroup(java.util.ArrayList uids,
java.lang.String grpCN)
This method is the same as removePersonFromGroup method except it removes multiple Persons . |
boolean |
removePersonFromGroup(java.lang.String uid,
java.lang.String grpCN)
This method removes the specified Person from the specified Group. |
boolean |
renameGroup(java.lang.String oldName,
java.lang.String newName)
This method changes the Group Name. |
boolean |
replaceAttributeForGroup(java.lang.String grpCN,
java.lang.String attr,
java.util.ArrayList values)
This method is the same as replaceAttributeForGroup except it accepts an ArrayList of values to accomodate multi-valued attributes.If you call this method on attr "cn", this method calls renameGroup --but make sure your ArrayList only has
one value or LugeException will be thrown. |
boolean |
replaceAttributeForGroup(java.lang.String grpCN,
java.lang.String attr,
java.lang.String value)
This method replaces an attribute. |
boolean |
replaceAttributeForGroup(java.lang.String grpCN,
java.lang.String attr,
java.lang.String oldValue,
java.lang.String newValue)
This method allows a single value of a multi-vauled attribute to be replaced. |
SearchVO |
searchGroups(SearchVO svo)
The preferred method to search the directory, see SearchVO documentation for setting serach criteria and extracting the results. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GroupFacade(java.lang.String cn, java.lang.String key) throws LugeException
cn
- - This is an id assigned to your applicationkey
- - Each id is also assigned a key for authentication purposes.
The key is not the LDAP server password.
LugeException
public GroupFacade(LugeTransformer lt) throws LugeException
public GroupFacade(LugeFacade lf) throws LugeException
Method Detail |
public boolean addGroup(java.lang.String grpCN) throws LugeException
grpCN
- The unique name of the group.
LugeException
public boolean addGroup(GroupVO gvo) throws LugeException
GroupVO gvo = new GroupVO();
gvo.setGroupName("myGroup");
gvo.setDescription("This is the Group of people authorized to access my application.");
ArrayList categories = new ArrayList();
categories.add("Marketing");
categories.add("Sales");
categories.add("Finance");
gvo.setAttributeValues("businessCategory", categories);
gvo.addValueToAttribute("businessCategory", "One_More_Category");
try{
GroupFacade gf = new AdminFacade("myApp", "myKey");
gf.addGroup(gvo);
} catch (LugeException lugeEx) {
lugeEx.printStackTrace();
}
LugeException
public boolean deleteGroup(java.lang.String grpCN) throws LugeException
grpCN
- - the unique name of the group.
LugeException
public boolean addPersonToGroup(java.lang.String uid, java.lang.String grpCN) throws LugeException
uid
- The userID of the person to be added.grpCN
- The name of the group.
LugeException
public GroupVO addPeopleToGroup(java.util.ArrayList uids, java.lang.String grpCN) throws LugeException
uids
- ArrayList of userIDs of persons to be added.grpCN
- The name of the group.
LugeException
public boolean removePersonFromGroup(java.lang.String uid, java.lang.String grpCN) throws LugeException
uid
- The userID of the person to be removed.grpCN
- The name of the group.
LugeException
public GroupVO removePeopleFromGroup(java.util.ArrayList uids, java.lang.String grpCN) throws LugeException
uids
- ArrayList of userIDs of persons to be removed.grpCN
- The name of the group.
LugeException
public boolean renameGroup(java.lang.String oldName, java.lang.String newName) throws LugeException
LugeException
public boolean addAttributeToGroup(java.lang.String grpCN, java.lang.String attr, java.lang.String value) throws LugeException
grpCN
- The name of the group.attr
- The valid LDAP attribute name.value
- The value to be added to the attribute.
LugeException
public boolean addAttributeToGroup(java.lang.String grpCN, java.lang.String attr, java.util.ArrayList values) throws LugeException
grpCN
- The name of the group.attr
- The valid LDAP attribute name.values
- An ArrayList of values to be added to the attribute.
LugeException
public boolean replaceAttributeForGroup(java.lang.String grpCN, java.lang.String attr, java.lang.String value) throws LugeException
grpCN
- The ldap cn of the groupattr
- The valid LDAP attribute name.value
- The value of the attribute.
LugeException
public boolean replaceAttributeForGroup(java.lang.String grpCN, java.lang.String attr, java.util.ArrayList values) throws LugeException
renameGroup
--but make sure your ArrayList only has
one value or LugeException will be thrown.
grpCN
- The ldap cn of the groupattr
- The valid LDAP attribute name.values
- An ArrayList of values of the attribute.
LugeException
public boolean replaceAttributeForGroup(java.lang.String grpCN, java.lang.String attr, java.lang.String oldValue, java.lang.String newValue) throws LugeException
renameGroup
.
grpCN
- The ldap cn of the groupattr
- The valid LDAP attribute name.oldValue
- The current value of the attribute.newValue
- The new value of the attribute.
LugeException
public boolean deleteAttributeFromGroup(java.lang.String grpCN, java.lang.String attr) throws LugeException
grpCN
- The ldap cn of the groupattr
- The valid LDAP attribute name.
LugeException
public boolean deleteAttributeValueFromGroup(java.lang.String grpCN, java.lang.String attr, java.lang.String val) throws LugeException
grpCN
- The ldap cn of the groupattr
- The valid LDAP attribute name.val
- The value of the attribute to be deleted.
LugeException
public boolean modifyGroup(java.lang.String grpCN, GroupVO gvo, boolean AppendAttributes) throws LugeException
AppendAttributes
boolean parameter to true and any atribute
value is already present, a LugeException will be thrown. Best to use false (and replace), or go through
and do the modifications one attribute at a time. If you post the "cn" attribute or post the group with a name,
renameGroup
will be called. Make sure cn is not multivalued because a Group can only have
one name.
grpCN
- The ldap cn of the group
LugeException
public boolean addMemberAndAttribute(java.lang.String grpCN, java.lang.String uid, java.lang.String attrName, java.lang.String attrValue) throws LugeException
grpCN
- - the actual ldap Group nameuid
- - the Person's nameattrName
- - the actual ldap attribute name
LugeException
public boolean removeMemberAndAttribute(java.lang.String grpCN, java.lang.String uid, java.lang.String attrName, java.lang.String attrValue) throws LugeException
grpCN
- - the actual ldap Group nameuid
- - the Person's nameattrName
- - the actual ldap attribute name
LugeException
public GroupVO addMembersAndAttributesBulk(java.lang.String grpCN, java.util.ArrayList uids, java.lang.String attrName, java.lang.String attrValue) throws LugeException
Check the myGroupVO.getOkPeople() for an ArrayList of users successfully added.
If the user is redundant (already a member of this Group) or if the user is nonexistant, this will also be recorded in the GroupVO as with any other Group. In the case of redundant people, this method will still try to add the attribute to the Person. If an error is thrown during the attribute update phase, the username will be recorded in the GroupVO problem_members. If the Person's attribute is updated succesfully, the uid will be listed in myGroupVO.getUpdatedPeople().
grpCN
- - the name of the Groupuids
- - an ArrayList of uids that correspond to the people to be added to the Group.attrName
- - the actual ldap attribute name to update for each Person entryattrValue
- - the value to be set for each Person
LugeException
public GroupVO removeMembersAndAttributesBulk(java.lang.String grpCN, java.util.ArrayList uids, java.lang.String attrName, java.lang.String attrValue) throws LugeException
Check the myGroupVO.getOkPeople() for an ArrayList of users successfully deleted from the Group.
If the user is a non-member (already not a member of this Group) or if the user is nonexistant, this will also be recorded in the GroupVO as with any other Group. In the case of non-members, this method will still try to remove the attribute from the Person entry. If an error is thrown during the attribute update phase, the uid will be recorded in the GroupVO problem_members. If the Person's attribute is removed succesfully, the uid will be listed in myGroupVO.getUpdatedPeople().
grpCN
- - the name of the Groupuids
- - an ArrayList of uids that correspond to the people to be removed from the Group.attrName
- - the actual ldap attribute name to update for each Person entryattrValue
- - the value to be removed for each Person
LugeException
public boolean groupExists(java.lang.String grpCN)
grpCN
- - The groupName
public java.util.ArrayList getMemberships(java.lang.String uid) throws LugeException
LugeException
public boolean isMember(java.lang.String uid, java.lang.String grpCN) throws LugeException
uid
- - The userName of the persongrpCN
- - The name of the group
LugeException
public SearchVO searchGroups(SearchVO svo) throws LugeException
LugeException
public java.util.ArrayList getMembers(java.lang.String grpCN) throws LugeException
LugeException
public java.util.ArrayList getAllGroupNames() throws LugeException
LugeException
public GroupVO groupLookup(java.lang.String groupCN) throws LugeException
groupCN
- - The ldap name (cn) of the group
LugeException
public java.util.Hashtable groupLookup(java.lang.String grpCn, java.lang.String[] attrs) throws LugeException
grpCn
- - The ldap name of the Group
LugeException
public java.lang.String getGroupAttributeSingleValue(java.lang.String grpCn, java.lang.String attr) throws LugeException
groupLookup(String grpCn, String[] attrs)
method.
method instead. If the value is not String, or if there is no value for this
attribute, this method returns an empty String.
grpCn
- - The ldap name of the group
LugeException
public java.util.ArrayList getGroupAttributeMultiValue(java.lang.String grpCn, java.lang.String attr) throws LugeException
grpCn
- - The ldap name of the group
LugeException
protected void finalize() throws java.lang.Throwable
finalize
in class LugeFacade
java.lang.Throwable
|
Copyright 2003, Michael Schwartz All Rights Reserved. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |