Class AbstractWebServiceProvider

    • Field Detail

      • m_Owner

        protected adams.flow.core.Actor m_Owner
        the owning actor.
      • m_URL

        protected String m_URL
        the URL of the webservice.
      • m_Running

        protected boolean m_Running
        whether the webservice is running.
    • Constructor Detail

      • AbstractWebServiceProvider

        public AbstractWebServiceProvider()
    • Method Detail

      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • setFlowContext

        public void setFlowContext​(adams.flow.core.Actor value)
        Sets the actor that executes this webservice.
        Specified by:
        setFlowContext in interface adams.flow.core.FlowContextHandler
        Specified by:
        setFlowContext in interface WebServiceProvider
        Parameters:
        value - the owner
      • getFlowContext

        public adams.flow.core.Actor getFlowContext()
        Returns the owning actor.
        Specified by:
        getFlowContext in interface adams.flow.core.FlowContextHandler
        Specified by:
        getFlowContext in interface WebServiceProvider
        Returns:
        the owner
      • getDefaultURL

        public abstract String getDefaultURL()
        Returns the default URL for the service.
        Returns:
        the URL
      • setURL

        public void setURL​(String value)
        Sets the URL to use.
        Parameters:
        value - the URL to use
      • URLTipText

        public String URLTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getDefaultInInterceptor

        protected AbstractInInterceptorGenerator getDefaultInInterceptor()
        Returns the default interceptor for incoming messages.
        Returns:
        the interceptor
      • inInterceptorTipText

        public String inInterceptorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getDefaultOutInterceptor

        protected AbstractOutInterceptorGenerator getDefaultOutInterceptor()
        Returns the default interceptor for outgoing messages.
        Returns:
        the interceptor
      • outInterceptorTipText

        public String outInterceptorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • check

        protected void check()
        Performs some initial checks before starting the service.

        Default implementation does nothing.
      • log

        public void log​(String msg,
                        String id)
        Logs an error message if a valid global log actor has been set up.
        Parameters:
        msg - the message to log
        id - an optional ID of the data token that failed in the web service
      • configureInterceptors

        protected void configureInterceptors​(org.apache.cxf.jaxws.EndpointImpl endpoint)
        Configures the interceptors/logging for the endpoint (incoming and outgoing).
        Parameters:
        endpoint - the endpoint to configure
        See Also:
        m_InInterceptor, m_OutInterceptor
      • configureTLS

        protected void configureTLS​(org.apache.cxf.jaxws.EndpointImpl endpoint,
                                    String url)
                             throws Exception
        Configures TLS support (if using https:// and actors present in flow).
        Parameters:
        endpoint - the (unpublished) endpoint to configure
        url - the URL to publish under
        Throws:
        IllegalStateException - if https used but failed to configure TLS params
        Exception
      • doStart

        protected abstract void doStart()
                                 throws Exception
        Performs the actual start of the service.
        Throws:
        Exception - if start fails
      • start

        public String start()
        Starts the service.
        Specified by:
        start in interface WebServiceProvider
        Returns:
        null if successful, otherwise error message
      • isRunning

        public boolean isRunning()
        Returns whether the service is running.
        Specified by:
        isRunning in interface WebServiceProvider
        Returns:
        true if running
      • doStop

        protected abstract void doStop()
                                throws Exception
        Performs the actual stop of the service.
        Throws:
        Exception - if stopping fails
      • stop

        public String stop()
        Stops the service.
        Specified by:
        stop in interface WebServiceProvider
        Returns:
        null if successful, otherwise error message
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Specified by:
        cleanUp in interface adams.core.CleanUpHandler
        Specified by:
        cleanUp in interface WebServiceProvider