net.ponder2.comms
Class Receiver

java.lang.Object
  extended by net.ponder2.comms.Receiver

public class Receiver
extends java.lang.Object

receive methods to match the transmit methods. This is a helper class common to all protocols. If the protocol is capable of handing the transmit arguments straight across then these methods simply have to be called without any further work

Version:
$Id:$
Author:
Kevin Twidle

Constructor Summary
Receiver()
           
 
Method Summary
static java.lang.String execute(java.lang.String sxml)
          Executes a remotely received command.
static com.twicom.qdparser.TaggedElement execute(com.twicom.qdparser.TaggedElement xml)
          Executes a remotely received command.
static P2Object execute(java.net.URI address, OID oid, P2Object source, java.lang.String op, P2Object[] args)
          Executes a remotely received command.
static com.twicom.qdparser.TaggedElement execute(java.net.URI address, com.twicom.qdparser.TaggedElement xoid, com.twicom.qdparser.TaggedElement xsource, java.lang.String op, com.twicom.qdparser.TaggedElement[] xargs)
          Executes a remotely received command.
static P2Object getObject(java.net.URI address, java.lang.String path)
          Returns a managed object to a remote SMC.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Receiver

public Receiver()
Method Detail

getObject

public static P2Object getObject(java.net.URI address,
                                 java.lang.String path)
                          throws Ponder2Exception
Returns a managed object to a remote SMC. The object is located by using the given pathname. The address used to access this SMC is also given. This address is added to the list of the SMC's addresses in case the local SMC did not know that it could be addressed this way. Future OIDs when serialised will include the new address.

Parameters:
address - the URI used to talk to this SMC
path - the local pathname for the object to be looked up
Returns:
the object located at the pathname
Throws:
Ponder2Exception

execute

public static P2Object execute(java.net.URI address,
                               OID oid,
                               P2Object source,
                               java.lang.String op,
                               P2Object[] args)
                        throws Ponder2Exception
Executes a remotely received command. All the arguments are the basic types required by the operation method

Parameters:
address - the URI that this SMC was addressed with
oid - the OID of the object (target) to receive the command
source - the source object of the command
op - the operation itself
args - an array of operation arguments
Returns:
the result of the operation as an internal SMC object
Throws:
Ponder2Exception - if an error is found

execute

public static com.twicom.qdparser.TaggedElement execute(java.net.URI address,
                                                        com.twicom.qdparser.TaggedElement xoid,
                                                        com.twicom.qdparser.TaggedElement xsource,
                                                        java.lang.String op,
                                                        com.twicom.qdparser.TaggedElement[] xargs)
                                                 throws Ponder2Exception
Executes a remotely received command. All Ponder2 types are expressed as Ponder2 XML.

Parameters:
address - the URI that this SMC was addressed with
xoid - the OID of the object (target) to receive the command in XML format
xsource - the source object of the command in XML format
op - the operation itself
xargs - an array of operation arguments in XML format
Returns:
the result of the operation as a Ponder2 object in XML format
Throws:
Ponder2Exception

execute

public static com.twicom.qdparser.TaggedElement execute(com.twicom.qdparser.TaggedElement xml)
                                                 throws Ponder2Exception
Executes a remotely received command. All the arguments are rolled into a single XML structure. This method has to be matched by the method in TransmitterImpl that rolls the arguments up into the XML structure.

Parameters:
xml - a single XML structure containing all the information for the execute command as sub-elements
Returns:
the result of the operation as a Ponder2 object in XML format
Throws:
Ponder2Exception

execute

public static java.lang.String execute(java.lang.String sxml)
                                throws Ponder2Exception
Executes a remotely received command. All the arguments are rolled into a single XML string

Parameters:
sxml - a single XML structure, in string form, containing all the information for the execute command as sub-elements
Returns:
the result of the operation as a Ponder2 object in XML format
Throws:
Ponder2Exception


Copyright © 2008 Imperial College. All Rights Reserved.