com.vhosting.netconf.messages
Class HelloMsg

java.lang.Object
  extended by com.vhosting.netconf.messages.HelloMsg

public final class HelloMsg
extends java.lang.Object

This class represents the Hello message in the Netconf protocol.

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

Constructor Summary
HelloMsg(Capability[] caps)
          Build the client side Hello message.
 
Method Summary
static HelloMsg createServerHello(byte[] message)
          Create the server side Hello message from a byte array as source.
 void dump(java.io.ByteArrayOutputStream out)
          Dump the message to an array output stream.
 java.lang.String[] getCapabilitiesURI()
          Get the capabilities URI with the message.
static java.lang.Integer getSessionId()
          Get the session id with the message.
 boolean validate()
          Validate the message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HelloMsg

public HelloMsg(Capability[] caps)
Build the client side Hello message.

Parameters:
caps - The client side capabilities.
Method Detail

createServerHello

public static final HelloMsg createServerHello(byte[] message)
                                        throws org.xml.sax.SAXException,
                                               java.io.IOException
Create the server side Hello message from a byte array as source.

Parameters:
message - The byte array.
Returns:
The Hello message or null if the message is not a valid Hello message.
Throws:
org.xml.sax.SAXException - Throw this exception if there are parsing troubles.
java.io.IOException - Throw this exception if there are reading troubles.

getCapabilitiesURI

public java.lang.String[] getCapabilitiesURI()
Get the capabilities URI with the message.

Returns:
The capabilities URI.

getSessionId

public static java.lang.Integer getSessionId()
Get the session id with the message. The session Id is null in case of a client side Hello message.

Returns:
The session identifier or null if not exists.

validate

public final boolean validate()
Validate the message.

Returns:
true if the document is a validated Netconf XML Document; false otherwise.

dump

public void dump(java.io.ByteArrayOutputStream out)
          throws java.io.IOException
Dump the message to an array output stream.

Parameters:
out - The array output stream.
Throws:
java.io.IOException - Throw this exception if there are writing troubles.