com.vhosting.netconf.frame
Interface RpcHandler


public interface RpcHandler

This interface defines the methods useful for handling the sending of RPC commands and the receiving of RPC replies.

Version:
1.00, 02/11/2010
Author:
Giuseppe Palmeri

Method Summary
 Session getSession()
          Get the session for this connection.
 int sendRpc(Rpc operation)
          Send a RPC operation.
 void sendRpc(Rpc operation, RpcReplySpecificListener listener)
          Send a RPC operation specifying a listener that will intercept the RPC reply.
 RpcReply sendSyncRpc(Rpc operation)
          Send an operation and waits until you get a reply.
 void setNotificationsListener(NotificationsListener listener)
          Set the Notifications listener that will intercept Netconf notifications.
 void setRpcReplyListener(RpcReplyListener listener)
          Set the general listener of RPC replies that will intercept RPC replies to which there is no direct association with an operation.
 

Method Detail

sendSyncRpc

RpcReply sendSyncRpc(Rpc operation)
                     throws java.io.IOException
Send an operation and waits until you get a reply.

Parameters:
operation - The RPC operation.
Returns:
The RPC reply.
Throws:
java.io.IOException - throws this exception when the connection is no longer active before and during the exchange of messages.

sendRpc

int sendRpc(Rpc operation)
            throws java.io.IOException
Send a RPC operation. the response can be intercepted using the method: setRpcReplyListener(RpcReplyListener listener);

Parameters:
operation - The RPC operation.
Returns:
The message id of the message which was sent the operation.
Throws:
java.io.IOException - Throws this exception when the connection is no longer active before and during the exchange of messages.
See Also:
setRpcReplyListener(RpcReplyListener listener)

sendRpc

void sendRpc(Rpc operation,
             RpcReplySpecificListener listener)
             throws java.io.IOException
Send a RPC operation specifying a listener that will intercept the RPC reply.

Parameters:
operation - The RPC operation.
listener - The listener that will intercept the RPC reply.
Throws:
java.io.IOException - Throws this exception when the connection is no longer active before and during the exchange of messages.

setRpcReplyListener

void setRpcReplyListener(RpcReplyListener listener)
Set the general listener of RPC replies that will intercept RPC replies to which there is no direct association with an operation.

Parameters:
listener - The listener that will intercept the RPC replies.

setNotificationsListener

void setNotificationsListener(NotificationsListener listener)
Set the Notifications listener that will intercept Netconf notifications.

Parameters:
listener - The listener that will intercept the Netconf notifications.

getSession

Session getSession()
Get the session for this connection. The session will remain inactive until when will you make a connection with the server.

Returns:
The session.