org.ws4d.java.communication
Class HTTPBinding

java.lang.Object
  extended by org.ws4d.java.communication.HTTPBinding
All Implemented Interfaces:
CommunicationBinding
Direct Known Subclasses:
HTTPSBinding

public class HTTPBinding
extends java.lang.Object
implements CommunicationBinding

HTTP binding to allows access to DPWS devices and services.
This HTTP binding allows the creation of an HTTP address for a device or a service.

HTTPBinding addr = new HTTPBinding("192.168.0.1", 8080, "/device");

The HTTP binding above will create the address http://192.168.0.1:8080/device and can be used for devices.


Field Summary
static int DISCOVERY_BINDING
           
static int HTTP_BINDING
           
static int HTTPS_BINDING
           
 
Constructor Summary
HTTPBinding(IPAddress ipAddress, int port, java.lang.String path)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getCommunicationManagerId()
          Returns the ID of the protocol/technology this binding corresponds to (e.g.
 IPAddress getHostAddress()
          Returns the host address of this binding.
 java.lang.String getPath()
          Returns the path of the HTTP address.
 int getPort()
          Returns the TCP/UDP port for this IP-based binding.
 URI getTransportAddress()
          Returns an URI for this binding.
 int getType()
           
 java.lang.String getURISchema()
           
 int hashCode()
           
 void resetAutoPort()
           
 void setPort(int port)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

HTTP_BINDING

public static final int HTTP_BINDING
See Also:
Constant Field Values

HTTPS_BINDING

public static final int HTTPS_BINDING
See Also:
Constant Field Values

DISCOVERY_BINDING

public static final int DISCOVERY_BINDING
See Also:
Constant Field Values
Constructor Detail

HTTPBinding

public HTTPBinding(IPAddress ipAddress,
                   int port,
                   java.lang.String path)
Constructor.

Parameters:
ipAddress -
port -
path -
Method Detail

getPath

public java.lang.String getPath()
Returns the path of the HTTP address.

Returns:
the path of the HTTP address.

hashCode

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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

setPort

public void setPort(int port)
Parameters:
port - the port to set

resetAutoPort

public void resetAutoPort()

getType

public int getType()
Specified by:
getType in interface CommunicationBinding

getTransportAddress

public URI getTransportAddress()
Description copied from interface: CommunicationBinding
Returns an URI for this binding. This URI is a transport address to access this binding.

Specified by:
getTransportAddress in interface CommunicationBinding
Returns:
an URI to access.

getURISchema

public java.lang.String getURISchema()

getCommunicationManagerId

public java.lang.String getCommunicationManagerId()
Description copied from interface: CommunicationBinding
Returns the ID of the protocol/technology this binding corresponds to (e.g. DPWS, Bluetooth, ZigBee, etc.).

Specified by:
getCommunicationManagerId in interface CommunicationBinding
Returns:
the ID of this binding's protocol/technology

getHostAddress

public IPAddress getHostAddress()
Returns the host address of this binding. The host address can be either an IPv4 literal, an IPv6 literal or a DNS host name.

Returns:
the host address of this binding.

getPort

public int getPort()
Returns the TCP/UDP port for this IP-based binding.

Returns:
the TCP/UDP port for this IP-based binding.

toString

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