ca.bc.gov.webade.developer.xml
Class XMLFileBinding

java.lang.Object
  extended byca.bc.gov.webade.developer.xml.XMLFileBinding
All Implemented Interfaces:
java.io.Serializable

public final class XMLFileBinding
extends java.lang.Object
implements java.io.Serializable

Acts as a communicator to the xml file for the XML FileProvider class.

Author:
Vivid Solutions Inc
See Also:
Serialized Form

Field Summary
static java.lang.String ACCOUNT_TYPE_ATTR
           
static java.lang.String BUSINESS_ACTIVATION_CODE_ATTR
           
static java.lang.String BUSINESS_GUID_ATTR
           
static java.lang.String BUSINESS_LEGAL_NAME_ATTR
           
static java.lang.String BUSINESS_PARTNER_USER_INFO_TAG
           
static java.lang.String DISPLAY_NAME_ATTR
           
static java.lang.String EMAIL_ADDRESS_ATTR
           
static java.lang.String EMPLOYEE_ID_ATTR
           
static java.lang.String EXPIRY_DATE_ATTR
           
static java.lang.String FIRST_NAME_ATTR
           
static java.lang.String GOVERNMENT_USER_INFO_TAG
           
static java.lang.String GUID_ATTR
           
static java.lang.String INDIVIDUAL_USER_INFO_TAG
           
static java.lang.String LAST_NAME_ATTR
           
static java.lang.String MIDDLE_INITIAL_ATTR
           
static java.lang.String PASSWORD_ATTR
           
static java.lang.String PHONE_NUMBER_ATTR
           
static java.lang.String VISIBLE_ATTR
           
 
Constructor Summary
XMLFileBinding(java.io.File file)
          Constructor.
 
Method Summary
 java.util.List findBusinessPartnerUsers(ca.bc.gov.webade.user.search.UserSearchQuery userSearchQuery)
          Searches the xml for Business Partner users matching the given search criteria.
 java.util.List findGovernmentUsers(ca.bc.gov.webade.user.search.UserSearchQuery userSearchQuery)
          Searches the xml for government users matching the given search criteria.
 ca.bc.gov.webade.user.WebADEUserInfo getBusinessPartnerUser(ca.bc.gov.webade.user.UserCredentials credentials)
          Retrives the user information for the given business partner user.
 ca.bc.gov.webade.user.WebADEUserInfo getGovernmentUser(ca.bc.gov.webade.user.UserCredentials credentials)
          Retrives the user information for the given government user.
 ca.bc.gov.webade.user.WebADEUserInfo getIndividualUser(ca.bc.gov.webade.user.UserCredentials credentials)
          Retrives the user information for the given individual user.
 java.util.ArrayList getUsers()
           
 boolean isValidPassword(ca.bc.gov.webade.user.UserCredentials credentials, java.lang.String password)
           
 boolean isValidPassword(ca.bc.gov.webade.user.UserCredentials credentials, java.lang.String password, boolean encrypted)
           
 void loadXml()
          Loads the xml from the current file into a DOM in memory.
 void loadXml(java.io.File f)
          Loads the xml from the given file into a DOM in memory.
 void loadXml(java.lang.String fileLocation)
          Loads the xml from the given file into a DOM in memory.
 void setUsers(org.w3c.dom.Document usersDocument)
           
 ca.bc.gov.webade.user.GUID[] userInGroups(ca.bc.gov.webade.user.UserCredentials credentials, ca.bc.gov.webade.user.GUID[] groupGuids)
          Retrieves an array of groups that the given user is a member of.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GOVERNMENT_USER_INFO_TAG

public static final java.lang.String GOVERNMENT_USER_INFO_TAG
See Also:
Constant Field Values

BUSINESS_PARTNER_USER_INFO_TAG

public static final java.lang.String BUSINESS_PARTNER_USER_INFO_TAG
See Also:
Constant Field Values

INDIVIDUAL_USER_INFO_TAG

public static final java.lang.String INDIVIDUAL_USER_INFO_TAG
See Also:
Constant Field Values

PASSWORD_ATTR

public static final java.lang.String PASSWORD_ATTR
See Also:
Constant Field Values

EMPLOYEE_ID_ATTR

public static final java.lang.String EMPLOYEE_ID_ATTR
See Also:
Constant Field Values

ACCOUNT_TYPE_ATTR

public static final java.lang.String ACCOUNT_TYPE_ATTR
See Also:
Constant Field Values

GUID_ATTR

public static final java.lang.String GUID_ATTR
See Also:
Constant Field Values

BUSINESS_ACTIVATION_CODE_ATTR

public static final java.lang.String BUSINESS_ACTIVATION_CODE_ATTR
See Also:
Constant Field Values

BUSINESS_GUID_ATTR

public static final java.lang.String BUSINESS_GUID_ATTR
See Also:
Constant Field Values

BUSINESS_LEGAL_NAME_ATTR

public static final java.lang.String BUSINESS_LEGAL_NAME_ATTR
See Also:
Constant Field Values

VISIBLE_ATTR

public static final java.lang.String VISIBLE_ATTR
See Also:
Constant Field Values

DISPLAY_NAME_ATTR

public static final java.lang.String DISPLAY_NAME_ATTR
See Also:
Constant Field Values

LAST_NAME_ATTR

public static final java.lang.String LAST_NAME_ATTR
See Also:
Constant Field Values

FIRST_NAME_ATTR

public static final java.lang.String FIRST_NAME_ATTR
See Also:
Constant Field Values

MIDDLE_INITIAL_ATTR

public static final java.lang.String MIDDLE_INITIAL_ATTR
See Also:
Constant Field Values

EMAIL_ADDRESS_ATTR

public static final java.lang.String EMAIL_ADDRESS_ATTR
See Also:
Constant Field Values

PHONE_NUMBER_ATTR

public static final java.lang.String PHONE_NUMBER_ATTR
See Also:
Constant Field Values

EXPIRY_DATE_ATTR

public static final java.lang.String EXPIRY_DATE_ATTR
See Also:
Constant Field Values
Constructor Detail

XMLFileBinding

public XMLFileBinding(java.io.File file)
               throws WebADEDeveloperException
Constructor.

Parameters:
file - The file containing the user information.
Throws:
WebADEDeveloperException
Method Detail

loadXml

public void loadXml()
             throws WebADEDeveloperException
Loads the xml from the current file into a DOM in memory.

Throws:
WebADEDeveloperException

loadXml

public void loadXml(java.lang.String fileLocation)
             throws WebADEDeveloperException
Loads the xml from the given file into a DOM in memory.

Parameters:
fileLocation -
Throws:
WebADEDeveloperException

loadXml

public void loadXml(java.io.File f)
             throws WebADEDeveloperException
Loads the xml from the given file into a DOM in memory.

Parameters:
f - The file
Throws:
WebADEDeveloperException

getBusinessPartnerUser

public ca.bc.gov.webade.user.WebADEUserInfo getBusinessPartnerUser(ca.bc.gov.webade.user.UserCredentials credentials)
                                                            throws WebADEDeveloperException
Retrives the user information for the given business partner user.

Parameters:
credentials - The given business partner user.
Returns:
The user information.
Throws:
WebADEDeveloperException

getUsers

public java.util.ArrayList getUsers()

setUsers

public void setUsers(org.w3c.dom.Document usersDocument)
              throws WebADEDeveloperException
Throws:
WebADEDeveloperException

isValidPassword

public boolean isValidPassword(ca.bc.gov.webade.user.UserCredentials credentials,
                               java.lang.String password)
                        throws WebADEDeveloperException
Throws:
WebADEDeveloperException

isValidPassword

public boolean isValidPassword(ca.bc.gov.webade.user.UserCredentials credentials,
                               java.lang.String password,
                               boolean encrypted)
                        throws WebADEDeveloperException
Throws:
WebADEDeveloperException

getIndividualUser

public ca.bc.gov.webade.user.WebADEUserInfo getIndividualUser(ca.bc.gov.webade.user.UserCredentials credentials)
                                                       throws WebADEDeveloperException
Retrives the user information for the given individual user.

Parameters:
credentials - The given individual user.
Returns:
The user information.
Throws:
WebADEDeveloperException

getGovernmentUser

public ca.bc.gov.webade.user.WebADEUserInfo getGovernmentUser(ca.bc.gov.webade.user.UserCredentials credentials)
                                                       throws WebADEDeveloperException
Retrives the user information for the given government user.

Parameters:
credentials - The given government user.
Returns:
The user information.
Throws:
WebADEDeveloperException

findGovernmentUsers

public java.util.List findGovernmentUsers(ca.bc.gov.webade.user.search.UserSearchQuery userSearchQuery)
                                   throws WebADEDeveloperException
Searches the xml for government users matching the given search criteria.

Parameters:
userSearchQuery - The UserSearchObject holding the search criteria.
Returns:
A list of government users matching the search criteria.
Throws:
WebADEDeveloperException

findBusinessPartnerUsers

public java.util.List findBusinessPartnerUsers(ca.bc.gov.webade.user.search.UserSearchQuery userSearchQuery)
                                        throws WebADEDeveloperException
Searches the xml for Business Partner users matching the given search criteria.

Parameters:
userSearchQuery - The UserSearchObject holding the search criteria.
Returns:
A list of Business Partner users matching the search criteria.
Throws:
WebADEDeveloperException

userInGroups

public ca.bc.gov.webade.user.GUID[] userInGroups(ca.bc.gov.webade.user.UserCredentials credentials,
                                                 ca.bc.gov.webade.user.GUID[] groupGuids)
                                          throws WebADEDeveloperException
Retrieves an array of groups that the given user is a member of.

Parameters:
credentials - The given user
groupGuids - Checking if the given user is a member of any of these groups.
Returns:
An array of GUID objects identifying groups the given user is a member of.
Throws:
WebADEDeveloperException