public class IPMulticastTransceiver extends java.lang.Object implements IIPPlugin, ITransceiver, IOperation
EVENT_TRANCEIVER_DISABLED, EVENT_TRANCEIVER_ENABLED
EXTENSION_COMPRESSION, EXTENSION_DISCOVERY, EXTENSION_ENCRYPTION, EXTENSION_ROUTING, EXTENSION_SEMANTIC, EXTENSION_SERIALIZATION, EXTENSION_TRANSCEIVER
Constructor and Description |
---|
IPMulticastTransceiver()
Creates a new instance of the plug-in that binds to any ip address
and port number that is available on the local system.
|
IPMulticastTransceiver(boolean nodelay)
Creates a new instance of the plug-in that binds to any ip address
and port number that is available on the local system.
|
IPMulticastTransceiver(byte[] address)
Creates a new instance of the plug-in that binds only to the specified
ip address.
|
IPMulticastTransceiver(byte[] address,
boolean nodelay)
Creates a new instance of the plug-in that binds only to the specified
ip address.
|
Modifier and Type | Method and Description |
---|---|
void |
addTransceiverListener(int type,
IListener listener)
Adds a listener to the bundle of registered end point listeners.
|
byte[] |
getAddress()
Returns the address of the server socket.
|
PluginDescription |
getPluginDescription()
Returns the description of the plug-in.
|
int |
getPort()
Returns the port of the server socket.
|
boolean |
isEnabled()
Determines whether the end point provided by the plug-in is enabled.
|
IPacketConnector |
openGroup()
Opens a connector that connects to the group.
|
IStreamConnector |
openSession(ISession session)
Opens a connection to the specified system.
|
void |
perform(IMonitor monitor)
Called when the operation is started.
|
boolean |
prepareSession(PluginDescription description,
NFCollection collection,
ISession session)
Called in order to prepare a session.
|
void |
release(IPPacketConnector connector)
Releases the specified connector by removing it from the
list of open connectors.
|
void |
release(IPStreamConnector connector)
Releases the specified connector by removing it from the
list of open connectors.
|
boolean |
removeTransceiverListener(int type,
IListener listener)
Removes a potentially previously registered end point listener for a
certain type of event.
|
void |
setAddress(byte[] address)
Sets the address of the server socket.
|
void |
setEnabled(boolean enabled)
Enables or disables the end point provided by the plug-in and
notifies all listeners if the state has changed.
|
void |
setTransceiverManager(ITransceiverManager manager)
Called by the plug-in manager during initialization of the plug-in.
|
void |
start()
Called by the plug-in manager to start the stopped plug-in.
|
void |
stop()
Called by the plug-in manager to stop the started plug-in.
|
public IPMulticastTransceiver()
public IPMulticastTransceiver(boolean nodelay)
nodelay
- A flag that indicates whether the tcp no delay socket
option will be set.public IPMulticastTransceiver(byte[] address)
address
- The ip address to bind to or null to bind to any address.java.lang.IllegalArgumentException
- Thrown if the address does not
indicate a valid ip address or if the address is part of the
filter list.public IPMulticastTransceiver(byte[] address, boolean nodelay)
address
- The ip address to bind to or null to bind to any address.nodelay
- A flag that indicates whether the tcp no delay socket
option will be set.java.lang.IllegalArgumentException
- Thrown if the address does not
indicate a valid ip address or if the address is part of the
filter list.public void setTransceiverManager(ITransceiverManager manager)
setTransceiverManager
in interface ITransceiver
manager
- The manager of the plug-in used to interface with
other plug-ins and to retrieve connection parameters.public void perform(IMonitor monitor) throws java.lang.Exception
perform
in interface IOperation
monitor
- The monitor that is used to signal changes.java.lang.Exception
- Should never happen.public boolean prepareSession(PluginDescription description, NFCollection collection, ISession session)
prepareSession
in interface IStreamer
description
- The description of the remote system.collection
- The requirements regarding the communication.session
- The session that holds the attributes.public IStreamConnector openSession(ISession session) throws java.io.IOException
openSession
in interface IStreamer
session
- The session data that has been prepared by the
prepare method.java.io.IOException
- Thrown if the connector cannot be opened.public IPacketConnector openGroup() throws java.io.IOException
openGroup
in interface ITransceiver
java.io.IOException
- Thrown if the connector cannot be opened.public void start()
public void stop()
public PluginDescription getPluginDescription()
getPluginDescription
in interface IPlugin
public void addTransceiverListener(int type, IListener listener) throws java.lang.NullPointerException
addTransceiverListener
in interface ITransceiver
type
- The type of event to register for.listener
- The listener to register.java.lang.NullPointerException
- Thrown if the listener is null.public boolean removeTransceiverListener(int type, IListener listener) throws java.lang.NullPointerException
removeTransceiverListener
in interface ITransceiver
type
- The type to unregister from.listener
- The listener to unregister.java.lang.NullPointerException
- Thrown if the listener is null.public void setEnabled(boolean enabled)
setEnabled
in interface ITransceiver
enabled
- Set true to enable and false to disable.public boolean isEnabled()
isEnabled
in interface ITransceiver
public byte[] getAddress()
public void setAddress(byte[] address)
address
- The new address.public int getPort()
public void release(IPStreamConnector connector)
public void release(IPPacketConnector connector)