Java Doc for ValidationEntry.java in  » J2EE » Expresso » com » jcorporate » expresso » services » validation » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Expresso » com.jcorporate.expresso.services.validation 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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


Field Summary
final public static  StringAVAILABLE
    
final public static  StringEXPIRED
    
final public static  StringNEW
    
final public static  StringPRM_EXPIRES_AFTER
    
final public static  StringPRM_VALIDATOR
    
final public static  StringPRM_VAL_CTX
    
final public static  StringPRM_VAL_DESC
    
final public static  StringPRM_VAL_PORT
    
final public static  StringPRM_VAL_SERVER
    
final public static  StringPRM_VAL_TITLE
    
final public static  StringSESSION_KEY
    
final public static  StringVALIDATED
    
final public static  StringWAITING
    
protected  StringdataContext
    
protected  StringexpiresAfter
    
protected  StringjobClassName
    
protected  StringjobNumber
    
protected  JobQueuejq
    
protected  JobQueueParamjqp
    
protected  intparamNum
    
protected  StringvalContextPath
    
protected  StringvalDesc
    
protected  StringvalPort
    
protected  StringvalServer
    
protected  StringvalTitle
    
protected  StringvalType
    
protected  StringvalidationClassName
    
protected  ValidationQueuevq
    

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.

Method Summary
public  voidaddParam(String name, String value)
    
public  booleancodeMatches(String code)
     Function to match the code in the DB versus the code in the request.
protected static  StringcreateValidationCode()
    
public  voiddelete()
    
public  voidexpiresAfter(int hr, int min, int sec)
    
public  DategetExpiresAt()
     Method to retrieve the absolute date/time when the request expires.
public  HashtablegetParams()
    
public  StringgetStatus()
    
public  ValidationHandlerinstantiateHandler()
    
public static  voidnotifyByEmail(String dbName, String from, Vector addresses, String subject, String content)
     Insert the method's description here.
public  voidsetContextPath(String path)
    
public  voidsetDesc(String desc)
    
public  voidsetJobClassName(String name)
     Sets the name of the job class for validation requests.
public  voidsetPort(String port)
    
public  voidsetServer(String server)
    
public  voidsetStatus(String newStatus)
    
public  voidsetTitle(String title)
    
public  voidsetValidationHandler(String className)
    
public  voidsetValidationHandler(Class clazz)
    
public  voidsubmit()
     Insert the method's description here.
public  StringvalidationURL()
     Utility function to create a URL based on the webapp context, and setup values such as the http server/port etc.

Field Detail
AVAILABLE
final public static String AVAILABLE(Code)
Status for available



EXPIRED
final public static String EXPIRED(Code)
Status for Expired



NEW
final public static String NEW(Code)
Status for new



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



jobNumber
protected String jobNumber(Code)
The Job Number



jq
protected JobQueue jq(Code)
JobQueue



jqp
protected JobQueueParam jqp(Code)
JobQueue parameter data object



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



valPort
protected String valPort(Code)
The validation port



valServer
protected String valServer(Code)
The validation server



valTitle
protected String valTitle(Code)
The validation job title



valType
protected String valType(Code)
?



validationClassName
protected String validationClassName(Code)
The validator class name



vq
protected ValidationQueue vq(Code)
The validation queue




Constructor Detail
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




Method Detail
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



delete
public void delete() throws AuthValidationException(Code)
Deletes the validation entry and all the connected parameters
throws:
  AuthValidationException - if no record is loaded OR there's anerror deleting the records.



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



instantiateHandler
public ValidationHandler instantiateHandler() throws AuthValidationException(Code)
Utility function to instantiate the app-specific validation handler Creation date: (9/23/2001 9:41:06 PM) Author: Shash Chatterjee Object of class ValidationHandler
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



submit
public void submit() throws AuthValidationException(Code)
Insert the method's description here. Creation date: (9/23/2001 9:41:06 PM) Author: Shash Chatterjee
throws:
  AuthValidationException - upon error



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



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.