public class HTTPBinding extends java.lang.Object implements CommunicationBinding, IPAddressChangeListener
HTTPBinding addr = new HTTPBinding(new IPAddress("192.168.0.1"), 8080, "/device",
CommunicationManager.getCommunicationManagerId()); The HTTP binding above will create the address
http://192.168.0.1:8080/device and can be used for devices.
| Modifier and Type | Field and Description |
|---|---|
protected DataStructure |
bindingListenerList |
protected AddressFilter |
filter |
protected IPAddress |
ipAddress |
protected int |
port |
protected URI |
transportAddress |
| Constructor and Description |
|---|
HTTPBinding(IPAddress ipAddress,
int port,
java.lang.String path,
java.lang.String comManId)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBindingListener(BindingListener listener)
Add
BindingListener to the Binding. |
void |
addressDown(IPAddress ip)
Will be called if a
DiscoveryDomain is down. |
void |
addressUp(IPAddress ip)
Will be called if a
IPAddress is up. |
void |
checkSecurityCredentialsEquality(HTTPBinding otherBinding) |
static java.lang.String |
createIpPortKey(java.lang.String address,
int port) |
CommunicationBinding |
duplicate(java.lang.String path)
Duplicates this communication binding with the new path.
|
boolean |
equals(java.lang.Object obj) |
AddressFilter |
getAddressFilter() |
java.lang.String |
getCommunicationManagerId()
Returns the ID as
String of the protocol/technology this binding corresponds to (e.g. |
CredentialInfo |
getCredentialInfo()
Returns the
CredentialInfo of this Binding. |
java.lang.Object |
getHostAddress() |
IPAddress |
getHostIPAddress()
Returns the host address of this binding.
|
java.lang.String |
getIpPortKey() |
java.lang.Integer |
getKey()
Returns the unique key of the
Binding. |
java.lang.String |
getPath()
Returns the path of the HTTP address.
|
int |
getPort()
Returns the TCP port for this IP-based binding.
|
URI |
getTransportAddress()
Returns an
URI for this binding. |
java.lang.String |
getURISchema() |
int |
hashCode() |
boolean |
isSecure()
Returns true if binding is secur binding.
|
boolean |
isUsable()
Returns whether the binding is usable.
|
void |
removeBindingListener(BindingListener listener)
Remove
BindingListener from the Binding. |
void |
resetAutoPort() |
void |
setAddressFilter(AddressFilter filter) |
void |
setCredentialInfo(CredentialInfo credentialInfo)
Sets the
CredentialInfo if given CredentialInfo is not null or CredentialInfo.EMPTY_CREDENTIAL_INFO. |
void |
setPort(int port) |
java.lang.String |
toString() |
protected IPAddress ipAddress
protected int port
protected URI transportAddress
protected DataStructure bindingListenerList
protected AddressFilter filter
public HTTPBinding(IPAddress ipAddress, int port, java.lang.String path, java.lang.String comManId)
ipAddress - port - path - public static java.lang.String createIpPortKey(java.lang.String address,
int port)
public java.lang.String getPath()
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.Integer getKey()
BindingBinding.public AddressFilter getAddressFilter()
public void setAddressFilter(AddressFilter filter)
public java.lang.String getIpPortKey()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic void resetAutoPort()
public boolean isSecure()
CommunicationBindingisSecure in interface CommunicationBindingpublic boolean isUsable()
Bindingpublic void checkSecurityCredentialsEquality(HTTPBinding otherBinding) throws WS4DIllegalStateException
WS4DIllegalStateExceptionpublic CredentialInfo getCredentialInfo()
BindingCredentialInfo of this Binding.getCredentialInfo in interface Bindingpublic void setCredentialInfo(CredentialInfo credentialInfo)
BindingCredentialInfo if given CredentialInfo is not null or CredentialInfo.EMPTY_CREDENTIAL_INFO.setCredentialInfo in interface Bindingpublic URI getTransportAddress()
CommunicationBindingURI for this binding. This URI is a transport address to access this
binding.getTransportAddress in interface CommunicationBindingpublic java.lang.String getURISchema()
public java.lang.String getCommunicationManagerId()
BindingString of the protocol/technology this binding corresponds to (e.g.
DPWS, UPNP, Bluetooth, etc.).getCommunicationManagerId in interface Bindingpublic IPAddress getHostIPAddress()
public java.lang.Object getHostAddress()
getHostAddress in interface Bindingpublic int getPort()
public void setPort(int port)
port - the port to setpublic java.lang.String toString()
toString in class java.lang.Objectpublic CommunicationBinding duplicate(java.lang.String path)
CommunicationBindingduplicate in interface CommunicationBindingpublic void addBindingListener(BindingListener listener)
BindingBindingListener to the Binding. If changes are performed the listener will
be announced.addBindingListener in interface Bindingpublic void removeBindingListener(BindingListener listener)
BindingBindingListener from the Binding.removeBindingListener in interface Bindingpublic void addressUp(IPAddress ip)
IPAddressChangeListenerIPAddress is up.addressUp in interface IPAddressChangeListenerpublic void addressDown(IPAddress ip)
IPAddressChangeListenerDiscoveryDomain is down.addressDown in interface IPAddressChangeListener