Class AbstractService

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static boolean configured
      Indicates the correct configuration of the service.
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addToRequest​(CloseablePooledSession closeablePooledSession)
      Adds the given session to the request.
      protected com.saperion.connector.SaClassicConnector getConnection​(java.lang.String token)
      Retrieves the connection by the given token.
      protected CloseablePooledSession getSession​(java.lang.String token)
      Gets the session by the given token.
      protected boolean isConfigured()
      Indicates the correct configuration of this web service.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • configured

        protected static boolean configured
        Indicates the correct configuration of the service. Flag is set in static block.
    • Constructor Detail

      • AbstractService

        public AbstractService()
    • Method Detail

      • getConnection

        protected com.saperion.connector.SaClassicConnector getConnection​(java.lang.String token)
                                                                   throws SaWsException
        Retrieves the connection by the given token.
        Parameters:
        token - The token to identify the corresponding connection.
        Returns:
        the corresponding connection SaClassicConnector object.
        Throws:
        SaWsException - if an authentication error occurs.
      • addToRequest

        protected void addToRequest​(CloseablePooledSession closeablePooledSession)
        Adds the given session to the request.
        Parameters:
        closeablePooledSession - the closable session
      • getSession

        protected CloseablePooledSession getSession​(java.lang.String token)
                                             throws java.lang.Exception
        Gets the session by the given token.
        Parameters:
        token - the token to get the session for.
        Returns:
        the session by the given token.
        Throws:
        java.lang.Exception - if an error occurs.
      • isConfigured

        protected boolean isConfigured()
        Indicates the correct configuration of this web service.
        Returns:
        configured True if the service is configured properly, false otherwise.