edu.mit.stellar.directory
Interface Person
- public interface Person
A class implementing the Person interface allows directory
information about a person to be accessed. Properties should come from
directory specifications. Suggested properties include:
- username
- commonName
- surname
- nameSortingField
- emailAddress
- nickname
- givenName
- initials
- Author:
- ccount
|
Method Summary |
java.util.Locale[] |
getAvailableLocales()
Returns an array of Locales that may be used to localize parameters. |
java.lang.String |
getCommonName()
Returns the common name (as in LDAP or X.500) of the Person. |
java.lang.String |
getEmail()
Deprecated. Use getEmailAddress(). |
java.lang.String |
getEmailAddress()
Returns the email address for the Person. |
java.lang.String |
getFamilyName()
Deprecated. Use getNameSortingField() or getSurname(). |
java.lang.String |
getFullName()
Deprecated. Use getCommonName(). |
java.util.Locale |
getLocale()
Returns the currently set Locale. |
java.lang.String |
getNameSortingField()
Returns the part of the Person's name which should be used in sorting
the name in a list. |
java.lang.String |
getNickname()
Returns the nickname (informal name) of the Person. |
java.lang.String |
getProperty(java.lang.String name)
Returns the value of a Person's information property as a String in the
current Locale, or null if the property does not exist. |
java.util.Map |
getPropertyMap()
Returns a java.util.Map of the properties for this Person in the
current Locale. |
java.util.Enumeration |
getPropertyNames()
Returns an Enumeration of String objects containing the names of the
properties for this Person. |
java.lang.String[] |
getPropertyValues(java.lang.String name)
Returns an array of String objects containing all of the values the
given Person's property has in the current Locale, or null if the
property does not exist. |
java.lang.String |
getSurname()
Returns the surname of the Person (as in rfc2258 or X.500), also known
as the family or last name in western) name. |
java.lang.String |
getUsername()
Returns the institution-defined username of the Person. |
void |
setLocale(java.util.Locale locale)
Sets the current Locale to be used in parameter returns for this
Person. |
getAvailableLocales
public java.util.Locale[] getAvailableLocales()
- Returns an array of Locales that may be used to localize parameters.
- Returns:
- an array of Locales that may be used as arguments to setLocale
setLocale
public void setLocale(java.util.Locale locale)
- Sets the current Locale to be used in parameter returns for this
Person.
- Parameters:
locale - the desired Locale- See Also:
getLocale()
getLocale
public java.util.Locale getLocale()
- Returns the currently set Locale.
- Returns:
- the current Locale.
- See Also:
setLocale(java.util.Locale)
getProperty
public java.lang.String getProperty(java.lang.String name)
- Returns the value of a Person's information property as a String in the
current Locale, or null if the property does not exist. You should only
use this method when you are sure the property has only one value. If
the property might have more than one value, use
getPropertyValues(java.lang.String). If you use this method with a
multivalued property, the value returned is equal to the first value in
the array returned by getPropertyValues.
- Parameters:
name - -
a String specifying the name of the property
- Returns:
- a String representing the single value of the property
- See Also:
getPropertyValues(java.lang.String)
getPropertyValues
public java.lang.String[] getPropertyValues(java.lang.String name)
- Returns an array of String objects containing all of the values the
given Person's property has in the current Locale, or null if the
property does not exist. If the property has a single value, the array
has a length of 1.
- Parameters:
name - -
a String containing the name of the property whose value is
requested
- Returns:
- an array of String objects containing the property's values
- See Also:
getProperty(java.lang.String)
getPropertyMap
public java.util.Map getPropertyMap()
- Returns a java.util.Map of the properties for this Person in the
current Locale.
- Returns:
- an immutable java.util.Map containing property names as keys
and property values as map values. The keys in the property map
are of type String. The values in the property map are of type
String array.
getPropertyNames
public java.util.Enumeration getPropertyNames()
- Returns an Enumeration of String objects containing the names of the
properties for this Person. If the Person has no properties, the method
returns an empty Enumeration.
- Returns:
- an Enumeration of String objects, each String containing the
name of a request property; or an empty Enumeration if the
Person has no properties
getUsername
public java.lang.String getUsername()
- Returns the institution-defined username of the Person. This is
equivalent to getProperty("username"), but returns "" rather than null
if there is no such property.
- Returns:
- the full name
getFullName
public java.lang.String getFullName()
- Deprecated. Use
getCommonName().
- Returns the full name of the Person. This is equivalent to
getProperty("fullName"), but returns "" rather than null if there is no
such property.
- Returns:
- the full name
getCommonName
public java.lang.String getCommonName()
- Returns the common name (as in LDAP or X.500) of the Person. This is
equivalent to getProperty("commonName"), but returns "" rather than
null if there is no such property.
- Returns:
- the common name
getFamilyName
public java.lang.String getFamilyName()
- Deprecated. Use
getNameSortingField() or getSurname().
- Returns the family (last, in western) name of the Person. This is
equivalent to getProperty("familyName"), but returns "" rather than
null if there is no such property.
- Returns:
- the full name
getSurname
public java.lang.String getSurname()
- Returns the surname of the Person (as in rfc2258 or X.500), also known
as the family or last name in western) name. This is equivalent to
getProperty("surname"), but returns "" rather than null if there is no
such property.
- Returns:
- the surname
getNameSortingField
public java.lang.String getNameSortingField()
- Returns the part of the Person's name which should be used in sorting
the name in a list. The part of the name which should be used is
culturally and individually determined. In english names this is
commonly the last name of the Person. This is equivalent to
getProperty("nameSortingField"), but returns "" rather than null if
there is no such property.
- Returns:
- the name sorting field
getEmail
public java.lang.String getEmail()
- Deprecated. Use
getEmailAddress().
- Returns the email address for the Person. This is equivalent to
getProperty("email"), but returns "" rather than null if there is no
such property.
- Returns:
- the email address
getEmailAddress
public java.lang.String getEmailAddress()
- Returns the email address for the Person. This is equivalent to
getProperty("emailAddress"), but returns "" rather than null if there
is no such property.
- Returns:
- the email address
getNickname
public java.lang.String getNickname()
- Returns the nickname (informal name) of the Person. This is equivalent
to getProperty("nickname"), but returns "" rather than null if there is
no such property.
- Returns:
- the nickname
Copyright 2006-2006 MIT AMPS. All Rights Reserved.