xmlBlaster 2.1.0 API

org.xmlBlaster.engine.qos
Class ConnectQosServer

java.lang.Object
  extended by org.xmlBlaster.engine.qos.ConnectQosServer

public final class ConnectQosServer
extends java.lang.Object

This class encapsulates the qos of a connect() invocation.

See Also:
ConnectQosSaxFactory, connect interface

Field Summary
private  AddressServer addressServer
          The address information got from the protocol plugin.
private  boolean allowExceptionsThrownToClient
          E.g.
private  boolean bypassCredentialCheck
           
private  ConnectQosData connectQosData
           
private  long persistenceUniqueId
           
private  boolean sessionLimitsPubSessionIdSpecific
          defaults to false If true the pubSessionId<0 and pubSessionId>0 can have different maxSessions and clearSession specified TODO: make configurable from client side and in xmlBlaster.properties currently you can only manipulate it using a security plugin I_Session.init(ConnectQosServer, java.util.Map)
 
Constructor Summary
ConnectQosServer(Global glob, ConnectQosData connectQosData)
           
ConnectQosServer(Global glob, java.lang.String xmlQos)
           
 
Method Summary
 void addCallbackAddress(CallbackAddress callback)
          Add a callback address where to send the message (for PtP or subscribes).
 boolean allowExceptionsThrownToClient()
           
 boolean bypassCredentialCheck()
           
 void bypassCredentialCheck(boolean bypassCredentialCheck)
          Tell authenticate to not check the password.
 boolean clearSessions()
          If clearSessions is true, all old sessions of this user are discarded.
 boolean duplicateUpdates()
           
 AddressServer getAddressServer()
          The address information got from the protocol plugin.
 java.lang.String getClientPluginType()
          Return the type of the referenced SecurityPlugin.
 java.lang.String getClientPluginVersion()
          Return the version of the referenced SecurityPlugin.
 ConnectQosServer getClone(Global newGlob)
          Serialize first to have a clone for security reasons (and to guarantee our Global).
 ConnectQosData getData()
           
 int getMaxSessions()
           
 long getPersistenceUniqueId()
           
 I_SecurityQos getSecurityQos()
           
 CbQueueProperty getSessionCbQueueProperty()
          Returns never null
 SessionName getSessionName()
           
 SessionQos getSessionQos()
           
 long getSessionTimeout()
          Timeout until session expires if no communication happens
 CbQueueProperty getSubjectQueueProperty()
          Returns never null.
 java.lang.String getUserId()
           
 boolean hasPublicSessionId()
           
 boolean isClusterNode()
           
 boolean isFromPersistenceRecovery()
          Marker if the message comes from persistent store after recovery.
 void isFromPersistenceRecovery(boolean fromPersistenceRecovery)
           
 boolean isPtpAllowed()
           
 boolean isSessionLimitsPubSessionIdSpecific()
           
 I_ClientPlugin loadClientPlugin(java.lang.String mechanism, java.lang.String version, java.lang.String loginName, java.lang.String passwd)
          Allows to set or overwrite the parsed security plugin.
 void setAddress(Address address)
          Set the address to which we want to connect, with all the configured parameters.
 void setAddressServer(AddressServer addressServer)
          The address information got from the protocol plugin.
 void setAllowExceptionsThrownToClient(boolean allowExceptionsThrownToClient)
          Can be set by e.g.
 void setDuplicateUpdates(boolean duplicateUpdates)
           
 void setPersistenceUniqueId(long persistenceUniqueId)
           
 void setPtpAllowed(boolean ptpAllowed)
           
 void setSessionCbQueueProperty(CbQueueProperty prop)
          Adds a queue description.
 void setSessionLimitsPubSessionIdSpecific(boolean sessionLimitsPubSessionIdSpecific)
           
 void setSessionName(SessionName sessionName)
          Set the login session name.
 void setSessionTimeout(long timeout)
          Timeout until session expires if no communication happens
 void setUserId(java.lang.String loginName)
          Allows to set or overwrite the login name for I_SecurityQos.
 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)
          Dump state of this object into a XML ASCII string.
 java.lang.String toXml(java.lang.String extraOffset, java.util.Properties props)
          Dump state of this object into a XML ASCII string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

connectQosData

private final ConnectQosData connectQosData

bypassCredentialCheck

private boolean bypassCredentialCheck

sessionLimitsPubSessionIdSpecific

private boolean sessionLimitsPubSessionIdSpecific
defaults to false If true the pubSessionId<0 and pubSessionId>0 can have different maxSessions and clearSession specified TODO: make configurable from client side and in xmlBlaster.properties currently you can only manipulate it using a security plugin I_Session.init(ConnectQosServer, java.util.Map)


persistenceUniqueId

private long persistenceUniqueId

addressServer

private AddressServer addressServer
The address information got from the protocol plugin.


allowExceptionsThrownToClient

private boolean allowExceptionsThrownToClient
E.g. mobile phones don't know what to do with it

Constructor Detail

ConnectQosServer

public ConnectQosServer(Global glob,
                        ConnectQosData connectQosData)

ConnectQosServer

public ConnectQosServer(Global glob,
                        java.lang.String xmlQos)
                 throws XmlBlasterException
Throws:
XmlBlasterException
Method Detail

getClone

public ConnectQosServer getClone(Global newGlob)
                          throws XmlBlasterException
Serialize first to have a clone for security reasons (and to guarantee our Global).

Parameters:
glob - Use the new Global for the returned clone
Throws:
XmlBlasterException

getData

public ConnectQosData getData()

setAddressServer

public void setAddressServer(AddressServer addressServer)
The address information got from the protocol plugin.

Parameters:
addressServer - The address information of the current protocol plugin

getAddressServer

public AddressServer getAddressServer()
The address information got from the protocol plugin.

Returns:
Can be null

bypassCredentialCheck

public void bypassCredentialCheck(boolean bypassCredentialCheck)
Tell authenticate to not check the password. This is an attribute of ConnectQosServer only, ConnectQosData and its toXml() never transport this setting. As the ConnectQosServer facade is only used in the core (inside the protector classes) this is no security hole.


bypassCredentialCheck

public boolean bypassCredentialCheck()

isFromPersistenceRecovery

public void isFromPersistenceRecovery(boolean fromPersistenceRecovery)

getPersistenceUniqueId

public long getPersistenceUniqueId()
Returns:
0 if not persisted

setPersistenceUniqueId

public void setPersistenceUniqueId(long persistenceUniqueId)

isFromPersistenceRecovery

public boolean isFromPersistenceRecovery()
Marker if the message comes from persistent store after recovery.


getSessionQos

public SessionQos getSessionQos()
Returns:
The session QoS which contains all session specific configuration, never null

getMaxSessions

public int getMaxSessions()

clearSessions

public boolean clearSessions()
If clearSessions is true, all old sessions of this user are discarded.


getSessionTimeout

public long getSessionTimeout()
Timeout until session expires if no communication happens


setSessionTimeout

public void setSessionTimeout(long timeout)
Timeout until session expires if no communication happens


hasPublicSessionId

public boolean hasPublicSessionId()

setSessionName

public void setSessionName(SessionName sessionName)
Set the login session name.


getSessionName

public SessionName getSessionName()

setUserId

public void setUserId(java.lang.String loginName)
               throws XmlBlasterException
Allows to set or overwrite the login name for I_SecurityQos.

This will call setSessionName() as well if sessionName is not set yet.

Parameters:
loginName - The unique user id
Throws:
XmlBlasterException

getUserId

public java.lang.String getUserId()
Returns:
The user ID or "NoLoginName" if not known

loadClientPlugin

public I_ClientPlugin loadClientPlugin(java.lang.String mechanism,
                                       java.lang.String version,
                                       java.lang.String loginName,
                                       java.lang.String passwd)
                                throws XmlBlasterException
Allows to set or overwrite the parsed security plugin.

<securityService type='simple' version='1.0'>...</securityService>

Parameters:
mechanism - The client side security plugin to use
passwd - If null the environment -passwd is checked
Throws:
XmlBlasterException

getSecurityQos

public I_SecurityQos getSecurityQos()
Returns:
Access the login credentials or null if not set

getClientPluginType

public java.lang.String getClientPluginType()
Return the type of the referenced SecurityPlugin.

Returns:
The type or null if not known

getClientPluginVersion

public java.lang.String getClientPluginVersion()
Return the version of the referenced SecurityPlugin.

Returns:
The version or null if not known

setPtpAllowed

public void setPtpAllowed(boolean ptpAllowed)
Parameters:
Set - if we accept point to point messages

isPtpAllowed

public boolean isPtpAllowed()
Returns:
true if we are accepting PtP messages

setDuplicateUpdates

public void setDuplicateUpdates(boolean duplicateUpdates)
Parameters:
Set - if we allow multiple updates for the same message if we have subscribed multiple times to it.

duplicateUpdates

public boolean duplicateUpdates()
Returns:
true if we allow multiple updates for the same message if we have subscribed multiple times to it.

setAddress

public void setAddress(Address address)
Set the address to which we want to connect, with all the configured parameters.

Parameters:
address - An object containing the protocol (e.g. EMAIL) the address (e.g. hugo@welfare.org) and the connection properties

addCallbackAddress

public void addCallbackAddress(CallbackAddress callback)
Add a callback address where to send the message (for PtP or subscribes).

Creates a default CbQueueProperty object to hold the callback address argument.
Note you can invoke this multiple times to allow multiple callbacks.

Parameters:
callback - An object containing the protocol (e.g. EMAIL) and the address (e.g. hugo@welfare.org)

setSessionCbQueueProperty

public void setSessionCbQueueProperty(CbQueueProperty prop)
Adds a queue description. This allows to set all supported attributes of a callback queue and a callback address

Parameters:
prop - The property object of the callback queue which shall be established in the server for calling us back.
See Also:
CallbackAddress

getSessionCbQueueProperty

public CbQueueProperty getSessionCbQueueProperty()
Returns never null


getSubjectQueueProperty

public CbQueueProperty getSubjectQueueProperty()
Returns never null. The subjectQueue has never callback addresses, the addresses of the sessions are used if configured.


isClusterNode

public boolean isClusterNode()
Returns:
Is the client a cluster?

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(java.lang.String extraOffset)
Dump state of this object into a XML ASCII string.

Parameters:
extraOffset - indenting of tags for nice output
Returns:
internal state of the connect QoS as a XML ASCII string

toXml

public java.lang.String toXml(java.lang.String extraOffset,
                              java.util.Properties props)
Dump state of this object into a XML ASCII string.

Parameters:
extraOffset - indenting of tags for nice output
flag - For example Constants.TOXML_NOSECURITY
Returns:
internal state of the connect QoS as a XML ASCII string

toXml

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

Returns:
An XML ASCII string

isSessionLimitsPubSessionIdSpecific

public boolean isSessionLimitsPubSessionIdSpecific()

setSessionLimitsPubSessionIdSpecific

public void setSessionLimitsPubSessionIdSpecific(boolean sessionLimitsPubSessionIdSpecific)

allowExceptionsThrownToClient

public boolean allowExceptionsThrownToClient()

setAllowExceptionsThrownToClient

public void setAllowExceptionsThrownToClient(boolean allowExceptionsThrownToClient)
Can be set by e.g. security plugins to false to protect clients to receive exception which they can't handle

Parameters:
allowExceptionsThrownToClient -

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.