Modifier and Type | Field and Description |
---|---|
protected APIAccessor |
apiAccessor |
Constructor and Description |
---|
AbstractConnector() |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Called by the engine before the connector is executed
This method can be implemented by connectors to handle here opening of connections like database connection
|
void |
disconnect()
Called by the engine after the connector and its output operations are executed
This method can be implemented by connectors to close connections here.
|
Map<String,Object> |
execute()
Execute the connector.
|
protected abstract void |
executeBusinessLogic() |
APIAccessor |
getAPIAccessor() |
EngineExecutionContext |
getExecutionContext() |
protected Object |
getInputParameter(String paramName) |
protected Object |
getInputParameter(String parameterKey,
Serializable defaultValue)
get the input parameter or the default value if the parameter is not set
|
protected Map<String,Object> |
getOutputParameters() |
void |
setAPIAccessor(APIAccessor apiAccessor) |
void |
setExecutionContext(EngineExecutionContext executionContext) |
void |
setInputParameters(Map<String,Object> parameters)
Set the input parameter for a connector.
|
protected void |
setOutputParameter(String paramName,
Object value) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
validateInputParameters
protected APIAccessor apiAccessor
public void setInputParameters(Map<String,Object> parameters)
Connector
setInputParameters
in interface Connector
parameters
- parameters is a map with parameter names and their value.protected Object getInputParameter(String parameterKey, Serializable defaultValue)
parameterKey
- name of the parameterdefaultValue
- value of the parameter if not setpublic final Map<String,Object> execute() throws ConnectorException
Connector
execute
in interface Connector
ConnectorException
- when something went wrong during connector executionpublic void connect() throws ConnectorException
Connector
connect
in interface Connector
ConnectorException
- when something went wrong during connector connectionpublic void disconnect() throws ConnectorException
Connector
disconnect
in interface Connector
ConnectorException
- when something went wrong during connector disconnectionprotected abstract void executeBusinessLogic() throws ConnectorException
ConnectorException
public void setAPIAccessor(APIAccessor apiAccessor)
public APIAccessor getAPIAccessor()
public EngineExecutionContext getExecutionContext()
public void setExecutionContext(EngineExecutionContext executionContext)
Copyright © 2016 Bonitasoft S.A.. All rights reserved.