xmlBlaster 2.2.0 API

org.xmlBlaster.protocol.socket
Class SocketCbConnection

java.lang.Object
  extended by org.xmlBlaster.util.protocol.RequestReplyExecutor
      extended by org.xmlBlaster.util.protocol.socket.SocketExecutor
          extended by org.xmlBlaster.protocol.socket.SocketCbConnection
All Implemented Interfaces:
I_AdminPlugin, I_AdminUsage, RequestReplyExecutorMBean, SocketExecutorMBean

public class SocketCbConnection
extends SocketExecutor

This instance establishes exactly one connection to a listening client side callback server.

NOTE: First step for a different SOCKET connection on callback NOTE: This code is currently NOT in use (as we reuse the same SOCKET with CallbackSocketDriver.java)

Author:
Marcel Ruff.
See Also:
The protocol.socket requirement

Field Summary
protected  java.lang.String cbSessionId
          The unique client cbSessionId
protected  CallbackAddress clientAddress
           
private  Global glob
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
protected  java.net.Socket sock
          The socket connection to one client
private  SocketUrl socketUrl
          Holds the hostname/port of the callback server running on client side to which we want connect
 
Fields inherited from class org.xmlBlaster.util.protocol.socket.SocketExecutor
iStream, loginName, maxChunkSize, msgInfoParserClassName, oStream, running, soLingerTimeout, soTimeout
 
Fields inherited from class org.xmlBlaster.util.protocol.RequestReplyExecutor
addressConfig, addressServer, cbClient, compressZlib, compressZlibStream, contextNode, mbeanHandle, minSizeForCompression, ONEWAY, pingResponseTimeout, prefix, progressListener, responseListenerMap, responseTimeout, updateResponseTimeout, useEmailExpiryTimestamp, WAIT_ON_RESPONSE
 
Constructor Summary
SocketCbConnection(Global glob)
          Connect to xmlBlaster using plain socket with native message format.
 
Method Summary
 void connectLowlevel(CallbackAddress callbackAddress)
          Connects to clients callback server with one socket connection.
(package private)  Global getGlobal()
           
 java.lang.String getLocalAddress()
          A string with the local address and port (the xmlBlaster side).
 java.lang.String getProtocol()
          Returns the protocol type.
 java.net.Socket getSocket()
          Get the raw socket handle
 java.lang.String getType()
          The protocol type, used for logging
 boolean isConnected()
           
 java.lang.String ping(java.lang.String qos)
          Check the clients cb server.
 void resetConnection()
          Reset the driver on problems
 void shutdown()
          Shut down the callback server.
 java.lang.String toXml()
          Dump of the state, remove in future.
 java.lang.String toXml(java.lang.String extraOffset)
          Dump of the state, remove in future.
 
Methods inherited from class org.xmlBlaster.util.protocol.socket.SocketExecutor
getCbMsgInfoParserClassName, getGlobalKey, getInputStream, getMsgInfoParserClassName, getOutputStream, getSoLingerTimeout, getSoTimeout, getUsageUrl, getVersion, initialize, sendMessage, sendUpdate, setLoginName, setRunning, setSoLingerTimeout, setSoTimeout, setUsageUrl, usage, useUdpForOneway
 
Methods inherited from class org.xmlBlaster.util.protocol.RequestReplyExecutor
addResponseListener, clearResponseListenerMap, executeException, executeResponse, freePendingThreads, getAddressServer, getCbClient, getDefaultPingResponseTimeout, getDefaultResponseTimeout, getDefaultUpdateResponseTimeout, getExpiryTimestamp, getMinSizeForCompression, getPendingRequestList, getPingResponseTimeout, getProgressListener, getResponseListener, getResponseTimeout, getResponseTimeout, getResponseTimeout, getResponseTimeoutPropertyName, getUpdateResponseTimeout, getXmlBlasterCore, hasConnection, initialize, initializeCb, interruptInvocation, isCompressZlib, isCompressZlibStream, isShutdown, isShutdownCompletly, isUseEmailExpiryTimestamp, receiveReply, registerProgressListener, removeResponseListener, requestAndBlockForReply, setCbClient, setCompressZlib, setCompressZlibStream, setMinSizeForCompression, setPingResponseTimeout, setResponseTimeout, setUpdateResponseTimeout, setUseEmailExpiryTimestamp, setXmlBlasterCore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xmlBlaster.util.protocol.RequestReplyExecutorMBean
getMinSizeForCompression, getPingResponseTimeout, getResponseTimeout, getResponseTimeout, getUpdateResponseTimeout, interruptInvocation, isCompressZlib, isCompressZlibStream, isUseEmailExpiryTimestamp, setCompressZlib, setCompressZlibStream, setMinSizeForCompression, setPingResponseTimeout, setResponseTimeout, setUpdateResponseTimeout, setUseEmailExpiryTimestamp
 
Methods inherited from interface org.xmlBlaster.util.admin.I_AdminPlugin
isShutdown
 

Field Detail

ME

private java.lang.String ME

glob

private Global glob

log

private static java.util.logging.Logger log

socketUrl

private SocketUrl socketUrl
Holds the hostname/port of the callback server running on client side to which we want connect


sock

protected java.net.Socket sock
The socket connection to one client


cbSessionId

protected java.lang.String cbSessionId
The unique client cbSessionId


clientAddress

protected CallbackAddress clientAddress
Constructor Detail

SocketCbConnection

public SocketCbConnection(Global glob)
                   throws XmlBlasterException
Connect to xmlBlaster using plain socket with native message format.

Throws:
XmlBlasterException
Method Detail

getSocket

public java.net.Socket getSocket()
                          throws XmlBlasterException
Get the raw socket handle

Throws:
XmlBlasterException

getGlobal

final Global getGlobal()

getType

public java.lang.String getType()
Description copied from class: RequestReplyExecutor
The protocol type, used for logging

Specified by:
getType in interface I_AdminPlugin
Specified by:
getType in class RequestReplyExecutor
Returns:
"SOCKET" or "EMAIL", never null

connectLowlevel

public void connectLowlevel(CallbackAddress callbackAddress)
                     throws XmlBlasterException
Connects to clients callback server with one socket connection.

Throws:
XmlBlasterException

resetConnection

public void resetConnection()
Reset the driver on problems


getLocalAddress

public java.lang.String getLocalAddress()
A string with the local address and port (the xmlBlaster side).

Returns:
For example "localhost:66557"

getProtocol

public final java.lang.String getProtocol()
Returns the protocol type.

Returns:
"SOCKET"

shutdown

public void shutdown()
Shut down the callback server. Is called by logout()

Specified by:
shutdown in interface I_AdminPlugin
Overrides:
shutdown in class SocketExecutor

isConnected

public final boolean isConnected()
Returns:
true if the socket connection is established

ping

public final java.lang.String ping(java.lang.String qos)
                            throws XmlBlasterException
Check the clients cb server.

Overrides:
ping in class SocketExecutor
Parameters:
qos - Currently an empty string ""
Returns:
Currently an empty string ""
Throws:
XmlBlasterException - If client not reachable

toXml

public java.lang.String toXml()
                       throws XmlBlasterException
Dump of the state, remove in future.

Throws:
XmlBlasterException

toXml

public java.lang.String toXml(java.lang.String extraOffset)
                       throws XmlBlasterException
Dump of the state, remove in future.

Throws:
XmlBlasterException

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.