001: /* Copyright 2001, 2002 The JA-SIG Collaborative. All rights reserved.
002: * See license distributed with this file and
003: * available online at http://www.uportal.org/license.html
004: */
005:
006: package org.jasig.portal.groups;
007:
008: import javax.naming.Name;
009:
010: /**
011: * An <code>IEntityGroup</code> is a composite, or non-leaf <code>IGroupMember</code>.
012: * It contains <code>IEntities</code> and other <code>IEntityGroups</code>.
013: * <p>
014: * The api defines methods for adding a member to, and removing it from, a group,
015: * though not vice versa. (Although there is nothing to prevent a given <code>IGroupMember</code>
016: * implementation from storing references to its containing groups.) These methods only
017: * change the group structure in memory.
018: * <p>
019: * <code>addMember(IGroupMember gm)</code><br>
020: * <code>removeMember(IGroupMember gm)</code><br>
021: * <p>
022: * The following methods commit changes in the group structure to the
023: * persistent store:
024: * <p>
025: * <code>delete()</code> - delete the group and its memberships<br>
026: * <code>update()</code> - insert or update the group, as appropriate<br>
027: * <code>updateMembers()</code> - insert/update/delete group memberships as appropriate<br>
028: * <p>
029: * The following methods were added to permit an <code>IEntityGroup</code> to function
030: * within a composite group service:
031: * <p>
032: * <code>getLocalKey()</code> - returns the key within the service of origin.<br>
033: * <code>getServiceName()</code> - returns the Name of the group service of origin.<br>
034: * <code>setLocalGroupService()</code> - sets the group service of origin.<br>
035: * <p>
036: *
037: * @author Dan Ellentuck
038: * @version $Revision: 34758 $
039: */
040: public interface IEntityGroup extends IGroupMember {
041: /**
042: * Adds <code>IGroupMember</code> gm to this group, but does not commit it to the
043: * data store. Use <code>updateMembers()</code> to commit memberships to the data store.
044: * @param gm org.jasig.portal.groups.IGroupMember
045: * @exception GroupsException is thrown if the member is a group and
046: * this group already has a group with the same name or if the addition
047: * of the group creates a circular reference.
048: */
049: public void addMember(IGroupMember gm) throws GroupsException;
050:
051: /**
052: * Deletes the <code>IEntityGroup</code> from the data store.
053: * @exception GroupsException if the delete cannot be performed.
054: */
055: public void delete() throws GroupsException;
056:
057: /**
058: * Returns the name of the group creator. May be null.
059: * @return String
060: */
061: public String getCreatorID();
062:
063: /**
064: * Returns the group description, which may be null.
065: * @return String
066: */
067: public String getDescription();
068:
069: /**
070: * Returns the key from the group service of origin.
071: * @return String
072: */
073: public String getLocalKey();
074:
075: /**
076: * Returns the group name.
077: * @return String
078: */
079: public String getName();
080:
081: /**
082: * Returns the Name of the group service of origin.
083: * @return String
084: */
085: public Name getServiceName();
086:
087: /**
088: * Answers if this <code>IEntityGroup</code> can be changed or deleted.
089: * @return boolean
090: * @exception GroupsException
091: */
092: public boolean isEditable() throws GroupsException;
093:
094: /**
095: * Removes the <code>IGroupMember</code> from this group, but does not remove the
096: * membership from the data store.
097: * @param gm org.jasig.portal.groups.IGroupMember
098: */
099: public void removeMember(IGroupMember gm) throws GroupsException;
100:
101: /**
102: * @param userID String (required)
103: */
104: public void setCreatorID(String userID);
105:
106: /**
107: * @param name String (may be null)
108: */
109: public void setDescription(String name);
110:
111: /**
112: * Sets the group name which must be unique within any of its containing
113: * groups.
114: * @param name String
115: * @exception GroupsException
116: */
117: public void setName(String name) throws GroupsException;
118:
119: /**
120: * Commit the <code>IEntityGroup</code> AND ITS MEMBERSHIPS to the data store.
121: * @exception GroupsException if the update cannot be performed.
122: */
123: public void update() throws GroupsException;
124:
125: /**
126: * Commit this <code>IEntityGroup's</code> memberships to the data store.
127: * @exception GroupsException if the update cannot be performed.
128: */
129: public void updateMembers() throws GroupsException;
130:
131: /**
132: * Sets the group service of origin.
133: */
134: public void setLocalGroupService(
135: IIndividualGroupService groupService)
136: throws GroupsException;
137: }
|