[Batchserver-cvs] batchserver/src/org/jmonks/batchserver/framework ErrorCode.java, 1.4, 1.5 JobStat
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-09-13 05:01:38
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25592 Modified Files: ErrorCode.java JobStatistics.java Log Message: no message Index: ErrorCode.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/ErrorCode.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ErrorCode.java 13 Sep 2006 04:49:46 -0000 1.4 --- ErrorCode.java 13 Sep 2006 05:01:34 -0000 1.5 *************** *** 3,19 **** /** * <p> ! * The ErrorCode represents the error condition can generate in the system ! * and holds error code and message. This is also used to represent the status code ! * for any processor/controller/job. This provides the flexibility to create ! * new custom error codes and append the message to the existing error code. * Codes ranging from 0 to 100 are reserved for framework purpose. Use the codes * above 100 to create the custom error codes. * </p> ! * * @author Suresh Pragada * @version 1.0 * @since 1.0 */ ! public final class ErrorCode { /** --- 3,20 ---- /** * <p> ! * The ErrorCode represents the error condition can generate in the system. ! * It holds code which uniquely identifies the error and message which explains the error in the system. ! * This is also used to represent the status code ! * for any processor/controller/job. This provides the flexibility to create ! * new custom error codes and append the message to the existing error code. * Codes ranging from 0 to 100 are reserved for framework purpose. Use the codes * above 100 to create the custom error codes. * </p> ! * * @author Suresh Pragada * @version 1.0 * @since 1.0 */ ! public final class ErrorCode { /** *************** *** 21,30 **** */ private int code; ! /** * Message illustrates the code. */ private String message=null; ! /** * <p> --- 22,31 ---- */ private int code; ! /** * Message illustrates the code. */ private String message=null; ! /** * <p> *************** *** 32,40 **** * from outside of this class and it is extensible. * </p> ! * * @param code Code represents the error. * @param errorMsg Message illustrates the exit code. */ ! private ErrorCode(int code, String errorMsg) { this.code=code; --- 33,41 ---- * from outside of this class and it is extensible. * </p> ! * * @param code Code represents the error. * @param errorMsg Message illustrates the exit code. */ ! private ErrorCode(int code, String errorMsg) { this.code=code; *************** *** 44,48 **** /** * Returns the error code represents the error. ! * * @return Returns the error code represents the error. */ --- 45,49 ---- /** * Returns the error code represents the error. ! * * @return Returns the error code represents the error. */ *************** *** 54,58 **** /** * Returns the error message illustrates the exit code. ! * * @return Returns the error message. */ --- 55,59 ---- /** * Returns the error message illustrates the exit code. ! * * @return Returns the error message. */ *************** *** 77,81 **** /** * Creates a new error code instance by accepting the code and message. The newMessage ! * should not be null or empty message. * * @param newCode Code to be used to construct the ErrorCode. --- 78,82 ---- /** * Creates a new error code instance by accepting the code and message. The newMessage ! * should not be null or empty message. * * @param newCode Code to be used to construct the ErrorCode. *************** *** 91,97 **** throw new IllegalArgumentException("Message to create new ErrorCode should not be null or empty."); } ! /** ! * Equality will be based on the code the two error codes contain. * * @see java.lang.Object#equals(java.lang.Object) --- 92,98 ---- throw new IllegalArgumentException("Message to create new ErrorCode should not be null or empty."); } ! /** ! * Equality will be based on the code the two error codes contain. * * @see java.lang.Object#equals(java.lang.Object) *************** *** 99,106 **** public boolean equals(Object errorCode) { ! return (errorCode!=null) && (this.getClass()==errorCode.getClass()) && (this.code==((ErrorCode)errorCode).getCode()); } ! /** * Code represented by error code will be returned as a hash code. --- 100,107 ---- public boolean equals(Object errorCode) { ! return (errorCode!=null) && (this.getClass()==errorCode.getClass()) && (this.code==((ErrorCode)errorCode).getCode()); } ! /** * Code represented by error code will be returned as a hash code. *************** *** 112,122 **** return this.code; } ! /** * <p> ! * Returns the string representation of ErrorCode class in the format * <br> {ErrorCode [code = value] [message = value]} * </p> ! * * @return Returns the string representation of ErrorCode. */ --- 113,123 ---- return this.code; } ! /** * <p> ! * Returns the string representation of ErrorCode class in the format * <br> {ErrorCode [code = value] [message = value]} * </p> ! * * @return Returns the string representation of ErrorCode. */ *************** *** 125,193 **** StringBuffer stringValue=new StringBuffer("{ErrorCode "); stringValue.append("[code = " + this.code + "]"); ! stringValue.append("[message = " + this.message + "]"); stringValue.append("}"); return stringValue.toString(); ! } ! ! /** ! * Represents job got completed successfully. Error code is 0. */ public static final ErrorCode JOB_COMPLETED_SUCCESSFULLY = new ErrorCode(0,"Job completed successfully."); ! /** ! * Represents job got completed with errors. This represents the partial success. Error code is 1. */ public static final ErrorCode JOB_COMPLETED_WITH_ERRORS = new ErrorCode(1, "Job completed with some errors."); /** ! * Represents the configuration error used to invoke the job. Error code is 10. */ public static final ErrorCode JOB_INVOKATION_CONFIGURAION_ERROR = new ErrorCode(10,"Error in configuraion passed to invoke job."); /** ! * Represents the framework configuration error. Error code is 11. */ public static final ErrorCode FRAMEWORK_CONFIGURATION_ERROR = new ErrorCode(11,"Error while accessing or parsing the framework configuration file."); /** ! * Represents the job config factory configuration error. Error code is 12. */ public static final ErrorCode JOB_CONFIG_FACTORY_CONFIGURATION_ERROR = new ErrorCode(12,"Job configuration factory cannot be created by the given factory configuration."); /** ! * Represents the job configuration error. Error code is 13. ! */ public static final ErrorCode JOB_CONFIGURATION_ERROR = new ErrorCode(13,"Error while loading the job configuration from the defined factory."); /** ! * Represents the job is not configured error. Error code is 14. ! */ public static final ErrorCode JOB_IS_NOT_CONFIGURED = new ErrorCode(14,"Job is not configured"); /** ! * Represents the job controller configuration error. Error code is 15. ! */ ! public static final ErrorCode JOB_CONTROLLER_CONFIGURATION_ERROR = new ErrorCode(15,"Job controller configuration is not defined properly."); /** ! * Represents the logging configuration error. Error code is 16. ! */ ! public static final ErrorCode JOB_LOGGING_CONFIGURATION_ERROR = new ErrorCode(16,"Job logging configuration is not defined properly."); /** ! * Represents the repository configuration error. Error code is 17. ! */ ! public static final ErrorCode JOB_REPOSITORY_CONFIGURATION_ERROR = new ErrorCode(17,"Repository configuration in framework configuration is not defined properly."); /** ! * Represents the connector configuration error. Error code is 18. ! */ ! public static final ErrorCode JOB_CONNECTOR_CONFIGURATION_ERROR = new ErrorCode(18,"Repository configuration in framework configuration is not defined properly."); /** ! * Represents the unknown configuration error. Error code is 19. ! */ ! public static final ErrorCode UNKNOWN_CONFIGURATION_ERROR = new ErrorCode(19,"Configuration error related to unknown component."); /** ! * Represents error because of the exception in basic job processor. Error code is 20. */ public static final ErrorCode BASIC_JOB_PROCESSOR_EXCEPTION = new ErrorCode(20,"Basic Job Controller caught exception while executing process method on basic job processor."); /** ! * Represents error because of the exception in pool job loader. Error code is 21. */ public static final ErrorCode POOL_JOB_LOADER_EXCEPTION = new ErrorCode(21,"Exception while executing the loader to load the pool."); /** ! * Represents error because of the exception in pool job processor. Error code is 22. ! */ public static final ErrorCode POOL_JOB_PROCESSOR_EXCEPTION = new ErrorCode(22,"Exception while executing the processor to process the pool."); ! } --- 126,194 ---- StringBuffer stringValue=new StringBuffer("{ErrorCode "); stringValue.append("[code = " + this.code + "]"); ! stringValue.append("[message = " + this.message + "]"); stringValue.append("}"); return stringValue.toString(); ! } ! ! /** ! * Represents job got completed successfully. Error code is 0. */ public static final ErrorCode JOB_COMPLETED_SUCCESSFULLY = new ErrorCode(0,"Job completed successfully."); ! /** ! * Represents job got completed with errors. This represents the partial success. Error code is 1. */ public static final ErrorCode JOB_COMPLETED_WITH_ERRORS = new ErrorCode(1, "Job completed with some errors."); /** ! * Represents the configuration error used to invoke the job. Error code is 10. */ public static final ErrorCode JOB_INVOKATION_CONFIGURAION_ERROR = new ErrorCode(10,"Error in configuraion passed to invoke job."); /** ! * Represents the framework configuration error. Error code is 11. */ public static final ErrorCode FRAMEWORK_CONFIGURATION_ERROR = new ErrorCode(11,"Error while accessing or parsing the framework configuration file."); /** ! * Represents the job config factory configuration error. Error code is 12. */ public static final ErrorCode JOB_CONFIG_FACTORY_CONFIGURATION_ERROR = new ErrorCode(12,"Job configuration factory cannot be created by the given factory configuration."); /** ! * Represents the job configuration error. Error code is 13. ! */ public static final ErrorCode JOB_CONFIGURATION_ERROR = new ErrorCode(13,"Error while loading the job configuration from the defined factory."); /** ! * Represents the job is not configured error. Error code is 14. ! */ public static final ErrorCode JOB_IS_NOT_CONFIGURED = new ErrorCode(14,"Job is not configured"); /** ! * Represents the job controller configuration error. Error code is 15. ! */ ! public static final ErrorCode JOB_CONTROLLER_CONFIGURATION_ERROR = new ErrorCode(15,"Job controller configuration is not defined properly."); /** ! * Represents the logging configuration error. Error code is 16. ! */ ! public static final ErrorCode JOB_LOGGING_CONFIGURATION_ERROR = new ErrorCode(16,"Job logging configuration is not defined properly."); /** ! * Represents the repository configuration error. Error code is 17. ! */ ! public static final ErrorCode JOB_REPOSITORY_CONFIGURATION_ERROR = new ErrorCode(17,"Repository configuration in framework configuration is not defined properly."); /** ! * Represents the connector configuration error. Error code is 18. ! */ ! public static final ErrorCode JOB_CONNECTOR_CONFIGURATION_ERROR = new ErrorCode(18,"Repository configuration in framework configuration is not defined properly."); /** ! * Represents the unknown configuration error. Error code is 19. ! */ ! public static final ErrorCode UNKNOWN_CONFIGURATION_ERROR = new ErrorCode(19,"Configuration error related to unknown component."); /** ! * Represents error because of the exception in basic job processor. Error code is 20. */ public static final ErrorCode BASIC_JOB_PROCESSOR_EXCEPTION = new ErrorCode(20,"Basic Job Controller caught exception while executing process method on basic job processor."); /** ! * Represents error because of the exception in pool job loader. Error code is 21. */ public static final ErrorCode POOL_JOB_LOADER_EXCEPTION = new ErrorCode(21,"Exception while executing the loader to load the pool."); /** ! * Represents error because of the exception in pool job processor. Error code is 22. ! */ public static final ErrorCode POOL_JOB_PROCESSOR_EXCEPTION = new ErrorCode(22,"Exception while executing the processor to process the pool."); ! } Index: JobStatistics.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/JobStatistics.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JobStatistics.java 13 Sep 2006 04:49:46 -0000 1.6 --- JobStatistics.java 13 Sep 2006 05:01:34 -0000 1.7 *************** *** 4,9 **** /** ! * This represents all the statistics related to the job. ! * * @author Suresh Pragada * @version 1.0 --- 4,13 ---- /** ! * <p> ! * JobStatistics holds the statistics of the job. These statistics will be ! * start and end time of the job, records have been processed, memory has ! * been utilized and exit code of the job. ! * </p> ! * * @author Suresh Pragada * @version 1.0 *************** *** 36,40 **** */ private ErrorCode exitCode=null; ! /** * Constructor takes the job name and build the skelton. --- 40,44 ---- */ private ErrorCode exitCode=null; ! /** * Constructor takes the job name and build the skelton. *************** *** 52,56 **** /** * Sets the startime of the job. ! * * @param startTime Starting time of the job. */ --- 56,60 ---- /** * Sets the startime of the job. ! * * @param startTime Starting time of the job. */ *************** *** 62,66 **** /** * Sets the endtime of the job. ! * * @param endTime Ending time of the job. */ --- 66,70 ---- /** * Sets the endtime of the job. ! * * @param endTime Ending time of the job. */ *************** *** 72,76 **** /** * Sets the number of the records processed in this job. ! * * @param recordCount Sets the number of records got processed. */ --- 76,80 ---- /** * Sets the number of the records processed in this job. ! * * @param recordCount Sets the number of records got processed. */ *************** *** 82,86 **** /** * Sets the maximum memory used for the job. ! * * @param memoryUsaeg Sets the memory usage by the job. */ --- 86,90 ---- /** * Sets the maximum memory used for the job. ! * * @param memoryUsaeg Sets the memory usage by the job. */ *************** *** 92,96 **** /** * Gets the start time of this job. ! * * @return Returns the starting time of this job. */ --- 96,100 ---- /** * Gets the start time of this job. ! * * @return Returns the starting time of this job. */ *************** *** 102,106 **** /** * Gets the ending time of this job. ! * * @return Gets the end time of this job. */ --- 106,110 ---- /** * Gets the ending time of this job. ! * * @return Gets the end time of this job. */ *************** *** 112,116 **** /** * Gets the number of records processed. ! * * @return Returns the number of records got processed. */ --- 116,120 ---- /** * Gets the number of records processed. ! * * @return Returns the number of records got processed. */ *************** *** 122,126 **** /** * Gets the maximum memory used by this job. ! * * @return Returns the max memory used by this job. */ --- 126,130 ---- /** * Gets the maximum memory used by this job. ! * * @return Returns the max memory used by this job. */ *************** *** 132,136 **** /** * Gets the job name ! * * @return Returns the name of this job. */ --- 136,140 ---- /** * Gets the job name ! * * @return Returns the name of this job. */ *************** *** 149,153 **** this.exitCode=exitCode; } ! /** * Gets the exit code. --- 153,157 ---- this.exitCode=exitCode; } ! /** * Gets the exit code. *************** *** 157,164 **** return this.exitCode; } ! /** * <p> ! * Returns the string representation of JobStatistics class in the format * <br> {JobStatistics [jobName = value] [startTime = value] [endTime = value]} * </p> --- 161,168 ---- return this.exitCode; } ! /** * <p> ! * Returns the string representation of JobStatistics class in the format * <br> {JobStatistics [jobName = value] [startTime = value] [endTime = value]} * </p> *************** *** 171,181 **** stringValue.append("[jobName = " + this.jobName + "]"); stringValue.append("[startTime = " + ((this.startTime!=null)?this.startTime.toString():"") + "]"); ! stringValue.append("[endTime = " + ((this.endTime!=null)?this.endTime.toString():"") + "]"); stringValue.append("[maxMemoryUsage = " + this.maxMemoryUsage + "]"); stringValue.append("[recordsProcessed = " + this.recordsProcessed + "]"); ! stringValue.append("[exitCode = " + this.exitCode.toString() + "]"); stringValue.append("}"); return stringValue.toString(); ! } ! } --- 175,185 ---- stringValue.append("[jobName = " + this.jobName + "]"); stringValue.append("[startTime = " + ((this.startTime!=null)?this.startTime.toString():"") + "]"); ! stringValue.append("[endTime = " + ((this.endTime!=null)?this.endTime.toString():"") + "]"); stringValue.append("[maxMemoryUsage = " + this.maxMemoryUsage + "]"); stringValue.append("[recordsProcessed = " + this.recordsProcessed + "]"); ! stringValue.append("[exitCode = " + this.exitCode.toString() + "]"); stringValue.append("}"); return stringValue.toString(); ! } ! } |