|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.netseeker.ejoe.ConnectionHeader
public class ConnectionHeader
A simple connection header contining informations about compression and blocking/non-blocking io features. The header bits are structured as follows: |compression|nio|persistent|http|directMode|mixedMode|useAdapter|canHandleServerHandshakeResponse|
Constructor Summary | |
---|---|
ConnectionHeader(boolean isClient)
Creates a new instance of ConnectionHeader. |
|
ConnectionHeader(java.nio.channels.SocketChannel channel,
java.lang.String host,
boolean isClient)
Creates a new instance of ConnectionHeader. |
|
ConnectionHeader(java.nio.channels.SocketChannel channel,
java.lang.String host,
boolean isClient,
byte header)
Creates a new instance of ConnectionHeader. |
|
ConnectionHeader(java.lang.String host,
boolean isClient)
Creates a new instance of ConnectionHeader. |
Method Summary | |
---|---|
ConnectionHeader |
copy()
Returns a clean copy of the current instance containing all transportable settings of the connection header |
void |
fromByte(byte header)
sets the eight most important bits of the connection header based on the bits contained in the given byte |
void |
fromString(java.lang.String header)
Extracts the header settings from a formatted header string which follows the mask: header=12345678[&adapter=somepackage.someadapter] |
java.lang.String |
getAdapterName()
|
java.lang.Object |
getAttachementInfo()
|
java.lang.Object |
getAttachment()
|
java.nio.channels.SocketChannel |
getChannel()
|
int |
getCompressionLevel()
|
java.lang.String |
getHost()
|
java.nio.ByteBuffer |
getWaitingBuffer()
|
boolean |
hasAdapter()
|
boolean |
hasAttachment()
|
boolean |
hasCompression()
|
boolean |
hasNonBlockingReadWrite()
|
boolean |
hasWaitingBuffer()
|
boolean |
isClient()
|
boolean |
isConnected()
|
boolean |
isDirect()
|
boolean |
isHandshakeResponseAware()
|
boolean |
isHttp()
|
boolean |
isMixed()
|
boolean |
isPersistent()
|
void |
releaseAttachment()
|
void |
releaseWaitingBuffer()
|
void |
setAdapterName(java.lang.String name)
|
void |
setAttachment(java.lang.Object attachment)
|
void |
setAttachment(java.lang.Object attachment,
java.lang.Object attachmentInfo)
|
void |
setChannel(java.nio.channels.SocketChannel channel)
|
void |
setCompression(boolean enable)
|
void |
setCompressionLevel(int level)
|
void |
setConnected(boolean enable)
|
void |
setHost(java.lang.String host)
|
void |
setHttp(boolean enable)
|
void |
setIsDirect(boolean enable)
|
void |
setIsHandshakeResponseAware(boolean enable)
|
void |
setIsMixed(boolean enable)
|
void |
setNonBlockingReadWrite(boolean enable)
|
void |
setPersistent(boolean enable)
|
void |
setWaitingBuffer(java.nio.ByteBuffer buf)
|
byte |
toByte()
Returns a byte representation of the eight most important bits of the connection header |
java.nio.ByteBuffer |
toByteBuffer()
Returns a ByteBuffer containg all transportable settings of the connection header |
byte[] |
toBytes()
Returns the byte array representation of this connection header |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConnectionHeader(boolean isClient)
public ConnectionHeader(java.lang.String host, boolean isClient)
host
- the host string in the form IP address : port, eg. 127.0.0.1:12577public ConnectionHeader(java.nio.channels.SocketChannel channel, java.lang.String host, boolean isClient)
channel
- The channel to which this connection header applies.host
- the host string in the form IP address : port, eg. 127.0.0.1:12577public ConnectionHeader(java.nio.channels.SocketChannel channel, java.lang.String host, boolean isClient, byte header)
channel
- The channel to which this connection header applies.host
- the host string in the form IP address : port, eg. 127.0.0.1:12577header
- The byte representing the settings used for:
Method Detail |
---|
public boolean hasCompression()
public void setCompression(boolean enable)
enable
- public void setCompressionLevel(int level)
level
- public int getCompressionLevel()
public boolean hasNonBlockingReadWrite()
public void setNonBlockingReadWrite(boolean enable)
enable
- public boolean isPersistent()
public void setPersistent(boolean enable)
enable
- public boolean isHttp()
public void setHttp(boolean enable)
http
- public boolean isDirect()
public void setIsDirect(boolean enable)
enable
- public boolean isMixed()
public void setIsMixed(boolean enable)
public boolean hasAdapter()
public void setAdapterName(java.lang.String name)
name
- public boolean isHandshakeResponseAware()
public void setIsHandshakeResponseAware(boolean enable)
enable
- public java.lang.String getAdapterName()
public boolean isConnected()
public void setConnected(boolean enable)
enable
- public boolean hasWaitingBuffer()
public java.nio.ByteBuffer getWaitingBuffer()
public void setWaitingBuffer(java.nio.ByteBuffer buf)
buf
- public void releaseWaitingBuffer()
public boolean hasAttachment()
public void setAttachment(java.lang.Object attachment)
attachment
- public void setAttachment(java.lang.Object attachment, java.lang.Object attachmentInfo)
attachment
- attachmentInfo
- public boolean isClient()
public java.lang.Object getAttachment()
public java.lang.Object getAttachementInfo()
public void releaseAttachment()
public void setChannel(java.nio.channels.SocketChannel channel)
channel
- public java.nio.channels.SocketChannel getChannel()
public java.lang.String getHost()
public void setHost(java.lang.String host)
host
- public byte toByte()
public void fromByte(byte header)
header
- public java.lang.String toString()
toString
in class java.lang.Object
public void fromString(java.lang.String header) throws java.text.ParseException
header=12345678[&adapter=somepackage.someadapter]
header
-
java.text.ParseException
public java.nio.ByteBuffer toByteBuffer()
ByteBuffer
containg all transportable settings of the connection header
ByteBuffer
representation of the connection headerpublic byte[] toBytes()
public ConnectionHeader copy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |