Package com.netscape.cms.profile.common
Class BasicProfile
- java.lang.Object
-
- com.netscape.cms.profile.common.BasicProfile
-
- All Implemented Interfaces:
IProfile
- Direct Known Subclasses:
EnrollProfile
public abstract class BasicProfile extends java.lang.Object implements IProfile
This class implements a basic profile.- Version:
- $Revision$, $Date$
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
mAuthInstanceId
protected java.lang.String
mAuthzAcl
protected IConfigStore
mConfig
protected java.lang.String
mId
protected java.util.Vector<java.lang.String>
mInputIds
protected java.util.Vector<java.lang.String>
mInputNames
protected java.util.Hashtable<java.lang.String,IProfileInput>
mInputs
protected java.util.Vector<java.lang.String>
mOutputIds
protected java.util.Hashtable<java.lang.String,IProfileOutput>
mOutputs
protected IProfileSubsystem
mOwner
protected java.util.Hashtable<java.lang.String,java.util.Vector<IProfilePolicy>>
mPolicySet
protected IPluginRegistry
mRegistry
protected java.util.Vector<java.lang.String>
mUpdaterIds
protected java.util.Hashtable<java.lang.String,IProfileUpdater>
mUpdaters
static java.lang.String
PROP_CLASS_ID
static java.lang.String
PROP_CONSTRAINT
static java.lang.String
PROP_DEFAULT
static java.lang.String
PROP_DESC
static java.lang.String
PROP_ENABLE
static java.lang.String
PROP_ENABLE_BY
static java.lang.String
PROP_GENERIC_EXT_DEFAULT
static java.lang.String
PROP_INPUT
static java.lang.String
PROP_INPUT_LIST
static java.lang.String
PROP_INSTANCE_ID
static java.lang.String
PROP_IS_RENEWAL
static java.lang.String
PROP_NAME
static java.lang.String
PROP_NO_CONSTRAINT
static java.lang.String
PROP_NO_DEFAULT
static java.lang.String
PROP_OUTPUT
static java.lang.String
PROP_OUTPUT_LIST
static java.lang.String
PROP_PARAMS
static java.lang.String
PROP_POLICY_LIST
static java.lang.String
PROP_UPDATER_LIST
static java.lang.String
PROP_VISIBLE
static java.lang.String
PROP_XML_OUTPUT
protected static Logger
signedAuditLogger
-
Constructor Summary
Constructors Constructor Description BasicProfile()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addInputName(java.lang.String name)
protected java.lang.String
auditSubjectID()
Signed Audit Log Subject ID This method is inherited by all extended "BasicProfile"s, and is called to obtain the "SubjectID" for a signed audit log message.abstract IProfileContext
createContext()
Retrieves profile context.IProfileInput
createProfileInput(java.lang.String id, java.lang.String inputId, NameValuePairs nvps)
Creates a input policy.IProfileInput
createProfileInput(java.lang.String id, java.lang.String inputId, NameValuePairs nvps, boolean createConfig)
IProfileOutput
createProfileOutput(java.lang.String id, java.lang.String outputId, NameValuePairs nvps)
Creates a output policy.IProfileOutput
createProfileOutput(java.lang.String id, java.lang.String outputId, NameValuePairs nvps, boolean createConfig)
IProfilePolicy
createProfilePolicy(java.lang.String setId, java.lang.String id, java.lang.String defaultClassId, java.lang.String constraintClassId)
Creates a profile policyIProfilePolicy
createProfilePolicy(java.lang.String setId, java.lang.String id, java.lang.String defaultClassId, java.lang.String constraintClassId, boolean createConfig)
abstract IRequest[]
createRequests(IProfileContext ctx, java.util.Locale locale)
Creates request.void
deleteAllProfileInputs()
Delete all profile inputsvoid
deleteAllProfileOutputs()
Delete all profile inputsvoid
deleteAllProfilePolicies()
Delete all profile policiesvoid
deleteProfileInput(java.lang.String inputId)
Deletes input policy by id.void
deleteProfileOutput(java.lang.String outputId)
Deletes output policy by id.void
deleteProfilePolicy(java.lang.String setId, java.lang.String policyId)
Deletes a policy.void
execute(IRequest request)
Process a request after validation.java.lang.String
getApprovedBy()
Retrieves the user id of the person who approves this profile.IProfileAuthenticator
getAuthenticator()
Retrieves the associated authenticator instance.java.lang.String
getAuthenticatorId()
Retrieves the instance id of the authenticator for this profile.java.lang.String
getAuthzAcl()
IConfigStore
getConfigStore()
Retrieves the configuration store of this profile.java.lang.String
getDescription(java.util.Locale locale)
Returns the profile description.java.lang.String
getId()
Returns the identifier of this profile.java.lang.String
getInput(java.lang.String name, java.util.Locale locale, IRequest request)
IDescriptor
getInputDescriptor(java.lang.String name)
java.util.Enumeration<java.lang.String>
getInputNames()
java.lang.String
getName(java.util.Locale locale)
Returns the profile name.java.util.Vector<IProfilePolicy>
getPolicies(java.lang.String setId)
IProfileInput
getProfileInput(java.lang.String name)
Retrieves input policy by id.java.util.Enumeration<java.lang.String>
getProfileInputIds()
Retrieves a list of input policy IDs.IProfileOutput
getProfileOutput(java.lang.String name)
Retrieves output policy by id.java.util.Enumeration<java.lang.String>
getProfileOutputIds()
Retrieves a list of output policy IDs.java.util.Enumeration<IProfilePolicy>
getProfilePolicies(java.lang.String setId)
Returns a list of profile policies.IProfilePolicy
getProfilePolicy(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.IProfileUpdater
getProfileUpdater(java.lang.String name)
java.util.Enumeration<java.lang.String>
getProfileUpdaterIds()
java.lang.String
getRequestorDN(IRequest request)
Retrieves a localized string that represents requestor's distinguished name.void
init(IProfileSubsystem owner, IConfigStore config)
Initializes this profile.boolean
isEnable()
java.lang.String
isRenewal()
boolean
isVisible()
Checks if this profile is end-user profile or not.java.lang.String
isXmlOutput()
void
populate(IRequest request)
Passes the request to the set of default policies that populate the profile information against the profile.void
populateInput(IProfileContext ctx, IRequest request)
Populates user-supplied input values into the requests.void
setAuthenticatorId(java.lang.String id)
Sets the instance id of the authenticator for this profile.void
setAuthzAcl(java.lang.String id)
void
setDescription(java.util.Locale locale, java.lang.String desc)
Returns the profile description.void
setId(java.lang.String id)
Sets id of this profile.void
setInput(java.lang.String name, java.util.Locale locale, IRequest request, java.lang.String value)
void
setName(java.util.Locale locale, java.lang.String name)
Returns the profile name.void
setRenewal(boolean renewal)
void
setVisible(boolean v)
Sets this profile end-user profile or not.void
setXMLOutput(boolean xmlOutput)
void
validate(IRequest request)
Passes the request to the set of constraint policies that validate the request against the profile.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.netscape.certsrv.profile.IProfile
getPolicySetId, getRequestQueue, submit
-
-
-
-
Field Detail
-
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
-
mOwner
protected IProfileSubsystem mOwner
-
mConfig
protected IConfigStore mConfig
-
mRegistry
protected IPluginRegistry mRegistry
-
mInputNames
protected java.util.Vector<java.lang.String> mInputNames
-
mInputs
protected java.util.Hashtable<java.lang.String,IProfileInput> mInputs
-
mInputIds
protected java.util.Vector<java.lang.String> mInputIds
-
mOutputs
protected java.util.Hashtable<java.lang.String,IProfileOutput> 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<IProfilePolicy>> mPolicySet
-
-
Method Detail
-
isEnable
public boolean isEnable()
-
setRenewal
public void setRenewal(boolean renewal)
- Specified by:
setRenewal
in interfaceIProfile
-
isXmlOutput
public java.lang.String isXmlOutput()
- Specified by:
isXmlOutput
in interfaceIProfile
-
setXMLOutput
public void setXMLOutput(boolean xmlOutput)
- Specified by:
setXMLOutput
in interfaceIProfile
-
getApprovedBy
public java.lang.String getApprovedBy()
Description copied from interface:IProfile
Retrieves the user id of the person who approves this profile.- Specified by:
getApprovedBy
in interfaceIProfile
- Returns:
- user id of the approver of this profile
-
setId
public void setId(java.lang.String id)
Description copied from interface:IProfile
Sets id of this profile.
-
getId
public java.lang.String getId()
Description copied from interface:IProfile
Returns the identifier of this profile.
-
getAuthenticator
public IProfileAuthenticator getAuthenticator() throws EProfileException
Description copied from interface:IProfile
Retrieves the associated authenticator instance.- Specified by:
getAuthenticator
in interfaceIProfile
- Returns:
- profile authenticator instance. if no associated authenticator, null is returned
- Throws:
EProfileException
- failed to retrieve
-
getRequestorDN
public java.lang.String getRequestorDN(IRequest request)
Description copied from interface:IProfile
Retrieves a localized string that represents requestor's distinguished name. This string displayed in the request listing user interface.- Specified by:
getRequestorDN
in interfaceIProfile
- Parameters:
request
- request- Returns:
- distringuished name of the request owner
-
getAuthenticatorId
public java.lang.String getAuthenticatorId()
Description copied from interface:IProfile
Retrieves the instance id of the authenticator for this profile.- Specified by:
getAuthenticatorId
in interfaceIProfile
- Returns:
- authenticator instance id
-
setAuthenticatorId
public void setAuthenticatorId(java.lang.String id)
Description copied from interface:IProfile
Sets the instance id of the authenticator for this profile.- Specified by:
setAuthenticatorId
in interfaceIProfile
- Parameters:
id
- authenticator instance id
-
setAuthzAcl
public void setAuthzAcl(java.lang.String id)
- Specified by:
setAuthzAcl
in interfaceIProfile
-
getAuthzAcl
public java.lang.String getAuthzAcl()
- Specified by:
getAuthzAcl
in interfaceIProfile
-
init
public void init(IProfileSubsystem owner, IConfigStore config) throws EBaseException
Initializes this profile.- Specified by:
init
in interfaceIProfile
- Parameters:
owner
- profile subsystemconfig
- configuration store for this profile- Throws:
EBaseException
- failed to initialize
-
getConfigStore
public IConfigStore getConfigStore()
Description copied from interface:IProfile
Retrieves the configuration store of this profile.- Specified by:
getConfigStore
in interfaceIProfile
- 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()
Description copied from interface:IProfile
Retrieves a list of output policy IDs.- Specified by:
getProfileOutputIds
in interfaceIProfile
- Returns:
- output policy id list
-
getProfileOutput
public IProfileOutput getProfileOutput(java.lang.String name)
Description copied from interface:IProfile
Retrieves output policy by id.- Specified by:
getProfileOutput
in interfaceIProfile
- Parameters:
name
- output policy id- Returns:
- output policy instance
-
getProfileInputIds
public java.util.Enumeration<java.lang.String> getProfileInputIds()
Description copied from interface:IProfile
Retrieves a list of input policy IDs.- Specified by:
getProfileInputIds
in interfaceIProfile
- Returns:
- input policy id list
-
getProfileInput
public IProfileInput getProfileInput(java.lang.String name)
Description copied from interface:IProfile
Retrieves input policy by id.- Specified by:
getProfileInput
in interfaceIProfile
- Parameters:
name
- 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()
Description copied from interface:IProfile
Returns the profile policy set identifiers.- Specified by:
getProfilePolicySetIds
in interfaceIProfile
- Returns:
- a list of policy set id
-
deleteProfilePolicy
public void deleteProfilePolicy(java.lang.String setId, java.lang.String policyId) throws EProfileException
Description copied from interface:IProfile
Deletes a policy.- Specified by:
deleteProfilePolicy
in interfaceIProfile
- Parameters:
setId
- id of the policy setpolicyId
- id of policy to delete- Throws:
EProfileException
- failed to delete
-
deleteAllProfilePolicies
public void deleteAllProfilePolicies() throws EProfileException
Description copied from interface:IProfile
Delete all profile policies- Specified by:
deleteAllProfilePolicies
in interfaceIProfile
- Throws:
EProfileException
-
deleteProfileInput
public void deleteProfileInput(java.lang.String inputId) throws EProfileException
Description copied from interface:IProfile
Deletes input policy by id.- Specified by:
deleteProfileInput
in interfaceIProfile
- Parameters:
inputId
- id of the input policy- Throws:
EProfileException
- failed to delete
-
deleteAllProfileInputs
public void deleteAllProfileInputs() throws EProfileException
Description copied from interface:IProfile
Delete all profile inputs- Specified by:
deleteAllProfileInputs
in interfaceIProfile
- Throws:
EProfileException
-
deleteProfileOutput
public void deleteProfileOutput(java.lang.String outputId) throws EProfileException
Description copied from interface:IProfile
Deletes output policy by id.- Specified by:
deleteProfileOutput
in interfaceIProfile
- Parameters:
outputId
- id of the output policy- Throws:
EProfileException
- failed to delete
-
deleteAllProfileOutputs
public void deleteAllProfileOutputs() throws EProfileException
Description copied from interface:IProfile
Delete all profile inputs- Specified by:
deleteAllProfileOutputs
in interfaceIProfile
- Throws:
EProfileException
-
createProfileOutput
public IProfileOutput createProfileOutput(java.lang.String id, java.lang.String outputId, NameValuePairs nvps) throws EProfileException
Description copied from interface:IProfile
Creates a output policy.- Specified by:
createProfileOutput
in interfaceIProfile
- Parameters:
id
- output policy idoutputId
- id of the registered output implementationnvps
- default parameters- Returns:
- output policy
- Throws:
EProfileException
- failed to create
-
createProfileOutput
public IProfileOutput createProfileOutput(java.lang.String id, java.lang.String outputId, NameValuePairs nvps, boolean createConfig) throws EProfileException
- Throws:
EProfileException
-
createProfileInput
public IProfileInput createProfileInput(java.lang.String id, java.lang.String inputId, NameValuePairs nvps) throws EProfileException
Description copied from interface:IProfile
Creates a input policy.- Specified by:
createProfileInput
in interfaceIProfile
- Parameters:
id
- input policy idinputId
- id of the registered input implementationnvps
- default parameters- Returns:
- input policy
- Throws:
EProfileException
- failed to create
-
createProfileInput
public IProfileInput createProfileInput(java.lang.String id, java.lang.String inputId, NameValuePairs nvps, boolean createConfig) throws EProfileException
- Throws:
EProfileException
-
createProfilePolicy
public IProfilePolicy createProfilePolicy(java.lang.String setId, java.lang.String id, java.lang.String defaultClassId, java.lang.String constraintClassId) throws EProfileException
Creates a profile policy- Specified by:
createProfilePolicy
in interfaceIProfile
- 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 IProfilePolicy 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 IProfilePolicy getProfilePolicy(java.lang.String setId, java.lang.String id)
Description copied from interface:IProfile
Retrieves a policy.- Specified by:
getProfilePolicy
in interfaceIProfile
- Parameters:
setId
- set idid
- policy id- Returns:
- profile policy
-
isVisible
public boolean isVisible()
Description copied from interface:IProfile
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.
-
setVisible
public void setVisible(boolean v)
Description copied from interface:IProfile
Sets this profile end-user profile or not.- Specified by:
setVisible
in interfaceIProfile
- Parameters:
v
- end-user profile or not
-
getName
public java.lang.String getName(java.util.Locale locale)
Returns the profile name.
-
setName
public void setName(java.util.Locale locale, java.lang.String name)
Description copied from interface:IProfile
Returns the profile name.
-
createContext
public abstract IProfileContext createContext()
Description copied from interface:IProfile
Retrieves profile context. The context stores information about the requestor before the actual request is created.- Specified by:
createContext
in interfaceIProfile
- Returns:
- profile context.
-
createRequests
public abstract IRequest[] createRequests(IProfileContext ctx, java.util.Locale locale) throws EProfileException
Creates request.- Specified by:
createRequests
in interfaceIProfile
- Parameters:
ctx
- profile contextlocale
- user locale- Returns:
- a list of requests
- Throws:
EProfileException
- failed to create requests
-
getDescription
public java.lang.String getDescription(java.util.Locale locale)
Returns the profile description.- Specified by:
getDescription
in interfaceIProfile
- Parameters:
locale
- end-user locale- Returns:
- localized profile description
-
setDescription
public void setDescription(java.util.Locale locale, java.lang.String desc)
Description copied from interface:IProfile
Returns the profile description.- Specified by:
setDescription
in interfaceIProfile
- Parameters:
locale
- end-user localedesc
- profile description
-
populateInput
public void populateInput(IProfileContext ctx, IRequest request) throws EProfileException
Description copied from interface:IProfile
Populates user-supplied input values into the requests.- Specified by:
populateInput
in interfaceIProfile
- Parameters:
ctx
- profile contextrequest
- request- Throws:
EProfileException
- failed to populate
-
getPolicies
public java.util.Vector<IProfilePolicy> getPolicies(java.lang.String setId)
-
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.- Specified by:
populate
in interfaceIProfile
- 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.- Specified by:
validate
in interfaceIProfile
- Parameters:
request
- request- Throws:
ERejectException
- validation violation
-
getProfilePolicies
public java.util.Enumeration<IProfilePolicy> getProfilePolicies(java.lang.String setId)
Description copied from interface:IProfile
Returns a list of profile policies.- Specified by:
getProfilePolicies
in interfaceIProfile
- Parameters:
setId
- set id- Returns:
- a list of policies
-
getProfilePolicyIds
public java.util.Enumeration<java.lang.String> getProfilePolicyIds(java.lang.String setId)
Description copied from interface:IProfile
Retrieves all the policy id within a set.- Specified by:
getProfilePolicyIds
in interfaceIProfile
- Parameters:
setId
- set id- Returns:
- a list of policy id
-
execute
public void execute(IRequest request) throws EProfileException
Description copied from interface:IProfile
Process a request after validation.- Specified by:
execute
in interfaceIProfile
- Parameters:
request
- request to be processed- Throws:
EProfileException
- failed to process
-
auditSubjectID
protected java.lang.String auditSubjectID()
Signed Audit Log Subject ID This method is inherited by all extended "BasicProfile"s, and is called to obtain the "SubjectID" for a signed audit log message.- Returns:
- id string containing the signed audit log message SubjectID
-
-