Package adams.flow.rest
Class GenericServer
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.rest.AbstractRESTProvider
-
- adams.flow.rest.GenericServer
-
- All Implemented Interfaces:
adams.core.AdditionalInformationHandler,adams.core.CleanUpHandler,adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.SizeOfHandler,adams.flow.core.FlowContextHandler,RESTProvider,Serializable
- Direct Known Subclasses:
RatsServer
public class GenericServer extends AbstractRESTProvider implements adams.core.AdditionalInformationHandler
Generic REST service provider, which allows you to assemble the REST plugins that should make up the service.
Automatically sets the flow context of plugins, if they should implement the adams.flow.core.FlowContextHandler interface.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-url <java.lang.String> (property: URL) The URL of the service. default: http://localhost:8080/
-in-interceptor <adams.flow.rest.interceptor.incoming.AbstractInInterceptorGenerator> (property: inInterceptor) The interceptor to use for incoming messages. default: adams.flow.rest.interceptor.incoming.NullGenerator
-out-interceptor <adams.flow.rest.interceptor.outgoing.AbstractOutInterceptorGenerator> (property: outInterceptor) The interceptor to use for outgoing messages. default: adams.flow.rest.interceptor.outgoing.NullGenerator
-plugin <adams.flow.rest.RESTPlugin> [-plugin ...] (property: plugins) The plugins that make up the REST service. default:
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected RESTPlugin[]m_Pluginsthe plugins that make up the server.-
Fields inherited from class adams.flow.rest.AbstractRESTProvider
m_InInterceptor, m_OutInterceptor, m_Owner, m_Running, m_Server, m_URL
-
-
Constructor Summary
Constructors Constructor Description GenericServer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigurePlugins(RESTPlugin[] plugins)For configuring the plugins, e.g., setting the flow context.voiddefineOptions()Adds options to the internal list of options.protected org.apache.cxf.endpoint.ServerdoStart()Performs the actual start of the service.StringgetAdditionalInformation()Returns the additional information.protected RESTPlugin[]getDefaultPlugins()Returns the default plugins to use.StringgetDefaultURL()Returns the default URL for the service.RESTPlugin[]getPlugins()Returns the REST plugins in use.StringglobalInfo()Returns a string describing the object.StringpluginsTipText()Returns the tip text for this property.voidsetPlugins(RESTPlugin[] value)Sets the REST plugins to use.-
Methods inherited from class adams.flow.rest.AbstractRESTProvider
check, cleanUp, configureInterceptors, configureTLS, doStop, getDefaultInInterceptor, getDefaultOutInterceptor, getFlowContext, getInInterceptor, getOutInterceptor, getURL, inInterceptorTipText, isRunning, log, outInterceptorTipText, setFlowContext, setInInterceptor, setOutInterceptor, setURL, start, stop, URLTipText
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Plugins
protected RESTPlugin[] m_Plugins
the plugins that make up the server.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
getAdditionalInformation
public String getAdditionalInformation()
Returns the additional information.- Specified by:
getAdditionalInformationin interfaceadams.core.AdditionalInformationHandler- Returns:
- the additional information, null or 0-length string for no information
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classAbstractRESTProvider
-
getDefaultPlugins
protected RESTPlugin[] getDefaultPlugins()
Returns the default plugins to use.- Returns:
- the default
-
setPlugins
public void setPlugins(RESTPlugin[] value)
Sets the REST plugins to use.- Parameters:
value- the plugins
-
getPlugins
public RESTPlugin[] getPlugins()
Returns the REST plugins in use.- Returns:
- the plugins
-
pluginsTipText
public String pluginsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultURL
public String getDefaultURL()
Returns the default URL for the service.- Specified by:
getDefaultURLin classAbstractRESTProvider- Returns:
- the URL
-
configurePlugins
protected void configurePlugins(RESTPlugin[] plugins)
For configuring the plugins, e.g., setting the flow context.- Parameters:
plugins- the plugins to configure
-
doStart
protected org.apache.cxf.endpoint.Server doStart() throws ExceptionPerforms the actual start of the service.- Specified by:
doStartin classAbstractRESTProvider- Returns:
- the server instance
- Throws:
Exception- if start fails
-
-