org.rhq.enterprise.communications.command.impl.stream
Class RemoteOutputStreamCommand

java.lang.Object
  extended by org.rhq.enterprise.communications.command.AbstractCommand
      extended by org.rhq.enterprise.communications.command.impl.stream.RemoteOutputStreamCommand
All Implemented Interfaces:
Serializable, Command

public class RemoteOutputStreamCommand
extends AbstractCommand

The command to be sent when a remote invocation on an output stream is to be made.

Author:
John Mazzitelli
See Also:
Serialized Form

Field Summary
static CommandType COMMAND_TYPE
          command type constant identifying this type of command
static ParameterDefinition PARAM_INVOCATION
          the required command parameter name containing the NameBasedInvocation object to describe what method to invoke on the remote stream.
static ParameterDefinition PARAM_STREAM_ID
          the required command parameter name containing the opaque identification object used to specify the particular output stream that is to be invoked.
 
Constructor Summary
RemoteOutputStreamCommand()
          Constructor for RemoteOutputStreamCommand.
RemoteOutputStreamCommand(Command commandToTransform)
          Constructor for RemoteOutputStreamCommand.
RemoteOutputStreamCommand(Map<String,Object> commandParameters)
          Constructor for RemoteOutputStreamCommand.
 
Method Summary
protected  CommandType buildCommandType()
          Builds the command type of this command.
protected  ParameterDefinition[] buildParameterDefinitions()
          Builds the set of parameter definitions that this command will use.
 org.jboss.remoting.invocation.NameBasedInvocation getNameBasedInvocation()
          Gets the invocation information that describes what needs to be invoked on the remote POJO.
 Long getStreamId()
          Get the opaque ID object used to identify the output stream that is being invoked by this command.
 boolean isCommandInResponse()
          The RemoteOutputStreamCommandResponse should not have the command in it in order to avoid returning back the byte array that was written (no sense in returning a copy of the byte array, would only decrease performance and increase the size of the over-the-wire response).
 void setCommandInResponse(boolean flag)
          The RemoteOutputStreamCommandResponse should not have the command in it in order to avoid returning back the byte array that was written (no sense in returning a copy of the byte array, would only decrease performance and increase the size of the over-the-wire response).
 void setNameBasedInvocation(org.jboss.remoting.invocation.NameBasedInvocation invocation)
          Sets the invocation information that describes what needs to be invoked on the remote POJO.
 void setStreamId(Long id)
          Sets the opaque ID object used to identify the output stream that is being invoked by this command.
 
Methods inherited from class org.rhq.enterprise.communications.command.AbstractCommand
allowAnyParameter, checkParameterValidity, convertParameters, getCommandType, getConfiguration, getParameterDefinition, getParameterDefinitions, getParameterValue, getParameterValues, getParameterValuesInternalMap, hasParameterValue, initializeMetadata, removeParameterValue, removeParameterValues, setParameterValue, setParameterValuesInternalMap, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMMAND_TYPE

public static final CommandType COMMAND_TYPE
command type constant identifying this type of command


PARAM_INVOCATION

public static final ParameterDefinition PARAM_INVOCATION
the required command parameter name containing the NameBasedInvocation object to describe what method to invoke on the remote stream.


PARAM_STREAM_ID

public static final ParameterDefinition PARAM_STREAM_ID
the required command parameter name containing the opaque identification object used to specify the particular output stream that is to be invoked.

Constructor Detail

RemoteOutputStreamCommand

public RemoteOutputStreamCommand()
                          throws IllegalArgumentException,
                                 InvalidParameterDefinitionException
Constructor for RemoteOutputStreamCommand.

Throws:
IllegalArgumentException
InvalidParameterDefinitionException
See Also:
AbstractCommand.AbstractCommand()

RemoteOutputStreamCommand

public RemoteOutputStreamCommand(Map<String,Object> commandParameters)
                          throws IllegalArgumentException,
                                 InvalidParameterDefinitionException
Constructor for RemoteOutputStreamCommand.

Throws:
IllegalArgumentException
InvalidParameterDefinitionException
See Also:
AbstractCommand.AbstractCommand(Map)

RemoteOutputStreamCommand

public RemoteOutputStreamCommand(Command commandToTransform)
Constructor for RemoteOutputStreamCommand.

See Also:
AbstractCommand.AbstractCommand(Command)
Method Detail

getNameBasedInvocation

public org.jboss.remoting.invocation.NameBasedInvocation getNameBasedInvocation()
Gets the invocation information that describes what needs to be invoked on the remote POJO.

Returns:
the invocation information

setNameBasedInvocation

public void setNameBasedInvocation(org.jboss.remoting.invocation.NameBasedInvocation invocation)
Sets the invocation information that describes what needs to be invoked on the remote POJO.

Parameters:
invocation - the invocation information

getStreamId

public Long getStreamId()
Get the opaque ID object used to identify the output stream that is being invoked by this command.

Returns:
stream identifier

setStreamId

public void setStreamId(Long id)
Sets the opaque ID object used to identify the output stream that is being invoked by this command.

Parameters:
id - stream identifier

isCommandInResponse

public boolean isCommandInResponse()
The RemoteOutputStreamCommandResponse should not have the command in it in order to avoid returning back the byte array that was written (no sense in returning a copy of the byte array, would only decrease performance and increase the size of the over-the-wire response). Therefore, this method forces its return value to be false always.

Specified by:
isCommandInResponse in interface Command
Overrides:
isCommandInResponse in class AbstractCommand
Returns:
false
See Also:
Command.isCommandInResponse()

setCommandInResponse

public void setCommandInResponse(boolean flag)
The RemoteOutputStreamCommandResponse should not have the command in it in order to avoid returning back the byte array that was written (no sense in returning a copy of the byte array, would only decrease performance and increase the size of the over-the-wire response). Therefore, this method forces the command-in-response flag to false, no matter that flag's value is.

Specified by:
setCommandInResponse in interface Command
Overrides:
setCommandInResponse in class AbstractCommand
Parameters:
flag - true to get this object returned with the command response.
See Also:
AbstractCommand.setCommandInResponse(boolean)

buildCommandType

protected CommandType buildCommandType()
Description copied from class: AbstractCommand
Builds the command type of this command. It must not be null.

This method is called by the command's constructors.

Specified by:
buildCommandType in class AbstractCommand
Returns:
the command's type definition; must not be null
See Also:
AbstractCommand.buildCommandType()

buildParameterDefinitions

protected ParameterDefinition[] buildParameterDefinitions()
Description copied from class: AbstractCommand
Builds the set of parameter definitions that this command will use. Parameter definitions define what parameters this command accepts. Implementors must return one of the following:

This method is called by the command's constructors.

Specified by:
buildParameterDefinitions in class AbstractCommand
Returns:
an array of parameter definitions or null
See Also:
AbstractCommand.buildParameterDefinitions()


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.