|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CommunicationManager
The * NEW * communication manager interface.
Field Summary | |
---|---|
static java.lang.String |
ID_NULL
|
Method Summary | |
---|---|
boolean |
addressMatches(URI xAddr,
boolean source,
ProtocolData protocolData)
|
ProtocolInfo |
createProtocolInfo(int version)
Creates an instance of ProtocolInfo according to the given
version information. |
void |
getAutobindings(java.lang.String descriptor,
DataStructure bindings)
TODO |
DataStructure |
getAvailableDomains()
Returns a data structure containing all domains
within the corresponding technology that this communication manager
instance provides. |
java.lang.String |
getCommunicationManagerId()
Returns the unique identifier of this communication manager's technology (e.g. |
CommunicationUtil |
getCommunicationUtil()
Returns an utility class for this communication manager. |
QNameSet |
getDeviceTypes()
|
DiscoveryBinding |
getDiscoveryBindingForDomain(ProtocolDomain domain)
Returns a discovery binding for a specified domain. |
DiscoveryBinding |
getDiscoveryBindingForProtocolData(ProtocolData data)
|
DataStructure |
getDiscoveryBindings()
To get a MulticastReceiver to all available Domains. |
DataStructure |
getDiscoveryDomainForBinding(DiscoveryBinding binding)
|
void |
getProtocolDomains(Iterator bindings,
DataStructure domains)
TODO |
ProtocolInfo |
getProtocolInfo()
Returns the an instance of ProtocolInfo for this communication
manager. |
long |
getRandomApplicationDelay(int version)
|
ResourceLoader |
getResourceAsStream(URI location)
Returns an input stream which allows to read a resource from the given location. |
HashSet |
getSupportedVersions()
Returns a set of supported versions by this communication manager. |
void |
init()
This method will be invoked be the framework during the start up phase. |
void |
kill()
Stops this communication manager immediately, closes all connections and frees any used resources without waiting for. |
void |
registerDevice(int[] messageTypes,
CommunicationBinding binding,
IncomingMessageListener listener,
HTTPGroup user)
Registers the messageListener for receiving incoming
messages of the specified messageTypes at the given
binding address. |
void |
registerDeviceReference(int[] messageTypes,
DiscoveryBinding binding,
IncomingMessageListener listener)
Registers the messageListener for receiving incoming
messages of the specified messageTypes at the given
binding address. |
void |
registerDiscovery(int[] messageTypes,
DiscoveryBinding binding,
IncomingMessageListener listener)
Registers the messageListener for receiving incoming
messages of the specified messageTypes at the given
binding address. |
URI |
registerResource(Resource resource,
CommunicationBinding binding,
java.lang.String resourcePath,
HTTPGroup user)
Deploys the given resource so that it can be accessed over the technology that this communication manager instance represents. |
void |
registerService(int[] messageTypes,
CommunicationBinding binding,
IncomingMessageListener listener,
HTTPGroup user)
Registers the messageListener for receiving incoming
messages of the specified messageTypes at the given
binding address. |
void |
send(Message message,
XAddressInfo targetXAdrInfo,
ProtocolDomain domain,
ResponseCallback callback)
Sends the message as a asynchronous request through
the specified domain ; any responses (if present) including
faults and timeouts will be delivered to the given callback . |
void |
serializeMessageWithAttachments(Message message,
java.lang.String attachmentSep,
List attachments,
java.io.OutputStream out,
ProtocolData pd)
|
void |
start()
Starts this communication manager instance. |
void |
stop()
Stops this communication manager as soon as possible, closes all connections and frees any used resources. |
boolean |
supportsAddressingNamespace(SOAPHeader header,
java.lang.String namespace,
ProtocolData pd)
|
void |
unregisterDevice(int[] messageTypes,
CommunicationBinding binding,
IncomingMessageListener listener)
Destroys a previously made registration for the given messageTypes ,
binding and listener . |
void |
unregisterDeviceReference(int[] messageTypes,
DiscoveryBinding binding,
IncomingMessageListener listener)
Destroys a previously made registration for the given messageTypes ,
binding and listener . |
void |
unregisterDiscovery(int[] messageTypes,
DiscoveryBinding binding,
IncomingMessageListener listener)
Destroys a previously made registration for the given messageTypes ,
binding and listener . |
void |
unregisterResource(URI deployAddress,
CommunicationBinding binding)
Removes the previously deployed resource at the given deployAddress from this
communication manager. |
void |
unregisterService(int[] messageTypes,
CommunicationBinding binding,
IncomingMessageListener listener)
Destroys a previously made registration for the given messageTypes ,
binding and listener . |
Field Detail |
---|
static final java.lang.String ID_NULL
Method Detail |
---|
void init()
java.lang.String getCommunicationManagerId()
void start() throws java.io.IOException
#register(int[], CommunicationBinding, IncomingMessageListener)
,
#send(Message, ProtocolDomain, ResponseCallback)
, etc. can
operate correctly.
If this communication manager has already been started, this method must not do anything else other than quickly return .
java.io.IOException
- in case initializing communication failed for some
reason; the caller should assume that this communication
manager instance is not usablevoid stop()
registering listeners
or
sending messages
will result in illegal state exceptions
.
If it is necessary to stop the communication manager immediately the
kill()
method should be used.
WARNING! This method causes the communication manager to
loose all of its current state! That is, reactivating the communication
manager again after this method has been called will result in having no
registrations
for incoming messages.
If this communication manager has already been stopped, this method must not do anything else other than quickly return
void kill()
registering listeners
or
sending messages
will result in illegal state exceptions
.
WARNING! This method causes the communication manager to
loose all of its current state! That is, reactivating the communication
manager again after this method has been called will result in having no
registrations
for incoming messages.
If this communication manager has already been stopped, this method must not do anything else other than quickly return
DataStructure getAvailableDomains()
domains
within the corresponding technology that this communication manager
instance provides. Domains are technology-specific endpoint designators,
e.g. for IP over Ethernet a domain would consist of a network interface
name (such as eth0) and an IP address.
void registerDevice(int[] messageTypes, CommunicationBinding binding, IncomingMessageListener listener, HTTPGroup user) throws java.io.IOException, WS4DIllegalStateException
messageListener
for receiving incoming
messages of the specified messageTypes
at the given
binding
address. See DPWSMessageConstants
for a list
of supported DPWS message types.
messageTypes
- determines which message types to register tobinding
- the binding to register tolistener
- the callback to deliver incoming desired messages to
java.io.IOException
- in case registration failed for some reason, e.g. an
address being already in use, etc.
WS4DIllegalStateException
- if this communication manager has
already been stopped
void registerService(int[] messageTypes, CommunicationBinding binding, IncomingMessageListener listener, HTTPGroup user) throws java.io.IOException, WS4DIllegalStateException
messageListener
for receiving incoming
messages of the specified messageTypes
at the given
binding
address. See DPWSMessageConstants
for a list
of supported DPWS message types.
messageTypes
- determines which message types to register tobinding
- the binding to register tolistener
- the callback to deliver incoming desired messages to
java.io.IOException
- in case registration failed for some reason, e.g. an
address being already in use, etc.
WS4DIllegalStateException
- if this communication manager has
already been stopped
void registerDiscovery(int[] messageTypes, DiscoveryBinding binding, IncomingMessageListener listener) throws java.io.IOException, WS4DIllegalStateException
messageListener
for receiving incoming
messages of the specified messageTypes
at the given
binding
address. See DPWSMessageConstants
for a list
of supported DPWS message types.
messageTypes
- determines which message types to register tobinding
- the binding to register tolistener
- the callback to deliver incoming desired messages to
java.io.IOException
- in case registration failed for some reason, e.g. an
address being already in use, etc.
WS4DIllegalStateException
- if this communication manager has
already been stopped
void registerDeviceReference(int[] messageTypes, DiscoveryBinding binding, IncomingMessageListener listener) throws java.io.IOException, WS4DIllegalStateException
messageListener
for receiving incoming
messages of the specified messageTypes
at the given
binding
address. See DPWSMessageConstants
for a list
of supported DPWS message types.
messageTypes
- determines which message types to register tobinding
- the binding to register tolistener
- the callback to deliver incoming desired messages to
java.io.IOException
- in case registration failed for some reason, e.g. an
address being already in use, etc.
WS4DIllegalStateException
- if this communication manager has
already been stopped
void unregisterDevice(int[] messageTypes, CommunicationBinding binding, IncomingMessageListener listener) throws java.io.IOException, WS4DIllegalStateException
registration
for the given messageTypes
,
binding
and listener
.
messageTypes
- determines which message types to remove registration
frombinding
- the binding to removelistener
- the callback which was previously registered
java.io.IOException
- in case removing the registration failed for some
reason, e.g. this binding was not already registered, etc.
WS4DIllegalStateException
- if this communication manager has
already been stopped
void unregisterService(int[] messageTypes, CommunicationBinding binding, IncomingMessageListener listener) throws java.io.IOException, WS4DIllegalStateException
registration
for the given messageTypes
,
binding
and listener
.
messageTypes
- determines which message types to remove registration
frombinding
- the binding to removelistener
- the callback which was previously registered
java.io.IOException
- in case removing the registration failed for some
reason, e.g. this binding was not already registered, etc.
WS4DIllegalStateException
- if this communication manager has
already been stopped
void unregisterDiscovery(int[] messageTypes, DiscoveryBinding binding, IncomingMessageListener listener) throws java.io.IOException, WS4DIllegalStateException
registration
for the given messageTypes
,
binding
and listener
.
messageTypes
- determines which message types to remove registration
frombinding
- the binding to removelistener
- the callback which was previously registered
java.io.IOException
- in case removing the registration failed for some
reason, e.g. this binding was not already registered, etc.
WS4DIllegalStateException
- if this communication manager has
already been stopped
void unregisterDeviceReference(int[] messageTypes, DiscoveryBinding binding, IncomingMessageListener listener) throws java.io.IOException, WS4DIllegalStateException
registration
for the given messageTypes
,
binding
and listener
.
messageTypes
- determines which message types to remove registration
frombinding
- the binding to removelistener
- the callback which was previously registered
java.io.IOException
- in case removing the registration failed for some
reason, e.g. this binding was not already registered, etc.
WS4DIllegalStateException
- if this communication manager has
already been stopped
void send(Message message, XAddressInfo targetXAdrInfo, ProtocolDomain domain, ResponseCallback callback) throws WS4DIllegalStateException
message
as a asynchronous request through
the specified domain
; any responses (if present) including
faults and timeouts will be delivered to the given callback
.
The argument domain
has a certain meaning only when sending
multicast/broadcast messages; this currently applies to
HelloMessage
s, ByeMessage
s, ProbeMessage
s and
ResolveMessage
s. In this case, it specifies the concrete
transport technology and optionally, some technology- or
protocol-specific interfaces (aka. "domains") over which to
send the multicast message. In the case of DPWS, where multicast messages
are sent by means of SOAP-over-UDP, the value of this argument could
depict a certain network interface (e.g. eth0, pcn0,
etc.) or a specific local IP address. This should then be used to send
the multicast message. For further information regarding the outgoing
interface of multicast messages when using IP multicast, see RFC 1112.
In the concrete case when message
is one of
HelloMessage
, ByeMessage
or
SubscriptionEndMessage
, the value of callback
is
ignored. In any other case it is expected to have a non-null
value.
message
- the request message to senddomain
- protocol domain over which to send the messagecallback
- where to deliver responses to the message
WS4DIllegalStateException
- if this communication manager has
already been stopped
URI registerResource(Resource resource, CommunicationBinding binding, java.lang.String resourcePath, HTTPGroup user) throws java.io.IOException, WS4DIllegalStateException
binding
and additional resource-specific addressing
information found in resourcePath
. Returns an URI
depicting the actual address the resource is bound to.
resource
- the resource to deploybinding
- a binding over which to make the resource availableresourcePath
- additional addressing-related information for use
when binding the resource
java.io.IOException
- in case binding the resource failed for some reason,
e.g. an address being already in use, etc.
WS4DIllegalStateException
- if this communication manager has
already been stopped
void unregisterResource(URI deployAddress, CommunicationBinding binding) throws java.io.IOException, WS4DIllegalStateException
deployed
resource at the given deployAddress
from this
communication manager.
deployAddress
- the addressing at which the resource previously was
#registerResource(Resource, CommunicationBinding, String)
java.io.IOException
- in case removing the resource failed for some reason,
e.g. the resource was not previously deployed, etc.
WS4DIllegalStateException
- if this communication manager has
already been stopped
ResourceLoader getResourceAsStream(URI location) throws java.io.IOException
location
- the location of the resource (e.g.
http://example.org/test.wsdl).
java.io.IOException
boolean addressMatches(URI xAddr, boolean source, ProtocolData protocolData)
xAddr
- a protocol dependent transport addresssource
- if true
, the given URI xAddr
is
compared against the source address of the specified
protocolData
, otherwise against the destination
addressprotocolData
- protocol data instance associated with a certain
incoming message
true
only if the given protocolData
has
a source or destination address matching the specified
xAddr
URIvoid getAutobindings(java.lang.String descriptor, DataStructure bindings) throws java.io.IOException
descriptor
- bindings
-
java.io.IOException
void getProtocolDomains(Iterator bindings, DataStructure domains) throws java.io.IOException
bindings
- domains
-
java.io.IOException
DataStructure getDiscoveryBindings() throws java.io.IOException
java.io.IOException
DiscoveryBinding getDiscoveryBindingForDomain(ProtocolDomain domain) throws java.io.IOException
domain
- specified domain.
java.io.IOException
- If the Domain does not fit.DataStructure getDiscoveryDomainForBinding(DiscoveryBinding binding) throws java.io.IOException
java.io.IOException
DiscoveryBinding getDiscoveryBindingForProtocolData(ProtocolData data)
void serializeMessageWithAttachments(Message message, java.lang.String attachmentSep, List attachments, java.io.OutputStream out, ProtocolData pd) throws java.io.IOException
java.io.IOException
ProtocolInfo getProtocolInfo()
ProtocolInfo
for this communication
manager.
ProtocolInfo createProtocolInfo(int version)
ProtocolInfo
according to the given
version information.
version
- the version the protocol info should be created for.
HashSet getSupportedVersions()
This should be a set containing Integer
objects with the version
number.
CommunicationUtil getCommunicationUtil()
long getRandomApplicationDelay(int version)
boolean supportsAddressingNamespace(SOAPHeader header, java.lang.String namespace, ProtocolData pd) throws VersionMismatchException
VersionMismatchException
QNameSet getDeviceTypes()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |