Package com.uc4.communication.requests
Class CreateSession
- java.lang.Object
-
- com.uc4.communication.requests.XMLRequest
-
- com.uc4.communication.requests.CreateSession
-
public class CreateSession extends XMLRequest
Login to UC4. This request creates a session on the UC4 server for user. The methodConnection#setSession
must be called before this request is sent.
-
-
Constructor Summary
Constructors Constructor Description CreateSession()
Internal use.CreateSession(MessageBox box)
Internal use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
createRequest(com.uc4.util.XMLDocument doc, org.w3c.dom.Element req, ConnectionAttributes session)
Creates the XML Document for the request.java.lang.String
getClient()
java.lang.String
getEncoding()
Returns the encoding of the XML messages.java.lang.String
getRedirectUrl()
When trying to login via SAML this returns you the URL to the SAML IDPjava.lang.String
getSessionID()
Returns the ID this session.protected java.lang.String
getSrc()
Returns the request source.java.lang.String
getSystemName()
Returns the name of the UC4 system.java.lang.String
getToken()
Returns a token which can be used instead of a passwort for future logons with the same UC4 user.java.lang.String
getUserIdnr()
Returns the ID of the connected user.java.lang.String
getUserName()
Returns the name of the logged on user.UC4UserName
getUserObject()
Returns the name of the User object (user/department).java.lang.String
getWelcomeMessage()
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
ignoreMessageBox()
protected boolean
isAllowedInClientZero()
This method is used internally.boolean
isLdapLogin()
Returns if user logged in through LDAPboolean
isLoginSuccessful()
Tests if the log in was successful.boolean
isPasswordChangeRequired()
Returnstrue
if the next action must be a change of the password.void
setClientType(java.lang.String type)
void
setKicks(java.lang.String kicks)
Registers this connection to receive the specified kick messages.protected void
setOS(java.lang.String os)
-
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 Detail
-
CreateSession
public CreateSession(MessageBox box)
Internal use.- Parameters:
box
- Message Box
-
CreateSession
public CreateSession()
Internal use.
-
-
Method Detail
-
setClientType
public void setClientType(java.lang.String type)
-
setOS
protected void setOS(java.lang.String os)
-
getSrc
protected java.lang.String 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, org.w3c.dom.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
protected void handleContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session)
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
public java.lang.String getWelcomeMessage()
Returns the first message after logon.- Returns:
- translated message text
-
getUserName
public java.lang.String getUserName()
Returns the name of the logged on user.- Returns:
- User name
-
getUserObject
public UC4UserName getUserObject()
Returns the name of the User object (user/department).- Returns:
- User object
-
getEncoding
public java.lang.String getEncoding()
Returns the encoding of the XML messages.- Returns:
- String containing the encoding.
-
getSessionID
public java.lang.String 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
public java.lang.String getSystemName()
Returns the name of the UC4 system.- Returns:
- String containing the name of the UC4 system.
-
getUserIdnr
public java.lang.String getUserIdnr()
Returns the ID of the connected user.- Returns:
- String containing the user ID.
-
getToken
public java.lang.String 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
public void setKicks(java.lang.String kicks)
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
public java.lang.String 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
public java.lang.String getClient()
-
-