public interface CustomWrapper
AbstractCustomWrapper
). For convenience, the user is
encouraged to extend AbstractCustomWrapper
instead of implementing
CustomWrapper
directly.Modifier and Type | Method and Description |
---|---|
void |
commit()
Defines how this Custom Wrappers performs a
commit operation in its
data source in the context of a distributed transaction. |
int |
delete(CustomWrapperConditionHolder condition,
Map<String,String> inputValues)
Defines how this Custom Wrapper deletes data from the data source.
|
CustomWrapperConfiguration |
getConfiguration()
Defines this Custom Wrapper's configuration based on several configurable properties
provided by the
CustomWrapperConfiguration class. |
CustomWrapperInputParameter[] |
getInputParameters()
Defines what input parameters supports this Custom Wrapper.
|
CustomWrapperSchemaParameter[] |
getSchemaParameters(Map<String,String> inputValues)
Defines the schema of this Custom Wrapper.
|
int |
insert(Map<CustomWrapperFieldExpression,Object> insertValues,
Map<String,String> inputValues)
Defines how this Custom Wrapper inserts values into the data source.
|
void |
prepare()
Defines how this Custom Wrapper performs a
prepare operation in its
data source in the context of a distributed transaction. |
void |
rollback()
Defines how this Custom Wrapper performs a
rollback operation in its
data source in the context of a distributed transaction. |
void |
run(CustomWrapperConditionHolder condition,
List<CustomWrapperFieldExpression> projectedFields,
CustomWrapperResult result,
Map<String,String> inputValues)
Defines how this Custom Wrapper acts when being queried.
|
boolean |
stop()
Stops the execution of this Custom Wrapper.
|
int |
update(Map<CustomWrapperFieldExpression,Object> updateValues,
CustomWrapperConditionHolder condition,
Map<String,String> inputValues)
Defines how this Custom Wrapper updates data in the data source.
|
CustomWrapperInputParameter[] getInputParameters()
CustomWrapperInputParameter
CustomWrapperInputParameter
CustomWrapperSchemaParameter[] getSchemaParameters(Map<String,String> inputValues) throws CustomWrapperException
inputValues
- a Map<String, String> which associates this Custom Wrapper's
input parameters' names (as defined in getInputParameters()
) with their
current values.CustomWrapperSchemaParameter
that defines the schema of this Custom
Wrapper.CustomWrapperException
CustomWrapperSchemaParameter
void run(CustomWrapperConditionHolder condition, List<CustomWrapperFieldExpression> projectedFields, CustomWrapperResult result, Map<String,String> inputValues) throws CustomWrapperException
condition
and inputValues
, constructing
a query taking into account the passed projectedFields
, retrieving data
from this Custom Wrapper data source and finally inserting such data in the passed
result
object.condition
- the query's condition (akin to the WHERE
clause in
a SQL
query).projectedFields
- the query's projected fields (akin to the SELECT
clause in a SQL
query).result
- an object which receives the data retrieved by this Custom Wrapper.inputValues
- a Map<String, String> which associates this Custom Wrapper's
input parameters' names (as defined in getInputParameters()
) with their
current values.CustomWrapperException
CustomWrapperConditionHolder
,
CustomWrapperFieldExpression
,
CustomWrapperResult
boolean stop()
true
if this Custom Wrapper can stop its execution,
false
otherwise.int insert(Map<CustomWrapperFieldExpression,Object> insertValues, Map<String,String> inputValues) throws CustomWrapperException
insertValues
and then accessing the data source
to perform the required insertion.insertValues
- a Map<CustomWrapperFieldExpression, Object> which associates
fields with values, in similar fashion to the INSERT
statement in SQL
.inputValues
- a Map<String, String> which associates this Custom Wrapper's
input parameters' names (as defined in getInputParameters()
) with their
current values.CustomWrapperException
CustomWrapperFieldExpression
int delete(CustomWrapperConditionHolder condition, Map<String,String> inputValues) throws CustomWrapperException
condition
and then accessing the data source
to perform the required deletions.condition
- the deletion condition (akin to the WHERE
clause in
a SQL
DELETE
statement).inputValues
- a Map<String, String> which associates this Custom Wrapper's
input parameters' names (as defined in getInputParameters()
) with their
current values.CustomWrapperException
CustomWrapperConditionHolder
int update(Map<CustomWrapperFieldExpression,Object> updateValues, CustomWrapperConditionHolder condition, Map<String,String> inputValues) throws CustomWrapperException
updateValues
and condition
, and then accessing the data source to perform the
required updates.updateValues
- a Map<CustomWrapperFieldExpression, Object> which associates fields with values, in similar
fashion to the UPDATE
statement in SQL
. The value can be a literal expressed
as a Java object or a field expressed as a CustomWrapperFieldExpression
condition
- the insert condition (akin to the WHERE
clause in a SQL
UPDATE
statement).inputValues
- a Map<String, String> which associates this Custom Wrapper's input parameters' names (as defined
in getInputParameters()
) with their current values.CustomWrapperException
CustomWrapperFieldExpression
,
CustomWrapperConditionHolder
void commit()
commit
operation in its
data source in the context of a distributed transaction.void rollback()
rollback
operation in its
data source in the context of a distributed transaction.void prepare()
prepare
operation in its
data source in the context of a distributed transaction.CustomWrapperConfiguration getConfiguration()
CustomWrapperConfiguration
class.CustomWrapperConfiguration
instance defining this Custom Wrapper
configuration parameters.Copyright © 2019 Denodo Technologies. All rights reserved.