public class CapabilityTunnel extends Capability
| Modifier and Type | Class and Description |
|---|---|
static class |
CapabilityTunnel.AttributeId
enum denoting various possible attributes of the
CapabilityTunnel. |
static class |
CapabilityTunnel.CloseTunnel
NOTE: This class is a placeholder.
|
static class |
CapabilityTunnel.CommandId
enum denoting the possible Commands that can be sent for
CapabilityTunnel. |
static class |
CapabilityTunnel.IpVersion
enum denoting possible values for Ip version.
|
static class |
CapabilityTunnel.OpenTunnel
NOTE: This class is a placeholder.
|
static class |
CapabilityTunnel.Protocol
enum denoting possible values for tunnel protocol.
|
static class |
CapabilityTunnel.State
enum denoting possible values for tunnel state.
|
static class |
CapabilityTunnel.TransportType
An enum denoting possible values for type of transport protocol used in tunnel.
|
static interface |
CapabilityTunnel.TunnelStatusListener
Listener which will be triggered after the callback
CallbacksInterface.tunnelStatusCallback(Capability, long, CapabilityTunnel.State, int). |
static class |
CapabilityTunnel.TunnelType
enum denoting possible values for type of tunnel.
|
Capability.CapabilityId, Capability.CommandStatusListener<T extends Capability.CommandId>| Modifier and Type | Field and Description |
|---|---|
static Capability.CapabilityId |
ID
ID for CapabilityTunnel.
|
| Modifier | Constructor and Description |
|---|---|
protected |
CapabilityTunnel(int id,
Resource parent)
Constructor of the current class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close(long tunnelHandle,
long timeout)
This function is used to close the existing tunnel present of this capability.
|
void |
closeAllTunnels(long timeout)
A function used to close an all existing tunnel.
|
protected Command<? extends Capability.CommandId> |
extendedCreateCommand(int primitiveCommandId,
com.google.gson.JsonElement commandParams)
A function to create the command from the Json params.
|
int |
getPort(long tunnelHandle)
This function is used to get the port over which the tunnel is open.
|
CapabilityTunnel.State |
getState(long tunnelHandle)
This function is used to get The state of the tunnel which is
represented by the enum State.
|
void |
open(java.lang.String forwardHostName,
int forwardHostPort,
java.lang.String listeningHostName,
int listeningHostPort,
CapabilityTunnel.TransportType transportType,
CapabilityTunnel.TunnelType tunnelType,
CapabilityTunnel.Protocol protocol,
CapabilityTunnel.IpVersion ipVersion,
long timeout,
CapabilityTunnel.TunnelStatusListener listener)
This function is used to open Tunnel to a resource.
|
void |
openTcpTunnel(java.lang.String listeningHostName,
int listeningHostPort,
CapabilityTunnel.TunnelType tunnelType,
CapabilityTunnel.IpVersion ipVersion,
long timeout,
CapabilityTunnel.TunnelStatusListener listener)
A function to open TCP tunnel (simple wrap of
open(java.lang.String, int, java.lang.String, int, buzz.getcoco.iot.CapabilityTunnel.TransportType, buzz.getcoco.iot.CapabilityTunnel.TunnelType, buzz.getcoco.iot.CapabilityTunnel.Protocol, buzz.getcoco.iot.CapabilityTunnel.IpVersion, long, buzz.getcoco.iot.CapabilityTunnel.TunnelStatusListener)). |
void |
openUdpTunnel(java.lang.String forwardHostName,
int forwardHostPort,
CapabilityTunnel.TunnelType tunnelType,
CapabilityTunnel.IpVersion ipVersion,
long timeout,
CapabilityTunnel.TunnelStatusListener listener)
A function to open UDP tunnel (simple wrap of
open(java.lang.String, int, java.lang.String, int, buzz.getcoco.iot.CapabilityTunnel.TransportType, buzz.getcoco.iot.CapabilityTunnel.TunnelType, buzz.getcoco.iot.CapabilityTunnel.Protocol, buzz.getcoco.iot.CapabilityTunnel.IpVersion, long, buzz.getcoco.iot.CapabilityTunnel.TunnelStatusListener)). |
boolean |
supports(Capability.CommandId commandId)
This function checks if a command is supported or not, pass
null to check if capability supports any commands at all.
|
clearAndSetStandardCommandSet, containsAttribute, containsAttribute, createCommand, createCommandResponseArgs, getAttribute, getAttribute, getAttributeMap, getCapabilityWrapper, getId, getName, getParent, getSupportedCommands, hashCode, interceptCommand, internalAddAttribute, internalMarkAsReady, internalRemoveAttribute, internalSetName, internalSetParent, isReady, iterator, sendResourceCommand, setCapabilityWrapper, toStringpublic static final Capability.CapabilityId ID
protected CapabilityTunnel(int id,
Resource parent)
id - The unique id Of the capabilityparent - The parent Resource of the capability.public boolean supports(Capability.CommandId commandId)
Capabilitysupports in class CapabilitycommandId - The ID denoting the command to be sent.public void openUdpTunnel(java.lang.String forwardHostName,
int forwardHostPort,
CapabilityTunnel.TunnelType tunnelType,
CapabilityTunnel.IpVersion ipVersion,
long timeout,
CapabilityTunnel.TunnelStatusListener listener)
open(java.lang.String, int, java.lang.String, int, buzz.getcoco.iot.CapabilityTunnel.TransportType, buzz.getcoco.iot.CapabilityTunnel.TunnelType, buzz.getcoco.iot.CapabilityTunnel.Protocol, buzz.getcoco.iot.CapabilityTunnel.IpVersion, long, buzz.getcoco.iot.CapabilityTunnel.TunnelStatusListener)).forwardHostName - The hostname which will receive the dataforwardHostPort - The port over which data will be receivedtunnelType - The type of the tunnel (LISTEN/CONNECT)ipVersion - The ipVersion used for identification (ipV4/ipV6)timeout - The timeout for this command in millislistener - The listener which will be triggered after the callback This will be
useful in tracking in tunnelStatusCbspublic void openTcpTunnel(java.lang.String listeningHostName,
int listeningHostPort,
CapabilityTunnel.TunnelType tunnelType,
CapabilityTunnel.IpVersion ipVersion,
long timeout,
CapabilityTunnel.TunnelStatusListener listener)
open(java.lang.String, int, java.lang.String, int, buzz.getcoco.iot.CapabilityTunnel.TransportType, buzz.getcoco.iot.CapabilityTunnel.TunnelType, buzz.getcoco.iot.CapabilityTunnel.Protocol, buzz.getcoco.iot.CapabilityTunnel.IpVersion, long, buzz.getcoco.iot.CapabilityTunnel.TunnelStatusListener)).listeningHostName - The hostname of the transmitting device.listeningHostPort - The port over which the packets will be exchanged.tunnelType - The type of the tunnel (LISTEN/CONNECT).ipVersion - The ipVersion used for identification (ipV4/ipV6).timeout - The timeout for this command in millis.listener - The listener which will be triggered after the callback. This will be
useful in tracking in tunnelStatusCbs.public void open(java.lang.String forwardHostName,
int forwardHostPort,
java.lang.String listeningHostName,
int listeningHostPort,
CapabilityTunnel.TransportType transportType,
CapabilityTunnel.TunnelType tunnelType,
CapabilityTunnel.Protocol protocol,
CapabilityTunnel.IpVersion ipVersion,
long timeout,
CapabilityTunnel.TunnelStatusListener listener)
forwardHostName - The hostname which will receive the data.forwardHostPort - The port over which the packets will be exchanged.listeningHostName - The hostname of the transmitting device.listeningHostPort - The port over which the device will transmit data.transportType - The TransportType (TCP/UDP) on which the transmission shall take placetunnelType - The type of the tunnel CapabilityTunnel.TunnelType(LISTEN/CONNECT).protocol - The protocol of the data exchange in tunnel,
should be one of CapabilityTunnel.AttributeId.SUPPORTED_PROTOCOL_ARR (RTSP).ipVersion - The ipVersion used for identification (ipV4/ipV6).timeout - The timeout for this command in millis.listener - The listener which will be triggered after the callback. This will be
useful in tracking in tunnelStatusCbs.public void closeAllTunnels(long timeout)
timeout - timeout defined for the operation.public void close(long tunnelHandle,
long timeout)
timeout - the timeout for the command.tunnelHandle - the handle responsible for tunneling
tunnelHandleMap.java.lang.RuntimeException - on failure to close the tunnel.public int getPort(long tunnelHandle)
tunnelHandle - the handle responsible for tunneling
tunnelHandleMap.public CapabilityTunnel.State getState(long tunnelHandle)
tunnelHandle - the handle responsible for tunneling
tunnelHandleMap.protected Command<? extends Capability.CommandId> extendedCreateCommand(int primitiveCommandId, com.google.gson.JsonElement commandParams)
extendedCreateCommand in class CapabilityprimitiveCommandId - The int form of the commandIdcommandParams - The Json params that can form a command