Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.drupal.project.async_command
Class CommandRecord

    java.lang.Object
      org.drupal.project.async_command.CommandRecord

All Implemented Interfaces:
  java.lang.Comparable<CommandRecord>

    public class CommandRecord

extends java.lang.Object
implements java.lang.Comparable<CommandRecord>

Database record for this AsyncCommand. This is the "boundary object" between AsyncCommand and Druplet, where Druplet knows how to transfer data into the AsyncCommand, And AsyncCommand only cares about the program logic.

Field Summary
`protected static java.util.logging.Logger` | `logger`

Constructor Summary
`CommandRecord(java.util.Map<java.lang.String,java.lang.Object> row, DrupalConnection drupalConnection)` Given the database query result, construct a AsyncCommand Record object.

Method Summary
`int` | `compareTo(CommandRecord o)` The smaller the weight, created, or id, the smaller the record.
`static CommandRecord` | `create(java.util.Map<java.lang.String,java.lang.Object> fields, DrupalConnection drupalConnection)` Not supported yet!! Factory method, Create a record and save in the database.
`static CommandRecord` | `forge(java.util.Map<java.lang.String,java.lang.Object> fields)` Created a forge record which is only used in memory.
`java.lang.String` | `getApp()`
`java.lang.Long` | `getCheckpoint()`
`java.lang.String` | `getCommand()`
`AsyncCommand.Control` | `getControl()`
`java.lang.Long` | `getCreated()`
`java.lang.String` | `getDescription()`
`java.lang.Long` | `getEid()`
`java.lang.Long` | `getEnd()`
`java.lang.Long` | `getId()`
`java.lang.Long` | `getId1()`
`java.lang.Long` | `getId2()`
`java.lang.Long` | `getId3()`
`java.lang.Long` | `getId4()`
`byte[]` | `getInput()`
`java.lang.String` | `getMessage()`
`java.lang.Float` | `getNumber1()`
`java.lang.Float` | `getNumber2()`
`java.lang.Float` | `getNumber3()`
`java.lang.Float` | `getNumber4()`
`byte[]` | `getOutput()`
`java.lang.Float` | `getProgress()`
`java.lang.Long` | `getStart()`
`AsyncCommand.Status` | `getStatus()`
`java.lang.String` | `getString1()`
`java.lang.String` | `getString2()`
`java.lang.String` | `getString3()`
`java.lang.String` | `getString4()`
`java.lang.Long` | `getUid()`
`java.lang.Long` | `getWeight()`
`boolean` | `isForged()`
`void` | `persistField(java.lang.String fieldName, java.lang.Object fieldValue)` Update a single field in the {async_command} table.
`void` | `persistResult()` Update the result and status part of the command record.
`void` | `setCheckpoint(java.lang.Long checkpoint)`
`void` | `setControl(AsyncCommand.Control control)`
`void` | `setEnd(java.lang.Long end)`
`void` | `setId1(java.lang.Long id1)`
`void` | `setId2(java.lang.Long id2)`
`void` | `setId3(java.lang.Long id3)`
`void` | `setId4(java.lang.Long id4)`
`void` | `setMessage(java.lang.String message)`
`void` | `setNumber1(java.lang.Float number1)`
`void` | `setNumber2(java.lang.Float number2)`
`void` | `setNumber3(java.lang.Float number3)`
`void` | `setNumber4(java.lang.Float number4)`
`void` | `setOutput(byte[] output)`
`void` | `setProgress(java.lang.Float progress)`
`void` | `setStart(java.lang.Long start)`
`void` | `setStatus(AsyncCommand.Status status)`
`void` | `setStatus(java.lang.String status)`
`void` | `setString1(java.lang.String string1)`
`void` | `setString2(java.lang.String string2)`
`void` | `setString3(java.lang.String string3)`
`void` | `setString4(java.lang.String string4)`
`void` | `setWeight(java.lang.Long weight)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### logger

    protected static java.util.logging.Logger logger

Constructor Detail

### CommandRecord

    public CommandRecord(java.util.Map<java.lang.String,java.lang.Object> row,
                         DrupalConnection drupalConnection)

  Given the database query result, construct a AsyncCommand Record object.

  Parameters:
    `row` - Database row for this record, should exact match the record.
    `drupalConnection` -

Method Detail

### persistResult

    public void persistResult()

  Update the result and status part of the command record.

### persistField

    public void persistField(java.lang.String fieldName,
                             java.lang.Object fieldValue)

  Update a single field in the {async_command} table.

  Parameters:
    `fieldName` - Can only be status, control, message, weight, start, end, checkpoint and progress.
    `fieldValue` - The value of the field. Doesn't have to match to the class member field.

### compareTo

    public int compareTo(CommandRecord o)

  The smaller the weight, created, or id, the smaller the record. Smaller record would get executed first.

  Specified by:
    `compareTo` in interface `java.lang.Comparable<CommandRecord>`
  Parameters:
    `o` -
  Returns:

### create

    public static CommandRecord create(java.util.Map<java.lang.String,java.lang.Object> fields,
                                       DrupalConnection drupalConnection)

  Not supported yet!! Factory method, Create a record and save in the database.

  Parameters:
    `fields` -
    `drupalConnection` -
  Returns:

### forge

    public static CommandRecord forge(java.util.Map<java.lang.String,java.lang.Object> fields)

  Created a forge record which is only used in memory.

  Parameters:
    `fields` -
  Returns:

### isForged

    public boolean isForged()

  Returns:

### getCommand

    public java.lang.String getCommand()

### setStatus

    public void setStatus(AsyncCommand.Status status)

### getStatus

    public AsyncCommand.Status getStatus()

### getId

    public java.lang.Long getId()

### getApp

    public java.lang.String getApp()

### getDescription

    public java.lang.String getDescription()

### getUid

    public java.lang.Long getUid()

### getEid

    public java.lang.Long getEid()

### getCreated

    public java.lang.Long getCreated()

### getInput

    public byte[] getInput()

### getOutput

    public byte[] getOutput()

### getId1

    public java.lang.Long getId1()

### getId2

    public java.lang.Long getId2()

### getId3

    public java.lang.Long getId3()

### getId4

    public java.lang.Long getId4()

### getNumber1

    public java.lang.Float getNumber1()

### getNumber2

    public java.lang.Float getNumber2()

### getNumber3

    public java.lang.Float getNumber3()

### getNumber4

    public java.lang.Float getNumber4()

### getString1

    public java.lang.String getString1()

### getString2

    public java.lang.String getString2()

### getString3

    public java.lang.String getString3()

### getString4

    public java.lang.String getString4()

### getControl

    public AsyncCommand.Control getControl()

### getMessage

    public java.lang.String getMessage()

### getWeight

    public java.lang.Long getWeight()

### getStart

    public java.lang.Long getStart()

### getEnd

    public java.lang.Long getEnd()

### getCheckpoint

    public java.lang.Long getCheckpoint()

### getProgress

    public java.lang.Float getProgress()

### setOutput

    public void setOutput(byte[] output)

### setId1

    public void setId1(java.lang.Long id1)

### setId2

    public void setId2(java.lang.Long id2)

### setId3

    public void setId3(java.lang.Long id3)

### setId4

    public void setId4(java.lang.Long id4)

### setNumber1

    public void setNumber1(java.lang.Float number1)

### setNumber2

    public void setNumber2(java.lang.Float number2)

### setNumber3

    public void setNumber3(java.lang.Float number3)

### setNumber4

    public void setNumber4(java.lang.Float number4)

### setString1

    public void setString1(java.lang.String string1)

### setString2

    public void setString2(java.lang.String string2)

### setString3

    public void setString3(java.lang.String string3)

### setString4

    public void setString4(java.lang.String string4)

### setStatus

    public void setStatus(java.lang.String status)

### setControl

    public void setControl(AsyncCommand.Control control)

### setMessage

    public void setMessage(java.lang.String message)

### setWeight

    public void setWeight(java.lang.Long weight)

### setStart

    public void setStart(java.lang.Long start)

### setEnd

    public void setEnd(java.lang.Long end)

### setCheckpoint

    public void setCheckpoint(java.lang.Long checkpoint)

### setProgress

    public void setProgress(java.lang.Float progress)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD