atg.userprofiling
Class RepositoryLinkProfileItemFinder

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.userprofiling.RepositoryProfileItemFinder
              extended by atg.userprofiling.RepositoryLinkProfileItemFinder
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class RepositoryLinkProfileItemFinder
extends RepositoryProfileItemFinder

An extension of RepositoryProfileItemFinder which finds the profile items by querying the linked repository instead of, or in addition to, the regular profile repository.

This class should be used, instead of RepositoryProfileItemFinder, if any of the following properties are kept in a linked repository, rather than the main profile repository:

For any such property, the corresponding xxxLinkedPropertyName property should be set accordingly. For example, if property "firstName" is kept in the linked repository, the firstNameLinkedPropertyName should be set to "firstName." If firstNameLinkedPropertyName is null, it is assumed that the first name property is kept in the profile repository.

The methods findByLogin and findByName can only be used if the relevant properties can be found in the same repository. For example, to use findByLogin, both login and password properties must be in either the profile repository or the linked repository; a cross-repository search is not attempted.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
RepositoryLinkProfileItemFinder()
           
 
Method Summary
 RepositoryItem[] findByEmail(java.lang.String pEmail, java.lang.String pProfileType)
          Returns all RepositoryItems which represent profiles with the given email address, null if no such items are found.
 RepositoryItem findByLogin(java.lang.String pLogin, java.lang.String pPassword, java.lang.String pProfileType)
          Returns the RepositoryItem which represents the profile with the given login and password, null if it's not found.
 RepositoryItem[] findByName(java.lang.String pFirstName, java.lang.String pLastName, java.lang.String pProfileType)
          Returns all RepositoryItems which represent profiles with the given first and last names, null if no such items are found.
 boolean getCreateLocalProfiles()
          Returns property createLocalProfiles.
 java.lang.String getEmailLinkedPropertyName()
          Returns the name of the email property in the linked repository, null if the email property only exists in the profile repository.
protected  java.lang.String getEmailPropertyName()
          Returns the name of the email property to use in the login query.
 java.lang.String getFirstNameLinkedPropertyName()
          Returns the name of the first name property in the linked repository, null if the first name property only exists in the profile repository.
protected  java.lang.String getFirstNamePropertyName()
          Returns the name of the first name property to use in the login query.
 java.lang.String getLastNameLinkedPropertyName()
          Returns the name of the last name property in the linked repository, null if the last name property only exists in the profile repository.
protected  java.lang.String getLastNamePropertyName()
          Returns the name of the last name property to use in the login query.
 java.lang.String getLinkedItemProperty()
          Returns the name of the property in the profile repository which points to the item in the linked repository.
 java.lang.String getLinkedProfileType(java.lang.String pLocalProfileType)
          Returns the profile type in the linked repository corresponding to the given profile repository's profile type.
 java.util.Properties getLinkedProfileTypeMap()
          Returns the mapping between profile repository's profile types and the corresponding linked repository's profile types.
 Repository getLinkedRepository()
          Returns the linked repository.
 java.lang.String getLinkPropertyLocal()
          Returns the name of the property used as the link property in the profile repository.
 java.lang.String getLinkPropertyRemote()
          Returns the name of the property used as the link property in the linked repository.
 RepositoryItem getLocalItem(RepositoryItem pLinkedItem, java.lang.String pProfileType)
          Returns the item from profile repository corresponding to the given item from the linked repository, null if the local item can't be obtained.
 java.lang.String getLoginLinkedPropertyName()
          Returns the name of the login property in the linked repository, null if the login property only exists in the profile repository.
protected  java.lang.String getLoginPropertyName()
          Returns the name of the login property to use in the login query.
 java.lang.String getPasswordLinkedPropertyName()
          Returns the name of the password property in the linked repository, null if the password property only exists in the profile repository.
protected  java.lang.String getPasswordPropertyName()
          Returns the name of the password property to use in the login query.
 void setCreateLocalProfiles(boolean pCreateLocalProfiles)
          Sets property createLocalProfiles.
 void setEmailLinkedPropertyName(java.lang.String pEmailLinkedPropertyName)
          Sets the name of the email property in the linked repository.
 void setFirstNameLinkedPropertyName(java.lang.String pFirstNameLinkedPropertyName)
          Sets the name of the first name property in the linked repository.
 void setLastNameLinkedPropertyName(java.lang.String pLastNameLinkedPropertyName)
          Sets the name of the last name property in the linked repository.
 void setLinkedItemProperty(java.lang.String pLinkedItemProperty)
          Sets the name of the property in the profile repository which points to the item in the linked repository.
 void setLinkedProfileTypeMap(java.util.Properties pLinkedProfileTypeMap)
          Sets the mapping between profile repository's profile types and the corresponding linked repository's profile types.
 void setLinkedRepository(Repository pLinkedRepository)
          Sets the linked repository.
 void setLinkPropertyLocal(java.lang.String pLinkPropertyLocal)
          Sets the name of the property used as the link property in the profile repository.
 void setLinkPropertyRemote(java.lang.String pLinkPropertyRemote)
          Sets the name of the property used as the link property in the linked repository.
 void setLoginLinkedPropertyName(java.lang.String pLoginLinkedPropertyName)
          Sets the name of the login property in the linked repository.
 void setPasswordLinkedPropertyName(java.lang.String pPasswordLinkedPropertyName)
          Sets the name of the password property in the linked repository.
 
Methods inherited from class atg.userprofiling.RepositoryProfileItemFinder
findByEmail, findByLogin, findByName, generateEmailQuery, generateLoginQuery, generateNameQuery, getProfileRepository, getProfileTools, getPropertyManager, setProfileRepository, setProfileTools, setPropertyManager
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

RepositoryLinkProfileItemFinder

public RepositoryLinkProfileItemFinder()
Method Detail

getLinkedRepository

public Repository getLinkedRepository()
Returns the linked repository.


setLinkedRepository

public void setLinkedRepository(Repository pLinkedRepository)
Sets the linked repository.


getLinkedProfileTypeMap

public java.util.Properties getLinkedProfileTypeMap()
Returns the mapping between profile repository's profile types and the corresponding linked repository's profile types.


setLinkedProfileTypeMap

public void setLinkedProfileTypeMap(java.util.Properties pLinkedProfileTypeMap)
Sets the mapping between profile repository's profile types and the corresponding linked repository's profile types.


getLinkedProfileType

public java.lang.String getLinkedProfileType(java.lang.String pLocalProfileType)
Returns the profile type in the linked repository corresponding to the given profile repository's profile type.


getLinkedItemProperty

public java.lang.String getLinkedItemProperty()
Returns the name of the property in the profile repository which points to the item in the linked repository.


setLinkedItemProperty

public void setLinkedItemProperty(java.lang.String pLinkedItemProperty)
Sets the name of the property in the profile repository which points to the item in the linked repository.


getLinkPropertyLocal

public java.lang.String getLinkPropertyLocal()
Returns the name of the property used as the link property in the profile repository.


setLinkPropertyLocal

public void setLinkPropertyLocal(java.lang.String pLinkPropertyLocal)
Sets the name of the property used as the link property in the profile repository.


getLinkPropertyRemote

public java.lang.String getLinkPropertyRemote()
Returns the name of the property used as the link property in the linked repository.


setLinkPropertyRemote

public void setLinkPropertyRemote(java.lang.String pLinkPropertyRemote)
Sets the name of the property used as the link property in the linked repository.


getLoginLinkedPropertyName

public java.lang.String getLoginLinkedPropertyName()
Returns the name of the login property in the linked repository, null if the login property only exists in the profile repository.


setLoginLinkedPropertyName

public void setLoginLinkedPropertyName(java.lang.String pLoginLinkedPropertyName)
Sets the name of the login property in the linked repository.


getPasswordLinkedPropertyName

public java.lang.String getPasswordLinkedPropertyName()
Returns the name of the password property in the linked repository, null if the password property only exists in the profile repository.


setPasswordLinkedPropertyName

public void setPasswordLinkedPropertyName(java.lang.String pPasswordLinkedPropertyName)
Sets the name of the password property in the linked repository.


getFirstNameLinkedPropertyName

public java.lang.String getFirstNameLinkedPropertyName()
Returns the name of the first name property in the linked repository, null if the first name property only exists in the profile repository.


setFirstNameLinkedPropertyName

public void setFirstNameLinkedPropertyName(java.lang.String pFirstNameLinkedPropertyName)
Sets the name of the first name property in the linked repository.


getLastNameLinkedPropertyName

public java.lang.String getLastNameLinkedPropertyName()
Returns the name of the last name property in the linked repository, null if the last name property only exists in the profile repository.


setLastNameLinkedPropertyName

public void setLastNameLinkedPropertyName(java.lang.String pLastNameLinkedPropertyName)
Sets the name of the last name property in the linked repository.


getEmailLinkedPropertyName

public java.lang.String getEmailLinkedPropertyName()
Returns the name of the email property in the linked repository, null if the email property only exists in the profile repository.


setEmailLinkedPropertyName

public void setEmailLinkedPropertyName(java.lang.String pEmailLinkedPropertyName)
Sets the name of the email property in the linked repository.


getCreateLocalProfiles

public boolean getCreateLocalProfiles()
Returns property createLocalProfiles. If true, and a profile is found in the linked repository but not in the main profile repository, the local profile will be created, with its link property set accordingly. Otherwise, the local profile won't be created, and the item will not be returned by the search. The default is false.


setCreateLocalProfiles

public void setCreateLocalProfiles(boolean pCreateLocalProfiles)
Sets property createLocalProfiles. If true, and a profile is found in the linked repository but not in the main profile repository, the local profile will be created, with its link property set accordingly. Otherwise, the local profile won't be created, and the item will not be returned by the search. The default is false.


getLocalItem

public RepositoryItem getLocalItem(RepositoryItem pLinkedItem,
                                   java.lang.String pProfileType)
Returns the item from profile repository corresponding to the given item from the linked repository, null if the local item can't be obtained.


findByLogin

public RepositoryItem findByLogin(java.lang.String pLogin,
                                  java.lang.String pPassword,
                                  java.lang.String pProfileType)
Returns the RepositoryItem which represents the profile with the given login and password, null if it's not found.

Overrides:
findByLogin in class RepositoryProfileItemFinder
Parameters:
pLogin - the user's login
pPassword - the user's password; if null, the search is only performed using the login
pProfileType - the name of the profiles' item descriptor

findByName

public RepositoryItem[] findByName(java.lang.String pFirstName,
                                   java.lang.String pLastName,
                                   java.lang.String pProfileType)
Returns all RepositoryItems which represent profiles with the given first and last names, null if no such items are found. Either first name or last name can be null.

Overrides:
findByName in class RepositoryProfileItemFinder
Parameters:
pFirstName - the user's first name
pLastName - the user's last name
pProfileType - the name of the profiles' item descriptor

findByEmail

public RepositoryItem[] findByEmail(java.lang.String pEmail,
                                    java.lang.String pProfileType)
Returns all RepositoryItems which represent profiles with the given email address, null if no such items are found.

Overrides:
findByEmail in class RepositoryProfileItemFinder
Parameters:
pEmail - the user's email address
pProfileType - the name of the profiles' item descriptor

getLoginPropertyName

protected java.lang.String getLoginPropertyName()
Returns the name of the login property to use in the login query. This returns loginLinkedPropertyName if it's not null; otherwise, the property name is looked up in the PropertyManager.

Overrides:
getLoginPropertyName in class RepositoryProfileItemFinder

getPasswordPropertyName

protected java.lang.String getPasswordPropertyName()
Returns the name of the password property to use in the login query. This returns passwordLinkedPropertyName if it's not null; otherwise, the property name is looked up in the PropertyManager.

Overrides:
getPasswordPropertyName in class RepositoryProfileItemFinder

getFirstNamePropertyName

protected java.lang.String getFirstNamePropertyName()
Returns the name of the first name property to use in the login query. This returns firstNameLinkedPropertyName if it's not null; otherwise, the property name is looked up in the PropertyManager.

Overrides:
getFirstNamePropertyName in class RepositoryProfileItemFinder

getLastNamePropertyName

protected java.lang.String getLastNamePropertyName()
Returns the name of the last name property to use in the login query. This returns lastNameLinkedPropertyName if it's not null; otherwise, the property name is looked up in the PropertyManager.

Overrides:
getLastNamePropertyName in class RepositoryProfileItemFinder

getEmailPropertyName

protected java.lang.String getEmailPropertyName()
Returns the name of the email property to use in the login query. This returns emailLinkedPropertyName if it's not null; otherwise, the property name is looked up in the PropertyManager.

Overrides:
getEmailPropertyName in class RepositoryProfileItemFinder