xmlBlaster 2.2.0 client API

org.xmlBlaster.client.qos
Class DisconnectQos

java.lang.Object
  extended by org.xmlBlaster.client.qos.DisconnectQos

public class DisconnectQos
extends java.lang.Object

This class encapsulates the qos of a logout() or disconnect()

So you don't need to type the 'ugly' XML ASCII string by yourself. After construction access the ASCII-XML string with the toXml() method.
A typical logout qos could look like this:

  <qos>
    <deleteSubjectQueue>true</deleteSubjectQueue>
    <clearSessions>false</clearSessions>
  </qos>
 

The following properties are evaluated (command line or xmlBlaster.properties) and control the behaviour on client side:

 dispatch/connection/shutdownDispatcher  true/false
 dispatch/connection/shutdownCbServer    true/false
 dispatch/connection/leaveServer         true/false
 
Additionally you can set these values as clientProperties, which have priority:
    <qos>
       <clientProperty name='shutdownDispatcher'>true</clientProperty>
       <clientProperty name='shutdownCbServer'>true</clientProperty>
       <clientProperty name='leaveServer'>false</clientProperty>
    </qos>
 

See Also:
The interface.disconnect requirement, org.xmlBlaster.test.classtest.DisconnectQosTest

Constructor Summary
DisconnectQos()
          Deprecated.  
DisconnectQos(Global glob)
           
DisconnectQos(Global glob, DisconnectQosData disconnectQosData)
          Constructor for internal use.
 
Method Summary
 void addClientProperty(java.lang.String key, java.lang.Object value)
          Sets a client property (an application specific property) to the given value.
 boolean clearClientQueue()
           
 void clearClientQueue(boolean clearClientQueue)
          If there are tail back messages in the client side queue, what to do with them.
 boolean clearSessions()
          Return true if we shall kill all other sessions of this user on logout (defaults to false).
 void clearSessions(boolean del)
           
 boolean deleteSubjectQueue()
          Return true if subject queue shall be deleted with last user session
 void deleteSubjectQueue(boolean del)
          If subject queue shall be deleted with last user session logout
 PropBoolean getClearClientQueueProp()
           
 ClientProperty getClientProperty(java.lang.String key)
          Read back a property.
 DisconnectQosData getData()
          Access the wrapped data holder
 boolean isLeaveServer()
           
 void setLeaveServer(boolean leaveServer)
          Set this to true if you just want to cleanup the client library but not disconnect from the server.
 boolean shutdownCbServer()
           
 void shutdownCbServer(boolean shutdownCbServer)
          Shutdown the client side callback server on disconnect.
 boolean shutdownDispatcher()
           
 void shutdownDispatcher(boolean shutdownDispatcher)
          Shutdown the client side dispatcher framework on disconnect, which includes the low level connection like CORBA.
 java.lang.String toString()
          Converts the data into a valid XML ASCII string.
 java.lang.String toXml()
          Converts the data into a valid XML ASCII string.
 java.lang.String toXml(java.lang.String extraOffset, java.util.Properties props)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DisconnectQos

public DisconnectQos(Global glob)

DisconnectQos

public DisconnectQos(Global glob,
                     DisconnectQosData disconnectQosData)
Constructor for internal use.

Parameters:
disconnectQosData - The struct holding the data

DisconnectQos

public DisconnectQos()
Deprecated. 

Method Detail

getData

public DisconnectQosData getData()
Access the wrapped data holder


deleteSubjectQueue

public boolean deleteSubjectQueue()
Return true if subject queue shall be deleted with last user session

Returns:
true;

deleteSubjectQueue

public void deleteSubjectQueue(boolean del)
If subject queue shall be deleted with last user session logout

Parameters:
del - defaults to true

clearSessions

public boolean clearSessions()
Return true if we shall kill all other sessions of this user on logout (defaults to false).

Returns:
false

clearSessions

public void clearSessions(boolean del)
Parameters:
true - if we shall kill all other sessions of this user on logout (defaults to false).

addClientProperty

public void addClientProperty(java.lang.String key,
                              java.lang.Object value)
Sets a client property (an application specific property) to the given value.

Note that this is no multimap, later similar keys will overwrite the previous

Parameters:
key -
value -

getClientProperty

public ClientProperty getClientProperty(java.lang.String key)
Read back a property.

Returns:
The client property or null if not found

toString

public java.lang.String toString()
Converts the data into a valid XML ASCII string.

Overrides:
toString in class java.lang.Object
Returns:
An XML ASCII string

toXml

public java.lang.String toXml()
Converts the data into a valid XML ASCII string.

Returns:
An XML ASCII string

toXml

public final java.lang.String toXml(java.lang.String extraOffset,
                                    java.util.Properties props)

clearClientQueue

public void clearClientQueue(boolean clearClientQueue)
If there are tail back messages in the client side queue, what to do with them.

Controls client side behavior.

Parameters:
clearClientQueue - true Removes all entries of the client side tailback queue which is default
false Keep persistent entries in client side queue, will be sent on next connect of the same client with the same public session ID.

clearClientQueue

public boolean clearClientQueue()
See Also:
clearClientQueue(boolean)

getClearClientQueueProp

public PropBoolean getClearClientQueueProp()

shutdownDispatcher

public void shutdownDispatcher(boolean shutdownDispatcher)
Shutdown the client side dispatcher framework on disconnect, which includes the low level connection like CORBA.

Controls client side behavior.

Parameters:
shutdownDispatcher - true is default

shutdownDispatcher

public boolean shutdownDispatcher()
Returns:
Defaults to true

shutdownCbServer

public void shutdownCbServer(boolean shutdownCbServer)
Shutdown the client side callback server on disconnect.

Controls client side behavior.

Parameters:
shutdownCbServer - true is default

shutdownCbServer

public boolean shutdownCbServer()
Returns:
Defaults to true

isLeaveServer

public boolean isLeaveServer()
Returns:
Returns the current setting

setLeaveServer

public void setLeaveServer(boolean leaveServer)
Set this to true if you just want to cleanup the client library but not disconnect from the server. At the server our session remains and will queue messages for us until we login again.

Parameters:
leaveServer - The leaveServer to set.

xmlBlaster 2.2.0 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.