Package com.uc4.communication.requests
Class CreateSession
java.lang.Object
com.uc4.communication.requests.XMLRequest
com.uc4.communication.requests.CreateSession
Login to UC4.
This request creates a session on the UC4 server for user.
The method
Connection#setSession
must be called before this request
is sent.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
createRequest
(com.uc4.util.XMLDocument doc, Element req, ConnectionAttributes session) Creates the XML Document for the request.Returns the encoding of the XML messages.When trying to login via SAML this returns you the URL to the SAML IDPReturns the ID this session.protected String
getSrc()
Returns the request source.Returns the name of the UC4 system.getToken()
Returns a token which can be used instead of a passwort for future logons with the same UC4 user.Returns the ID of the connected user.Returns the name of the logged on user.Returns the name of the User object (user/department).Returns the first message after logon.protected void
handleContent
(com.uc4.util.XMLDocument doc, ConnectionAttributes session) Sub classes extract the values from the XML document and provide public getter methods.protected boolean
protected boolean
This method is used internally.boolean
Returns if user logged in through LDAPboolean
Tests if the log in was successful.boolean
Returnstrue
if the next action must be a change of the password.void
setClientType
(String type) void
Registers this connection to receive the specified kick messages.protected void
Methods inherited from class com.uc4.communication.requests.XMLRequest
assertClientZero, assertServerVersion, checkClient, checkID, checkLnr, checkNull, checkSelStatisticsPrivilege, checkSystemOverviewPrivilege, checkUC4ObjectEmptyName, checkUC4ObjectName, createNATFor, createNATRequest, emptyAttributes, getAllMessageBoxes, getMessageBox, getRequestID, handleResponse, send, setMessageBox, showQuarantineNotification
-
Constructor Details
-
CreateSession
Internal use.- Parameters:
box
- Message Box
-
CreateSession
public CreateSession()Internal use.
-
-
Method Details
-
setClientType
-
setOS
-
getSrc
Description copied from class:XMLRequest
Returns the request source. This method is used internally.- Specified by:
getSrc
in classXMLRequest
- Returns:
- Source
-
createRequest
protected void createRequest(com.uc4.util.XMLDocument doc, Element req, ConnectionAttributes session) Description copied from class:XMLRequest
Creates the XML Document for the request. This method is used internally.- Specified by:
createRequest
in classXMLRequest
- Parameters:
doc
- Document, used to create new Elementsreq
- Request Element - classes append information to this request elementsession
- Information about the session
-
handleContent
Description copied from class:XMLRequest
Sub classes extract the values from the XML document and provide public getter methods.- Overrides:
handleContent
in classXMLRequest
- Parameters:
doc
- XML Documentsession
- Info about the user session
-
getWelcomeMessage
Returns the first message after logon.- Returns:
- translated message text
-
getUserName
Returns the name of the logged on user.- Returns:
- User name
-
getUserObject
Returns the name of the User object (user/department).- Returns:
- User object
-
getEncoding
Returns the encoding of the XML messages.- Returns:
- String containing the encoding.
-
getSessionID
Returns the ID this session. This ID is unqiue for a connection to the UC4 server.- Returns:
- String containing the ID of the session.
-
getSystemName
Returns the name of the UC4 system.- Returns:
- String containing the name of the UC4 system.
-
getUserIdnr
Returns the ID of the connected user.- Returns:
- String containing the user ID.
-
getToken
Returns a token which can be used instead of a passwort for future logons with the same UC4 user. The token remains valid until the original API connection is closed. An invalid token means that no further connections can be created using the token, the existing connections are not affected.- Returns:
- Logon token
-
isLoginSuccessful
public boolean isLoginSuccessful()Tests if the log in was successful.- Returns:
- true if the user is logged in.
-
isPasswordChangeRequired
public boolean isPasswordChangeRequired()Returnstrue
if the next action must be a change of the password.- Returns:
- true if the password has expired
-
isAllowedInClientZero
protected boolean isAllowedInClientZero()Description copied from class:XMLRequest
This method is used internally. Tests if thisXMLRequest
is allowed in client 0. The default implementation returnsfalse
, subclasses may override.- Overrides:
isAllowedInClientZero
in classXMLRequest
- Returns:
true
if this request is allowed in client 0,false
otherwise
-
ignoreMessageBox
protected boolean ignoreMessageBox()- Overrides:
ignoreMessageBox
in classXMLRequest
-
setKicks
Registers this connection to receive the specified kick messages. Kick messages are sent from the AE to the connected client when certain events occur in the AE. This procedure has to be called before the connection to the AE is established.- Parameters:
kicks
- Comma separated list of kick messages.
-
getRedirectUrl
When trying to login via SAML this returns you the URL to the SAML IDP- Returns:
- String SAML IDP URL
-
isLdapLogin
public boolean isLdapLogin()Returns if user logged in through LDAP- Returns:
- true, if LDAP
-
getClient
-