Package com.saperion.ws
Class SaWsAuthenticationService
- java.lang.Object
-
- com.saperion.ws.AbstractService
-
- com.saperion.ws.SaWsAuthenticationService
-
public class SaWsAuthenticationService extends AbstractService
This class wraps all methods of the SaClassicConnector. It parses the information, which is fetched from the server to classes usable for web services. JAX-B requires classes to be JavaBeans, because it uses the set/get-Methods. You need a token for calling the methods to perform searches and modifications. For getting a token the logon method has to be called. If the thread is timed out on the backend or if you aren't logged in you will get an exception.- Author:
- Daniel Manzke(dam)
-
-
Field Summary
-
Fields inherited from class com.saperion.ws.AbstractService
configured
-
-
Constructor Summary
Constructors Constructor Description SaWsAuthenticationService()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAlive(java.lang.String token)
Determines if the session identified by the given token is alive.java.lang.String
login(java.lang.String username, java.lang.String password, int type, java.lang.String mandant)
Login to the backend system.boolean
logoff(java.lang.String token)
Logoff from the backend system.java.lang.String
logon(java.lang.String username, java.lang.String password, SaWsLicenseType type, java.lang.String mandant)
Logon to the backend system.-
Methods inherited from class com.saperion.ws.AbstractService
addToRequest, getConnection, getSession, isConfigured
-
-
-
-
Method Detail
-
logoff
public boolean logoff(java.lang.String token) throws SaWsException
Logoff from the backend system. This command also destroys the command thread on the java broker server.- Parameters:
token
- to identify the session.- Returns:
- boolean. True, if logoff successful.
- Throws:
SaWsException
- if an error occurs.- See Also:
SaClassicConnector.logoff()
-
logon
public java.lang.String logon(java.lang.String username, java.lang.String password, SaWsLicenseType type, java.lang.String mandant) throws SaWsException
Logon to the backend system.- Parameters:
username
- Usernamepassword
- Passwordtype
- User typemandant
- client name- Returns:
- User token for future use.
- Throws:
SaWsException
- if an error occurs.- See Also:
SaClassicConnector.logon(java.lang.String, java.lang.String, int, java.lang.String)
-
login
public java.lang.String login(java.lang.String username, java.lang.String password, int type, java.lang.String mandant) throws SaWsException
Login to the backend system. Following client types are supported: 1=index, 2=query, 3=admin- Parameters:
username
- Usernamepassword
- Passwordtype
- User typemandant
- client name- Returns:
- User token for future use
- Throws:
SaWsException
- if an error occurs.- See Also:
SaClassicConnector.logon(java.lang.String, java.lang.String, int, java.lang.String)
-
isAlive
public boolean isAlive(java.lang.String token) throws SaWsAuthenticationException, SaWsRepositoryException
Determines if the session identified by the given token is alive.- Parameters:
token
- The token which identifies the session.- Returns:
- the boolean indication the isAlive state.
- Throws:
SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.
-
-