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#setSessionmust 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 voidcreateRequest(com.uc4.util.XMLDocument doc, org.w3c.dom.Element req, ConnectionAttributes session)Creates the XML Document for the request.java.lang.StringgetClient()java.lang.StringgetEncoding()Returns the encoding of the XML messages.java.lang.StringgetRedirectUrl()When trying to login via SAML this returns you the URL to the SAML IDPjava.lang.StringgetSessionID()Returns the ID this session.protected java.lang.StringgetSrc()Returns the request source.java.lang.StringgetSystemName()Returns the name of the UC4 system.java.lang.StringgetToken()Returns a token which can be used instead of a passwort for future logons with the same UC4 user.java.lang.StringgetUserIdnr()Returns the ID of the connected user.java.lang.StringgetUserName()Returns the name of the logged on user.UC4UserNamegetUserObject()Returns the name of the User object (user/department).java.lang.StringgetWelcomeMessage()Returns the first message after logon.protected voidhandleContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session)Sub classes extract the values from the XML document and provide public getter methods.protected booleanignoreMessageBox()protected booleanisAllowedInClientZero()This method is used internally.booleanisLdapLogin()Returns if user logged in through LDAPbooleanisLoginSuccessful()Tests if the log in was successful.booleanisPasswordChangeRequired()Returnstrueif the next action must be a change of the password.voidsetClientType(java.lang.String type)voidsetKicks(java.lang.String kicks)Registers this connection to receive the specified kick messages.protected voidsetOS(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:XMLRequestReturns the request source. This method is used internally.- Specified by:
getSrcin classXMLRequest- Returns:
- Source
-
createRequest
protected void createRequest(com.uc4.util.XMLDocument doc, org.w3c.dom.Element req, ConnectionAttributes session)Description copied from class:XMLRequestCreates the XML Document for the request. This method is used internally.- Specified by:
createRequestin 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:XMLRequestSub classes extract the values from the XML document and provide public getter methods.- Overrides:
handleContentin 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()
Returnstrueif 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:XMLRequestThis method is used internally. Tests if thisXMLRequestis allowed in client 0. The default implementation returnsfalse, subclasses may override.- Overrides:
isAllowedInClientZeroin classXMLRequest- Returns:
trueif this request is allowed in client 0,falseotherwise
-
ignoreMessageBox
protected boolean ignoreMessageBox()
- Overrides:
ignoreMessageBoxin 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()
-
-