com.netscape.cms.profile.common
Class BasicProfile

java.lang.Object
  extended by 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: 1806 $, $Date: 2011-02-01 14:12:56 -0800 (Tue, 01 Feb 2011) $

Field Summary
protected  IProfileAuthenticator mAuthenticator
           
protected  java.lang.String mAuthInstanceId
           
protected  java.lang.String mAuthzAcl
           
protected  IConfigStore mConfig
           
protected  java.lang.String mId
           
protected  java.util.Vector mInputIds
           
protected  java.util.Vector mInputNames
           
protected  java.util.Hashtable mInputs
           
protected  java.util.Vector mOutputIds
           
protected  java.util.Hashtable mOutputs
           
protected  IProfileSubsystem mOwner
           
protected  java.util.Hashtable mPolicySet
           
protected  IPluginRegistry mRegistry
           
protected  ILogger mSignedAuditLogger
           
protected  java.util.Vector mUpdaterIds
           
protected  java.util.Hashtable 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
           
 
Constructor Summary
BasicProfile()
           
 
Method Summary
 void addInputName(java.lang.String name)
           
protected  void audit(java.lang.String msg)
          Signed Audit Log This method is inherited by all extended "BasicProfile"s, and is called to store messages to the signed audit log.
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 policy
 IProfilePolicy 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 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 getInputNames()
           
 java.lang.String getName(java.util.Locale locale)
          Returns the profile name.
 java.util.Vector getPolicies(java.lang.String setId)
           
 IProfileInput getProfileInput(java.lang.String name)
          Retrieves input policy by id.
 java.util.Enumeration getProfileInputIds()
          Retrieves a list of input policy IDs.
 IProfileOutput getProfileOutput(java.lang.String name)
          Retrieves output policy by id.
 java.util.Enumeration getProfileOutputIds()
          Retrieves a list of output policy IDs.
 java.util.Enumeration 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 getProfilePolicyIds(java.lang.String setId)
          Retrieves all the policy id within a set.
 java.util.Enumeration getProfilePolicySetIds()
          Returns the profile policy set identifiers.
 IProfileUpdater getProfileUpdater(java.lang.String name)
           
 java.util.Enumeration 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 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 setVisible(boolean v)
          Sets this profile end-user profile or not.
 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

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 mInputNames

mInputs

protected java.util.Hashtable mInputs

mInputIds

protected java.util.Vector mInputIds

mOutputs

protected java.util.Hashtable mOutputs

mOutputIds

protected java.util.Vector mOutputIds

mUpdaters

protected java.util.Hashtable mUpdaters

mUpdaterIds

protected java.util.Vector mUpdaterIds

mAuthenticator

protected IProfileAuthenticator mAuthenticator

mAuthInstanceId

protected java.lang.String mAuthInstanceId

mId

protected java.lang.String mId

mAuthzAcl

protected java.lang.String mAuthzAcl

mPolicySet

protected java.util.Hashtable mPolicySet

mSignedAuditLogger

protected ILogger mSignedAuditLogger
Constructor Detail

BasicProfile

public BasicProfile()
Method Detail

isEnable

public boolean isEnable()

isRenewal

public java.lang.String isRenewal()
Specified by:
isRenewal in interface IProfile

isXmlOutput

public java.lang.String isXmlOutput()
Specified by:
isXmlOutput in interface IProfile

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 interface IProfile
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.

Specified by:
setId in interface IProfile
Parameters:
id - profile identifier

getId

public java.lang.String getId()
Description copied from interface: IProfile
Returns the identifier of this profile.

Specified by:
getId in interface IProfile
Returns:
profile id

getAuthenticator

public IProfileAuthenticator getAuthenticator()
                                       throws EProfileException
Description copied from interface: IProfile
Retrieves the associated authenticator instance.

Specified by:
getAuthenticator in interface IProfile
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 interface IProfile
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 interface IProfile
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 interface IProfile
Parameters:
id - authenticator instance id

getAuthzAcl

public java.lang.String getAuthzAcl()
Specified by:
getAuthzAcl in interface IProfile

init

public void init(IProfileSubsystem owner,
                 IConfigStore config)
          throws EBaseException
Initializes this profile.

Specified by:
init in interface IProfile
Parameters:
owner - profile subsystem
config - 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 interface IProfile
Returns:
configuration store

getInputNames

public java.util.Enumeration getInputNames()

getProfileUpdaterIds

public java.util.Enumeration getProfileUpdaterIds()

getProfileUpdater

public IProfileUpdater getProfileUpdater(java.lang.String name)

getProfileOutputIds

public java.util.Enumeration getProfileOutputIds()
Description copied from interface: IProfile
Retrieves a list of output policy IDs.

Specified by:
getProfileOutputIds in interface IProfile
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 interface IProfile
Parameters:
name - output policy id
Returns:
output policy instance

getProfileInputIds

public java.util.Enumeration getProfileInputIds()
Description copied from interface: IProfile
Retrieves a list of input policy IDs.

Specified by:
getProfileInputIds in interface IProfile
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 interface IProfile
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 getProfilePolicySetIds()
Description copied from interface: IProfile
Returns the profile policy set identifiers.

Specified by:
getProfilePolicySetIds in interface IProfile
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 interface IProfile
Parameters:
setId - id of the policy set
policyId - id of policy to delete
Throws:
EProfileException - failed to delete

deleteProfileInput

public void deleteProfileInput(java.lang.String inputId)
                        throws EProfileException
Description copied from interface: IProfile
Deletes input policy by id.

Specified by:
deleteProfileInput in interface IProfile
Parameters:
inputId - id of the input policy
Throws:
EProfileException - failed to delete

deleteProfileOutput

public void deleteProfileOutput(java.lang.String outputId)
                         throws EProfileException
Description copied from interface: IProfile
Deletes output policy by id.

Specified by:
deleteProfileOutput in interface IProfile
Parameters:
outputId - id of the output policy
Throws:
EProfileException - failed to delete

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 interface IProfile
Parameters:
id - output policy id
outputId - id of the registered output implementation
nvps - 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 interface IProfile
Parameters:
id - input policy id
inputId - id of the registered input implementation
nvps - 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 interface IProfile
Parameters:
setId - id of the policy set that owns this policy
id - policy id
defaultClassId - id of the registered default implementation
constraintClassId - 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 interface IProfile
Parameters:
setId - set id
id - 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.

Specified by:
isVisible in interface IProfile
Returns:
end-user profile or not

setVisible

public void setVisible(boolean v)
Description copied from interface: IProfile
Sets this profile end-user profile or not.

Specified by:
setVisible in interface IProfile
Parameters:
v - end-user profile or not

getName

public java.lang.String getName(java.util.Locale locale)
Returns the profile name.

Specified by:
getName in interface IProfile
Parameters:
locale - end-user locale
Returns:
localized profile name

setName

public void setName(java.util.Locale locale,
                    java.lang.String name)
Description copied from interface: IProfile
Returns the profile name.

Specified by:
setName in interface IProfile
Parameters:
locale - end-user locale
name - 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 interface IProfile
Returns:
profile context.

createRequests

public abstract IRequest[] createRequests(IProfileContext ctx,
                                          java.util.Locale locale)
                                   throws EProfileException
Creates request.

Specified by:
createRequests in interface IProfile
Parameters:
ctx - profile context
locale - 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 interface IProfile
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 interface IProfile
Parameters:
locale - end-user locale
desc - 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 interface IProfile
Parameters:
ctx - profile context
request - request
Throws:
EProfileException - failed to populate

getPolicies

public java.util.Vector 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 interface IProfile
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 interface IProfile
Parameters:
request - request
Throws:
ERejectException - validation violation

getProfilePolicies

public java.util.Enumeration getProfilePolicies(java.lang.String setId)
Description copied from interface: IProfile
Returns a list of profile policies.

Specified by:
getProfilePolicies in interface IProfile
Parameters:
setId - set id
Returns:
a list of policies

getProfilePolicyIds

public java.util.Enumeration getProfilePolicyIds(java.lang.String setId)
Description copied from interface: IProfile
Retrieves all the policy id within a set.

Specified by:
getProfilePolicyIds in interface IProfile
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 interface IProfile
Parameters:
request - request to be processed
Throws:
EProfileException - failed to process

audit

protected void audit(java.lang.String msg)
Signed Audit Log This method is inherited by all extended "BasicProfile"s, and is called to store messages to the signed audit log.

Parameters:
msg - signed audit log message

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