Package com.netscape.cms.profile.common
Class Profile
- java.lang.Object
-
- com.netscape.cms.profile.common.Profile
-
- Direct Known Subclasses:
EnrollProfile
public abstract class Profile extends java.lang.ObjectThis class implements a basic profile. A profile contains a list of input policies, default policies, constraint policies and output policies.The input policy is for building the enrollment page.
The default policy is for populating user-supplied and system-supplied values into the request.
The constraint policy is for validating the request before processing.
The output policy is for building the result page.
Each profile can have multiple policy set. Each set is composed of zero or more default policies and zero or more constraint policies.
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Loggerloggerprotected java.lang.StringmAuthInstanceIdprotected java.lang.StringmAuthzAclprotected IConfigStoremConfigprotected java.lang.StringmIdprotected java.util.Vector<java.lang.String>mInputIdsprotected java.util.Vector<java.lang.String>mInputNamesprotected java.util.Hashtable<java.lang.String,ProfileInput>mInputsprotected java.util.Vector<java.lang.String>mOutputIdsprotected java.util.Hashtable<java.lang.String,ProfileOutput>mOutputsprotected java.util.Hashtable<java.lang.String,java.util.Vector<ProfilePolicy>>mPolicySetprotected java.util.Vector<java.lang.String>mUpdaterIdsprotected java.util.Hashtable<java.lang.String,IProfileUpdater>mUpdatersstatic java.lang.StringPROP_CLASS_IDstatic java.lang.StringPROP_CONSTRAINTstatic java.lang.StringPROP_DEFAULTstatic java.lang.StringPROP_DESCstatic java.lang.StringPROP_ENABLEstatic java.lang.StringPROP_ENABLE_BYstatic java.lang.StringPROP_GENERIC_EXT_DEFAULTstatic java.lang.StringPROP_INPUTstatic java.lang.StringPROP_INPUT_LISTstatic java.lang.StringPROP_INSTANCE_IDstatic java.lang.StringPROP_IS_RENEWALstatic java.lang.StringPROP_NAMEstatic java.lang.StringPROP_NO_CONSTRAINTstatic java.lang.StringPROP_NO_DEFAULTstatic java.lang.StringPROP_OUTPUTstatic java.lang.StringPROP_OUTPUT_LISTstatic java.lang.StringPROP_PARAMSstatic java.lang.StringPROP_POLICY_LISTstatic java.lang.StringPROP_UPDATER_LISTstatic java.lang.StringPROP_VISIBLEstatic java.lang.StringPROP_XML_OUTPUTprotected PluginRegistryregistryprotected static LoggersignedAuditLogger
-
Constructor Summary
Constructors Constructor Description Profile()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddInputName(java.lang.String name)protected java.lang.StringauditSubjectID()Signed Audit Log Subject ID This method is used to obtain the "SubjectID" for a signed audit log message.ProfileInputcreateProfileInput(java.lang.String id, java.lang.String inputID, NameValuePairs nvps)Creates a input policy.ProfileInputcreateProfileInput(java.lang.String id, java.lang.String inputId, NameValuePairs nvps, boolean createConfig)ProfileOutputcreateProfileOutput(java.lang.String id, java.lang.String outputID, NameValuePairs nvps)Creates a output policy.ProfileOutputcreateProfileOutput(java.lang.String id, java.lang.String outputId, NameValuePairs nvps, boolean createConfig)ProfilePolicycreateProfilePolicy(java.lang.String setId, java.lang.String id, java.lang.String defaultClassId, java.lang.String constraintClassId)Creates a profile policy.ProfilePolicycreateProfilePolicy(java.lang.String setId, java.lang.String id, java.lang.String defaultClassId, java.lang.String constraintClassId, boolean createConfig)abstract IRequest[]createRequests(java.util.Map<java.lang.String,java.lang.String> ctx, java.util.Locale locale)Creates one or more requests.voiddeleteAllProfileInputs()Delete all profile inputsvoiddeleteAllProfileOutputs()Delete all profile inputsvoiddeleteAllProfilePolicies()Delete all profile policiesvoiddeleteProfileInput(java.lang.String inputId)Deletes input policy by id.voiddeleteProfileOutput(java.lang.String outputId)Deletes output policy by id.voiddeleteProfilePolicy(java.lang.String setId, java.lang.String policyId)Deletes a policy.voidexecute(IRequest request)Process a request after validation.java.lang.StringgetApprovedBy()Retrieves the user id of the person who approves this profile.java.lang.StringgetAuthenticatorId()Retrieves the instance id of the authenticator for this profile.java.lang.StringgetAuthzAcl()IConfigStoregetConfigStore()Retrieves the configuration store of this profile.java.lang.StringgetDescription(java.util.Locale locale)Returns the profile description.java.lang.StringgetId()Returns the identifier of this profile.java.lang.StringgetInput(java.lang.String name, java.util.Locale locale, IRequest request)IDescriptorgetInputDescriptor(java.lang.String name)java.util.Enumeration<java.lang.String>getInputNames()java.lang.StringgetName(java.util.Locale locale)Returns the profile name.java.util.Vector<ProfilePolicy>getPolicies(java.lang.String setId)abstract java.lang.StringgetPolicySetId(IRequest req)Retrieves a default set id for the given request.ProfileInputgetProfileInput(java.lang.String id)Retrieves input policy by id.java.util.Enumeration<java.lang.String>getProfileInputIds()Retrieves a list of input policy IDs.ProfileOutputgetProfileOutput(java.lang.String id)Retrieves output policy by id.java.util.Enumeration<java.lang.String>getProfileOutputIds()Retrieves a list of output policy IDs.java.util.Enumeration<ProfilePolicy>getProfilePolicies(java.lang.String setId)Returns a list of profile policies.ProfilePolicygetProfilePolicy(java.lang.String setId, java.lang.String id)Retrieves a policy.java.util.Enumeration<java.lang.String>getProfilePolicyIds(java.lang.String setId)Retrieves all the policy id within a set.java.util.Enumeration<java.lang.String>getProfilePolicySetIds()Returns the profile policy set identifiers.IProfileUpdatergetProfileUpdater(java.lang.String name)java.util.Enumeration<java.lang.String>getProfileUpdaterIds()java.lang.StringgetRequestorDN(IRequest request)Retrieves a localized string that represents requestor's distinguished name.abstract IRequestQueuegetRequestQueue()Retrieves the request queue that is associated with this profile.voidinit(IConfigStore config)Initializes this profile.booleanisEnable()java.lang.StringisRenewal()Is this a renewal profilebooleanisVisible()Checks if this profile is end-user profile or not.java.lang.StringisXmlOutput()is output going to be in xml?voidpopulate(IRequest request)Passes the request to the set of default policies that populate the profile information against the profile.voidpopulateInput(java.util.Map<java.lang.String,java.lang.String> ctx, IRequest request)Populates user-supplied input values into the requests.voidsetAuthenticatorId(java.lang.String id)Sets the instance id of the authenticator for this profile.voidsetAuthzAcl(java.lang.String id)voidsetDescription(java.util.Locale locale, java.lang.String desc)Returns the profile description.voidsetId(java.lang.String id)Sets id of this profile.voidsetInput(java.lang.String name, java.util.Locale locale, IRequest request, java.lang.String value)voidsetName(java.util.Locale locale, java.lang.String name)Returns the profile name.voidsetRenewal(boolean renewal)voidsetVisible(boolean v)Sets this profile end-user profile or not.voidsetXMLOutput(boolean xmlOutput)abstract voidsubmit(IAuthToken token, IRequest request)Handles end-user request submission.voidvalidate(IRequest request)Passes the request to the set of constraint policies that validate the request against the profile.
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
signedAuditLogger
protected static Logger signedAuditLogger
-
PROP_ENABLE
public static final java.lang.String PROP_ENABLE
- See Also:
- Constant Field Values
-
PROP_ENABLE_BY
public static final java.lang.String PROP_ENABLE_BY
- See Also:
- Constant Field Values
-
PROP_IS_RENEWAL
public static final java.lang.String PROP_IS_RENEWAL
- See Also:
- Constant Field Values
-
PROP_XML_OUTPUT
public static final java.lang.String PROP_XML_OUTPUT
- See Also:
- Constant Field Values
-
PROP_VISIBLE
public static final java.lang.String PROP_VISIBLE
- See Also:
- Constant Field Values
-
PROP_INPUT_LIST
public static final java.lang.String PROP_INPUT_LIST
- See Also:
- Constant Field Values
-
PROP_OUTPUT_LIST
public static final java.lang.String PROP_OUTPUT_LIST
- See Also:
- Constant Field Values
-
PROP_UPDATER_LIST
public static final java.lang.String PROP_UPDATER_LIST
- See Also:
- Constant Field Values
-
PROP_POLICY_LIST
public static final java.lang.String PROP_POLICY_LIST
- See Also:
- Constant Field Values
-
PROP_DEFAULT
public static final java.lang.String PROP_DEFAULT
- See Also:
- Constant Field Values
-
PROP_CONSTRAINT
public static final java.lang.String PROP_CONSTRAINT
- See Also:
- Constant Field Values
-
PROP_INPUT
public static final java.lang.String PROP_INPUT
- See Also:
- Constant Field Values
-
PROP_OUTPUT
public static final java.lang.String PROP_OUTPUT
- See Also:
- Constant Field Values
-
PROP_CLASS_ID
public static final java.lang.String PROP_CLASS_ID
- See Also:
- Constant Field Values
-
PROP_INSTANCE_ID
public static final java.lang.String PROP_INSTANCE_ID
- See Also:
- Constant Field Values
-
PROP_PARAMS
public static final java.lang.String PROP_PARAMS
- See Also:
- Constant Field Values
-
PROP_NAME
public static final java.lang.String PROP_NAME
- See Also:
- Constant Field Values
-
PROP_DESC
public static final java.lang.String PROP_DESC
- See Also:
- Constant Field Values
-
PROP_NO_DEFAULT
public static final java.lang.String PROP_NO_DEFAULT
- See Also:
- Constant Field Values
-
PROP_NO_CONSTRAINT
public static final java.lang.String PROP_NO_CONSTRAINT
- See Also:
- Constant Field Values
-
PROP_GENERIC_EXT_DEFAULT
public static final java.lang.String PROP_GENERIC_EXT_DEFAULT
- See Also:
- Constant Field Values
-
mConfig
protected IConfigStore mConfig
-
registry
protected PluginRegistry registry
-
mInputNames
protected java.util.Vector<java.lang.String> mInputNames
-
mInputs
protected java.util.Hashtable<java.lang.String,ProfileInput> mInputs
-
mInputIds
protected java.util.Vector<java.lang.String> mInputIds
-
mOutputs
protected java.util.Hashtable<java.lang.String,ProfileOutput> mOutputs
-
mOutputIds
protected java.util.Vector<java.lang.String> mOutputIds
-
mUpdaters
protected java.util.Hashtable<java.lang.String,IProfileUpdater> mUpdaters
-
mUpdaterIds
protected java.util.Vector<java.lang.String> mUpdaterIds
-
mAuthInstanceId
protected java.lang.String mAuthInstanceId
-
mId
protected java.lang.String mId
-
mAuthzAcl
protected java.lang.String mAuthzAcl
-
mPolicySet
protected java.util.Hashtable<java.lang.String,java.util.Vector<ProfilePolicy>> mPolicySet
-
-
Method Detail
-
isEnable
public boolean isEnable()
-
isRenewal
public java.lang.String isRenewal()
Is this a renewal profile
-
setRenewal
public void setRenewal(boolean renewal)
-
isXmlOutput
public java.lang.String isXmlOutput()
is output going to be in xml?
-
setXMLOutput
public void setXMLOutput(boolean xmlOutput)
-
getApprovedBy
public java.lang.String getApprovedBy()
Retrieves the user id of the person who approves this profile.- Returns:
- user id of the approver of this profile
-
setId
public void setId(java.lang.String id)
Sets id of this profile.- Parameters:
id- profile identifier
-
getId
public java.lang.String getId()
Returns the identifier of this profile.- Returns:
- profile id
-
getRequestorDN
public java.lang.String getRequestorDN(IRequest request)
Retrieves a localized string that represents requestor's distinguished name. This string displayed in the request listing user interface.- Parameters:
request- request- Returns:
- distringuished name of the request owner
-
getAuthenticatorId
public java.lang.String getAuthenticatorId()
Retrieves the instance id of the authenticator for this profile.- Returns:
- authenticator instance id
-
setAuthenticatorId
public void setAuthenticatorId(java.lang.String id)
Sets the instance id of the authenticator for this profile.- Parameters:
id- authenticator instance id
-
setAuthzAcl
public void setAuthzAcl(java.lang.String id)
-
getAuthzAcl
public java.lang.String getAuthzAcl()
-
init
public void init(IConfigStore config) throws EBaseException
Initializes this profile.- Parameters:
config- configuration store for this profile- Throws:
EBaseException- failed to initialize
-
getRequestQueue
public abstract IRequestQueue getRequestQueue()
Retrieves the request queue that is associated with this profile. The request queue is for creating new requests.- Returns:
- request queue
-
getConfigStore
public IConfigStore getConfigStore()
Retrieves the configuration store of this profile.- Returns:
- configuration store
-
getInputNames
public java.util.Enumeration<java.lang.String> getInputNames()
-
getProfileUpdaterIds
public java.util.Enumeration<java.lang.String> getProfileUpdaterIds()
-
getProfileUpdater
public IProfileUpdater getProfileUpdater(java.lang.String name)
-
getProfileOutputIds
public java.util.Enumeration<java.lang.String> getProfileOutputIds()
Retrieves a list of output policy IDs.- Returns:
- output policy id list
-
getProfileOutput
public ProfileOutput getProfileOutput(java.lang.String id)
Retrieves output policy by id.- Parameters:
id- output policy id- Returns:
- output policy instance
-
getProfileInputIds
public java.util.Enumeration<java.lang.String> getProfileInputIds()
Retrieves a list of input policy IDs.- Returns:
- input policy id list
-
getProfileInput
public ProfileInput getProfileInput(java.lang.String id)
Retrieves input policy by id.- Parameters:
id- input policy id- Returns:
- input policy instance
-
addInputName
public void addInputName(java.lang.String name)
-
getInputDescriptor
public IDescriptor getInputDescriptor(java.lang.String name)
-
getInput
public java.lang.String getInput(java.lang.String name, java.util.Locale locale, IRequest request) throws EProfileException- Throws:
EProfileException
-
setInput
public void setInput(java.lang.String name, java.util.Locale locale, IRequest request, java.lang.String value) throws EProfileException- Throws:
EProfileException
-
getProfilePolicySetIds
public java.util.Enumeration<java.lang.String> getProfilePolicySetIds()
Returns the profile policy set identifiers.- Returns:
- a list of policy set id
-
deleteProfilePolicy
public void deleteProfilePolicy(java.lang.String setId, java.lang.String policyId) throws EProfileExceptionDeletes a policy.- Parameters:
setId- id of the policy setpolicyId- id of policy to delete- Throws:
EProfileException- failed to delete
-
deleteAllProfilePolicies
public void deleteAllProfilePolicies() throws EProfileExceptionDelete all profile policies- Throws:
EProfileException
-
deleteProfileInput
public void deleteProfileInput(java.lang.String inputId) throws EProfileExceptionDeletes input policy by id.- Parameters:
inputId- id of the input policy- Throws:
EProfileException- failed to delete
-
deleteAllProfileInputs
public void deleteAllProfileInputs() throws EProfileExceptionDelete all profile inputs- Throws:
EProfileException
-
deleteProfileOutput
public void deleteProfileOutput(java.lang.String outputId) throws EProfileExceptionDeletes output policy by id.- Parameters:
outputId- id of the output policy- Throws:
EProfileException- failed to delete
-
deleteAllProfileOutputs
public void deleteAllProfileOutputs() throws EProfileExceptionDelete all profile inputs- Throws:
EProfileException
-
createProfileOutput
public ProfileOutput createProfileOutput(java.lang.String id, java.lang.String outputID, NameValuePairs nvps) throws EProfileException
Creates a output policy.- Parameters:
id- output policy idoutputID- id of the registered output implementationnvps- default parameters- Returns:
- output policy
- Throws:
EProfileException- failed to create
-
createProfileOutput
public ProfileOutput createProfileOutput(java.lang.String id, java.lang.String outputId, NameValuePairs nvps, boolean createConfig) throws EProfileException
- Throws:
EProfileException
-
createProfileInput
public ProfileInput createProfileInput(java.lang.String id, java.lang.String inputID, NameValuePairs nvps) throws EProfileException
Creates a input policy.- Parameters:
id- input policy idinputID- id of the registered input implementationnvps- default parameters- Returns:
- input policy
- Throws:
EProfileException- failed to create
-
createProfileInput
public ProfileInput createProfileInput(java.lang.String id, java.lang.String inputId, NameValuePairs nvps, boolean createConfig) throws EProfileException
- Throws:
EProfileException
-
createProfilePolicy
public ProfilePolicy createProfilePolicy(java.lang.String setId, java.lang.String id, java.lang.String defaultClassId, java.lang.String constraintClassId) throws EProfileException
Creates a profile policy.- Parameters:
setId- id of the policy set that owns this policyid- policy iddefaultClassId- id of the registered default implementationconstraintClassId- id of the registered constraint implementation- Returns:
- profile policy instance
- Throws:
EProfileException- failed to create policy
-
createProfilePolicy
public ProfilePolicy createProfilePolicy(java.lang.String setId, java.lang.String id, java.lang.String defaultClassId, java.lang.String constraintClassId, boolean createConfig) throws EProfileException
- Throws:
EProfileException
-
getProfilePolicy
public ProfilePolicy getProfilePolicy(java.lang.String setId, java.lang.String id)
Retrieves a policy.- Parameters:
setId- set idid- policy id- Returns:
- profile policy
-
isVisible
public boolean isVisible()
Checks if this profile is end-user profile or not. End-user profile will be displayed to the end user. Non end-user profile mainly is for registration manager.- Returns:
- end-user profile or not
-
setVisible
public void setVisible(boolean v)
Sets this profile end-user profile or not.- Parameters:
v- end-user profile or not
-
getName
public java.lang.String getName(java.util.Locale locale)
Returns the profile name.- Parameters:
locale- end-user locale- Returns:
- localized profile name
-
setName
public void setName(java.util.Locale locale, java.lang.String name)Returns the profile name.- Parameters:
locale- end-user localename- profile name
-
createRequests
public abstract IRequest[] createRequests(java.util.Map<java.lang.String,java.lang.String> ctx, java.util.Locale locale) throws java.lang.Exception
Creates one or more requests. Normally, only one request will be created. In case of CRMF request, multiple requests may be created for one submission.- Parameters:
ctx- profile contextlocale- user locale- Returns:
- a list of requests
- Throws:
java.lang.Exception- failed to create requests
-
getDescription
public java.lang.String getDescription(java.util.Locale locale)
Returns the profile description.- Parameters:
locale- end-user locale- Returns:
- localized profile description
-
setDescription
public void setDescription(java.util.Locale locale, java.lang.String desc)Returns the profile description.- Parameters:
locale- end-user localedesc- profile description
-
populateInput
public void populateInput(java.util.Map<java.lang.String,java.lang.String> ctx, IRequest request) throws java.lang.ExceptionPopulates user-supplied input values into the requests.- Parameters:
ctx- profile contextrequest- request- Throws:
java.lang.Exception- failed to populate
-
getPolicies
public java.util.Vector<ProfilePolicy> getPolicies(java.lang.String setId)
-
getPolicySetId
public abstract java.lang.String getPolicySetId(IRequest req)
Retrieves a default set id for the given request. It is the profile's responsibility to return an appropriate set id for the request.- Parameters:
req- request- Returns:
- policy set id
-
populate
public void populate(IRequest request) throws EProfileException
Passes the request to the set of default policies that populate the profile information against the profile.- Parameters:
request- request- Throws:
EProfileException- failed to populate default values
-
validate
public void validate(IRequest request) throws ERejectException
Passes the request to the set of constraint policies that validate the request against the profile.- Parameters:
request- request- Throws:
ERejectException- validation violation
-
getProfilePolicies
public java.util.Enumeration<ProfilePolicy> getProfilePolicies(java.lang.String setId)
Returns a list of profile policies.- Parameters:
setId- set id- Returns:
- a list of policies
-
getProfilePolicyIds
public java.util.Enumeration<java.lang.String> getProfilePolicyIds(java.lang.String setId)
Retrieves all the policy id within a set.- Parameters:
setId- set id- Returns:
- a list of policy id
-
execute
public void execute(IRequest request) throws EProfileException
Process a request after validation.- Parameters:
request- request to be processed- Throws:
EProfileException- failed to process
-
submit
public abstract void submit(IAuthToken token, IRequest request) throws EDeferException, EProfileException
Handles end-user request submission.- Parameters:
token- authentication tokenrequest- request to be processed- Throws:
EDeferException- defer requestEProfileException- failed to submit
-
auditSubjectID
protected java.lang.String auditSubjectID()
Signed Audit Log Subject ID This method is used to obtain the "SubjectID" for a signed audit log message.- Returns:
- id string containing the signed audit log message SubjectID
-
-