|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drupal.project.computing.DCommand
public abstract class DCommand
Individual command to be executed. Each command is also registered with a DApplication. A command doesn't necessarily know a DSite. If needed, it can get from DApplication. The Record class needs to know a DSite in order to do database operations. DCommand has no constructor. To initialize a DCommand, use the "create()" factory method, which also initialize things for all DCommand sub-classes. Sub-classes should implement the map* methods for further initialization.
Field Summary | |
---|---|
protected DApplication |
application
|
protected java.util.logging.Logger |
logger
|
protected DRecord |
record
|
Constructor Summary | |
---|---|
DCommand()
|
Method Summary | |
---|---|
protected void |
after()
|
protected void |
before()
|
DRecord |
call()
Impelments Callable::call(). |
static DCommand |
create(java.lang.Class<? extends DCommand> commandClass,
DApplication application)
|
static DCommand |
create(java.lang.Class<? extends DCommand> commandClass,
DApplication application,
DRecord record)
Create a command sub-class, and then initialize it. |
protected abstract void |
execute()
The execution of DCommand sub-class doesn't have to care about DRecord. |
protected DApplication |
getApplication()
|
protected DSite |
getDrupalSite()
Each DCommand is associated with one DApplication, which means it's associated with one Drupal site. |
java.lang.String |
getIdentifier()
|
protected DRecord |
getRecord()
|
abstract void |
keepResults(DRecord record)
Saves command results back to the record. |
abstract void |
mapArgs(java.lang.String[] args,
DRecord record)
Defines how to map the args to the given record. |
abstract void |
mapRecord(DRecord record)
Defines how to map a record to the parameters in the command. |
protected void |
markProgress(float progress)
|
protected void |
markStatus(DRecord.Status status)
|
protected void |
printMessage(java.lang.String message)
|
void |
run()
Overrides Runnable.run(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.logging.Logger logger
protected DApplication application
protected DRecord record
Constructor Detail |
---|
public DCommand()
Method Detail |
---|
public static DCommand create(java.lang.Class<? extends DCommand> commandClass, DApplication application, DRecord record)
commandClass
- application
- record
-
public static DCommand create(java.lang.Class<? extends DCommand> commandClass, DApplication application)
protected DApplication getApplication()
protected DRecord getRecord()
protected DSite getDrupalSite()
public java.lang.String getIdentifier()
protected void markStatus(DRecord.Status status) throws DConnectionException
DConnectionException
protected void markProgress(float progress) throws DConnectionException
DConnectionException
protected void printMessage(java.lang.String message)
public abstract void mapRecord(DRecord record)
record
- public abstract void mapArgs(java.lang.String[] args, DRecord record)
args
- record
- public abstract void keepResults(DRecord record)
public void run()
run
in interface java.lang.Runnable
protected void before()
protected void after()
protected abstract void execute() throws DCommandExecutionException, DConnectionException
DCommandExecutionException
DConnectionException
public DRecord call()
call
in interface java.util.concurrent.Callable<DRecord>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |