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 java.util.Iterator;
009:
010: import org.jasig.portal.EntityIdentifier;
011:
012: /**
013: * Interface for finding and maintaining <code>IEntityGroups</code>.
014: * @author Dan Ellentuck
015: * @version 1.0, 11/29/01
016: */
017: public interface IEntityGroupStore extends IGroupConstants {
018: /**
019: * Answers if <code>group</code> contains <code>member</code>.
020: * @return boolean
021: * @param group org.jasig.portal.groups.IEntityGroup
022: * @param member org.jasig.portal.groups.IGroupMember
023: */
024: public boolean contains(IEntityGroup group, IGroupMember member)
025: throws GroupsException;
026:
027: /**
028: * Delete this <code>IEntityGroup</code> from the data store.
029: * @param group org.jasig.portal.groups.IEntityGroup
030: */
031: public void delete(IEntityGroup group) throws GroupsException;
032:
033: /**
034: * Returns an instance of the <code>IEntityGroup</code> from the data store.
035: * @return org.jasig.portal.groups.IEntityGroup
036: * @param key java.lang.String
037: */
038: public IEntityGroup find(String key) throws GroupsException;
039:
040: /**
041: * Returns an <code>Iterator</code> over the <code>Collection</code> of
042: * <code>IEntityGroups</code> that the <code>IGroupMember</code> belongs to.
043: * @return java.util.Iterator
044: * @param gm org.jasig.portal.groups.IEntityGroup
045: */
046: public Iterator findContainingGroups(IGroupMember gm)
047: throws GroupsException;
048:
049: /**
050: * Returns an <code>Iterator</code> over the <code>Collection</code> of
051: * <code>IEntities</code> that are members of this <code>IEntityGroup</code>.
052: * @return java.util.Iterator
053: * @param group org.jasig.portal.groups.IEntityGroup
054: */
055: public Iterator findEntitiesForGroup(IEntityGroup group)
056: throws GroupsException;
057:
058: /**
059: * Returns an instance of the <code>ILockableEntityGroup</code> from the data store.
060: * @return org.jasig.portal.groups.IEntityGroup
061: * @param key java.lang.String
062: */
063: public ILockableEntityGroup findLockable(String key)
064: throws GroupsException;
065:
066: /**
067: * Returns a <code>String[]</code> containing the keys of <code>IEntityGroups</code>
068: * that are members of this <code>IEntityGroup</code>. In a composite group
069: * system, a group may contain a member group from a different service. This is
070: * called a foreign membership, and is only possible in an internally-managed
071: * service. A group store in such a service can return the key of a foreign member
072: * group, but not the group itself, which can only be returned by its local store.
073: *
074: * @return String[]
075: * @param group org.jasig.portal.groups.IEntityGroup
076: */
077: public String[] findMemberGroupKeys(IEntityGroup group)
078: throws GroupsException;
079:
080: /**
081: * Returns an <code>Iterator</code> over the <code>Collection</code> of
082: * <code>IEntityGroups</code> that are members of this <code>IEntityGroup</code>.
083: * @return java.util.Iterator
084: * @param group org.jasig.portal.groups.IEntityGroup
085: */
086: public Iterator findMemberGroups(IEntityGroup group)
087: throws GroupsException;
088:
089: /**
090: * @return org.jasig.portal.groups.IEntityGroup
091: */
092: public IEntityGroup newInstance(Class entityType)
093: throws GroupsException;
094:
095: /**
096: * Find EntityIdentifiers for groups whose name matches the query string
097: * according to the specified method and matches the provided leaf type
098: */
099: public EntityIdentifier[] searchForGroups(String query, int method,
100: Class leaftype) throws GroupsException;
101:
102: /**
103: * Adds or updates the <code>IEntityGroup</code> AND ITS MEMBERSHIPS to the
104: * data store, as appropriate.
105: * @param group org.jasig.portal.groups.IEntityGroup
106: */
107: public void update(IEntityGroup group) throws GroupsException;
108:
109: /**
110: * Commits the group memberships of the <code>IEntityGroup</code> to
111: * the data store.
112: * @param group org.jasig.portal.groups.IEntityGroup
113: */
114: public void updateMembers(IEntityGroup group)
115: throws GroupsException;
116: }
|