|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.services.validation.ValidationEntry
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.
| Field Summary | |
static String |
AVAILABLE
Status for available |
protected String |
dataContext
default data context |
static String |
EXPIRED
Status for Expired |
protected String |
expiresAfter
Time it expires after |
protected String |
jobClassName
The Job class name |
protected String |
jobNumber
The Job Number |
protected JobQueue |
jq
JobQueue |
protected JobQueueParam |
jqp
JobQueue parameter data object |
static String |
NEW
Status for new |
protected int |
paramNum
current parameter number |
static String |
PRM_EXPIRES_AFTER
PArameter for 'Expires After' |
static String |
PRM_VAL_CTX
Parameter for 'Validation webapp context' |
static String |
PRM_VAL_DESC
Parameter for 'Validation Description' |
static String |
PRM_VAL_PORT
Parameter for 'Validation Port' |
static String |
PRM_VAL_SERVER
Parameter for 'Validation Server' |
static String |
PRM_VAL_TITLE
Parameter for 'Validation Title' |
static String |
PRM_VALIDATOR
Parameter for validator |
static String |
SESSION_KEY
Session validation key |
protected String |
valContextPath
The validation context path |
protected String |
valDesc
The default description |
static String |
VALIDATED
Status for Validated |
protected String |
validationClassName
The validator class name |
protected String |
valPort
The validation port |
protected String |
valServer
The validation server |
protected String |
valTitle
The validation job title |
protected String |
valType
? |
protected ValidationQueue |
vq
The validation queue |
static String |
WAITING
Status for waiting |
| Constructor Summary | |
ValidationEntry(String newDbName)
This constructor is used by classes that submit a validation request into the system. |
|
ValidationEntry(String context,
List paramsVector,
JobQueue jq)
This constructor is used by the validation job to create a validation entry from the job parameters. |
|
ValidationEntry(String dbName,
String id)
This constructor is used, after a validation request comes in, to resurrect a validation entry from the DB. |
|
| Method Summary | |
void |
addParam(String name,
String value)
Adds an application specific parameter into the validation entry Creation date: (9/23/2001 9:41:06 PM) Author: Shash Chatterjee |
boolean |
codeMatches(String code)
Function to match the code in the DB versus the code in the request. |
protected static String |
createValidationCode()
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 |
void |
delete()
Deletes the validation entry and all the connected parameters |
void |
expiresAfter(int hr,
int min,
int sec)
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 |
Date |
getExpiresAt()
Method to retrieve the absolute date/time when the request expires. |
Hashtable |
getParams()
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 |
String |
getStatus()
Returns the current status of the validation request Creation date: (9/23/2001 9:41:06 PM) Author: Shash Chatterjee |
ValidationHandler |
instantiateHandler()
Utility function to instantiate the app-specific validation handler Creation date: (9/23/2001 9:41:06 PM) Author: Shash Chatterjee |
static void |
notifyByEmail(String dbName,
String from,
Vector addresses,
String subject,
String content)
Insert the method's description here. |
void |
setContextPath(String path)
|
void |
setDesc(String desc)
Sets the description for the validation job Creation date: (9/23/2001 9:41:06 PM) Author: Shash Chatterjee |
void |
setJobClassName(String name)
Sets the name of the job class for validation requests. |
void |
setPort(String port)
|
void |
setServer(String server)
|
void |
setStatus(String newStatus)
Sets the current status of the validation entry Creation date: (9/23/2001 9:41:06 PM) Author: Shash Chatterjee |
void |
setTitle(String title)
Set's the title of the validation entry job Creation date: (9/23/2001 9:41:06 PM) Author: Shash Chatterjee |
void |
setValidationHandler(Class clazz)
Method to set the app-specific validation handler associated with this validation request |
void |
setValidationHandler(String className)
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 |
void |
submit()
Insert the method's description here. |
String |
validationURL()
Utility function to create a URL based on the webapp context, and setup values such as the http server/port etc. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String PRM_VALIDATOR
public static final String PRM_EXPIRES_AFTER
public static final String PRM_VAL_TITLE
public static final String PRM_VAL_DESC
public static final String PRM_VAL_SERVER
public static final String PRM_VAL_PORT
public static final String PRM_VAL_CTX
public static final String NEW
public static final String WAITING
public static final String AVAILABLE
public static final String VALIDATED
public static final String EXPIRED
public static final String SESSION_KEY
protected JobQueue jq
protected JobQueueParam jqp
protected String dataContext
protected String expiresAfter
protected String jobClassName
protected String jobNumber
protected String valContextPath
protected String valDesc
protected String valPort
protected String valServer
protected String valTitle
protected String valType
protected String validationClassName
protected ValidationQueue vq
protected int paramNum
| Constructor Detail |
public ValidationEntry(String newDbName)
throws AuthValidationException
newDbName - newDbName The database context to create the validation
Job/Entry in.
public ValidationEntry(String dbName,
String id)
throws AuthValidationException
dbName - dbName The DB context to retrieve the validation entry
fromid - id The validation request id/seq. number
AuthValidationException - AuthValidationException
public ValidationEntry(String context,
List paramsVector,
JobQueue jq)
throws AuthValidationException
context - context The DB context to use for the validation entryparamsVector - paramsVector All the params passed in to the jobjq - jq The job queue entry in its entirety
AuthValidationException - AuthValidationException| Method Detail |
public void setContextPath(String path)
path - public void setDesc(String desc)
desc - desc The description
public Date getExpiresAt()
throws AuthValidationException
AuthValidationException
public void setJobClassName(String name)
throws AuthValidationException
name - name Class name of validation job
AuthValidationException - AuthValidationException if the class
isn't an Expresso Job class
public Hashtable getParams()
throws AuthValidationException
AuthValidationExceptionpublic void setPort(String port)
port - public void setServer(String server)
server -
public void setStatus(String newStatus)
throws AuthValidationException
newStatus - newStatus = "A"=available, "N"=new, "W"=waiting,
"V"=validated, "E"=expired
AuthValidationException - AuthValidationException
public String getStatus()
throws AuthValidationException
AuthValidationException - AuthValidationExceptionpublic void setTitle(String title)
title - title The title
public void setValidationHandler(String className)
throws AuthValidationException
className - className Class name of a class that implements
ValidationHandler interface
AuthValidationException - AuthValidationException if the handler
is not of the correct class, or if the instantiation fails
public void setValidationHandler(Class clazz)
throws AuthValidationException
clazz - Class that implements
ValidationHandler interface
AuthValidationException - AuthValidationException if the handler
is not of the correct class, or if the instantiation fails
public void addParam(String name,
String value)
throws AuthValidationException
name - name Name of the parametervalue - value Value of the parameter
AuthValidationException
public boolean codeMatches(String code)
throws AuthValidationException
code - code Code in the request URL
AuthValidationException - AuthValidationException
public void delete()
throws AuthValidationException
AuthValidationException - if no record is loaded OR there's an
error deleting the records.
public void expiresAfter(int hr,
int min,
int sec)
hr - hr Delta hoursmin - min Delta minutessec - sec Delta seconds
public ValidationHandler instantiateHandler()
throws AuthValidationException
AuthValidationException - AuthValidationException
public static void notifyByEmail(String dbName,
String from,
Vector addresses,
String subject,
String content)
throws AuthValidationException
dbName - The data context to usefrom - the "From" email field.addresses - the email addresses to notifysubject - the subject of the emailcontent - The body of the email message
AuthValidationException
public void submit()
throws AuthValidationException
AuthValidationException - upon error
public String validationURL()
throws AuthValidationException
AuthValidationException - upon errorprotected static String createValidationCode()
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||