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)
  • Constructor Details

    • SaWsAuthenticationService

      public SaWsAuthenticationService()
      Constructor.
  • Method Details

    • logoff

      public boolean logoff(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 String logon(String username, String password, SaWsLicenseType type, String mandant) throws SaWsException
      Logon to the backend system.
      Parameters:
      username - Username
      password - Password
      type - User type
      mandant - 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 String login(String username, String password, int type, String mandant) throws SaWsException
      Login to the backend system. Following client types are supported: 1=index, 2=query, 3=admin
      Parameters:
      username - Username
      password - Password
      type - User type
      mandant - 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(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.