com.starteam.events
Class ServerCommandEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.starteam.events.ServerCommandEvent
All Implemented Interfaces:
java.io.Serializable

public final class ServerCommandEvent
extends java.util.EventObject

An event triggered whenever a command is issued to the StarTeam Server.

See Also:
ServerCommandListener, NetMonitor.addServerCommandListener(com.starteam.events.ServerCommandListener), Serialized Form

Method Summary
 long getBytesReceived()
          Gets the total number of bytes returned by the server to the client.
 long getBytesSent()
          Gets the total number of bytes sent from the client to the server.
 int getCommandCount()
          Gets the number of commands executed in this command session.
 int getCommandID()
          Gets the internal ID assigned to this command.
 java.lang.String getCommandName()
          Gets a symbolic name that describes this command ID.
 long getCommandTime()
          Gets the total execution time of this command, in milliseconds.
 java.lang.Throwable getError()
          Gets the exception that occurred during execution of the command, if any.
 int getItemsExpected()
          For bulk commands that are executed in chunks, gets the total number of items to be processed.
 int getItemsSoFar()
          For bulk commands that are executed in chunks, gets the number of items that have been processed so far.
 int getPendingCommandCount()
          Gets the total number of server commands currently in progress in this client application.
 java.lang.String getPropertyNameBeingFetched()
          if a property fetch has been triggered, this method returns the name of the property that has triggered the fetch; otherwise it will return null
 Server getServer()
          returns the server against which this command was issued
 int getServerThreadID()
          Returns the Server's Thread ID which processed this command.
 int getSessionID()
          Gets a unique id assigned to this command session.
 Type getType()
          returns the Type of Object associated with this Command, if any or null, if this command is not associated with any specific type
 boolean isCommandFinished()
          Determines whether or not the execution of this command is starting (a start event) or finishing (an end or error event).
 boolean isPropertyFetchTriggered()
          Returns true if this command triggers a property fetch for a single item This is an indication that the application has not pre-populated the appropriate set of properties for the item(s) at the folder level Failure to do so implies significantly increased server round-trip processing.
 boolean isSuccessful()
          Determines whether or not the command terminated normally.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getSessionID

public int getSessionID()
Gets a unique id assigned to this command session. The session id and the command count together uniquely identify a command instance.

Returns:
A unique id assigned to this command session.
See Also:
ServerCommandEvent.getCommandCount()

getCommandCount

public int getCommandCount()
Gets the number of commands executed in this command session. The command count is incremented at the start of the command. The session id and the command count together uniquely identify a command instance.

Returns:
The number of commands executed in this command session.
See Also:
ServerCommandEvent.getSessionID()

getCommandID

public int getCommandID()
Gets the internal ID assigned to this command. Different IDs represent different server functions.

Returns:
The internal ID assigned to this command.
See Also:
ServerCommandEvent.getCommandName()

getServerThreadID

public int getServerThreadID()
Returns the Server's Thread ID which processed this command. Will be -1 until until set at the end of command execution.

Returns:
Returns the Server's Thread ID which processed this command.

getCommandName

public java.lang.String getCommandName()
Gets a symbolic name that describes this command ID.

Returns:
A symbolic name that describes this command ID.
See Also:
ServerCommandEvent.getCommandID()

getBytesSent

public long getBytesSent()
Gets the total number of bytes sent from the client to the server.

Returns:
The total number of bytes sent from the client to the server, or zero if this is a start event.
See Also:
ServerCommandEvent.isCommandFinished()

getBytesReceived

public long getBytesReceived()
Gets the total number of bytes returned by the server to the client.

Returns:
The total number of bytes returned by the server to the client, or zero if this is a start event.
See Also:
ServerCommandEvent.isCommandFinished()

getCommandTime

public long getCommandTime()
Gets the total execution time of this command, in milliseconds.

Returns:
The total execution time of this command, in milliseconds, or zero if this is a start event.
See Also:
ServerCommandEvent.isCommandFinished()

isCommandFinished

public boolean isCommandFinished()
Determines whether or not the execution of this command is starting (a start event) or finishing (an end or error event).

Returns:
false for a start event; true for an end or error event.

isSuccessful

public boolean isSuccessful()
Determines whether or not the command terminated normally.

Returns:
true if the command terminated normally; false if an exception occurred during the execution of the command.
See Also:
ServerCommandEvent.getError()

getError

public java.lang.Throwable getError()
Gets the exception that occurred during execution of the command, if any.

Returns:
The exception that ocurred during execution of the command, or null if the command did not terminate abnormally.
See Also:
ServerCommandEvent.isSuccessful()

getPendingCommandCount

public int getPendingCommandCount()
Gets the total number of server commands currently in progress in this client application. Usually one (for a start event) or zero (for an end event), but may be greater than this if there are other command sessions executing in separate threads.

Returns:
The total number of server commands currently in progress in this client application.

isPropertyFetchTriggered

public boolean isPropertyFetchTriggered()
Returns true if this command triggers a property fetch for a single item This is an indication that the application has not pre-populated the appropriate set of properties for the item(s) at the folder level Failure to do so implies significantly increased server round-trip processing. Applications should rely upon this information for performance improvement purposes only

Returns:
boolean true if this command triggers a property fetch for a single item

getPropertyNameBeingFetched

public java.lang.String getPropertyNameBeingFetched()
if a property fetch has been triggered, this method returns the name of the property that has triggered the fetch; otherwise it will return null

Returns:
String the name of the property that has triggered the fetch
See Also:
ServerCommandEvent.isPropertyFetchTriggered()

getType

public Type getType()
returns the Type of Object associated with this Command, if any or null, if this command is not associated with any specific type

Returns:
Type the Type of Object associated with this Command, if any
See Also:
Type

getServer

public Server getServer()
returns the server against which this command was issued

Returns:
Server the server against which this command was issued

getItemsSoFar

public int getItemsSoFar()
For bulk commands that are executed in chunks, gets the number of items that have been processed so far.

Note that isCommandFinished() may return true even if there are more items still to be processed. This occurs when each chunk is implemented as a separate server command.

Currently, PROJ_CMD_REFRESH_ITEMS is the only server command for which getItemsSoFar() returns non-zero. Note that isCommandFinished() may return true even if there are more items still to be processed. This is because each chunk is currently executed as a separate command.

Returns:
The number of items processed so far, or zero if this server command is not a bulk command that processes items in chunks.
See Also:
ServerCommandEvent.getItemsExpected(), Folder.populate(Item.Type, PropertyCollection, int)

getItemsExpected

public int getItemsExpected()
For bulk commands that are executed in chunks, gets the total number of items to be processed.

Returns:
The total number of items to be processed, or zero if this server command is not a bulk command that processes items in chunks.
See Also:
ServerCommandEvent.getItemsSoFar()


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.