Package adams.flow.core
Class AbstractRESTClient
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.core.AbstractActor
-
- adams.flow.core.AbstractRESTClient
-
- 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.QuickInfoSupporter
,adams.core.ShallowCopySupporter<adams.flow.core.Actor>
,adams.core.SizeOfHandler
,adams.core.Stoppable
,adams.core.StoppableWithFeedback
,adams.core.VariablesInspectionHandler
,adams.event.VariableChangeListener
,adams.flow.core.Actor
,adams.flow.core.ErrorHandler
,Serializable
,Comparable
- Direct Known Subclasses:
RESTSink
,RESTSource
,RESTTransformer
public abstract class AbstractRESTClient extends adams.flow.core.AbstractActor
Ancestor for REST webservice client actors.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected RESTClient
m_Client
the webservice client to use.-
Fields inherited from class adams.flow.core.AbstractActor
m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_ExecutionListeningSupporter, m_FullName, m_LoggingPrefix, m_Name, m_Parent, m_ScopeHandler, m_Self, m_Silent, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
-
-
Constructor Summary
Constructors Constructor Description AbstractRESTClient()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract String
checkClient(RESTClient value)
Checks the client.void
cleanUp()
Cleans up the actor.String
clientTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected String
doQuery()
Queries the webservice.RESTClient
getClient()
Returns the webservice client in use.protected abstract RESTClient
getDefaultClient()
Returns the default client to use.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.protected String
postQuery()
Hook method after the webservice got queried.protected String
preQuery()
Hook method before the webservice gets queried.protected String
query()
Queries the webservice.void
setClient(RESTClient value)
Sets the webservice client to use.String
setUp()
Initializes the item for flow execution.-
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, backupState, canInspectOptions, canPerformSetUpCheck, compareTo, configureLogger, destroy, doExecute, equals, execute, finalUpdateVariables, findVariables, findVariables, forceVariables, forCommandLine, forName, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, initialize, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, performVariableChecks, postExecute, preExecute, pruneBackup, pruneBackup, reset, restoreState, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, silentTipText, sizeOf, skipTipText, stopExecution, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged, wrapUp
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
m_Client
protected RESTClient m_Client
the webservice client to use.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.flow.core.AbstractActor
-
getDefaultClient
protected abstract RESTClient getDefaultClient()
Returns the default client to use.- Returns:
- the client
-
checkClient
protected abstract String checkClient(RESTClient value)
Checks the client.- Parameters:
value
- the client to check- Returns:
- null if accepted, otherwise error message
-
setClient
public void setClient(RESTClient value)
Sets the webservice client to use.- Parameters:
value
- the webservice client to use
-
getClient
public RESTClient getClient()
Returns the webservice client in use.- Returns:
- the webservice client in use
-
clientTipText
public String clientTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceadams.flow.core.Actor
- Specified by:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Overrides:
getQuickInfo
in classadams.flow.core.AbstractActor
- Returns:
- null if no info available, otherwise short string
-
setUp
public String setUp()
Initializes the item for flow execution.- Specified by:
setUp
in interfaceadams.flow.core.Actor
- Overrides:
setUp
in classadams.flow.core.AbstractActor
- Returns:
- null if everything is fine, otherwise error message
-
preQuery
protected String preQuery()
Hook method before the webservice gets queried.
Default implementation does nothing.- Returns:
- null if successful, otherwise error message
-
doQuery
protected String doQuery()
Queries the webservice.- Returns:
- null if successful, otherwise error message
-
postQuery
protected String postQuery()
Hook method after the webservice got queried.
Default implementation does nothing.- Returns:
- null if successful, otherwise error message
-
query
protected String query()
Queries the webservice.- Returns:
- null if successful, otherwise error message
- See Also:
preQuery()
,doQuery()
,postQuery()
-
cleanUp
public void cleanUp()
Cleans up the actor.- Specified by:
cleanUp
in interfaceadams.flow.core.Actor
- Specified by:
cleanUp
in interfaceadams.core.CleanUpHandler
- Overrides:
cleanUp
in classadams.flow.core.AbstractActor
-
-