edu.indiana.dde.mylead.common
Class MyLeadUser

java.lang.Object
  extended by edu.indiana.dde.mylead.common.MyLeadUser

public class MyLeadUser
extends java.lang.Object

This class is used for both adding and updating user metadata. The wrap parameters method only wraps those parameters that are not empty. In case the user wants to clear a value, there are boolean flags for each variable that can be used to reset the variable to the initial blank value on update. The dn is unique so it cannot be cleared.


Constructor Summary
MyLeadUser()
          Default constructor for a user.
 
Method Summary
 void addStorageResource(MyLeadStorage resource)
          This method Adds an instance of a MyLeadStorage storage resource to the user's collection of resources.
 void clearAddress(boolean clearFlag)
           
 void clearAll(boolean clearFlag)
          This method is called with a boolean value that indicates whether all of the clear flags should be turned on or off.
 void clearEmailAddr(boolean clearFlag)
           
 void clearFax(boolean clearFlag)
           
 void clearHours(boolean clearFlag)
           
 void clearInstructions(boolean clearFlag)
           
 void clearName(boolean clearFlag)
           
 void clearOrgName(boolean clearFlag)
           
 void clearPhone(boolean clearFlag)
           
 void clearPosition(boolean clearFlag)
           
 void clearReplicaSelected(boolean clearFlag)
           
 void clearResources(boolean clearFlag)
           
 void clearTtdttyPhone(boolean clearFlag)
           
 void clearUrl(boolean clearFlag)
           
 java.lang.String getAddrCity()
           
 java.lang.String getAddrCountry()
           
 java.lang.String getAddrPostCode()
           
 java.lang.String getAddrState()
           
 java.lang.String getAddrStreet()
           
 java.lang.String getAddrType()
           
 java.lang.String getContactInstructions()
          Returns a String containing the contact instructions previously set using the setContactInstructions method.
 java.lang.String getDn()
          Returns a String containing the user's distinguished name as previously identified using the setDn method.
 java.lang.String getEmail()
          Returns a String containing the user's email address as previously set using the setEmail method.
 java.lang.String getFax()
          Returns a String containing the user's fax number as previously set using the setFax method.
 java.lang.String getHours()
          Returns a String containing the user's hours of operation as previously set using the setHours method.
 java.lang.String getName()
          Returns a String containing the user's name as previously identified using the setName method.
 java.lang.String getOrganization()
          Returns a String containing the name of the user's organization as previously set using the setOrganization method.
 java.lang.String getPhone()
          Returns a String containing the user's phone number as previously set using the setPhone method.
 java.lang.String getPosition()
          Returns a String containing the user's position or title as previously set using the setPosition method.
 java.lang.String getReplica()
          Returns a String containing the nickname of the replica that was previously assigned using the setReplica method.
 java.lang.String getTtdttyPhone()
          Returns a String containing the user's TTDTTY hearing impaired phone number as previously set using the setTtdttyPhone method.
 java.lang.String getUrl()
          Returns a String containing the URL of the user's homepage as previously set using the setUrl method.
 void setAddress(java.lang.String aType, java.lang.String aStreet, java.lang.String aCity, java.lang.String aState, java.lang.String aPostCode, java.lang.String aCountry)
          Used to set the user's address.
 void setContactInstructions(java.lang.String contactStr)
          Used to set the instructions for contacting the user.
 void setDn(java.lang.String dnStr)
          Used to set the user's distinguished name.
 void setEmail(java.lang.String emailStr)
          Used to set the user's email address.
 void setFax(java.lang.String faxStr)
          Used to set the user's fax number.
 void setHours(java.lang.String hoursStr)
          Used to set a description of the hours of operation for this user.
 void setName(java.lang.String nameStr)
          Used to set the user's name.
 void setOrganization(java.lang.String orgStr)
          Used to set the name of the user's organization.
 void setPhone(java.lang.String phoneStr)
          Used to set the user's phone number.
 void setPosition(java.lang.String posStr)
          Used to set the user's position or title.
 void setReplica(java.lang.String replicaStr)
          This method is passed the nickname of a replica and the user is then assigned to that replica.
 void setTtdttyPhone(java.lang.String ttdttyStr)
          Used to set the user's phone number for TTDTTY hearing impared.
 void setUrl(java.lang.String urlStr)
          Used to define the URL for the user's homepage.
 java.lang.String wrapParameters()
          Wraps up the parameters in an XML fragment for use in an OGSA-DAI perform document used by the myLEAD client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyLeadUser

public MyLeadUser()
Default constructor for a user. All of the fields are initialized with String fields being set to empty Strings.

Method Detail

setDn

public void setDn(java.lang.String dnStr)
Used to set the user's distinguished name. The dn must be unique as this is the external ID for the user in myLEAD.

Parameters:
dnStr - String containing the user's distinguished name.

getDn

public java.lang.String getDn()
Returns a String containing the user's distinguished name as previously identified using the setDn method. If the distinguished name has not previously been set, then the default empty String set in the constructor is returned.

Returns:
String with the user's distinguished name.

setName

public void setName(java.lang.String nameStr)
Used to set the user's name. The name should include both the first and last name of the user. This field does not need to be unique - the dn is the user's unique ID. This field is free text limited to 255 characters.

Parameters:
nameStr - String containing the user's name.

getName

public java.lang.String getName()
Returns a String containing the user's name as previously identified using the setName method. If the name has not previously been set, then the default empty String set in the constructor is returned.

Returns:
String with the user's name.

setReplica

public void setReplica(java.lang.String replicaStr)
This method is passed the nickname of a replica and the user is then assigned to that replica. The replica must have already been defined using the create method in LeadClient which takes a MyLeadReplica parameter. Each replica has a unique nickname, and that nickname is passed as a parameter to this method.

Parameters:
replicaStr - String with the name of a replica that has already been defined.
See Also:
MyLeadReplica

getReplica

public java.lang.String getReplica()
Returns a String containing the nickname of the replica that was previously assigned using the setReplica method. If the replica was not previously set, then the default empty String set in the constructor is returned.

Returns:
String with the replica the user is assigned to.

setOrganization

public void setOrganization(java.lang.String orgStr)
Used to set the name of the user's organization. This field is free text limited to 255 characters and is not masked to any specific format.

Parameters:
orgStr - String containing the user's organization.

getOrganization

public java.lang.String getOrganization()
Returns a String containing the name of the user's organization as previously set using the setOrganization method. If the organization name was not previously set, then the default empty String set in the constructor is returned. This field is free text and is not masked to any specific format.

Returns:
String with the user's organization.

setPosition

public void setPosition(java.lang.String posStr)
Used to set the user's position or title. This field is free text limited to 255 characters and is not masked to any specific format.

Parameters:
posStr - String containing the user's position or title.

getPosition

public java.lang.String getPosition()
Returns a String containing the user's position or title as previously set using the setPosition method. If the position or title was not previously set, then the default empty String set in the constructor is returned. This field is free text and is not masked to any specific format.

Returns:
String with the user's position or title.

setAddress

public void setAddress(java.lang.String aType,
                       java.lang.String aStreet,
                       java.lang.String aCity,
                       java.lang.String aState,
                       java.lang.String aPostCode,
                       java.lang.String aCountry)
Used to set the user's address. Each of the parameters maps to a free text field which is limited to 255 characters and not in a specific format.

Parameters:
aType - String that should describe the type of phone number.
aStreet - String with the street address.
aCity - String with the city of the user's address.
aState - String with the name of the user's state or state code.
aPostCode - String with the user's zip or postal code - not masked to any specific format.
aCountry - String with the country in which the user's address is located.

getAddrType

public java.lang.String getAddrType()

getAddrStreet

public java.lang.String getAddrStreet()

getAddrCity

public java.lang.String getAddrCity()

getAddrState

public java.lang.String getAddrState()

getAddrPostCode

public java.lang.String getAddrPostCode()

getAddrCountry

public java.lang.String getAddrCountry()

setPhone

public void setPhone(java.lang.String phoneStr)
Used to set the user's phone number. This field is free text limited to 255 characters and is not masked to a particular phone number format.

Parameters:
phoneStr - String containing the user's phone number.

getPhone

public java.lang.String getPhone()
Returns a String containing the user's phone number as previously set using the setPhone method. If the phone number was not previously set, then the default empty String set in the constructor is returned. This field is free text and is not masked to any specific phone number format.

Returns:
String with the user's phone number.

setTtdttyPhone

public void setTtdttyPhone(java.lang.String ttdttyStr)
Used to set the user's phone number for TTDTTY hearing impared. This field is free text limited to 255 characters and is not masked to a particular phone number format.

Parameters:
ttdttyStr - String containing the user's TTDTTY phone number.

getTtdttyPhone

public java.lang.String getTtdttyPhone()
Returns a String containing the user's TTDTTY hearing impaired phone number as previously set using the setTtdttyPhone method. If the phone number was not previously set, then the default empty String set in the constructor is returned. This field is free text and is not masked to any specific phone number format.

Returns:
String with the user's TTDTTY phone number.

setEmail

public void setEmail(java.lang.String emailStr)
Used to set the user's email address. This field is free text limited to 255 characters and is not masked to a particular format.

Parameters:
emailStr - String containing the user's email address.

getEmail

public java.lang.String getEmail()
Returns a String containing the user's email address as previously set using the setEmail method. If the email address was not previously set, then the default empty String set in the constructor is returned. This field is free text and is not masked to any specific format.

Returns:
String with the user's email address.

setFax

public void setFax(java.lang.String faxStr)
Used to set the user's fax number. This field is free text and is not masked to any phone number format.

Parameters:
faxStr - String containing the user's fax number.

getFax

public java.lang.String getFax()
Returns a String containing the user's fax number as previously set using the setFax method. If the fax number was not previously set, then the default empty String set in the constructor is returned. This field is free text and is not masked to a phone number format.

Returns:
String with the user's fax number.

setUrl

public void setUrl(java.lang.String urlStr)
Used to define the URL for the user's homepage. The URL is limited to 255 characters.

Parameters:
urlStr - String containing the URL of the user's homepage.

getUrl

public java.lang.String getUrl()
Returns a String containing the URL of the user's homepage as previously set using the setUrl method. If the URL was not previously set, then the default empty String set in the constructor is returned.

Returns:
String with the URL of the user's homepage.

setHours

public void setHours(java.lang.String hoursStr)
Used to set a description of the hours of operation for this user. This is free text and not a Date field, but the description of the hours must be limited to 255 characters.

Parameters:
hoursStr - String containing a description of the users hours of operation.

getHours

public java.lang.String getHours()
Returns a String containing the user's hours of operation as previously set using the setHours method. If the hours have not previously been set, then the default empty String set in the constructor is returned.

Returns:
String with the hours of operation.

setContactInstructions

public void setContactInstructions(java.lang.String contactStr)
Used to set the instructions for contacting the user. The instructions must be limited to 255 characters.

Parameters:
contactStr - String containing the instructions for contacting the user.

getContactInstructions

public java.lang.String getContactInstructions()
Returns a String containing the contact instructions previously set using the setContactInstructions method. If the instructions have not previously been set, then the default empty String set in the constructor is returned.

Returns:
String with the contact instructions.

addStorageResource

public void addStorageResource(MyLeadStorage resource)
This method Adds an instance of a MyLeadStorage storage resource to the user's collection of resources. This also sets the flag to clear resources to false since a resource is being added.

Parameters:
resource - An instance of MyLeadStorage that defines a resource.
See Also:
MyLeadStorage

clearName

public void clearName(boolean clearFlag)

clearReplicaSelected

public void clearReplicaSelected(boolean clearFlag)

clearOrgName

public void clearOrgName(boolean clearFlag)

clearPosition

public void clearPosition(boolean clearFlag)

clearAddress

public void clearAddress(boolean clearFlag)

clearPhone

public void clearPhone(boolean clearFlag)

clearTtdttyPhone

public void clearTtdttyPhone(boolean clearFlag)

clearEmailAddr

public void clearEmailAddr(boolean clearFlag)

clearFax

public void clearFax(boolean clearFlag)

clearUrl

public void clearUrl(boolean clearFlag)

clearHours

public void clearHours(boolean clearFlag)

clearInstructions

public void clearInstructions(boolean clearFlag)

clearResources

public void clearResources(boolean clearFlag)

clearAll

public void clearAll(boolean clearFlag)
This method is called with a boolean value that indicates whether all of the clear flags should be turned on or off. If the parameter passed is true, then all of the clear flags are turned on.
Since the distinguished name is required, there is no clear flag for the dn.

Parameters:
clearFlag - boolean to indicate if all of the clear flags should be set.

wrapParameters

public java.lang.String wrapParameters()
                                throws MyLeadException
Wraps up the parameters in an XML fragment for use in an OGSA-DAI perform document used by the myLEAD client. For each field, the user can elect to clear the field. For an update, this will clear any existing value. Otherwise, the field is only included if it has a value.

Returns:
String The XML fragment with the user's profile.
Throws:
MyLeadException