| java.lang.Object com.jcorporate.expresso.services.validation.ValidationEntry
ValidationEntry | public class ValidationEntry implements Serializable(Code) | | This class abstracts the storing of the data that goes along with any
particular validation operation. This class also provides functions for a
validation request to be created in the first place. In this first
incarnation, this class stores all the data using DBObjects. If warranted
at a later time, the ideal way to change the functionality by making this
class abstract and then implementing DBValidationEntry and
XMLValidationEntry or whatever. Most of the methods in this class are
"protected", so that minor changes can be handled by simply extending this
class and overridining the necessary methods.
author: Shash Chatterjee version: $Revision: 1.25 $ $Date: 2004/11/17 20:48:22 $ since: Expresso 4.0 |
Constructor Summary | |
public | ValidationEntry(String newDbName) This constructor is used by classes that submit a validation request
into the system. | public | ValidationEntry(String dbName, String id) This constructor is used, after a validation request comes in, to
resurrect a validation entry from the DB. | public | ValidationEntry(String context, List paramsVector, JobQueue jq) This constructor is used by the validation job to create a validation
entry from the job parameters. |
AVAILABLE | final public static String AVAILABLE(Code) | | Status for available
|
EXPIRED | final public static String EXPIRED(Code) | | Status for Expired
|
PRM_EXPIRES_AFTER | final public static String PRM_EXPIRES_AFTER(Code) | | PArameter for 'Expires After'
|
PRM_VALIDATOR | final public static String PRM_VALIDATOR(Code) | | Parameter for validator
|
PRM_VAL_CTX | final public static String PRM_VAL_CTX(Code) | | Parameter for 'Validation webapp context'
|
PRM_VAL_DESC | final public static String PRM_VAL_DESC(Code) | | Parameter for 'Validation Description'
|
PRM_VAL_PORT | final public static String PRM_VAL_PORT(Code) | | Parameter for 'Validation Port'
|
PRM_VAL_SERVER | final public static String PRM_VAL_SERVER(Code) | | Parameter for 'Validation Server'
|
PRM_VAL_TITLE | final public static String PRM_VAL_TITLE(Code) | | Parameter for 'Validation Title'
|
SESSION_KEY | final public static String SESSION_KEY(Code) | | Session validation key
|
VALIDATED | final public static String VALIDATED(Code) | | Status for Validated
|
WAITING | final public static String WAITING(Code) | | Status for waiting
|
dataContext | protected String dataContext(Code) | | default data context
|
expiresAfter | protected String expiresAfter(Code) | | Time it expires after
|
jobClassName | protected String jobClassName(Code) | | The Job class name
|
paramNum | protected int paramNum(Code) | | current parameter number
|
valContextPath | protected String valContextPath(Code) | | The validation context path
|
valDesc | protected String valDesc(Code) | | The default description
|
valServer | protected String valServer(Code) | | The validation server
|
valTitle | protected String valTitle(Code) | | The validation job title
|
validationClassName | protected String validationClassName(Code) | | The validator class name
|
ValidationEntry | public ValidationEntry(String newDbName) throws AuthValidationException(Code) | | This constructor is used by classes that submit a validation request
into the system. It creates a Job Queue Entry for the validation
request. Application specific parameters are added using the
addParam(...) method, and the request finally committed using the
submit(...) method. Creation date: (9/23/2001 9:41:06 PM) Author: Shash
Chatterjee
Parameters: newDbName - newDbName The database context to create the validationJob/Entry in. |
ValidationEntry | public ValidationEntry(String dbName, String id) throws AuthValidationException(Code) | | This constructor is used, after a validation request comes in, to
resurrect a validation entry from the DB. Creation date: (9/23/2001
9:41:06 PM) Author: Shash Chatterjee
Parameters: dbName - dbName The DB context to retrieve the validation entryfrom Parameters: id - id The validation request id/seq. number throws: AuthValidationException - AuthValidationException |
ValidationEntry | public ValidationEntry(String context, List paramsVector, JobQueue jq) throws AuthValidationException(Code) | | This constructor is used by the validation job to create a validation
entry from the job parameters. Application classes should have no need
to use this class/ Creation date: (9/23/2001 9:41:06 PM) Author: Shash
Chatterjee
Parameters: context - context The DB context to use for the validation entry Parameters: paramsVector - paramsVector All the params passed in to the job Parameters: jq - jq The job queue entry in its entirety throws: AuthValidationException - AuthValidationException |
addParam | public void addParam(String name, String value) throws AuthValidationException(Code) | | Adds an application specific parameter into the validation entry
Creation date: (9/23/2001 9:41:06 PM) Author: Shash Chatterjee
Parameters: name - name Name of the parameter Parameters: value - value Value of the parameter |
codeMatches | public boolean codeMatches(String code) throws AuthValidationException(Code) | | Function to match the code in the DB versus the code in the request.
Creation date: (9/23/2001 9:41:06 PM) Author: Shash Chatterjee
Parameters: code - code Code in the request URL true if code matches, false otherwise throws: AuthValidationException - AuthValidationException |
createValidationCode | protected static String createValidationCode()(Code) | | Create a cryptographically sound validation code for use in the
validation operation [Currently generates a 256-bit random number]
Creation date: (9/23/2001 9:41:06 PM) Author: Shash Chatterjee,
strengthened by Mike Rimov
The validation code |
expiresAfter | public void expiresAfter(int hr, int min, int sec)(Code) | | Method to set the time delta from current time when the request will
expire if unused Creation date: (9/23/2001 9:41:06 PM) Author: Shash
Chatterjee
Parameters: hr - hr Delta hours Parameters: min - min Delta minutes Parameters: sec - sec Delta seconds |
getExpiresAt | public Date getExpiresAt() throws AuthValidationException(Code) | | Method to retrieve the absolute date/time when the request expires.
Creation date: (9/23/2001 9:41:06 PM) Author: Shash Chatterjee
The expiry date/time |
getParams | public Hashtable getParams() throws AuthValidationException(Code) | | Method to return all the application-specific parameters associated with
this validation request Creation date: (9/23/2001 9:41:06 PM) Author:
Shash Chatterjee
Hashtable of all the parameters, keyed by parameter name |
getStatus | public String getStatus() throws AuthValidationException(Code) | | Returns the current status of the validation request Creation date:
(9/23/2001 9:41:06 PM) Author: Shash Chatterjee
"N","A","V","E" - for "new", "available", "validated", "expired" throws: AuthValidationException - AuthValidationException |
notifyByEmail | public static void notifyByEmail(String dbName, String from, Vector addresses, String subject, String content) throws AuthValidationException(Code) | | Insert the method's description here. Creation date: (9/23/2001 9:41:06
PM) Author: Shash Chatterjee
Parameters: dbName - The data context to use Parameters: from - the "From" email field. Parameters: addresses - the email addresses to notify Parameters: subject - the subject of the email Parameters: content - The body of the email message |
setContextPath | public void setContextPath(String path)(Code) | | Parameters: path - |
setDesc | public void setDesc(String desc)(Code) | | Sets the description for the validation job Creation date: (9/23/2001
9:41:06 PM) Author: Shash Chatterjee
Parameters: desc - desc The description |
setJobClassName | public void setJobClassName(String name) throws AuthValidationException(Code) | | Sets the name of the job class for validation requests. Currently the
only job that should be specified is ValidationJob Creation date:
(9/23/2001 9:41:06 PM) Author: Shash Chatterjee
Parameters: name - name Class name of validation job throws: AuthValidationException - AuthValidationException if the classisn't an Expresso Job class |
setPort | public void setPort(String port)(Code) | | Parameters: port - |
setServer | public void setServer(String server)(Code) | | Parameters: server - |
setStatus | public void setStatus(String newStatus) throws AuthValidationException(Code) | | Sets the current status of the validation entry Creation date:
(9/23/2001 9:41:06 PM) Author: Shash Chatterjee
Parameters: newStatus - newStatus = "A"=available, "N"=new, "W"=waiting,"V"=validated, "E"=expired throws: AuthValidationException - AuthValidationException |
setTitle | public void setTitle(String title)(Code) | | Set's the title of the validation entry job Creation date: (9/23/2001
9:41:06 PM) Author: Shash Chatterjee
Parameters: title - title The title |
setValidationHandler | public void setValidationHandler(String className) throws AuthValidationException(Code) | | Method to set the app-specific validation handler associated with this
validation request Creation date: (9/23/2001 9:41:06 PM) Author: Shash
Chatterjee
Parameters: className - className Class name of a class that implementsValidationHandler interface throws: AuthValidationException - AuthValidationException if the handleris not of the correct class, or if the instantiation fails |
setValidationHandler | public void setValidationHandler(Class clazz) throws AuthValidationException(Code) | | Method to set the app-specific validation handler associated with this
validation request
Parameters: clazz - Class that implementsValidationHandler interface throws: AuthValidationException - AuthValidationException if the handleris not of the correct class, or if the instantiation fails |
validationURL | public String validationURL() throws AuthValidationException(Code) | | Utility function to create a URL based on the webapp context, and setup
values such as the http server/port etc. It tags on the db context,
the validation entry id and the validation code as request parameters.
Creation date: (9/23/2001 9:41:06 PM) Author: Shash Chatterjee
The URL for use by the validator to approve the validationrequest throws: AuthValidationException - upon error |
|
|