ca.bc.gov.webade.user
Class AbstractWebADEUserInfo

java.lang.Object
  extended byca.bc.gov.webade.user.AbstractWebADEUserInfo
All Implemented Interfaces:
java.io.Serializable, WebADEUserInfo
Direct Known Subclasses:
DefaultBusinessPartnerUserInfo, DefaultGovernmentUserInfo, DefaultIndividualUserInfo, DefaultVerifiedIndividualUserInfo

public abstract class AbstractWebADEUserInfo
extends java.lang.Object
implements WebADEUserInfo, java.io.Serializable

Default implementation of the WebADEUserInfo. Each setter can only be called once, after which the set methods will throw a RuntimeException.

Author:
jason
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface ca.bc.gov.webade.user.WebADEUserInfo
CONTACT_ADDRESS_CITY, CONTACT_ADDRESS_COUNTRY, CONTACT_ADDRESS_LINE_1, CONTACT_ADDRESS_LINE_2, CONTACT_ADDRESS_POSTAL_CODE, CONTACT_ADDRESS_PROVINCE, CONTACT_ADDRESS_UNSTRUCTURED, DEPARTMENT, DISPLAY_NAME, EMAIL_ADDRESS, EXPIRY_DATE, FIRST_NAME, IS_VISIBLE, LAST_NAME, MIDDLE_INITIAL, PHONE_NUMBER, PREFERRED_NAME, USER_CREDENTIALS
 
Constructor Summary
AbstractWebADEUserInfo()
          Default Constructor.
AbstractWebADEUserInfo(AbstractWebADEUserInfo user)
          Copy constructor.
AbstractWebADEUserInfo(UserCredentials userCredentials)
          User Credentials Constructor.
 
Method Summary
abstract  java.lang.Object clone()
          Clones the WebADEUserInfo object.
 boolean equals(java.lang.Object obj)
           
 java.lang.String[] getAttributeNames()
          Returns the set of attribute names for user attributes supported by this object instance.
 java.lang.Object getAttributeValue(java.lang.String attributeName)
          Returns the value for the attribute with the given name.
 java.lang.String getContactAddressCity()
           
 java.lang.String getContactAddressCountry()
           
 java.lang.String getContactAddressLine1()
           
 java.lang.String getContactAddressLine2()
           
 java.lang.String getContactAddressPostalCode()
           
 java.lang.String getContactAddressProvince()
           
 java.lang.String getContactAddressUnstructured()
           
 java.lang.String getDepartment()
           
 java.lang.String getDisplayName()
           
 java.lang.String getEmailAddress()
           
 java.util.Date getExpiryDate()
          Deprecated. Expiry Date is no longer supported by the BCeID web service.
 java.lang.String getFirstName()
           
 java.lang.String getLastName()
           
 java.lang.String getMiddleInitial()
           
 java.lang.String getPhoneNumber()
           
 java.lang.String getPreferredName()
           
 UserCredentials getUserCredentials()
           
 boolean hasAttribute(java.lang.String attributeName)
          Returns whether this object instance supports the attribute with the given name.
 int hashCode()
           
 boolean isReadOnly()
           
 boolean isVisible()
           
 void setContactAddressCity(java.lang.String contactAddressCity)
          Sets this user's contactAddressCity attribute to the given value.
 void setContactAddressCountry(java.lang.String contactAddressCountry)
          Sets this user's contactAddressCountry attribute to the given value.
 void setContactAddressLine1(java.lang.String contactAddressLine1)
          Sets this user's contactAddressLine1 attribute to the given value.
 void setContactAddressLine2(java.lang.String contactAddressLine2)
          Sets this user's contactAddressLine2 attribute to the given value.
 void setContactAddressPostalCode(java.lang.String contactAddressPostalCode)
          Sets this user's contactAddressPostalCode attribute to the given value.
 void setContactAddressProvince(java.lang.String contactAddressProvince)
          Sets this user's contactAddressProvince attribute to the given value.
 void setContactAddressUnstructured(java.lang.String contactAddressUnstructured)
          Sets this user's contactAddressUnstructured attribute to the given value.
 void setDepartment(java.lang.String department)
          Sets this user's department attribute to the given value.
 void setDisplayName(java.lang.String displayName)
          Sets this user's displayName attribute to the given value.
 void setEmailAddress(java.lang.String emailAddress)
          Sets this user's emailAddress attribute to the given value.
 void setExpiryDate(java.util.Date expiryDate)
          Deprecated. Expiry Date is no longer supported by the BCeID web service.
 void setFirstName(java.lang.String firstName)
          Sets this user's firstName attribute to the given value.
 void setLastName(java.lang.String lastName)
          Sets this user's lastName attribute to the given value.
 void setMiddleInitial(java.lang.String middleInitial)
          Sets this user's middleInitial attribute to the given value.
 void setPhoneNumber(java.lang.String phoneNumber)
          Sets this user's phoneNumber attribute to the given value.
 void setPreferredName(java.lang.String preferredName)
          Sets this user's preferredName attribute to the given value.
 void setReadOnly()
          Sets the attributes of this object are non-editable.
 void setUserCredentials(UserCredentials userCredentials)
          Sets this instance's user credentials to the given settings.
 void setVisible(boolean visible)
          Sets this user's visible flag attribute to the given value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractWebADEUserInfo

public AbstractWebADEUserInfo()
Default Constructor.


AbstractWebADEUserInfo

public AbstractWebADEUserInfo(UserCredentials userCredentials)
User Credentials Constructor. Creates an empty user object with the given user credentials.

Parameters:
userCredentials - The user credentials to set for this user.

AbstractWebADEUserInfo

public AbstractWebADEUserInfo(AbstractWebADEUserInfo user)
Copy constructor. Copies all user details from the given object to this instance.

Parameters:
user - The user object to copy.
Method Detail

getUserCredentials

public final UserCredentials getUserCredentials()
Specified by:
getUserCredentials in interface WebADEUserInfo
Returns:
Returns the user's credentials.
See Also:
WebADEUserInfo.getUserCredentials()

getDisplayName

public final java.lang.String getDisplayName()
Specified by:
getDisplayName in interface WebADEUserInfo
Returns:
Returns the user's display name.
See Also:
WebADEUserInfo.getDisplayName()

getLastName

public final java.lang.String getLastName()
Specified by:
getLastName in interface WebADEUserInfo
Returns:
Returns the lastName.
See Also:
WebADEUserInfo.getLastName()

getFirstName

public final java.lang.String getFirstName()
Specified by:
getFirstName in interface WebADEUserInfo
Returns:
Returns the firstName.
See Also:
WebADEUserInfo.getFirstName()

getMiddleInitial

public final java.lang.String getMiddleInitial()
Specified by:
getMiddleInitial in interface WebADEUserInfo
Returns:
Returns the middleInitial.
See Also:
WebADEUserInfo.getMiddleInitial()

getEmailAddress

public final java.lang.String getEmailAddress()
Specified by:
getEmailAddress in interface WebADEUserInfo
Returns:
Returns the emailAddress.
See Also:
WebADEUserInfo.getEmailAddress()

getPhoneNumber

public final java.lang.String getPhoneNumber()
Specified by:
getPhoneNumber in interface WebADEUserInfo
Returns:
Returns the phoneNumber.
See Also:
WebADEUserInfo.getPhoneNumber()

getPreferredName

public final java.lang.String getPreferredName()
Specified by:
getPreferredName in interface WebADEUserInfo
Returns:
Returns the preferredName.
See Also:
WebADEUserInfo.getPreferredName()

getDepartment

public final java.lang.String getDepartment()
Specified by:
getDepartment in interface WebADEUserInfo
Returns:
Returns the department.
See Also:
WebADEUserInfo.getDepartment()

getContactAddressLine1

public final java.lang.String getContactAddressLine1()
Specified by:
getContactAddressLine1 in interface WebADEUserInfo
Returns:
Returns the contactAddressLine1.
See Also:
WebADEUserInfo.getContactAddressLine1()

getContactAddressLine2

public final java.lang.String getContactAddressLine2()
Specified by:
getContactAddressLine2 in interface WebADEUserInfo
Returns:
Returns the contactAddressLine2.
See Also:
WebADEUserInfo.getContactAddressLine2()

getContactAddressCity

public final java.lang.String getContactAddressCity()
Specified by:
getContactAddressCity in interface WebADEUserInfo
Returns:
Returns the contactAddressCity.
See Also:
WebADEUserInfo.getContactAddressCity()

getContactAddressProvince

public final java.lang.String getContactAddressProvince()
Specified by:
getContactAddressProvince in interface WebADEUserInfo
Returns:
Returns the contactAddressProvince.
See Also:
WebADEUserInfo.getContactAddressProvince()

getContactAddressCountry

public final java.lang.String getContactAddressCountry()
Specified by:
getContactAddressCountry in interface WebADEUserInfo
Returns:
Returns the contactAddressCountry.
See Also:
WebADEUserInfo.getContactAddressCountry()

getContactAddressPostalCode

public final java.lang.String getContactAddressPostalCode()
Specified by:
getContactAddressPostalCode in interface WebADEUserInfo
Returns:
Returns the contactAddressPostalCode.
See Also:
WebADEUserInfo.getContactAddressPostalCode()

getContactAddressUnstructured

public final java.lang.String getContactAddressUnstructured()
Specified by:
getContactAddressUnstructured in interface WebADEUserInfo
Returns:
Returns the contactAddressUnstructured for foreign addresses (outside Canada and USA).
See Also:
WebADEUserInfo.getContactAddressUnstructured()

getExpiryDate

public final java.util.Date getExpiryDate()
Deprecated. Expiry Date is no longer supported by the BCeID web service.

Specified by:
getExpiryDate in interface WebADEUserInfo
Returns:
Returns the expiryDate or null if none is set.
See Also:
WebADEUserInfo.getExpiryDate()

isVisible

public final boolean isVisible()
Specified by:
isVisible in interface WebADEUserInfo
Returns:
Returns true if this user object's information is visible to the requesting user.
See Also:
WebADEUserInfo.isVisible()

getAttributeNames

public java.lang.String[] getAttributeNames()
Description copied from interface: WebADEUserInfo
Returns the set of attribute names for user attributes supported by this object instance.

Specified by:
getAttributeNames in interface WebADEUserInfo
Returns:
The array of attribute name constants.
See Also:
WebADEUserInfo.getAttributeNames()

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.String attributeName)
Description copied from interface: WebADEUserInfo
Returns the value for the attribute with the given name.

Specified by:
getAttributeValue in interface WebADEUserInfo
Parameters:
attributeName - The name constant assigned to the user attribute.
Returns:
The attribute value, or null if the attribute is not found.
See Also:
WebADEUserInfo.getAttributeValue(java.lang.String)

hasAttribute

public boolean hasAttribute(java.lang.String attributeName)
Description copied from interface: WebADEUserInfo
Returns whether this object instance supports the attribute with the given name.

Specified by:
hasAttribute in interface WebADEUserInfo
Parameters:
attributeName - The name constant assigned to the target user attribute.
Returns:
True if the attribute name is supported, otherwise false.
See Also:
WebADEUserInfo.hasAttribute(java.lang.String)

setDisplayName

public final void setDisplayName(java.lang.String displayName)
Sets this user's displayName attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
displayName - The displayName to set.

setEmailAddress

public final void setEmailAddress(java.lang.String emailAddress)
Sets this user's emailAddress attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
emailAddress - The emailAddress to set.

setExpiryDate

public final void setExpiryDate(java.util.Date expiryDate)
Deprecated. Expiry Date is no longer supported by the BCeID web service.

Sets this user's expiryDate attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
expiryDate - The expiryDate to set.

setFirstName

public final void setFirstName(java.lang.String firstName)
Sets this user's firstName attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
firstName - The firstName to set.

setLastName

public final void setLastName(java.lang.String lastName)
Sets this user's lastName attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
lastName - The lastName to set.

setMiddleInitial

public final void setMiddleInitial(java.lang.String middleInitial)
Sets this user's middleInitial attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
middleInitial - The middleInitial to set.

setPhoneNumber

public final void setPhoneNumber(java.lang.String phoneNumber)
Sets this user's phoneNumber attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
phoneNumber - The phoneNumber to set.

setPreferredName

public final void setPreferredName(java.lang.String preferredName)
Sets this user's preferredName attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
preferredName - The preferredName to set.

setDepartment

public final void setDepartment(java.lang.String department)
Sets this user's department attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
department - The department to set.

setContactAddressLine1

public final void setContactAddressLine1(java.lang.String contactAddressLine1)
Sets this user's contactAddressLine1 attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
contactAddressLine1 - The contactAddressLine1 to set.

setContactAddressLine2

public final void setContactAddressLine2(java.lang.String contactAddressLine2)
Sets this user's contactAddressLine2 attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
contactAddressLine2 - The contactAddressLine2 to set.

setContactAddressCity

public final void setContactAddressCity(java.lang.String contactAddressCity)
Sets this user's contactAddressCity attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
contactAddressCity - The contactAddressCity to set.

setContactAddressProvince

public final void setContactAddressProvince(java.lang.String contactAddressProvince)
Sets this user's contactAddressProvince attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
contactAddressProvince - The contactAddressProvince to set.

setContactAddressCountry

public final void setContactAddressCountry(java.lang.String contactAddressCountry)
Sets this user's contactAddressCountry attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
contactAddressCountry - The contactAddressCountry to set.

setContactAddressPostalCode

public final void setContactAddressPostalCode(java.lang.String contactAddressPostalCode)
Sets this user's contactAddressPostalCode attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
contactAddressPostalCode - The contactAddressPostalCode to set.

setContactAddressUnstructured

public final void setContactAddressUnstructured(java.lang.String contactAddressUnstructured)
Sets this user's contactAddressUnstructured attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
contactAddressUnstructured - The contactAddressUnstructured to set.

setUserCredentials

public final void setUserCredentials(UserCredentials userCredentials)
Sets this instance's user credentials to the given settings. If this instance's credentials are already set but incomplete, the given user credentials will be merged in with any existing settings. If this instance's credentials are already set and complete, a runtime exception is thrown.

Parameters:
userCredentials - The user's credentials to set.

setVisible

public final void setVisible(boolean visible)
Sets this user's visible flag attribute to the given value. If this user object is read-only, a runtime exception is thrown.

Parameters:
visible - The visible to set.

setReadOnly

public final void setReadOnly()
Sets the attributes of this object are non-editable. Used to prevent an application from editing the attributes of the session user object.

Specified by:
setReadOnly in interface WebADEUserInfo

isReadOnly

public final boolean isReadOnly()
Specified by:
isReadOnly in interface WebADEUserInfo
Returns:
True is the attributes of this object are non-editable.

clone

public abstract java.lang.Object clone()
Clones the WebADEUserInfo object. The cloned object will have the isReadOnly() flag set to false, making it editable.

Specified by:
clone in interface WebADEUserInfo

toString

public java.lang.String toString()

equals

public boolean equals(java.lang.Object obj)
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
See Also:
Object.hashCode()