com.vhosting.netconf.frame
Class Rpc

java.lang.Object
  extended by com.vhosting.netconf.frame.Identity
      extended by com.vhosting.netconf.frame.IdentityCreator
          extended by com.vhosting.netconf.frame.Rpc

public class Rpc
extends IdentityCreator

This class provides the basic structure for the construction of RPC operations and reading the associated RPC reply informations. The class was designed having in mind the fact that it can be used in case of automated code generation from a YANG module. Nothing prevents, however, be used freely.

Version:
1.01, 09/10/2010
Author:
Giuseppe Palmeri

Field Summary
 
Fields inherited from class com.vhosting.netconf.frame.Identity
name, namespaceURI, prefix
 
Constructor Summary
Rpc(Capability cap, java.lang.String name)
          Create an RPC request with the operation name for the specified capability.
 
Method Summary
 void addAttribute(Attribute attr)
          Allows you to assign an attribute to the RPC operation.
 void clearInputValues()
          Clear the Input container.
 void clearOutputValues()
          Clear the Output container.
 void dumpRpcMessage(Session session, int messageId, java.io.OutputStream out)
          This method writes the RPC operation on the specified output stream as an XML Netconf message.
 Container getInput()
          Get the first entry point to the structure of the PRC operation as a container.
 Container getOutput()
          Get the first entry point to the structure of the PRC reply as a container.
 boolean readFromRpcReplyMessage(org.w3c.dom.Document doc)
          This method loads the RPC reply from the specified XML document.
 
Methods inherited from class com.vhosting.netconf.frame.IdentityCreator
createAnyxml, createAnyxml, createContainer, createContainer, createContainerReference, createContainerReference, createIdentity, createIdentity, createLeaf, createLeaf, createLeafList, createLeafList, createList, createList, createListReference, createListReference
 
Methods inherited from class com.vhosting.netconf.frame.Identity
getName, getNamespaceURI, getPrefix, getUniqueNane
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rpc

public Rpc(Capability cap,
           java.lang.String name)
Create an RPC request with the operation name for the specified capability.

Parameters:
cap - The capability.
name - The name of the RPC operation.
Method Detail

addAttribute

public void addAttribute(Attribute attr)
Allows you to assign an attribute to the RPC operation.

Parameters:
attr - The attribute.

clearInputValues

public void clearInputValues()
Clear the Input container. After the invocation of this method all the values assigned to the operation RPC will be deleted. For a specific RPC operation with default values may be useful to repopulate the property defaults to the values immediately after the invocation of this method.


clearOutputValues

public void clearOutputValues()
Clear the Output container. After the invocation of this method all the assigned values through an RPC reply will be deleted.


getInput

public final Container getInput()
Get the first entry point to the structure of the PRC operation as a container.

Returns:
The RPC operation input container.

getOutput

public final Container getOutput()
Get the first entry point to the structure of the PRC reply as a container.

Returns:
The RPC reply output container.

dumpRpcMessage

public void dumpRpcMessage(Session session,
                           int messageId,
                           java.io.OutputStream out)
                    throws java.io.IOException
This method writes the RPC operation on the specified output stream as an XML Netconf message.

Parameters:
messageId - The message id.
out - The output stream.
Throws:
java.io.IOException - Throw this exception when there are problems when writing the message.

readFromRpcReplyMessage

public boolean readFromRpcReplyMessage(org.w3c.dom.Document doc)
This method loads the RPC reply from the specified XML document. The XML document should be a Netconf RPC reply message. The values loaded are available within the output container.

Parameters:
doc - The XML document containing the Netconf RPC reply message.
Returns:
true if it has been possible to load values into the structure; false otherwise.
See Also:
getOutput()