2009-01-09 1.2.0

org.eclipse.soda.dk.connection
Class StreamConnection

java.lang.Object
  extended by org.eclipse.soda.dk.core.EscObject
      extended by org.eclipse.soda.dk.connection.Connection
          extended by org.eclipse.soda.dk.connection.StreamConnection
All Implemented Interfaces:
ConnectionService

public class StreamConnection
extends Connection
implements ConnectionService

The StreamConnection class implements the ConnectionService interface.

Since:
1.0
Version:
1.2.0
See Also:
EscObject, ConnectionService

Field Summary
 
Fields inherited from class org.eclipse.soda.dk.connection.Connection
CHANNEL_ACTIVE_STATE_RESOURCE, CHANNEL_ALIVE_STATE_RESOURCE, CHANNEL_CLOSED_RESOURCE, CHANNEL_CONNECTED_STATE_RESOURCE, CHANNEL_CREATED_STATE_RESOURCE, CHANNEL_DEAD_STATE_RESOURCE, CHANNEL_OPEN, CHANNEL_OPENFAILED_RESOURCE, CHANNEL_READ_BYTES_RESOURCE, CHANNEL_STARTED_STATE_RESOURCE, CHANNEL_WRITE_BYTES_RESOURCE, CLIENT_WAIT_RESOURCE, CLOSE_RESOURCE, CLOSED_RESOURCE, configurationService, logLevel, OPEN_RESOURCE, OPENFAILED_RESOURCE, READ_BYTES_RESOURCE, readByteCount, WRITE_BYTES_RESOURCE, writeByteCount
 
Fields inherited from class org.eclipse.soda.dk.core.EscObject
CLONE_EXCEPTION_RESOURCE, EMPTY_BYTES, EMPTY_STRING, ERROR_OCCURRED_EXCEPTION_RESOURCE, ID_FILTER_KEY, ID_KEY, ID_KEY_ANY, ID_NAME_KEY, INTEGER_TABLE, INTEGER_TABLE_SIZE, KEY_KEY, LOG_DEBUG, LOG_DEFAULT, LOG_ERROR, LOG_INFO, LOG_LEVEL_KEY, LOG_TRACE, LOG_WARNING, LONG_TABLE, LONG_TABLE_SIZE, PREFIX_KEY, READONLY_EMPTY_COLLECTION, READONLY_EMPTY_LIST, READONLY_EMPTY_MAP, RESOURCE_BUNDLE, SLEEP_EXCEPTION_RESOURCE, SYSTEM_INFO_RESOURCE, TO_STRING_CONFIGURATION_KEYS, TRACE_LEVEL_HIGH, TRACE_LEVEL_LOW, TRACE_LEVEL_MAX, TRACE_LEVEL_MIN, TRACE_LEVEL_NONE, TRACE_LEVEL_NORMAL, TRACELEVEL_KEY, UNKNOWN_ERROR_RESOURCE, Unmodifiable
 
Fields inherited from interface org.eclipse.soda.dk.connection.service.ConnectionService
CONNECTION_DEFAULT, CONNECTION_KEY, CONNECTION_TYPE, DEFAULT_CONNECTION, SERVICE_NAME
 
Constructor Summary
StreamConnection()
          Constructs an instance of this class.
StreamConnection(ConfigurationService configuration)
          Constructs an instance of this class from the specified configuration parameter.
StreamConnection(java.util.Dictionary properties)
          Constructs an instance of this class from the specified properties parameter.
 
Method Summary
 void close()
          Perform the close action method.
 void flush()
          Flush any data to be written.
protected  java.io.InputStream getInputStream()
          Gets the input stream value.
protected  java.io.OutputStream getOutputStream()
          Gets the output stream value.
 int read(byte[] bytes)
          Read bytes.
 int read(byte[] bytes, int offset, int length)
          Read bytes.
 void setInputStream(java.io.InputStream inputStream)
          Sets the input stream value.
 void setOutputStream(java.io.OutputStream outputStream)
          Sets the output stream value.
 void write(byte[] bytes)
          Writes count bytes from the byte array buffer starting at offset.
 void write(byte[] bytes, int offset, int count)
          Writes count bytes from the byte array buffer starting at offset.
 
Methods inherited from class org.eclipse.soda.dk.connection.Connection
attemptRecoveryFromError, exit, finalize, getConfigurationService, getDefaultResource, getErrorSeverity, getLogDetails4, getLogDetails5, getLogLevel, getReadByteCount, getResource, getWriteByteCount, isOpen, open, setConfigurationInformation, setConfigurationService, setLogLevel, setOpen, setReadByteCount, setWriteByteCount, toStringInfo, updateReadByteCount, updateWriteByteCount
 
Methods inherited from class org.eclipse.soda.dk.core.EscObject
createBoolean, createDefaultLogService, createException, createException, createInteger, createIntegerTable, createLong, createLongTable, createNumber, format, getBoolean, getByte, getChar, getCurrentTimestamp, getDefaultLogService, getDouble, getFloat, getId, getIdName, getInt, getLoadLibraryName, getLogDetails, getLogDetails, getLogDetails0, getLogDetails1, getLogDetails2, getLogDetails3, getLogDetails6, getLogDetails7, getLogService, getLong, getObject, getOutputName, getReadOnlyEmptyCollection, getReadOnlyEmptyList, getReadOnlyEmptyMap, getShort, getSimpleClassName, getStaticBoolean, getStaticByte, getStaticChar, getStaticDouble, getStaticFloat, getStaticInt, getStaticLong, getStaticObject, getStaticShort, getStaticString, getString, getTraceLevel, getVmLibraryVersion, handleError, handleError, handleError, handleError, handleErrorInternal, handleStaticError, handleStaticException, isBackward, isDebug, isLogging, isTrace, isUnmodifiable, loadService, log, log, log, report, report, report, report, report, report, report, reportError, reportSystemInfo, setBackward, setDebug, setDefaultLogService, setLogService, setTraceLevel, setUnmodifiable, shouldLog, sleep, startupEscStatic, toString, toStringConfigurationKeys
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.soda.dk.connection.service.ConnectionService
exit, isOpen, open, setConfigurationInformation
 

Constructor Detail

StreamConnection

public StreamConnection(ConfigurationService configuration)
Constructs an instance of this class from the specified configuration parameter.

Parameters:
configuration - The configuration (ConfigurationService) parameter.
See Also:
StreamConnection(Dictionary), StreamConnection()

StreamConnection

public StreamConnection(java.util.Dictionary properties)
Constructs an instance of this class from the specified properties parameter.

Parameters:
properties - The properties (Dictionary) parameter.
See Also:
StreamConnection(ConfigurationService), StreamConnection()

StreamConnection

public StreamConnection()
Constructs an instance of this class.

See Also:
StreamConnection(ConfigurationService), StreamConnection(Dictionary)
Method Detail

close

public void close()
           throws java.io.IOException
Perform the close action method.

Specified by:
close in interface ConnectionService
Overrides:
close in class Connection
Throws:
java.io.IOException - IOException.
See Also:
ConnectionService.close()

flush

public void flush()
           throws java.io.IOException
Flush any data to be written.

Specified by:
flush in interface ConnectionService
Overrides:
flush in class Connection
Throws:
java.io.IOException - IOException.

getInputStream

protected java.io.InputStream getInputStream()
Gets the input stream value.

Returns:
The input stream (InputStream) value.
See Also:
setInputStream(InputStream)

getOutputStream

protected java.io.OutputStream getOutputStream()
Gets the output stream value.

Returns:
The output stream (OutputStream) value.
See Also:
setOutputStream(OutputStream)

read

public int read(byte[] bytes)
         throws java.io.IOException
Read bytes.

Specified by:
read in interface ConnectionService
Overrides:
read in class Connection
Parameters:
bytes - The bytes (byte[]) parameter.
Returns:
The number of bytes actually read or -1 if end of stream.
Throws:
java.io.IOException - IOException.
See Also:
read(byte[],int,int)

read

public int read(byte[] bytes,
                int offset,
                int length)
         throws java.io.IOException
Read bytes.

Specified by:
read in interface ConnectionService
Parameters:
bytes - The bytes (byte[]) parameter.
offset - The offset (int) parameter.
length - The length (int) parameter.
Returns:
The number of bytes actually read or -1 if end of stream.
Throws:
java.io.IOException - IOException.
See Also:
read(byte[])

setInputStream

public void setInputStream(java.io.InputStream inputStream)
Sets the input stream value.

Parameters:
inputStream - The input stream (InputStream) parameter.
See Also:
getInputStream()

setOutputStream

public void setOutputStream(java.io.OutputStream outputStream)
Sets the output stream value.

Parameters:
outputStream - The output stream (OutputStream) parameter.
See Also:
getOutputStream()

write

public void write(byte[] bytes)
           throws java.io.IOException
Writes count bytes from the byte array buffer starting at offset.

Specified by:
write in interface ConnectionService
Overrides:
write in class Connection
Parameters:
bytes - The bytes (byte[]) parameter.
Throws:
java.io.IOException - IOException.
See Also:
write(byte[],int,int)

write

public void write(byte[] bytes,
                  int offset,
                  int count)
           throws java.io.IOException
Writes count bytes from the byte array buffer starting at offset.

Specified by:
write in interface ConnectionService
Parameters:
bytes - The bytes (byte[]) parameter.
offset - The offset (int) parameter.
count - The count (int) parameter.
Throws:
java.io.IOException - IOException.
See Also:
write(byte[])

2009-01-09 1.2.0

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