com.xensource.xenapi
Class Tunnel

java.lang.Object
  extended by com.xensource.xenapi.XenAPIObject
      extended by com.xensource.xenapi.Tunnel

public class Tunnel
extends XenAPIObject

A tunnel for network traffic


Nested Class Summary
static class Tunnel.Record
          Represents all the fields in a Tunnel
 
Field Summary
protected  java.lang.String ref
          The XenAPI reference to this object.
 
Method Summary
 void addToOtherConfig(Connection c, java.lang.String key, java.lang.String value)
          Add the given key-value pair to the other_config field of the given tunnel.
 void addToStatus(Connection c, java.lang.String key, java.lang.String value)
          Add the given key-value pair to the status field of the given tunnel.
static Tunnel create(Connection c, PIF transportPIF, Network network)
          Create a tunnel
static Task createAsync(Connection c, PIF transportPIF, Network network)
          Create a tunnel
 void destroy(Connection c)
          Destroy a tunnel
 Task destroyAsync(Connection c)
          Destroy a tunnel
 boolean equals(java.lang.Object obj)
          If obj is a Tunnel, compares XenAPI references for equality.
 PIF getAccessPIF(Connection c)
          Get the access_PIF field of the given tunnel.
static java.util.Set<Tunnel> getAll(Connection c)
          Return a list of all the tunnels known to the system.
static java.util.Map<Tunnel,Tunnel.Record> getAllRecords(Connection c)
          Return a map of tunnel references to tunnel records for all tunnels known to the system.
static Tunnel getByUuid(Connection c, java.lang.String uuid)
          Get a reference to the tunnel instance with the specified UUID.
 java.util.Map<java.lang.String,java.lang.String> getOtherConfig(Connection c)
          Get the other_config field of the given tunnel.
 Tunnel.Record getRecord(Connection c)
          Get a record containing the current state of the given tunnel.
 java.util.Map<java.lang.String,java.lang.String> getStatus(Connection c)
          Get the status field of the given tunnel.
 PIF getTransportPIF(Connection c)
          Get the transport_PIF field of the given tunnel.
 java.lang.String getUuid(Connection c)
          Get the uuid field of the given tunnel.
 int hashCode()
           
 void removeFromOtherConfig(Connection c, java.lang.String key)
          Remove the given key and its corresponding value from the other_config field of the given tunnel.
 void removeFromStatus(Connection c, java.lang.String key)
          Remove the given key and its corresponding value from the status field of the given tunnel.
 void setOtherConfig(Connection c, java.util.Map<java.lang.String,java.lang.String> otherConfig)
          Set the other_config field of the given tunnel.
 void setStatus(Connection c, java.util.Map<java.lang.String,java.lang.String> status)
          Set the status field of the given tunnel.
 java.lang.String toWireString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ref

protected final java.lang.String ref
The XenAPI reference to this object.

Method Detail

toWireString

public java.lang.String toWireString()
Specified by:
toWireString in class XenAPIObject

equals

public boolean equals(java.lang.Object obj)
If obj is a Tunnel, compares XenAPI references for equality.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getRecord

public Tunnel.Record getRecord(Connection c)
                        throws Types.BadServerResponse,
                               Types.XenAPIException,
                               org.apache.xmlrpc.XmlRpcException
Get a record containing the current state of the given tunnel.

Returns:
all fields from the object
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getByUuid

public static Tunnel getByUuid(Connection c,
                               java.lang.String uuid)
                        throws Types.BadServerResponse,
                               Types.XenAPIException,
                               org.apache.xmlrpc.XmlRpcException
Get a reference to the tunnel instance with the specified UUID.

Parameters:
uuid - UUID of object to return
Returns:
reference to the object
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getUuid

public java.lang.String getUuid(Connection c)
                         throws Types.BadServerResponse,
                                Types.XenAPIException,
                                org.apache.xmlrpc.XmlRpcException
Get the uuid field of the given tunnel.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAccessPIF

public PIF getAccessPIF(Connection c)
                 throws Types.BadServerResponse,
                        Types.XenAPIException,
                        org.apache.xmlrpc.XmlRpcException
Get the access_PIF field of the given tunnel.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getTransportPIF

public PIF getTransportPIF(Connection c)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException
Get the transport_PIF field of the given tunnel.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getStatus

public java.util.Map<java.lang.String,java.lang.String> getStatus(Connection c)
                                                           throws Types.BadServerResponse,
                                                                  Types.XenAPIException,
                                                                  org.apache.xmlrpc.XmlRpcException
Get the status field of the given tunnel.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getOtherConfig

public java.util.Map<java.lang.String,java.lang.String> getOtherConfig(Connection c)
                                                                throws Types.BadServerResponse,
                                                                       Types.XenAPIException,
                                                                       org.apache.xmlrpc.XmlRpcException
Get the other_config field of the given tunnel.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setStatus

public void setStatus(Connection c,
                      java.util.Map<java.lang.String,java.lang.String> status)
               throws Types.BadServerResponse,
                      Types.XenAPIException,
                      org.apache.xmlrpc.XmlRpcException
Set the status field of the given tunnel.

Parameters:
status - New value to set
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

addToStatus

public void addToStatus(Connection c,
                        java.lang.String key,
                        java.lang.String value)
                 throws Types.BadServerResponse,
                        Types.XenAPIException,
                        org.apache.xmlrpc.XmlRpcException
Add the given key-value pair to the status field of the given tunnel.

Parameters:
key - Key to add
value - Value to add
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

removeFromStatus

public void removeFromStatus(Connection c,
                             java.lang.String key)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException
Remove the given key and its corresponding value from the status field of the given tunnel. If the key is not in that Map, then do nothing.

Parameters:
key - Key to remove
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setOtherConfig

public void setOtherConfig(Connection c,
                           java.util.Map<java.lang.String,java.lang.String> otherConfig)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException
Set the other_config field of the given tunnel.

Parameters:
otherConfig - New value to set
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

addToOtherConfig

public void addToOtherConfig(Connection c,
                             java.lang.String key,
                             java.lang.String value)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException
Add the given key-value pair to the other_config field of the given tunnel.

Parameters:
key - Key to add
value - Value to add
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

removeFromOtherConfig

public void removeFromOtherConfig(Connection c,
                                  java.lang.String key)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException
Remove the given key and its corresponding value from the other_config field of the given tunnel. If the key is not in that Map, then do nothing.

Parameters:
key - Key to remove
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

createAsync

public static Task createAsync(Connection c,
                               PIF transportPIF,
                               Network network)
                        throws Types.BadServerResponse,
                               Types.XenAPIException,
                               org.apache.xmlrpc.XmlRpcException,
                               Types.OpenvswitchNotActive,
                               Types.TransportPifNotConfigured,
                               Types.IsTunnelAccessPif
Create a tunnel

Parameters:
transportPIF - PIF which receives the tagged traffic
network - Network to receive the tunnelled traffic
Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
Types.OpenvswitchNotActive
Types.TransportPifNotConfigured
Types.IsTunnelAccessPif

create

public static Tunnel create(Connection c,
                            PIF transportPIF,
                            Network network)
                     throws Types.BadServerResponse,
                            Types.XenAPIException,
                            org.apache.xmlrpc.XmlRpcException,
                            Types.OpenvswitchNotActive,
                            Types.TransportPifNotConfigured,
                            Types.IsTunnelAccessPif
Create a tunnel

Parameters:
transportPIF - PIF which receives the tagged traffic
network - Network to receive the tunnelled traffic
Returns:
The reference of the created tunnel object
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
Types.OpenvswitchNotActive
Types.TransportPifNotConfigured
Types.IsTunnelAccessPif

destroyAsync

public Task destroyAsync(Connection c)
                  throws Types.BadServerResponse,
                         Types.XenAPIException,
                         org.apache.xmlrpc.XmlRpcException
Destroy a tunnel

Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

destroy

public void destroy(Connection c)
             throws Types.BadServerResponse,
                    Types.XenAPIException,
                    org.apache.xmlrpc.XmlRpcException
Destroy a tunnel

Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAll

public static java.util.Set<Tunnel> getAll(Connection c)
                                    throws Types.BadServerResponse,
                                           Types.XenAPIException,
                                           org.apache.xmlrpc.XmlRpcException
Return a list of all the tunnels known to the system.

Returns:
references to all objects
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAllRecords

public static java.util.Map<Tunnel,Tunnel.Record> getAllRecords(Connection c)
                                                         throws Types.BadServerResponse,
                                                                Types.XenAPIException,
                                                                org.apache.xmlrpc.XmlRpcException
Return a map of tunnel references to tunnel records for all tunnels known to the system.

Returns:
records of all objects
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException