org.eclipse.datatools.sqltools.result
Class OperationCommand

java.lang.Object
  extended byorg.eclipse.datatools.sqltools.result.OperationCommand
All Implemented Interfaces:
java.io.Serializable

public class OperationCommand
extends java.lang.Object
implements java.io.Serializable

The OperationCommand is used to uniquely identify an execution result in SQL Results View, it is the starting point to use SQL Results View.

The consumer needs to initiate an instance of OperationCommand first, and then uses ResultsViewAPI to append message or result set, or set parameters to SQL Results View. When using the ResultsViewAPI to append result item to SQL Results View, this instance should always be given.

Author:
Dafan Yang
See Also:
ResultsViewAPI, Serialized Form

Field Summary
static int ACTION_EXECUTE
           
static int STATUS_CRITICAL_ERROR
           
static int STATUS_FAILED
           
static int STATUS_RUNNING
           
static int STATUS_STARTED
           
static int STATUS_SUCCEEDED
           
static int STATUS_TERMINATED
           
static int STATUS_WARNING
           
 
Constructor Summary
OperationCommand(int type, java.lang.String displayStr, java.lang.String consumerName, java.lang.String profileName, java.lang.String databaseName)
          Constructs an instance of OperationCommand.
OperationCommand(int type, java.lang.String displayStr, java.lang.String consumerName, java.lang.String profileName, java.lang.String databaseName, java.io.Serializable data)
          Construstor
 
Method Summary
static java.lang.String getActionString(int actionId)
          Converts the action id to action string.
 int getActionType()
          Returns the action type
 java.lang.String getConsumerName()
          Returns the consumer's name
 java.io.Serializable getData()
          Returns the data
 java.lang.String getDatabaseName()
          Returns the database name
 java.lang.String getDisplayString()
          Returns the display string of this operation
 java.lang.String getProfileName()
          Returns the connection profile name
static Image getStatusImage(int statusId)
          Returns the image of given status
static java.lang.String getStatusString(int statusId)
          Converts the status id to status string
 void setData(java.io.Serializable _data)
          Sets the data
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_CRITICAL_ERROR

public static final int STATUS_CRITICAL_ERROR
See Also:
Constant Field Values

STATUS_WARNING

public static final int STATUS_WARNING
See Also:
Constant Field Values

STATUS_TERMINATED

public static final int STATUS_TERMINATED
See Also:
Constant Field Values

STATUS_FAILED

public static final int STATUS_FAILED
See Also:
Constant Field Values

STATUS_SUCCEEDED

public static final int STATUS_SUCCEEDED
See Also:
Constant Field Values

STATUS_RUNNING

public static final int STATUS_RUNNING
See Also:
Constant Field Values

STATUS_STARTED

public static final int STATUS_STARTED
See Also:
Constant Field Values

ACTION_EXECUTE

public static final int ACTION_EXECUTE
See Also:
Constant Field Values
Constructor Detail

OperationCommand

public OperationCommand(int type,
                        java.lang.String displayStr,
                        java.lang.String consumerName,
                        java.lang.String profileName,
                        java.lang.String databaseName)
Constructs an instance of OperationCommand.

Parameters:
type - the action type, should be one of the types defined in this class(for now, we have only 1 type)
displayStr - string used to display, for example SQL statement, should not be null
consumerName - name of the caller
profileName - connection profile name, should not be null
databaseName - database name, should not be null
See Also:
ACTION_EXECUTE

OperationCommand

public OperationCommand(int type,
                        java.lang.String displayStr,
                        java.lang.String consumerName,
                        java.lang.String profileName,
                        java.lang.String databaseName,
                        java.io.Serializable data)
Construstor

Parameters:
data - consumer can use this field to store anything
Method Detail

getDisplayString

public java.lang.String getDisplayString()
Returns the display string of this operation

Returns:
the display string of this operation

getActionType

public int getActionType()
Returns the action type

Returns:
the action type
See Also:
ACTION_EXECUTE

getConsumerName

public java.lang.String getConsumerName()
Returns the consumer's name

Returns:
the consumer's name

getProfileName

public java.lang.String getProfileName()
Returns the connection profile name

Returns:
the connection profile name

getDatabaseName

public java.lang.String getDatabaseName()
Returns the database name

Returns:
the database name

getActionString

public static java.lang.String getActionString(int actionId)
Converts the action id to action string.

Parameters:
actionId - the action type
Returns:
the action string

getStatusImage

public static Image getStatusImage(int statusId)
Returns the image of given status

Parameters:
statusId - the status id
Returns:
the image of this status

getStatusString

public static java.lang.String getStatusString(int statusId)
Converts the status id to status string

Parameters:
statusId - the id of the status
Returns:
the string that describes this status

getData

public java.io.Serializable getData()
Returns the data

Returns:
the data

setData

public void setData(java.io.Serializable _data)
Sets the data

Parameters:
_data - the data


Copyright © 2006 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.