|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.userprofiling.ProfileTools
public class ProfileTools
A general set of tools which help manipulate profiles.
The class atg.userprofiling.Profile
, used in many methods as a parameter,
is the class which represents the instance of the session-scoped Profile object,
located at the Nucleus path /atg/userprofiling/Profile
. The methods
which contain this parameter signature should only be used when it is required to
manipulate the session-scoped Profile object. Typically one will have a property reference
to the object or resolve the object through the request. Developers should not needlessly
construct new Profile instances (i.e. Profile p = new Profile()
) and pass
it as a parameter. Remember this object is only a placeholder to put in the component
tree. The _real_ profile is an atg.repository.RepositoryItem
instance, which
is wrapped through the dataSource
property of the atg.userprofiling.Profile
class.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
static java.lang.String |
DPS_VERSION
Full Product Version Identifier |
static java.lang.String |
DPS_VERSION_NUM
Version number for this product |
protected atg.userprofiling.PasswordGenerator |
mPasswordGenerator
|
protected atg.security.PasswordRuleChecker |
mPasswordRuleChecker
|
protected atg.security.PreviousNPasswordManager |
mPreviousNPasswordManager
|
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 | |
---|---|
ProfileTools()
Constructs an instanceof ProfileTools |
Method Summary | |
---|---|
void |
addMultiPropertyValues(java.lang.String pPropertyName,
RepositoryItem pSourceItem,
RepositoryItem pTargetItem)
Adds a specific multi-valued property's values from the given source user to the given target user |
boolean |
assumeSecurityIdentity(Profile pProfile)
Takes the given profile and makes the current Thread's User have the persona of this profile. |
boolean |
assumeSecurityIdentity(Profile pProfile,
IdentityManager pIdentityManager)
Takes the given profile and IdentityManager and makes the current Thread's User have the persona of this profile. |
java.util.Collection |
buildPropertyUpdatesForDictionary(RepositoryItem pItem,
java.util.Dictionary pValues)
Builds a collection of PropertyUpdate objects that reflect the updates in the value dictionary. |
protected java.util.Collection |
buildPropertyUpdatesForRepositoryFormList(RepositoryItem pItemWithMultiValuedProperty,
RepositoryFormList pRepositoryFormList)
Builds a collection of PropertyUpdate objects for the updates in the RepositoryFormList. |
protected java.util.Collection |
buildPropertyUpdatesForRepositoryFormMap(RepositoryItem pItem,
RepositoryFormMap pRepositoryFormMap)
Builds a collection of PropertyUpdate objects for the updates in the RepositoryFormMap. |
void |
buildUpdateMessage(RepositoryItem repItem,
java.util.Dictionary newValues,
java.util.Vector propertyUpdatesVector,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Operation called to set up the event data to be fired in the postUpdateUser method. |
void |
buildUpdateMessage(RepositoryItem repItem,
RepositoryItemDescriptor pItemDescriptor,
java.util.Dictionary newValues,
java.util.Vector propertyUpdatesVector,
java.lang.String pPropertyPath,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Operation called to set up the event data to be fired in the postUpdateUser method. |
void |
changePassword(RepositoryItem pProfile,
java.lang.String pNewPassword,
java.lang.String pConfirmNewPassword,
java.lang.String pConfirmOldPassword,
boolean pMustConfirmNewPassword,
boolean pMustConfirmOldPassword)
Changes the password for the profile, if certain criteria are met: If requiring a confirmation password, then pNewPassword and pConfirmPassword must match. |
boolean |
createNewUser(java.lang.String pUserType,
Profile pProfile)
Creates a new user and loads it into the session-scoped Profile object. |
boolean |
createNewUser(java.lang.String pProfileId,
java.lang.String pUserType,
Profile pProfile)
Creates a new user and loads it into the Profile object. |
protected atg.userprofiling.PropertyUpdate |
createPropertyUpdate(int pUpdateType,
java.lang.String pPropertyName,
java.lang.String pOldValue,
java.lang.String pNewValue)
Creates a property update object using the values provided. |
void |
doStartService()
Called after the service has been created, placed into the naming hierarchy, and initialized with its configured property values. |
java.lang.String |
formatMultiValueUpdateString(java.lang.String pPropertyName,
java.lang.String pKey,
java.lang.Object pReferencedObject)
Creates a formatted string that denotes an item within a multi-valued property(collection, map or object []). |
protected Query |
generateEmailQuery(java.lang.String pEmail,
QueryBuilder pQueryBuilder)
Deprecated. As of DPS 5.5, this method has been moved to RepositoryProfileItemFinder . If you call this
method, you should change your code to instead call
getProfileItemFinder().generateEmailQuery . If you
override this method in this class, you should instead override
the RepositoryProfileItemFinder component's method. |
protected Query |
generateLoginQuery(java.lang.String pLogin,
java.lang.String pPassword,
QueryBuilder pQueryBuilder)
Deprecated. As of DPS 5.5, this method has been moved to RepositoryProfileItemFinder . If you call this
method, you should change your code to instead call
getProfileItemFinder().generateLoginQuery . If you
override this method in this class, you should instead override
the RepositoryProfileItemFinder component's method. |
protected Query |
generateNameQuery(java.lang.String pFirstName,
java.lang.String pLastName,
QueryBuilder pQueryBuilder)
Deprecated. As of DPS 5.5, this method has been moved to RepositoryProfileItemFinder . If you call this
method, you should change your code to instead call
getProfileItemFinder().generateNameQuery . If you
override this method in this class, you should instead override
the RepositoryProfileItemFinder component's method. |
java.lang.String |
generateNewPasswordForProfile(RepositoryItem pProfile)
Creates a randomly generated password for the profile. |
java.lang.Boolean |
getAutoLogin(Profile pProfile)
Gets the auto-login property of the given profile. |
CookieManager |
getCookieManager()
Returns property CookieManager |
java.lang.String |
getDefaultProfileType()
Returns property DefaultProfileType |
atg.repository.nucleus.RepositoryGroupContainer |
getGroupContainer()
Returns property GroupContainer |
RepositoryItem |
getItem(java.lang.String pLogin,
java.lang.String pPassword)
Returns a RepositoryItem which represents a profile. |
RepositoryItem |
getItem(java.lang.String pLogin,
java.lang.String pPassword,
java.lang.String pProfileType)
Returns a RepositoryItem which represents a profile. |
RepositoryItem |
getItemFromEmail(java.lang.String pEmail)
Returns a RepositoryItem which represents a profile. |
RepositoryItem |
getItemFromEmail(java.lang.String pEmail,
java.lang.String pProfileType)
Returns a RepositoryItem which represents a profile. |
RepositoryItem[] |
getItems(java.lang.String pFirstName,
java.lang.String pLastName)
Returns an list of RepositoryItems which represents profiles found for the first and last names entered. |
RepositoryItem[] |
getItems(java.lang.String pFirstName,
java.lang.String pLastName,
java.lang.String pProfileType)
Returns an list of RepositoryItems which represents profiles found for the first and last names entered. |
RepositoryItem[] |
getItemsFromEmail(java.lang.String pEmail)
Returns a RepositoryItem which represents a profile. |
RepositoryItem[] |
getItemsFromEmail(java.lang.String pEmail,
java.lang.String pProfileType)
Returns a RepositoryItem which represents a profile. |
java.lang.String |
getLoggingIdentifier()
|
java.lang.String |
getLogin(RepositoryItem pProfile)
Gets the login of the given profile. |
atg.userdirectory.UserDirectoryLoginUserAuthority |
getLoginUserAuthority()
Returns property UserAuthority |
MutableRepositoryItem |
getMutableItem(RepositoryItem pItem)
Gets the mutable form of the given repository item, assuming that there is one. |
java.lang.String |
getPassword(RepositoryItem pProfile)
Gets the password of the given profile. |
atg.userprofiling.PasswordGenerator |
getPasswordGenerator()
|
atg.security.PasswordRuleChecker |
getPasswordRuleChecker()
|
atg.security.PreviousNPasswordManager |
getPreviousNPasswordManager()
|
ProfileEventTrigger |
getProfileEventTrigger()
Returns property ProfileEventTrigger |
RepositoryProfileItemFinder |
getProfileItemFinder()
Returns property PropertyManager |
MutableRepository |
getProfileRepository()
Returns property ProfileRepository |
PropertyManager |
getPropertyManager()
Returns property PropertyManager |
java.lang.Integer |
getSecurityStatus(Profile pProfile)
Gets the security status of the given profile, if there is such a property |
UserLoginManager |
getUserLoginManager()
Returns the value of the property LoginUserAuthority. |
boolean |
isAutoLoginSecurityStatus(int pSecurityStatus)
Returns true if the given security status indicates an auto login |
boolean |
isEnableSecurityStatus()
|
boolean |
isValidCredentials(java.lang.String pLogin,
java.lang.String pCleartextPassword)
Determines if the given login and cleartext password represent a valid pair of credentials for a user, according to a configured IdentityManager. |
boolean |
isValidCredentials(java.lang.String pLogin,
java.lang.String pCleartextPassword,
IdentityManager pIdentityManager)
Determines if the given login and cleartext password represent a valid pair of credentials for a user. |
boolean |
isValidCredentialsEncrypted(java.lang.String pLogin,
java.lang.String pEncryptedPassword,
java.lang.String pHashKey)
This method validates the given credentials, assuming that the given password has been encrypted according to the profile password hasher algorithm, and further encrypted using the given pHashKey. |
boolean |
locateUserFromEmail(java.lang.String pEmail,
Profile pProfile)
A query is built to look for users with the given email. |
boolean |
locateUserFromEmail(java.lang.String pEmail,
Profile pProfile,
java.lang.String pProfileType)
A query is built to look for users with the given email. |
boolean |
locateUserFromId(java.lang.String pId,
Profile pProfile)
A profile is attempted to be loaded by their user id. |
boolean |
locateUserFromId(java.lang.String pId,
Profile pProfile,
java.lang.String pProfileType)
A profile is attempted to be loaded by their user id. |
boolean |
locateUserFromLogin(java.lang.String pLogin,
Profile pProfile)
A query is built to look for users with the given login. |
boolean |
locateUserFromLogin(java.lang.String pLogin,
Profile pProfile,
java.lang.String pProfileType)
A query is built to look for users with the given login. |
boolean |
locateUserFromLogin(java.lang.String pLogin,
java.lang.String pPassword,
Profile pProfile)
A query is built to look for users with the given login and password. |
boolean |
locateUserFromLogin(java.lang.String pLogin,
java.lang.String pPassword,
Profile pProfile,
java.lang.String pProfileType)
A query is built to look for users with the given login and password. |
static void |
main(java.lang.String[] pArgs)
Print out the version of DPS |
void |
prefixPropertyNames(java.util.Collection pPropertyUpdates,
java.lang.String pPropertyNamePrefix)
Iterates through the property updates and modifies the propertyName property to be prefixed by the pPropertyNamePrefix. |
void |
propagateLocale(Profile pProfile,
atg.servlet.RequestLocale pRequestLocale,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Tests to see if the locale of the profile and the locale of the current request are different, and if so, whether or not the caller should change the locale to that of the profile's |
boolean |
revokeSecurityIdentity()
Revokes the identity(ies) of the current user. |
boolean |
revokeSecurityIdentity(IdentityManager pIdentityManager)
Takes the given IdentityManager and revokes the managed User's persona(s) i.e. |
void |
sendEmailToUser(MutableRepositoryItem pProfile,
boolean pRunInSeparateThread,
boolean pPersist,
TemplateEmailSender pTemplateEmailSender,
TemplateEmailInfo pTemplateEmailInfo,
java.util.Map pTemplateParameters)
Sends email to the user using the provided email template and parameters. |
void |
setAutoLoginSecurityStatus(Profile pProfile,
ProfileRequest pProfileRequest)
Sets the security status property of the profile. |
void |
setCookieManager(CookieManager pCookieManager)
Sets property CookieManager |
void |
setDefaultProfileType(java.lang.String pDefaultProfileType)
Sets property DefaultProfileType |
void |
setEnableSecurityStatus(boolean pEnableSecurityStatus)
|
void |
setGroupContainer(atg.repository.nucleus.RepositoryGroupContainer pGroupContainer)
Sets property GroupContainer |
void |
setLoginSecurityStatus(Profile pProfile,
DynamoHttpServletRequest pRequest)
Sets the security status property of the profile. |
void |
setLoginUserAuthority(atg.userdirectory.UserDirectoryLoginUserAuthority pUserAuthority)
Sets property UserAuthority |
void |
setPasswordGenerator(atg.userprofiling.PasswordGenerator pPasswordGenerator)
Sets the property PasswordGenerator |
void |
setPasswordRuleChecker(atg.security.PasswordRuleChecker pPasswordRuleChecker)
Sets the property PasswordRuleChecker |
void |
setPreviousNPasswordManager(atg.security.PreviousNPasswordManager pPreviousNPasswordManager)
Sets the property PreviousNPasswordManager |
void |
setProfileEventTrigger(ProfileEventTrigger pProfileEventTrigger)
Sets property ProfileEventTrigger |
void |
setProfileItemFinder(RepositoryProfileItemFinder pProfileItemFinder)
Sets property ProfileItemFinder |
void |
setProfileRepository(MutableRepository pProfileRepository)
Sets property ProfileRepository |
void |
setPropertyManager(PropertyManager pPropertyManager)
Sets property PropertyManager |
void |
setSecurityStatus(Profile pProfile,
int pValue)
Sets the security status property of the profile. |
void |
setUserLoginManager(UserLoginManager pUserLoginManager)
Sets the property LoginUserAuthority. |
boolean |
shouldSendProfileCookies(Profile pProfile)
Determines if profile cookies should be sent to the given profile's web client |
java.lang.String |
toString()
|
void |
updateProperties(java.util.Dictionary pPropertyTable,
RepositoryItem pItem)
Attempts to update the profile with the given set of changed property values. |
void |
updateProperty(java.lang.String pPropertyName,
java.lang.Object pPropertyValue,
RepositoryItem pItem)
Attempts to update the named property for the profile. |
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, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
public static final java.lang.String DPS_VERSION_NUM
public static final java.lang.String DPS_VERSION
protected atg.userprofiling.PasswordGenerator mPasswordGenerator
protected atg.security.PreviousNPasswordManager mPreviousNPasswordManager
protected atg.security.PasswordRuleChecker mPasswordRuleChecker
Constructor Detail |
---|
public ProfileTools()
Method Detail |
---|
public void setPasswordGenerator(atg.userprofiling.PasswordGenerator pPasswordGenerator)
public atg.userprofiling.PasswordGenerator getPasswordGenerator()
public void setProfileRepository(MutableRepository pProfileRepository)
public MutableRepository getProfileRepository()
public void setDefaultProfileType(java.lang.String pDefaultProfileType)
public java.lang.String getDefaultProfileType()
public void setCookieManager(CookieManager pCookieManager)
public CookieManager getCookieManager()
public void setPropertyManager(PropertyManager pPropertyManager)
public PropertyManager getPropertyManager()
public void setProfileItemFinder(RepositoryProfileItemFinder pProfileItemFinder)
public RepositoryProfileItemFinder getProfileItemFinder()
public void setProfileEventTrigger(ProfileEventTrigger pProfileEventTrigger)
public ProfileEventTrigger getProfileEventTrigger()
public void setGroupContainer(atg.repository.nucleus.RepositoryGroupContainer pGroupContainer)
public atg.repository.nucleus.RepositoryGroupContainer getGroupContainer()
public void setLoginUserAuthority(atg.userdirectory.UserDirectoryLoginUserAuthority pUserAuthority)
public atg.userdirectory.UserDirectoryLoginUserAuthority getLoginUserAuthority()
public void setUserLoginManager(UserLoginManager pUserLoginManager)
public UserLoginManager getUserLoginManager()
public void setPreviousNPasswordManager(atg.security.PreviousNPasswordManager pPreviousNPasswordManager)
public atg.security.PreviousNPasswordManager getPreviousNPasswordManager()
public void setPasswordRuleChecker(atg.security.PasswordRuleChecker pPasswordRuleChecker)
public atg.security.PasswordRuleChecker getPasswordRuleChecker()
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the service had a problem
starting uppublic boolean createNewUser(java.lang.String pUserType, Profile pProfile)
MutableRepository.createItem
method
and sets the Profile.dataSource
property to the newly
constructed RepositoryItem
.
/atg/userprofiling/Profile
.
pUserType
- the type of profile to construct, which maps to an ItemDescriptor typepProfile
- the session-scoped Profile instance
public boolean createNewUser(java.lang.String pProfileId, java.lang.String pUserType, Profile pProfile)
MutableRepository.createItem
method
and sets the Profile.dataSource
property to the newly
constructed RepositoryItem
.
pProfileId
- The id of the profile to create. It's the caller's responsibility
to ensure this is a valid profile id.pUserType
- the type of profile to construct, which maps to an ItemDescriptor typepProfile
- the Profile instance to load the new created user item.
public boolean locateUserFromLogin(java.lang.String pLogin, java.lang.String pPassword, Profile pProfile)
dataSource
property of the
session-scoped Profile is updated to point to the found user.
/atg/userprofiling/Profile
.
pLogin
- the login name of the user to findpPassword
- the matching password of the user to loadpProfile
- the session-scoped Profile instance
public boolean locateUserFromLogin(java.lang.String pLogin, java.lang.String pPassword, Profile pProfile, java.lang.String pProfileType)
dataSource
property of the
session-scoped Profile is updated to point to the found user.
/atg/userprofiling/Profile
.
pLogin
- the login name of the user to findpPassword
- the matching password of the user to loadpProfile
- the session-scoped Profile instancepProfileType
- the name of item descriptor to use to look for the profile
public boolean locateUserFromLogin(java.lang.String pLogin, Profile pProfile)
dataSource
property of the session-scoped Profile is
updated to point to the found user.
/atg/userprofiling/Profile
.
pLogin
- the login name of the user to findpProfile
- the session-scoped Profile instance
public boolean locateUserFromLogin(java.lang.String pLogin, Profile pProfile, java.lang.String pProfileType)
dataSource
property of the session-scoped Profile is
updated to point to the found user.
/atg/userprofiling/Profile
.
pLogin
- the login name of the user to findpProfile
- the session-scoped Profile instancepProfileType
- the name of item descriptor to use to look for the profile
public boolean locateUserFromId(java.lang.String pId, Profile pProfile)
dataSource
property of the session-scoped Profile is
updated to point to the found user.
/atg/userprofiling/Profile
.
pId
- the user id of the profile to loadpProfile
- the session-scoped Profile instance
public boolean locateUserFromId(java.lang.String pId, Profile pProfile, java.lang.String pProfileType)
dataSource
property of the session-scoped Profile is
updated to point to the found user.
/atg/userprofiling/Profile
.
pId
- the user id of the profile to loadpProfile
- the session-scoped Profile instancepProfileType
- the name of item descriptor to use to look for the profile
public boolean locateUserFromEmail(java.lang.String pEmail, Profile pProfile)
dataSource
property of the session-scoped Profile is
updated to point to the found user. Note that if multiple users exist with
the same email address, only one of them will be found.
/atg/userprofiling/Profile
.
pEmail
- the email address of the user to findpProfile
- the session-scoped Profile instance
public boolean locateUserFromEmail(java.lang.String pEmail, Profile pProfile, java.lang.String pProfileType)
dataSource
property of the session-scoped Profile is
updated to point to the found user. Note that if multiple users exist with
the same email address, only one of them will be found.
/atg/userprofiling/Profile
.
pEmail
- the email address of the user to findpProfile
- the session-scoped Profile instancepProfileType
- the name of item descriptor to use to look for the profile
public void updateProperty(java.lang.String pPropertyName, java.lang.Object pPropertyValue, RepositoryItem pItem) throws RepositoryException
pPropertyName
- the name of the propertypPropertyValue
- the value of the property to changepItem
- the profile to update
RepositoryException
- if there was a problem updating the profilepublic void updateProperties(java.util.Dictionary pPropertyTable, RepositoryItem pItem) throws RepositoryException
pPropertyTable
- a dictionary of property names and new property valuespItem
- the profile to update
RepositoryException
- if there was a problem updating the profilepublic RepositoryItem getItem(java.lang.String pLogin, java.lang.String pPassword)
dataSource
property. A query is built using the supplied login to find the data source. If
the pPassword parameter is not null then an extra constraint is added
to the query operation to make sure the correct password is given.
pLogin
- what the user claims is their loginpPassword
- the user's password
protected Query generateLoginQuery(java.lang.String pLogin, java.lang.String pPassword, QueryBuilder pQueryBuilder) throws RepositoryException
RepositoryProfileItemFinder
. If you call this
method, you should change your code to instead call
getProfileItemFinder().generateLoginQuery
. If you
override this method in this class, you should instead override
the RepositoryProfileItemFinder
component's method.
(login == pLogin) AND (password == pPassword)
.
If the password is null then just (login == pLogin)
is returned.
RepositoryException
RepositoryProfileItemFinder.generateLoginQuery
public RepositoryItem getItem(java.lang.String pLogin, java.lang.String pPassword, java.lang.String pProfileType)
dataSource
property. A query is built using the supplied login to find the data source. If
the pPassword parameter is not null then an extra constraint is added
to the query operation to make sure the correct password is given.
pLogin
- what the user claims is their loginpPassword
- the user's passwordpProfileType
- the name of item descriptor to use to look for the profile
public RepositoryItem[] getItems(java.lang.String pFirstName, java.lang.String pLastName)
pFirstName
- the first name to query onpLastName
- the last name to query on
public RepositoryItem[] getItems(java.lang.String pFirstName, java.lang.String pLastName, java.lang.String pProfileType)
pFirstName
- the first name to query onpLastName
- the last name to query on
protected Query generateNameQuery(java.lang.String pFirstName, java.lang.String pLastName, QueryBuilder pQueryBuilder) throws RepositoryException
RepositoryProfileItemFinder
. If you call this
method, you should change your code to instead call
getProfileItemFinder().generateNameQuery
. If you
override this method in this class, you should instead override
the RepositoryProfileItemFinder
component's method.
(firstName ==
pFirstName) AND (lastName == pLastName)
.
If the firstName is null then just (lastName == pLLastName)
is returned.
RepositoryException
RepositoryProfileItemFinder.generateNameQuery
public RepositoryItem getItemFromEmail(java.lang.String pEmail)
dataSource
property. A query is built using the supplied email to find the data source.
Note that if multiple users exist with the same email address, only one of
them will be returned.
pEmail
- the email address of the user to find
public RepositoryItem getItemFromEmail(java.lang.String pEmail, java.lang.String pProfileType)
dataSource
property. A query is built using the supplied email to find the data source.
Note that if multiple users exist with the same email address, only one of
them will be returned.
pEmail
- the email address of the user to findpProfileType
- the name of item descriptor to use to look for the profile
public RepositoryItem[] getItemsFromEmail(java.lang.String pEmail)
dataSource
property. A query is built using the supplied email to find the data source.
Note that if multiple users exist with the same email address, only one of
them will be returned.
pEmail
- the email address of the user to find
public RepositoryItem[] getItemsFromEmail(java.lang.String pEmail, java.lang.String pProfileType)
dataSource
property. A query is built using the supplied email to find the data source.
Note that if multiple users exist with the same email address, only one of
them will be returned.
pEmail
- the email address of the user to findpProfileType
- the name of item descriptor to use to look for the profile
protected Query generateEmailQuery(java.lang.String pEmail, QueryBuilder pQueryBuilder) throws RepositoryException
RepositoryProfileItemFinder
. If you call this
method, you should change your code to instead call
getProfileItemFinder().generateEmailQuery
. If you
override this method in this class, you should instead override
the RepositoryProfileItemFinder
component's method.
RepositoryException
RepositoryProfileItemFinder.generateEmailQuery
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getLoggingIdentifier()
public static void main(java.lang.String[] pArgs)
public void setEnableSecurityStatus(boolean pEnableSecurityStatus)
public boolean isEnableSecurityStatus()
public void setLoginSecurityStatus(Profile pProfile, DynamoHttpServletRequest pRequest) throws RepositoryException
pProfile
- the profile to updatepRequest
- the request.
RepositoryException
public void setAutoLoginSecurityStatus(Profile pProfile, ProfileRequest pProfileRequest) throws RepositoryException
pProfile
- the profile to updatepProfileRequest
- used only when pExplicit is false. we use it to get the request source
RepositoryException
public boolean isAutoLoginSecurityStatus(int pSecurityStatus)
pSecurityStatus
- the security status to examine
pSecurityStatus
indicates an auto login,
false otherwisepublic void setSecurityStatus(Profile pProfile, int pValue) throws RepositoryException
pProfile
- the profile to updatepValue
- what to set the property value to.
RepositoryException
public void buildUpdateMessage(RepositoryItem repItem, java.util.Dictionary newValues, java.util.Vector propertyUpdatesVector, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws RepositoryException
repItem
- the item as it is in the repository before the updatenewValues
- the dictionary containing the updated profile propertiespropertyUpdatesVector
- a place to hold the updated properties as we recursepRequest
- the servlet's requestpResponse
- the servlet's response
RepositoryException
public void buildUpdateMessage(RepositoryItem repItem, RepositoryItemDescriptor pItemDescriptor, java.util.Dictionary newValues, java.util.Vector propertyUpdatesVector, java.lang.String pPropertyPath, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws RepositoryException
repItem
- the item as it is in the repository before the updatenewValues
- the dictionary containing the updated profile propertiespropertyUpdatesVector
- a place to hold the updated properties as we recursepRequest
- the servlet's requestpResponse
- the servlet's response
RepositoryException
public boolean assumeSecurityIdentity(Profile pProfile)
pProfile
- the profile of the persona the current user is to
be associated with
pProfile
, false otherwisepublic boolean assumeSecurityIdentity(Profile pProfile, IdentityManager pIdentityManager)
pProfile
- the profile of the persona the current user is to
be associated withpIdentityManager
- the service that holds references to the
current user and the user authority needed to make the persona
association
pProfile
, false otherwisepublic boolean revokeSecurityIdentity()
userLoginManager
property of this component
public boolean revokeSecurityIdentity(IdentityManager pIdentityManager)
pIdentityManager
- the service that holds references to the
current user and the user authority needed to revoke all associated
personas
public boolean shouldSendProfileCookies(Profile pProfile)
pProfile
- the profile of the user to send the cookies topRequest
- the current requestpResponse
- the current response
cookieManager
is not null, is
configured to send cookies, and pProfile
does
not have an autoLogin property or the autoLogin property is set
to true.public boolean isValidCredentials(java.lang.String pLogin, java.lang.String pCleartextPassword)
pLogin
- the login of the person to validatepCleartextPassword
- the unencrypted password of the person
to validate
public boolean isValidCredentials(java.lang.String pLogin, java.lang.String pCleartextPassword, IdentityManager pIdentityManager)
pLogin
- the login of the person to validatepCleartextPassword
- the unencrypted password of the person
to validatepIdentityManager
- the identity manager used to validate
the given credentials
public boolean isValidCredentialsEncrypted(java.lang.String pLogin, java.lang.String pEncryptedPassword, java.lang.String pHashKey)
pLogin
- the login to validatepEncryptedPassword
- a password encrypted using the algorithm
configured by the propertyManager.passwordHasher
property,
and further encrypted with the given pHashKey
pHashKey
- the hashkey used to further encrypt a password hashed
according to the algorithm configured by
propertyManager.passwordHasher
public java.lang.Integer getSecurityStatus(Profile pProfile) throws PropertyNotFoundException
pProfile
- the profile to get the security status of
PropertyNotFoundException
public java.lang.String getLogin(RepositoryItem pProfile) throws PropertyNotFoundException
propertyManager.loginPropertyName
pProfile
- the profile to get the login of
PropertyNotFoundException
public java.lang.String getPassword(RepositoryItem pProfile) throws PropertyNotFoundException
propertyManager.passwordPropertyName
pProfile
- the profile to get the login of
PropertyNotFoundException
public java.lang.Boolean getAutoLogin(Profile pProfile) throws PropertyNotFoundException
propertyManager.autoLoginPropertyName
. This property
must be specified as a boolean in the profile repository
pProfile
- the profile to get the auto-login of
pProfile
's auto-login property.
This property must be defined as a Boolean in your profile repository.
If your repository does not define it as such, do not use this method.
PropertyNotFoundException
public void propagateLocale(Profile pProfile, atg.servlet.RequestLocale pRequestLocale, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
pProfile
- the profile whose locale will be usedpRequestLocale
- the request locale that could be altered
according to the profile's locale propertypRequest
- the current requestpResponse
- the current responsepublic MutableRepositoryItem getMutableItem(RepositoryItem pItem) throws RepositoryException
pItem
- the item to return in mutable form
pItem
in mutable form
RepositoryException
- if an error occurs trying to get
the item for updatepublic void addMultiPropertyValues(java.lang.String pPropertyName, RepositoryItem pSourceItem, RepositoryItem pTargetItem) throws PropertyNotFoundException
pPropertyName
- the name of a multi-valued property whose values
will be copied from the source user and added to the target userpSourceItem
- the user to copy values frompTargetItem
- the user to copy values to
PropertyNotFoundException
public java.util.Collection buildPropertyUpdatesForDictionary(RepositoryItem pItem, java.util.Dictionary pValues)
pItem
- the item for which the changes in the dictionary applypValues
- the value dictionary.
protected java.util.Collection buildPropertyUpdatesForRepositoryFormMap(RepositoryItem pItem, RepositoryFormMap pRepositoryFormMap)
pItem
- the item for which the changes in the map applypRepositoryFormMap
- the RepositoryFormMap.
protected java.util.Collection buildPropertyUpdatesForRepositoryFormList(RepositoryItem pItemWithMultiValuedProperty, RepositoryFormList pRepositoryFormList)
Note that ReposioryFormList is used for Sets, Lists and Object[]
pItemWithMultiValuedProperty
- the item for which has the multi-valued property that is being updated.pRepositoryFormList
- the RepositoryFormList.
public java.lang.String formatMultiValueUpdateString(java.lang.String pPropertyName, java.lang.String pKey, java.lang.Object pReferencedObject)
pPropertyName
- the property name where the object was containedpKey
- the map key. This is only used for maps.pReferencedObject
- the object referenced by the property
protected atg.userprofiling.PropertyUpdate createPropertyUpdate(int pUpdateType, java.lang.String pPropertyName, java.lang.String pOldValue, java.lang.String pNewValue)
pUpdateType
- the type of updatepPropertyName
- the property name affected by the udpatepOldValue
- the old value of the propertypNewValue
- the new value of the property
public void prefixPropertyNames(java.util.Collection pPropertyUpdates, java.lang.String pPropertyNamePrefix)
pPropertyNamePrefix
- pPropertyName
- public java.lang.String generateNewPasswordForProfile(RepositoryItem pProfile) throws RepositoryException
Updates the profile's password property.
Updates the profile's generatedPassword boolean property.
The caller is responsible for transaction demarcation.
pProfile
- the affected profile
RepositoryException
PasswordGenerator#generatePassword()
public void changePassword(RepositoryItem pProfile, java.lang.String pNewPassword, java.lang.String pConfirmNewPassword, java.lang.String pConfirmOldPassword, boolean pMustConfirmNewPassword, boolean pMustConfirmOldPassword) throws atg.userprofiling.PasswordChangeException, RepositoryException, PropertyNotFoundException
In the past the check that the new password does not match the current password was performed explicitly in the form handler's version of this method. With the move from form handler to this utility class, the method has changed so that we allow the PasswordRuleChecker's PreviousNPasswordManager to check that.
As a side effect, this method will update several user properties: previousNPasswords, generatedPassword, passwordLastUpdated
The caller is responsible for transaction demarcation, and for removing the passwordexpired flag from the session.
pProfile
- the affected profilepNewPassword
- the new password in clear textpConfirmNewPassword
- a repeat of the new password, used for confirmation if pMustConfirmNewPasswordpConfirmOldPassword
- clear text of old password, used for confirmation if pMustConfirmOldPasswordpMustConfirmNewPassword
- true if you make the user type in the new password twicepMustConfirmOldPassword
- true if you make the user type in the old password in order to change it
PasswordChangeException
- if the new password violates any of the rules of the password rule checker
RepositoryException
- if the property values can't be read or written for some reason
PropertyNotFoundException
- if the login or password properties can't be found in the profile itemPasswordGenerator#generatePassword()
public void sendEmailToUser(MutableRepositoryItem pProfile, boolean pRunInSeparateThread, boolean pPersist, TemplateEmailSender pTemplateEmailSender, TemplateEmailInfo pTemplateEmailInfo, java.util.Map pTemplateParameters) throws TemplateEmailException
pProfile
- the affected user profilepRunInSeparateThread
- determines if the email is sent in a separate threadpPersist
- determines if the email is persisted before it is sentpTemplateEmailInfo
- the template used to generate the email.pTemplateEmailSender
- the template email sender object that is used to send the templated email.pTemplateParameters
- a map of template parameters that are associated with the pTemplateEmailInfoImpl
TemplateEmailException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |