Expresso 5-6

com.jcorporate.expresso.services.dbobj
Class JobHandlerControl

java.lang.Object
  extended bycom.jcorporate.expresso.core.dataobjects.BaseDataObject
      extended bycom.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
          extended bycom.jcorporate.expresso.core.dbobj.DBObject
              extended bycom.jcorporate.expresso.core.dbobj.SecuredDBObject
                  extended bycom.jcorporate.expresso.services.dbobj.JobHandlerControl
All Implemented Interfaces:
Cacheable, ContextNested, DataObject, LookupInterface, Securable, Serializable

public class JobHandlerControl
extends SecuredDBObject

applies operations (commands) to all jobs running on a server. For example, cause all jobs to stop or restart.

Author:
Mike Dubman
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.jcorporate.expresso.core.dbobj.DBObject
DBObject.FieldError, DBObject.FieldUpdate
 
Field Summary
static String FLD_COMMAND
          command to apply to all jobs on server. currently, only restart and stop are available
static String FLD_COMMAND_ID
           
static String FLD_REQUEST_TIME
           
static String FLD_SERVERID
           
static String FLD_STATUS_CODE
           
static String FLD_UID
           
static String JOB_STATUS_AVAILABLE
           
static String JOB_STATUS_COMPLETED
           
static String JOB_STATUS_NEW
           
static String JOB_STATUS_RUNNING
           
static String RESTART_COMMAND
           
static String STOP_COMMAND
           
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
ADD, ALL_FUNCTIONS, CACHE_NAME, CACHE_TTY, DELETE, SEARCH, SYSTEM_ACCOUNT, SYSTEM_ACCOUNT_NAME, UPDATE
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.DBObject
ATTRIBUTE_ERROR, ATTRIBUTE_ERROR_MESSAGE, ATTRIBUTE_PAGE_LIMIT, BIG_DECIMAL_ZERO, EMAIL_MASK, EVENT_ADD, EVENT_DELETE, EVENT_UPDATE, FLOAT_MASK, INT_MASK, IS_CHECK_RELATIONAL_INTEGRITY, UPDATE_CHANGED_ONLY, WHERE_KEYWORD
 
Fields inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
anyFieldsDistinct, anyFieldsToRetrieve, appendCustomWhere, caseSensitiveQuery, customWhereClause, dbKey, distinctFields, localConnection, LONGBINARY_READ_DEFAULT_SIZE, maxRecords, myClassName, myUpdates, offsetRecord, recordSet, retrieveFields, sMetadataMap, sortKeys
 
Fields inherited from class com.jcorporate.expresso.core.dataobjects.BaseDataObject
currentStatus, globalMask
 
Fields inherited from interface com.jcorporate.expresso.core.dataobjects.DataObject
STATUS_CURRENT, STATUS_DELETED, STATUS_NEW, STATUS_UPDATED
 
Constructor Summary
JobHandlerControl()
           
JobHandlerControl(int uid)
           
JobHandlerControl(RequestContext request)
          For using DBObjects within Controllers.
 
Method Summary
 void add()
          If the user is allowed to add, invoke the superclass add
 Vector getValidValues(String fieldName)
          Override the method getValidValues to provide specific values for our multi-valued fields
 void setCmdRestartJob(String jobID)
           
 void setCmdStopJob(String jobID)
           
 void setKillCommand(String jobID)
           
protected  void setupFields()
          Method to set up the fields for this database object.
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
canRequesterAdd, canRequesterDelete, canRequesterRead, canRequesterUpdate, checkAllowed, copyAttributes, count, createSecurityCache, delete, deleteAll, find, getRequestingUid, getString, getString, getString, getString, getString, getString, getSystemUid, instantiate, isAllowed, retrieve, search, searchAndRetrieveList, searchAndRetrieveList, setRequestingUid, update
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.DBObject
addDetail, addField, addField, addFieldError, addFoundKeys, addIfNeeded, addIndex, addKey, addOrUpdate, addSortKey, addTransition, addVirtualField, addVirtualField, addVirtualField, addVirtualField, average, basicAdd, cacheIsChangedComparison, checkAllReferredToBy, checkAllRefs, checkAllRefsPublic, checkDeleteDetailPerm, checkField, checkRef, checkRef, clear, clearDistinctFields, clearError, clearFieldsToRetrieve, clearSortKeys, containsWildCards, delete, deleteAll, deleteDetails, denotesRange, equals, forKey, formatDateTime, get, getAllAttributes, getAttribute, getAttributesIterator, getBooleanFieldValue, getCacheSize, getCacheStatsMap, getCacheUtil, getCheckZeroUpdate, getCustomWhereClause, getDataContext, getDataField, getDataTransferObject, getDBName, getDetails, getDistinctFieldCount, getDistinctFields, getField, getFieldBigDecimal, getFieldBoolean, getFieldByte, getFieldByteArray, getFieldData, getFieldDate, getFieldDecimalFormatted, getFieldDouble, getFieldErrorMessage, getFieldFloat, getFieldInt, getFieldLong, getFieldMetaData, getFieldShort, getFieldsToRetrieveCount, getFilterClass, getFoundCount, getFoundKeysArray, getIndexArray, getISOValuesDefault, getISOValuesDefault, getISOValuesDefault, getKey, getKeyFieldListIterator, getLength, getLengthInt, getLocalConnection, getLocale, getLogger, getLookupObject, getMax, getMax, getMaxRecords, getMyKeys, getMyUpdatesArray, getOffsetRecord, getPatternMatcher, getPrecision, getSerializedForm, getStringFilter, getThisDBbj, getThisDBObj, getValidValueDescrip, getValidValuesList, getValues, getValuesDefault, getValuesDefault, getValuesDefault, hasError, hasErrors, haveAllKeys, initialize, isCached, isChanged, isDistinct, isEmpty, isFieldDistinct, isFieldNull, isFieldsToRetrieve, isFieldToRetrieve, isMultiValued, isReadOnly, isSecret, isVirtual, loadFromConnection, logChange, max, min, newInstance, noNewLine, noQuotes, notifyListeners, populateDefaultValues, referredToBy, removeAttribute, removeFromCache, retrieveFromCache, saveBinaryField, search, set, setAttribute, setCacheSize, setCharset, setCheckZeroUpdate, setConnection, setConnection, setCustomWhereClause, setCustomWhereClause, setDataContext, setDataField, setDataTransferObject, setDefaultValue, setDescription, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setFieldData, setFieldData, setFieldDistinct, setFieldsToRetrieve, setFilterClass, setFilterClass, setKeys, setLocale, setLookupField, setLookupObject, setMask, setMaxRecords, setMultiValued, setName, setOffsetRecord, setReadOnly, setSchema, setSecret, setSortKey, setStringFilter, setStringFiltersOnAll, setTargetDbSchema, setTargetTable, sqlAggrFunction, sum, toDebugString, update, updateAll, updateAll, verify
 
Methods inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
addInParam, addOutParam, buildWhereClause, buildWhereClauseBuffer, checkZeroUpdate, constructNewMetaData, createAndExecuteSearch, createAndRunStoreProcedure, getConnectionPool, getCustomStringFieldValue, getDef, getDistinctFieldArrayList, getExecutor, getFieldsToRetrieveIterator, getJDBCMetaData, getJDBCUtil, getMappedDataContext, getMetaData, getQueryInterface, getSerialForm, loadFromConnection, makeLimitationStub, quoteIfNeeded, runStoredProcedure, runStoredProcedureAndRetrieveList, selectFieldString, setCaseSensitiveQuery, setDBConnectionPool, setDBName, setMappedDataContext, setOriginalDBName, setTargetStoreProcedure
 
Methods inherited from class com.jcorporate.expresso.core.dataobjects.BaseDataObject
getGlobalMask, getStatus, isGlobalMasked, setFieldsWithDefaults, setGlobalMask, setStatus
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLD_REQUEST_TIME

public static final String FLD_REQUEST_TIME
See Also:
Constant Field Values

FLD_COMMAND

public static final String FLD_COMMAND
command to apply to all jobs on server. currently, only restart and stop are available

See Also:
Constant Field Values

FLD_UID

public static final String FLD_UID
See Also:
Constant Field Values

FLD_STATUS_CODE

public static final String FLD_STATUS_CODE
See Also:
Constant Field Values

FLD_SERVERID

public static final String FLD_SERVERID
See Also:
Constant Field Values

FLD_COMMAND_ID

public static final String FLD_COMMAND_ID
See Also:
Constant Field Values

JOB_STATUS_NEW

public static final String JOB_STATUS_NEW
See Also:
Constant Field Values

JOB_STATUS_AVAILABLE

public static final String JOB_STATUS_AVAILABLE
See Also:
Constant Field Values

JOB_STATUS_COMPLETED

public static final String JOB_STATUS_COMPLETED
See Also:
Constant Field Values

JOB_STATUS_RUNNING

public static final String JOB_STATUS_RUNNING
See Also:
Constant Field Values

RESTART_COMMAND

public static final String RESTART_COMMAND
See Also:
Constant Field Values

STOP_COMMAND

public static final String STOP_COMMAND
See Also:
Constant Field Values
Constructor Detail

JobHandlerControl

public JobHandlerControl()
                  throws DBException
Throws:
DBException

JobHandlerControl

public JobHandlerControl(int uid)
                  throws DBException
Parameters:
uid - the Expresso user id
Throws:
DBException - upon initialization error

JobHandlerControl

public JobHandlerControl(RequestContext request)
                  throws DBException
For using DBObjects within Controllers. Initializes based upon the current user and the requested db. [Of course this can be modified later]

Parameters:
request - - The controller request handed to you by the framework.
Throws:
DBException - upon initialization error
Method Detail

setupFields

protected void setupFields()
                    throws DBException
Description copied from class: DBObject
Method to set up the fields for this database object. This method should be defined in the implementing object and should make calls to addField, addKey, setMultiValued, etc. as required to define the content of the DBObject. Each setupFields method should call "super.setupFields()" so that field definitions can be "inheritcable"

Overrides:
setupFields in class DBObject
Throws:
DBException

add

public void add()
         throws DBException
Description copied from class: SecuredDBObject
If the user is allowed to add, invoke the superclass add

Specified by:
add in interface DataObject
Overrides:
add in class SecuredDBObject
Throws:
DBException - If the user is not permitted to add or if the add fails

getValidValues

public Vector getValidValues(String fieldName)
                      throws DBException
Override the method getValidValues to provide specific values for our multi-valued fields

Overrides:
getValidValues in class DBObject
Parameters:
fieldName - Field name for which values are requested
Returns:
Vector The ValidValues field
Throws:
DBException - If the values cannot be retrieved

setCmdStopJob

public void setCmdStopJob(String jobID)
                   throws DBException
Throws:
DBException

setCmdRestartJob

public void setCmdRestartJob(String jobID)
                      throws DBException
Throws:
DBException

setKillCommand

public void setKillCommand(String jobID)
                    throws DBException
Throws:
DBException

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.