public abstract class SimpleCronTask extends java.lang.Object implements CronTask
CronTaskManager
,
CronTask
,
psdi.test.CronErrorTest
Constructor and Description |
---|
SimpleCronTask() |
Modifier and Type | Method and Description |
---|---|
void |
beforeRemoval()
Method to implement when there are actions involved when the crontask instance is about to be removed
by the crontask manager when the crontask instance is auto removal and it is time to remove it.
|
abstract void |
cronAction()
This is the CORE METHOD of this class.
|
java.lang.String |
getCronTaskHistoryMsg()
Get message to be written to CronTaskHistory.
|
CrontaskInstanceRemote |
getCrontaskInstance()
Return the crontask instance object associated with this crontask
object.
|
MXLogger |
getCronTaskLogger()
Returns a logger to log messages related to this task.
|
MXLogger |
getCronTaskSqlLogger()
Returns a logger to log SQL messages related to this task.
|
int |
getDBLastSeed()
Gets the last seed for the server for a task in database
|
java.util.Vector |
getEnteredValueVector()
Gets the vector containg invidual time values
|
long |
getInterval()
Returns the interval
|
boolean |
getIntervalFlag()
Gets flag for interval
|
java.util.Date |
getLastRunDate()
Gets the last Run Time for a task in database
|
int |
getLastSeed()
Gets the last seed for the server for a task
|
java.lang.String |
getName()
Should return the name of this CronTask.
|
boolean |
getParamAsBoolean(java.lang.String parameter)
It returns the value of the parameter of the instance this crontask object
is instantiated for as boolean.
|
java.util.Date |
getParamAsDate(java.lang.String parameter)
It returns the value of the parameter of the instance this crontask object
is instantiated for as date.
|
double |
getParamAsDouble(java.lang.String parameter)
It returns the value of the parameter of the instance this crontask object
is instantiated for as double.
|
int |
getParamAsInt(java.lang.String parameter)
It returns the value of the parameter of the instance this crontask object
is instantiated for as int.
|
java.lang.String |
getParamAsString(java.lang.String parameter)
It returns the value of the parameter
getParameterValidationMbo(CrontaskInstanceRemote for as String.
|
MboRemote |
getParameter(java.lang.String parameter)
Get the MBO of crontaskparameter for the specified parameter for the instance
this crontask object is instantiated for.
|
CrontaskParamInfo[] |
getParameters()
This method provides an array of CrontaskParamInfo() object to describe
all the parameters of the crontask.
|
MboRemote |
getParameterValidationMbo()
This method can only be called after the crontask is initialized.
|
MboRemote |
getParameterValidationMbo(CrontaskInstanceRemote inst)
Default implementation.
|
UserInfo |
getRunasUserInfo()
Return the system user info of the user specified by the runasuserid on
crontaskparameter.
|
long |
getSleepTime()
Gets the time for the server to sleep before the next task
|
void |
init()
Invoked by the CronTaskManager when the class is instantiated.
|
boolean |
isOKToRun(MXServerRemote server)
Default implementation of isOKToRun.
|
boolean |
isShutdown()
Getter for the shutdown variable.
|
void |
setCronTaskHistoryMsg(java.lang.String val)
Set message to be written to CronTaskHistory.
|
void |
setCrontaskInstance(CrontaskInstanceRemote inst)
Cache the crontask instance this crontask object is instantiated for.
|
void |
setDBLastSeed(int dbseed)
Sets the last seed for the server for a task in database
|
void |
setEnteredValueVector(java.util.Vector v)
Sets the vector containg invidual time values
|
void |
setInterval(long interval)
Sets the interval specified in properties file
|
void |
setIntervalFlag(boolean flag)
Sets the flag if interval is specified in properties file
|
void |
setLastRunDate(java.util.Date d)
Sets the last Run Time for a task in database
|
void |
setLastSeed(int seed)
Sets the last seed for the server for a task
|
void |
setSleepTime(long time)
Sets the time for the server to sleep before the next task
|
void |
shutdown()
Sets the shutdown variable.
|
void |
start()
Default implementation for start().
|
void |
stop()
Default implementation for stop().
|
public CrontaskParamInfo[] getParameters() throws MXException, java.rmi.RemoteException
CronTask
getParameters
in interface CronTask
MXException
java.rmi.RemoteException
CrontaskParamInfo
public MboRemote getParameterValidationMbo(CrontaskInstanceRemote inst) throws MXException, java.rmi.RemoteException
getParameterValidationMbo
in interface CronTask
instance
- MXException
java.rmi.RemoteException
CronTask.getParameterValidationMbo(CrontaskInstanceRemote)
public boolean isOKToRun(MXServerRemote server)
public MboRemote getParameterValidationMbo() throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public MboRemote getParameter(java.lang.String parameter) throws MXException, java.rmi.RemoteException
parameter
- MXException
java.rmi.RemoteException
public java.lang.String getParamAsString(java.lang.String parameter) throws MXException, java.rmi.RemoteException
parameter
- MXException
java.rmi.RemoteException
public boolean getParamAsBoolean(java.lang.String parameter) throws MXException, java.rmi.RemoteException
parameter
- MXException
java.rmi.RemoteException
public int getParamAsInt(java.lang.String parameter) throws MXException, java.rmi.RemoteException
parameter
- MXException
java.rmi.RemoteException
public double getParamAsDouble(java.lang.String parameter) throws MXException, java.rmi.RemoteException
parameter
- MXException
java.rmi.RemoteException
public java.util.Date getParamAsDate(java.lang.String parameter) throws MXException, java.rmi.RemoteException
parameter
- MXException
java.rmi.RemoteException
public void setCrontaskInstance(CrontaskInstanceRemote inst)
setCrontaskInstance
in interface CronTask
CronTask.setCrontaskInstance(CrontaskInstanceRemote)
public long getInterval()
public void setInterval(long interval)
public void setSleepTime(long time)
setSleepTime
in interface CronTask
public long getSleepTime()
getSleepTime
in interface CronTask
public void setIntervalFlag(boolean flag)
public boolean getIntervalFlag()
public void setLastSeed(int seed)
setLastSeed
in interface CronTask
public int getLastSeed()
getLastSeed
in interface CronTask
public void setDBLastSeed(int dbseed)
setDBLastSeed
in interface CronTask
public int getDBLastSeed()
getDBLastSeed
in interface CronTask
public void setLastRunDate(java.util.Date d)
setLastRunDate
in interface CronTask
public java.util.Date getLastRunDate()
getLastRunDate
in interface CronTask
public void setEnteredValueVector(java.util.Vector v)
setEnteredValueVector
in interface CronTask
public java.util.Vector getEnteredValueVector()
getEnteredValueVector
in interface CronTask
public void init() throws MXException
runAsUserInfo
.
Performs a silent login via SecurityService.init
in interface CronTask
MXException
SecurityService.authenticateUser(String, boolean)
public abstract void cronAction()
cronAction
in interface CronTask
public void shutdown()
public boolean isShutdown()
isShutdown
in interface CronTask
public java.lang.String getName()
public void setCronTaskHistoryMsg(java.lang.String val)
setCronTaskHistoryMsg
in interface CronTask
public java.lang.String getCronTaskHistoryMsg()
getCronTaskHistoryMsg
in interface CronTask
CronTask.setCronTaskHistoryMsg(java.lang.String)
public MXLogger getCronTaskLogger()
public MXLogger getCronTaskSqlLogger()
public CrontaskInstanceRemote getCrontaskInstance()
getCrontaskInstance
in interface CronTask
public final UserInfo getRunasUserInfo()
#runAsUserInfo
public void start()
start
in interface CronTask
CronTask.stop()
,
startup()
public void stop()
public void beforeRemoval() throws MXException, java.rmi.RemoteException
CronTask
beforeRemoval
in interface CronTask
MXException
java.rmi.RemoteException