2009-01-09 1.2.0

org.eclipse.soda.dk.transport.service
Interface TransportService

All Known Subinterfaces:
ConnectionTransportService, DigitalIoTransportService, TunnelTransportService

public interface TransportService

The TransportService interface defines the TransportService concept. A TransportService is the mechanism for sending and receiving messages. A TransportService may be started and stopped, as well as Listened to using the TransportListener Interface.

Since:
1.0
Version:
1.2.0
See Also:
ErrorListener, MessageService, ParameterService, TransportListener

Field Summary
static int ACTIVE
          The ACTIVE state is when the transport is attempting to start but is not yet started.
static int ALIVE
          The ALIVE state is when the transport has been told to start.
static java.lang.String CHANNEL_EXTERNAL_ID_DATA_KEY
          Define the channel external id data key (String) constant.
static java.lang.String CHANNEL_ID_DATA_KEY
          Define the channel id data key (String) constant.
static java.lang.String CONFIGURATION_DATA_KEY
          Define the configuration data key (String) constant.
static int CONNECTED
          The CONNECTED state is when the transport is connected to the hardware device.
static java.lang.String CONNECTION_DEFAULT
          Define the connection default (String) constant.
static java.lang.String CONNECTION_KEY
          Define the connection key (String) constant.
static int CREATED
          The CREATED state is when the transport has been created or stopped.
static int DEAD
          The DEAD state is when the transport has exited and can not be restarted.
static java.lang.String DEFAULT_CONNECTION
          Define the default connection (String) constant.
static java.lang.String ERROR_COUNT_DATA_KEY
          Define the error count data key (String) constant.
static java.lang.String ID_KEY
          Define the id key (String) constant.
static java.lang.String INPUT_MESSAGE_COUNT_DATA_KEY
          Define the input message count data key (String) constant.
static java.lang.String METRICS_EXTERNAL_KEY
          Define the metrics external key (String) constant.
static short NULL
          Define the NULL transport style.
static java.lang.String SERVICE_NAME
          Define the OSGi service name.
static java.lang.String SOURCE_DATA_KEY
          Define the source data key (String) constant.
static int STARTED
          The STARTED state is when the transport has started and should be processing messages.
static java.lang.String STATE_DATA_KEY
          Define the state data key (String) constant.
static java.lang.String STATE_OLD_DATA_KEY
          Define the state old data key (String) constant.
static java.lang.String STATUS_EXTERNAL_KEY
          Define the status external key (String) constant.
static java.lang.String TIMESTAMP_DATA_KEY
          Define the timestamp data key (String) constant.
static java.lang.String VALUE_DATA_KEY
          Define the value data key (String) constant.
static java.lang.String VALUE_OLD_DATA_KEY
          Define the value old data key (String) constant.
 
Method Summary
 void addInterest(InterestService interest)
          Add an interest object to the transport.
 void addTransportListener(TransportListener transportListener)
          Adds the specified transport listener to receive listener notification.
 void closeChannel(ChannelService channel)
          Close channel with the specified channel parameter.
 void exit()
          Request the transport to exit.
 java.util.Map getChannels()
          Gets the channels (Map) value.
 java.util.Dictionary getConfigurationInformation()
          Gets the configuration information (Dictionary) value.
 org.eclipse.soda.dk.notification.service.NotificationService getNotificationService()
          Gets the notification service value.
 int getState()
          Gets the int state property value.
 boolean isMultiplexing()
          Gets the multiplexing (boolean) value.
 ChannelService openChannel(java.util.Map parameters)
          Open channel with the specified parameters parameter and return the ChannelService result.
 void removeInterest(InterestService interest)
          Remove an interest object from the transport.
 void removeTransportListener(TransportListener transportListener)
          Removes the specified transport listener from receiving listener notification.
 void send(ChannelService channel, MessageService message)
          Send with the specified channel and message parameters.
 void send(ChannelService channel, MessageService message, ResponseListener responseListener)
          Send with the specified channel and message parameters.
 void send(MessageService message)
          Send the specified message.
 void send(MessageService message, ResponseListener responseListener)
          Send the specified message.
 void setConfigurationInformation(java.util.Dictionary configurationInformation)
          Set the configuration information.
 void setNotificationService(org.eclipse.soda.dk.notification.service.NotificationService notificationService)
          Sets the notification service value.
 void start()
          Request the transport to start.
 void stop()
          Request the transport to stop.
 void write(byte[] messageBytes)
          Write the message bytes.
 void write(ChannelService channel, byte[] messageBytes)
          Write with the specified channel and message bytes parameters.
 

Field Detail

SERVICE_NAME

static final java.lang.String SERVICE_NAME
Define the OSGi service name.


CONNECTION_DEFAULT

static final java.lang.String CONNECTION_DEFAULT
Define the connection default (String) constant.

See Also:
Constant Field Values

ID_KEY

static final java.lang.String ID_KEY
Define the id key (String) constant.

See Also:
Constant Field Values

CONNECTION_KEY

static final java.lang.String CONNECTION_KEY
Define the connection key (String) constant.

See Also:
Constant Field Values

DEFAULT_CONNECTION

static final java.lang.String DEFAULT_CONNECTION
Define the default connection (String) constant.

See Also:
Constant Field Values

NULL

static final short NULL
Define the NULL transport style.

See Also:
Constant Field Values

DEAD

static final int DEAD
The DEAD state is when the transport has exited and can not be restarted.

See Also:
Constant Field Values

CREATED

static final int CREATED
The CREATED state is when the transport has been created or stopped. The transport will not attempt to move to another state until a start request has been issued.

See Also:
Constant Field Values

ALIVE

static final int ALIVE
The ALIVE state is when the transport has been told to start.

See Also:
Constant Field Values

CONNECTED

static final int CONNECTED
The CONNECTED state is when the transport is connected to the hardware device. This is normally done via a connection service object.

See Also:
Constant Field Values

ACTIVE

static final int ACTIVE
The ACTIVE state is when the transport is attempting to start but is not yet started.

See Also:
Constant Field Values

STARTED

static final int STARTED
The STARTED state is when the transport has started and should be processing messages.

See Also:
Constant Field Values

STATUS_EXTERNAL_KEY

static final java.lang.String STATUS_EXTERNAL_KEY
Define the status external key (String) constant.

See Also:
Constant Field Values

VALUE_DATA_KEY

static final java.lang.String VALUE_DATA_KEY
Define the value data key (String) constant.

See Also:
Constant Field Values

VALUE_OLD_DATA_KEY

static final java.lang.String VALUE_OLD_DATA_KEY
Define the value old data key (String) constant.

See Also:
Constant Field Values

STATE_DATA_KEY

static final java.lang.String STATE_DATA_KEY
Define the state data key (String) constant.

See Also:
Constant Field Values

STATE_OLD_DATA_KEY

static final java.lang.String STATE_OLD_DATA_KEY
Define the state old data key (String) constant.

See Also:
Constant Field Values

TIMESTAMP_DATA_KEY

static final java.lang.String TIMESTAMP_DATA_KEY
Define the timestamp data key (String) constant.

See Also:
Constant Field Values

SOURCE_DATA_KEY

static final java.lang.String SOURCE_DATA_KEY
Define the source data key (String) constant.

See Also:
Constant Field Values

CHANNEL_ID_DATA_KEY

static final java.lang.String CHANNEL_ID_DATA_KEY
Define the channel id data key (String) constant.

Since:
1.2
See Also:
Constant Field Values

CHANNEL_EXTERNAL_ID_DATA_KEY

static final java.lang.String CHANNEL_EXTERNAL_ID_DATA_KEY
Define the channel external id data key (String) constant.

Since:
1.2
See Also:
Constant Field Values

CONFIGURATION_DATA_KEY

static final java.lang.String CONFIGURATION_DATA_KEY
Define the configuration data key (String) constant.

See Also:
Constant Field Values

ERROR_COUNT_DATA_KEY

static final java.lang.String ERROR_COUNT_DATA_KEY
Define the error count data key (String) constant.

See Also:
Constant Field Values

INPUT_MESSAGE_COUNT_DATA_KEY

static final java.lang.String INPUT_MESSAGE_COUNT_DATA_KEY
Define the input message count data key (String) constant.

See Also:
Constant Field Values

METRICS_EXTERNAL_KEY

static final java.lang.String METRICS_EXTERNAL_KEY
Define the metrics external key (String) constant.

See Also:
Constant Field Values
Method Detail

addInterest

void addInterest(InterestService interest)
Add an interest object to the transport. The transport will provide notification on messages that pass the interest test. When multiple interests have been added to the transport, message notification will occur to all transport listeners if a message pass any of the interest objects. The interest object to add to the transport.

Parameters:
interest - The interest (InterestService) parameter.
See Also:
removeInterest(InterestService)

addTransportListener

void addTransportListener(TransportListener transportListener)
Adds the specified transport listener to receive listener notification. Implementors of TransportListener may be added as listeners to a TransportService. The TransportListeners will be notified when a valid MessageService is received. The addInterest method can be used to filter message notification. The org.eclipse.soda.dk.transport.service.TransportServiceListener listener to be added.

Parameters:
transportListener - The transport listener (TransportListener) parameter.
See Also:
removeTransportListener(TransportListener)

closeChannel

void closeChannel(ChannelService channel)
Close channel with the specified channel parameter.

Parameters:
channel - The channel (ChannelService) parameter.
Since:
1.2
See Also:
openChannel(Map)

exit

void exit()
Request the transport to exit. The transport service will be stopped. It will no longer read Messages or write Messages. All resources will be released. After an exit, the transport service can not be restarted.


getChannels

java.util.Map getChannels()
Gets the channels (Map) value.

Returns:
The channels (Map) value.
Since:
1.2

getConfigurationInformation

java.util.Dictionary getConfigurationInformation()
Gets the configuration information (Dictionary) value.

Returns:
Configuration Information.
See Also:
setConfigurationInformation(Dictionary)

getNotificationService

org.eclipse.soda.dk.notification.service.NotificationService getNotificationService()
Gets the notification service value.

Returns:
The notification service (NotificationService) value.
See Also:
setNotificationService(NotificationService)

getState

int getState()
Gets the int state property value. A TransportService may be queried for its current running status.

Returns:
Results of the get state (int) value.

isMultiplexing

boolean isMultiplexing()
Gets the multiplexing (boolean) value.

Returns:
The multiplexing (boolean) value.
Since:
1.2

openChannel

ChannelService openChannel(java.util.Map parameters)
                           throws java.io.IOException
Open channel with the specified parameters parameter and return the ChannelService result.

Parameters:
parameters - The parameters (Map) parameter.
Returns:
Results of the open channel (ChannelService) value.
Throws:
java.io.IOException - IOException.
Since:
1.2
See Also:
closeChannel(ChannelService)

removeInterest

void removeInterest(InterestService interest)
Remove an interest object from the transport. The interest object to remove from the transport.

Parameters:
interest - The interest (InterestService) parameter.
See Also:
addInterest(InterestService)

removeTransportListener

void removeTransportListener(TransportListener transportListener)
Removes the specified transport listener from receiving listener notification. The removed transportListener will no longer be notified when a valid MessageService is received. The org.eclipse.soda.dk.transport.service.TransportServiceListener listener to be removed.

Parameters:
transportListener - The transport listener (TransportListener) parameter.
See Also:
addTransportListener(TransportListener)

send

void send(ChannelService channel,
          MessageService message)
Send with the specified channel and message parameters.

Parameters:
channel - The channel (ChannelService) parameter.
message - The message (MessageService) parameter.
Since:
1.2
See Also:
send(MessageService), send(ChannelService,MessageService,ResponseListener), send(MessageService,ResponseListener)

send

void send(MessageService message)
Send the specified message. A TransportService may send a MessageService when it is started. org.eclipse.soda.dk.message.service.MessageService

Parameters:
message - The message (MessageService) parameter.
See Also:
send(ChannelService,MessageService), send(ChannelService,MessageService,ResponseListener), send(MessageService,ResponseListener)

send

void send(ChannelService channel,
          MessageService message,
          ResponseListener responseListener)
Send with the specified channel and message parameters.

Parameters:
channel - The channel (ChannelService) parameter.
message - The message (MessageService) parameter.
responseListener - The response listener (ResponseListener) parameter.
Since:
1.2
See Also:
send(ChannelService,MessageService), send(MessageService), send(MessageService,ResponseListener)

send

void send(MessageService message,
          ResponseListener responseListener)
Send the specified message. A TransportService may send a MessageService when it is started. org.eclipse.soda.dk.message.service.MessageService

Parameters:
message - The message (MessageService) parameter.
responseListener - The response listener (ResponseListener) parameter.
Since:
1.2
See Also:
send(ChannelService,MessageService), send(MessageService), send(ChannelService,MessageService,ResponseListener)

setConfigurationInformation

void setConfigurationInformation(java.util.Dictionary configurationInformation)
Set the configuration information. Set the configuration information,

Parameters:
configurationInformation - The configuration information (Dictionary) parameter.
See Also:
getConfigurationInformation()

setNotificationService

void setNotificationService(org.eclipse.soda.dk.notification.service.NotificationService notificationService)
Sets the notification service value.

Parameters:
notificationService - The notification service (NotificationService) parameter.
See Also:
getNotificationService()

start

void start()
Request the transport to start. If the transport service is not already started, then the transport will be started and it will now be able to read and write Messages.


stop

void stop()
Request the transport to stop. If no remaining transport service users exist, then the transport will be stopped and it will no longer read Messages or write Messages.


write

void write(byte[] messageBytes)
           throws java.lang.Exception
Write the message bytes. byte[]

Parameters:
messageBytes - The message bytes (byte[]) parameter.
Throws:
java.lang.Exception - Exception.
See Also:
write(ChannelService,byte[])

write

void write(ChannelService channel,
           byte[] messageBytes)
           throws java.lang.Exception
Write with the specified channel and message bytes parameters.

Parameters:
channel - The channel (ChannelService) parameter.
messageBytes - The message bytes (byte[]) parameter.
Throws:
java.lang.Exception - Exception.
Since:
1.2
See Also:
write(byte[])

2009-01-09 1.2.0

Copyright (c) 2009 IBM. See license in Legal section.