com.vhosting.netconf.transport
Class Capability

java.lang.Object
  extended by com.vhosting.netconf.transport.Capability
Direct Known Subclasses:
YANGCapability

public class Capability
extends java.lang.Object

This class represents a generic capability. When it is necessary to have a new capability, this class can be instantiated and used the instance to create new operations.

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

Nested Class Summary
 class Capability.CapabilityParams
          This class defines the parameters for a capability provided by the server.
 
Field Summary
protected  java.lang.String prefix
           
 
Constructor Summary
Capability(java.lang.String capabilityBaseURI, java.lang.String namespaceURI, java.lang.String prefix)
          Constructs the instance of a capability.
 
Method Summary
 java.lang.String getCapabilityBaseURI()
          Get the capability base Uri or the capability Uri without parameters.
 java.lang.String getNamespaceURI()
          Get the capability namespace Uri.
 java.lang.String getPrefix()
          Get the namespace prefix.
 Capability.CapabilityParams getServerCapabilityParams(Session session)
          When the session is active, takes the server side parameters set for this capability.
 boolean isPresentOnServer(Session session)
          Check if the capability is present on the server.
 java.lang.String toString()
           
 void touch()
          Use this method when you want to ensure that the capability is included in the Hello message before establishing a connection.
 void unsetServerCapabilityPresence(Session session)
          Unset the presence of the capability on the server side.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

prefix

protected java.lang.String prefix
Constructor Detail

Capability

public Capability(java.lang.String capabilityBaseURI,
                  java.lang.String namespaceURI,
                  java.lang.String prefix)
Constructs the instance of a capability.

Parameters:
capabilityBaseURI - The capability base Uri or the capability Uri without parameters.
namespaceURI - The namespace Uri for this capability.
prefix - The candidate namespace prefix of the namespace Uri.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

touch

public final void touch()
Use this method when you want to ensure that the capability is included in the Hello message before establishing a connection.


isPresentOnServer

public boolean isPresentOnServer(Session session)
Check if the capability is present on the server.

Parameters:
session - The active session.
Returns:
true if the capability is present on the server; false otherwise;

getServerCapabilityParams

public Capability.CapabilityParams getServerCapabilityParams(Session session)
When the session is active, takes the server side parameters set for this capability.

Parameters:
session - The active session.
Returns:
The capability params; null if the capability is not present on the server

unsetServerCapabilityPresence

public void unsetServerCapabilityPresence(Session session)
Unset the presence of the capability on the server side. After this method is invoked, the server side parameters are no longer available.

Parameters:
session - The active session.

getPrefix

public java.lang.String getPrefix()
Get the namespace prefix.

Returns:
The namespace prefix.

getNamespaceURI

public java.lang.String getNamespaceURI()
Get the capability namespace Uri.

Returns:
The namespace Uri.

getCapabilityBaseURI

public java.lang.String getCapabilityBaseURI()
Get the capability base Uri or the capability Uri without parameters.

Returns:
The capability Uri without parameters.