com.vhosting.netconf
Class CreateSubscription

java.lang.Object
  extended by com.vhosting.netconf.Operation
      extended by com.vhosting.netconf.CreateSubscription

public class CreateSubscription
extends Operation

The create-subscription Netconf operation. This operation initiates an event notification subscription that will send asynchronous event notifications to the initiator of the operation until the subscription terminates. Supported server capabilities:

 urn:ietf:params:xml:ns:netconf:notification:1.0
 

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

Nested Class Summary
 
Nested classes/interfaces inherited from class com.vhosting.netconf.Operation
Operation.Reply
 
Field Summary
 
Fields inherited from class com.vhosting.netconf.Operation
operation, session
 
Constructor Summary
CreateSubscription(Session session)
          Create the create-subscription Netconf operation.
 
Method Summary
static java.lang.String convert3339(java.util.Date d)
          Converts a date into a string that conforms to the RFC3339 standard of the Internet.
 SubtreeFilter createSubtreeFilter()
          Create a subtree filter.
 void setStartTime(java.util.Date startTime)
          Allows you to specify the starting time for the subscription.
 void setStopTime(java.util.Date stopTime)
          Allows you to specify the time to end the subscription.
 void setStream(java.lang.String stream)
          This method allows you to specify a specific stream for the subscription.
 void setSubtreeFilter(SubtreeFilter f)
           
 void setXPathFilter(java.lang.String xpath)
          Set an XPath filter.
 
Methods inherited from class com.vhosting.netconf.Operation
execute, execute, executeSync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateSubscription

public CreateSubscription(Session session)
                   throws CapabilityException
Create the create-subscription Netconf operation.
 See the RFC 5277 - NETCONF Event Notifications
 

Parameters:
session - The active session.
Throws:
CapabilityException - Throw this exception if the server does not have the :notification:1.0 capability.
Method Detail

setStream

public void setStream(java.lang.String stream)
This method allows you to specify a specific stream for the subscription.

Parameters:
stream - The stream.

setStartTime

public void setStartTime(java.util.Date startTime)
Allows you to specify the starting time for the subscription.

Parameters:
startTime - The start time.

setStopTime

public void setStopTime(java.util.Date stopTime)
Allows you to specify the time to end the subscription.

Parameters:
stopTime - The stop time.

createSubtreeFilter

public SubtreeFilter createSubtreeFilter()
Create a subtree filter. Simply call this method to create a filter in the operation. The created filter is an empty filter. Through an empty filter, no data will be selected. You will need to populate the filter created with references to the data you want.

Returns:
The SubtreeFilter created.

setSubtreeFilter

public void setSubtreeFilter(SubtreeFilter f)

setXPathFilter

public void setXPathFilter(java.lang.String xpath)
                    throws CapabilityException
Set an XPath filter. Use this method when the operation includes the possibility of an XPath filter on data received. The filter will be interpreted by the server.

Parameters:
xpath - The XPath string.
Throws:
CapabilityException - Throw this exception if the server does not have the :xpath:1.0 capability.

convert3339

public static java.lang.String convert3339(java.util.Date d)
Converts a date into a string that conforms to the RFC3339 standard of the Internet.

Parameters:
d - The Java Date.
Returns:
The RFC3339 compliant Date string.