public abstract class BaseConnector extends Object implements Connector
Connector
. A Connector implementation should not do any significant
work in its constructor but should instead defer such work to the initialize(com.boomi.connector.api.AtomContext)
method. As noted in the sdk
documentation, the Connector must be thread-safe, and should not be managing account specific information.Modifier | Constructor and Description |
---|---|
protected |
BaseConnector() |
Modifier and Type | Method and Description |
---|---|
Browser |
createBrowser(BrowseContext context)
Default implementation throws UnsupportedOperationException.
|
protected Operation |
createCreateOperation(OperationContext context)
Creates a new CREATE operation.
|
protected Operation |
createDeleteOperation(OperationContext context)
Creates a new DELETE operation.
|
protected Operation |
createExecuteOperation(OperationContext context)
Creates a new EXECUTE operation.
|
protected Operation |
createGetOperation(OperationContext context)
Creates a new GET operation.
|
Operation |
createOperation(OperationContext context)
Returns the actual Operation.
|
protected Operation |
createQueryOperation(OperationContext context)
Creates a new QUERY operation.
|
protected Operation |
createUpdateOperation(OperationContext context)
Creates a new UPDATE operation.
|
protected Operation |
createUpsertOperation(OperationContext context)
Creates a new UPSERT operation.
|
AtomContext |
getContext()
Returns the atom context as passed to the
initialize(com.boomi.connector.api.AtomContext) method. |
void |
initialize(AtomContext context)
Does any startup initialization for this connector.
|
void |
setContext(AtomContext newContext)
Sets the atom context, currently only done by the
initialize(com.boomi.connector.api.AtomContext) method. |
public AtomContext getContext()
initialize(com.boomi.connector.api.AtomContext)
method.public void setContext(AtomContext newContext)
initialize(com.boomi.connector.api.AtomContext)
method.public void initialize(AtomContext context)
This call may do expensive things like open connections or other resources which will be used throughout the
Connector's lifecycle. Connectors are never explicitly closed, so explicit resource cleanup (if necessary) should
be managed through garbage-collector hooks (e.g. reference objects or finalize). Note that any resources cached
at the Connector level should not be account specific. The preferred resource cache is the one returned by
a call to ConnectorContext.getConnectorCache()
as it is Boomi account specific and therefore may be used to
cache account specific information.
Base implementation stores given context.
initialize
in interface Connector
context
- the static atom contextpublic Browser createBrowser(BrowseContext context)
createBrowser
in interface Connector
context
- the context for this browse operation. this context is considered to be owned by the Browser after
this call and may be held by the Browser for use in subsequent method calls.public Operation createOperation(OperationContext context)
ConnectorContext.getConnectionProperties()
and operation all fields will be provided in
BrowseContext.getOperationProperties()
(where the keys will be the relevant field's "id" and the values
will be of the appropriate Java type for the relevant field's "type").
This call should be relatively cheap as Operations are only ever created for a single invocation. Any resource
caching should be handled at the Connector level or via the ConnectorContext.getConnectorCache()
.
Base implementation delegates creation call to one of the create*Operation()
methods.
createOperation
in interface Connector
context
- the context for this connector operation. this context is considered to be owned by the Operation
after this call and may be held by the Operation for use in subsequent method calls.protected Operation createGetOperation(OperationContext context)
Default implementation throws UnsupportedOperationException.
context
- the new operation's contextprotected Operation createQueryOperation(OperationContext context)
Default implementation throws UnsupportedOperationException.
context
- the new operation's contextprotected Operation createCreateOperation(OperationContext context)
Default implementation throws UnsupportedOperationException.
context
- the new operation's contextprotected Operation createUpdateOperation(OperationContext context)
Default implementation throws UnsupportedOperationException.
context
- the new operation's contextprotected Operation createUpsertOperation(OperationContext context)
Default implementation throws UnsupportedOperationException.
context
- the new operation's contextprotected Operation createDeleteOperation(OperationContext context)
Default implementation throws UnsupportedOperationException.
context
- the new operation's contextprotected Operation createExecuteOperation(OperationContext context)
Default implementation throws UnsupportedOperationException.
context
- the new operation's context