net.kano.joscar.rvcmd
Class DefaultRvCommandFactory

java.lang.Object
  extended byDefaultRvCommandFactory
All Implemented Interfaces:
RvCommandFactory

public class DefaultRvCommandFactory
extends java.lang.Object
implements RvCommandFactory

A default RV command factory that generates instances of the RvCommands defined in the net.kano.joscar.rvcmd subpackages.

This factory can generate RV commands from the following types of capabilities:


Constructor Summary
DefaultRvCommandFactory()
           
 
Method Summary
 RvCommand genRvCommand(RecvRvIcbm rvIcbm)
          Attempts to generate a RvCommand from the data in the given RecvRvIcbm.
 CapabilityBlock[] getSupportedCapabilities()
          Returns the types of RV commands that this factory may be able to generate in genRvCommand.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRvCommandFactory

public DefaultRvCommandFactory()
Method Detail

getSupportedCapabilities

public CapabilityBlock[] getSupportedCapabilities()
Description copied from interface: RvCommandFactory
Returns the types of RV commands that this factory may be able to generate in genRvCommand. Note that a capability block's presence in the returned array does not mean that a call to RvCommandFactory.genRvCommand(net.kano.joscar.snaccmd.icbm.RecvRvIcbm) must return a non-null value; it simply means that this factory can be used to handle commands of that type.

Note that if this method returns null, it will be used to by the RvProcessor to which it is added to handle all types of commands do not otherwise have an associated factory. See RvProcessor.registerRvCmdFactory(CapabilityBlock, RvCommandFactory) for details.

Specified by:
getSupportedCapabilities in interface RvCommandFactory
Returns:
the capabilities (RV types) that this factory may be able to convert, or null if it can handle all types of rendezvous commands

genRvCommand

public RvCommand genRvCommand(RecvRvIcbm rvIcbm)
Description copied from interface: RvCommandFactory
Attempts to generate a RvCommand from the data in the given RecvRvIcbm. Note that this method can return null if an RV command cannot be generated for any reason (such as if the given command is in an invalid format

Specified by:
genRvCommand in interface RvCommandFactory
Parameters:
rvIcbm - the incoming rendezvous ICBM command from which a RvCommand should be generated
Returns:
a RvCommand generated from the given incoming RV ICBM, or null if none could be generated