001: /* Copyright 2001 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.security;
007:
008: import java.io.Serializable;
009: import java.util.Enumeration;
010: import java.util.Map;
011:
012: import org.jasig.portal.EntityIdentifier;
013: import org.jasig.portal.IBasicEntity;
014:
015: /**
016: * @author Bernie Durfee, bdurfee@interactivebusiness.com
017: * @version $Revision: 36782 $
018: */
019: public interface IPerson extends IAdditionalDescriptor, IBasicEntity,
020: Serializable {
021:
022: /**
023: * String used as a key for the eduPerson username attribute.
024: */
025: public static final String USERNAME = "username";
026:
027: /**
028: * The default ID for person objects.
029: */
030: public static final int UNDEFINED_ID = -1;
031:
032: /**
033: * The user id for guest users.
034: */
035: public static final int GUEST_ID = 1;
036:
037: /**
038: * The user id for the special system user.
039: */
040: public static final int SYSTEM_USER_ID = 0;
041:
042: /**
043: * Sets the ID of the user
044: * @param sID
045: */
046: public void setID(int sID);
047:
048: /**
049: * Gets the ID of the user
050: * @return ID of the user
051: */
052: public int getID();
053:
054: /**
055: * Sets the full name of the user
056: * @param sFullName
057: */
058: public void setFullName(String sFullName);
059:
060: /**
061: * Gets the full name of the user
062: * @return full name of the user
063: */
064: public String getFullName();
065:
066: /**
067: * Gets an attribute associated with the user
068: * @param key
069: * @return attribute associated with the user
070: */
071: public Object getAttribute(String key);
072:
073: /**
074: * Gets multiple values of an attribute associated with the user
075: * @param key
076: * @return attributes associated with the user
077: */
078: public Object[] getAttributeValues(String key);
079:
080: /**
081: * Associates an attribute with the user
082: * @param key
083: * @param value
084: */
085: public void setAttribute(String key, Object value);
086:
087: /**
088: * Associates attributes with the user
089: * @param attrs
090: */
091: public void setAttributes(Map attrs);
092:
093: /**
094: * Gets all of the attributes associated with the user
095: * @return all of the attributes associated with the user
096: */
097: public Enumeration getAttributes();
098:
099: /**
100: * Returns the names of all of the attributes stored for the user
101: * @return names of all of the attributes stored for the user
102: */
103: public Enumeration getAttributeNames();
104:
105: /**
106: * Associates a security context object with the user
107: * @param securityContext
108: */
109: public void setSecurityContext(ISecurityContext securityContext);
110:
111: /**
112: * Gets the security context object associated with the user
113: * @return security context object associated with the user
114: */
115: public ISecurityContext getSecurityContext();
116:
117: /**
118: * Checks to see if this user is considered a guest
119: * @return true if user is considered a guest
120: */
121: public boolean isGuest();
122:
123: /**
124: * Explicitly set the entity identifier
125: * The default implementation enforces a one time setting
126: * so that the value can't be changed once explicitly set.
127: * @param ei
128: */
129: public void setEntityIdentifier(EntityIdentifier ei);
130: }
|