|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.client.qos.ConnectQos
public final class ConnectQos
This class encapsulates the qos of a connect() invocation.
ConnectQosSaxFactory
,
connect interfaceConstructor Summary | |
---|---|
ConnectQos(Global glob)
Default constructor. |
|
ConnectQos(Global glob,
ConnectQosData connectQosData)
Constructor for special use in cluster environment only. |
|
ConnectQos(Global glob,
java.lang.String userId,
java.lang.String passwd)
Login with the default security plugin as given by -Security.Client.DefaultPlugin htpasswd,1.0 |
Method Summary | |
---|---|
void |
addCallbackAddress(CallbackAddress callback)
Add a callback address where to send the message (for PtP or subscribes). |
void |
addClientProperty(java.lang.String key,
java.lang.Object value)
Sets a client property (an application specific property) to the given value |
void |
addClientQueueProperty(ClientQueueProperty clientQueueProperty)
The configuration of the local client side queue. |
boolean |
clearSessions()
If clearSessions is true, all old sessions of this user are discarded. |
void |
clearSessions(boolean clear)
If clearSessions is true, all old sessions of this user are discarded. |
boolean |
doSendConnect()
|
void |
doSendConnect(boolean doSendConnect)
If set to false the connect() is not send to the server. |
boolean |
duplicateUpdates()
Deprecated. Please use multiSubscribe=false from SubscribeQos |
Address |
getAddress()
The connection address and properties of the xmlBlaster server we want connect to. |
AddressBase[] |
getAddresses(boolean forceCbAddressCreation)
The connection address and properties of the xmlBlaster server we want connect to. |
org.xmlBlaster.authentication.plugins.I_ClientPlugin |
getClientPlugin()
Access the default plugin or the previously added by load loadClientPlugin() |
ClientProperty |
getClientProperty(java.lang.String key)
Read back a property. |
ClientQueueProperty |
getClientQueueProperty()
The configuration of the local client side queue. |
ConnectQosData |
getData()
|
boolean |
getPersistent()
Gets the persistent flag. |
boolean |
getRefreshSession()
|
org.xmlBlaster.authentication.plugins.I_SecurityQos |
getSecurityQos()
This is a convenience method for getClientPlugin().getSecurityQos() . |
CbQueueProperty |
getSessionCbQueueProperty()
Returns never null. |
SessionName |
getSessionName()
|
SessionQos |
getSessionQos()
|
CbQueueProperty |
getSubjectQueueProperty()
Gets the subject queue properties as set on this connection. |
java.lang.String |
getUserId()
|
boolean |
isPtpAllowed()
|
org.xmlBlaster.authentication.plugins.I_ClientPlugin |
loadClientPlugin(java.lang.String type,
java.lang.String version,
java.lang.String userId,
java.lang.String credential)
Allows to set or overwrite the client side security plugin. |
static void |
main(java.lang.String[] args)
For testing invoke: java org.xmlBlaster.client.qos.ConnectQos |
void |
setAddress(Address address)
Set the address to which we want to connect, with all the configured parameters. |
void |
setDuplicateUpdates(boolean duplicateUpdates)
Deprecated. Please use multiSubscribe=false from SubscribeQos |
void |
setMaxSessions(int max)
If maxSession == 1, only a single login is possible |
void |
setPersistent(boolean persistent)
sets the persistent flag for this subscription. |
void |
setPtpAllowed(boolean ptpAllowed)
|
void |
setRefreshSession(boolean refreshSession)
|
void |
setSecretCbSessionId(java.lang.String id)
Set the secret cbSessionId. |
void |
setSecretSessionId(java.lang.String id)
Set the secret sessionId. |
void |
setSessionCbQueueProperty(CbQueueProperty prop)
Adds a queue description. |
void |
setSessionName(SessionName sessionName)
Set the login session name. |
void |
setSessionTimeout(long timeout)
Timeout until session expires if no communication happens |
void |
setSubjectQueueProperty(CbQueueProperty subjectQueueProperty)
Sets the queue properties for the subject queue of this subject |
void |
setUserId(java.lang.String loginName)
Allows to set or overwrite the login name for I_SecurityQos. |
int |
size()
The number of bytes of stringified qos |
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 |
usage()
Get a usage string for the connection parameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConnectQos(Global glob) throws XmlBlasterException
Initializes login credentials from environment e.g. -session.name guest and -passwd secret with the default security plugin as given by -Security.Client.DefaultPlugin htpasswd,1.0
To use another security authentication plugin use setSecurity()
XmlBlasterException
- on problems loading the client security pluginpublic ConnectQos(Global glob, java.lang.String userId, java.lang.String passwd) throws XmlBlasterException
userId
- e.g. "joe" or "joe/7" if you want to connect to joe's seventh sessionpasswd
- The password if you use a password based authentication
XmlBlasterException
- if the default security plugin couldn't be loadedpublic ConnectQos(Global glob, ConnectQosData connectQosData)
Method Detail |
---|
public ConnectQosData getData()
public SessionQos getSessionQos()
public void setSessionName(SessionName sessionName)
This will NOT set the security loginName (see setUserId()).
sessionName
- e.g. "joe" which is the loginName (subjectId) onlypublic SessionName getSessionName()
public void setSessionTimeout(long timeout)
timeout
- The login session will be destroyed after given milliseconds.public void setSecretSessionId(java.lang.String id)
public void setSecretCbSessionId(java.lang.String id)
update(cbSessionId, ...)
public void setMaxSessions(int max)
max
- How often the same client may loginpublic void clearSessions(boolean clear)
clear
- Defaults to falsepublic final boolean clearSessions()
public final boolean getRefreshSession()
public final void setRefreshSession(boolean refreshSession)
refreshSession
- true: The client automatically notifies xmlBlaster that it is alive
and the login session is extendedpublic void setUserId(java.lang.String loginName) throws XmlBlasterException
This will call setSessionName() as well if sessionName is not set yet.
This is a convenience method to set the securityQos userId
loginName
- The unique user id
XmlBlasterException
public java.lang.String getUserId()
public org.xmlBlaster.authentication.plugins.I_ClientPlugin loadClientPlugin(java.lang.String type, java.lang.String version, java.lang.String userId, java.lang.String credential) throws XmlBlasterException
type
- The client side security plugin to usecredential
- For 'htpasswd' the password, if null the environment -passwd is checked (default plugin)
XmlBlasterException
ConnectQosData.loadClientPlugin(String, String, String, String)
public org.xmlBlaster.authentication.plugins.I_ClientPlugin getClientPlugin()
public org.xmlBlaster.authentication.plugins.I_SecurityQos getSecurityQos()
getClientPlugin().getSecurityQos()
.
public void setPtpAllowed(boolean ptpAllowed)
Set
- if we accept point to point messagespublic boolean isPtpAllowed()
public void setDuplicateUpdates(boolean duplicateUpdates)
Set
- if we allow multiple updates for the same message if we have subscribed multiple times to it.public boolean duplicateUpdates()
public ClientQueueProperty getClientQueueProperty()
public void addClientQueueProperty(ClientQueueProperty clientQueueProperty)
Your
- hardcoded configurationpublic void setAddress(Address address)
address
- An object containing the protocol (e.g. EMAIL) the address (e.g. hugo@welfare.org) and the connection propertiespublic Address getAddress()
public AddressBase[] getAddresses(boolean forceCbAddressCreation)
public void addCallbackAddress(CallbackAddress callback)
callback
- An object containing the protocol (e.g. EMAIL) and the address (e.g. hugo@welfare.org)public void setSessionCbQueueProperty(CbQueueProperty prop)
prop
- The property object of the callback queue which shall be established in the server for calling us back.CallbackAddress
public CbQueueProperty getSessionCbQueueProperty()
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toXml()
public void addClientProperty(java.lang.String key, java.lang.Object value)
key
- value
- public ClientProperty getClientProperty(java.lang.String key)
public void setPersistent(boolean persistent)
persistent
- public boolean getPersistent()
public java.lang.String usage()
public void setSubjectQueueProperty(CbQueueProperty subjectQueueProperty)
subjectQueueProperty
- public CbQueueProperty getSubjectQueueProperty()
public boolean doSendConnect()
public void doSendConnect(boolean doSendConnect)
doSendConnect
- Overwrites default or value from environmentpublic static void main(java.lang.String[] args) throws XmlBlasterException
XmlBlasterException
|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |