Package de.ubs.xdm.utils.modification
Class ModificationContext
java.lang.Object
de.ubs.xdm.utils.modification.ScriptContext
de.ubs.xdm.utils.modification.ModificationContext
- Author:
- Sven Schneider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class de.ubs.xdm.utils.modification.ScriptContext
xegersMap -
Constructor Summary
ConstructorsConstructorDescriptionModificationContext(de.ubs.xdm.utils.modification.ModificationInternalContext privateContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReportRow(String name, String... values) Adds a row to the named report.voidbuildPoolTable(String methodName, String category, String url, String user, String password, String tableSchema, String tableName, String refreshInterval, String... columnNames) Deprecated.The pool tables are not compatible with a multi container XDM installation.voidbuildShufflingPoolTable(String methodName, String category, String url, String user, String password, String tableSchema, String tableName, String refreshInterval, String... columnNames) Deprecated.The pool tables are not compatible with a multi container XDM installation.voidcreatePoolTableIfNotExists(String poolTableName, Object[] data) Deprecated.The pool tables are not compatible with a multi container XDM installation.voidcreatePoolTableIfNotExists(String poolTableName, String mappedColumnNames) Creates pool table with given name of format category/name if not already existing.voiddefineReport(String name, boolean ignoreDuplicate, String... columns) Defines a report to be written when modification is complete.voiddefineReport(String name, String... columns) Defines a report to be written when modification is complete.doesSourceTableContainsColumn(String columnName) fetchSingleValueFromConnection(String scope, String sql, Object... parameter) Executes a statement against the source or target connection and returns a single value.fetchSingleValueFromConnection(Connection connection, String sql, Object... parameter) Executes a statement against the source or target connection and returns a single value.Retrieves a value from the store that works in the scope of one rule specified for a table.getColumnTypeClassification(String columnName) This return an internal representation of the column.This return an internal representation of the source table.This return an internal representation of the table.longGet the number of invocations for a row of this contextprotected StringlongThe run time in milliseconds for this modification method in the given contextgetParameterConnectionPool(String scope) getPersistent(String mapName, Object key) Deprecated.method is substituted bysessionPersistentGet(String mapName, Object key)getPoolTable(String poolTableName) Deprecated.The pool tables are not compatible with a multi container XDM installation.getPoolTableColumnTypes(String poolTableName) Deprecated.The pool tables are not compatible with a multi container XDM installation.intgetPoolTableSize(String poolTableName) Deprecated.The pool tables are not compatible with a multi container XDM installation.static de.ubs.xdm.utils.modification.ModificationReportStreamde.ubs.xdm.batch.client.model.ModificationRulegetRule()Returns the rule, which was used to apply the modification method against this table.final intReturns the index of the column in the current table as it can be used as index against dataprotected voidloadLibrary(InputStream jsLibReader, String fileName) The use of theContext.evaluateReader()method has the effect of loading all the code supplied byjsLibReaderinto the current method scope.Object[]mappingTable(Object[] row, String mappedColumns) Deprecated.The pool tables are not compatible with a multi container XDM installation.Object[]mappingTable(Object[] row, String mappedColumns, String columnsToPreserve) Deprecated.The pool tables are not compatible with a multi container XDM installation.Object[]mappingTable(String name, Object[] row, String mappedColumns) Deprecated.The pool tables are not compatible with a multi container XDM installation.Object[]mappingTable(String name, Object[] row, String mappedColumns, String columnsToPreserve) Deprecated.The pool tables are not compatible with a multi container XDM installation.de.ubs.xdm.utils.core.HighPrecisionTimestampparseTimestamp(String patternToSecond, String patternAfterSecond, String data) Parses a string and returns a HighPrecisionTimestamp, the internal Format for all date/time related data types.Object[]poolMappingGet(Object[] data, String poolTableName) Deprecated.The pool tables are not compatible with a multi container XDM installation.Object[]poolMappingGet(Object[] data, String poolTableName, String mappedColumns, boolean takeRandom) Deprecated.The pool tables are not compatible with a multi container XDM installation.poolMappingGet(Object data, String poolTableName) Deprecated.The pool tables are not compatible with a multi container XDM installation.poolMappingGet(Object data, String poolTableName, String mappedColumns, boolean takeRandom) Utility function to access a pool table.voidpoolMappingPut(Object[] srcData, Object[] tgtData, String poolTableName) Deprecated.The pool tables are not compatible with a multi container XDM installation.voidpoolMappingPut(Object[] srcData, Object[] tgtData, String poolTableName, String mappedColumns) Deprecated.The pool tables are not compatible with a multi container XDM installation.voidpoolMappingPut(Object srcData, Object tgtData, String poolTableName) Deprecated.The pool tables are not compatible with a multi container XDM installation.voidpoolMappingPut(Object srcData, Object tgtData, String poolTableName, String mappedColumns) Deprecated.The pool tables are not compatible with a multi container XDM installation.voidStores a value in scope of the current column.voidputPersistent(String mapName, Object key, Object value) Deprecated.method is substituted bysessionPersistentPut(String mapName, Object key, Object value)sessionPersistentGet(String mapName, Object key) Retrieves a persistent value from the global map.voidsessionPersistentPut(String mapName, Object key, Object value) Stores a persistent value for an entire run of the modification.voidSets the value in the current row.specialGetMappingTable(String poolTableName, String types) Deprecated.method is substituted bygetPoolTable(String poolTableName)intspecialGetMappingTableSize(String poolTableName, String types) Deprecated.method is substituted bygetPoolTableSize(String poolTableName)Object[]specialMapping(Object[] data, String poolTableName, String types, boolean takeRandom) Deprecated.method is substituted bypoolMapping(Object[] data, String poolTableName, String mappedColumns, boolean takeRandom)specialMapping(Object data, String mappingName, String types, boolean takeRandom) Deprecated.method is substituted bypoolMappingGet(Object data, String poolTableName, String mappedColumns, boolean takeRandom)voidspecialMappingPut(Object[] srcData, Object[] tgtData, String poolTableName, String types) Deprecated.method is substituted bypoolMappingPut(Object[] srcData, Object[] tgtData, String poolTableName, String mappedColumns)voidspecialMappingPut(Object srcData, Object tgtData, String poolTableName, String types) Deprecated.method is substituted bypoolMappingPut(Object srcData, Object tgtData, String poolTableName, String mappedColumns)voidStashes a row to be fetched later with get unstashRows() method.Returns all rows that have been stashed with the stashRow(Object[]) data method.Methods inherited from class de.ubs.xdm.utils.modification.ScriptContext
buildObjectArray, callRestEndpoint, callRestEndpoint, callRestEndpoint, callRestEndpoint, callRestEndpoint, callRestEndpoint, createXeger, generateValueByRegexPattern, getLibraryFileName, getTaskRuntimeProperty, getTaskRuntimeProperty, getXmlAsString, getXmlXPath, getXmlXPathValue, getXmlXPathValue, phoneNumber, phoneticEncryption, print, print, removeXmlPathTag, require, setXmlXPathValue, shiftDate, shiftDateSt, splitTrim, wrapStringIntoClob
-
Field Details
-
PARM_DATA
- See Also:
-
PARM_DATA_ARRAY
- See Also:
-
PARM_CONTEXT
- See Also:
-
PARM_COLUMN_INDEX
- See Also:
-
PARM_COLUMN_NAME
- See Also:
-
PARM_RETURN
- See Also:
-
-
Constructor Details
-
ModificationContext
public ModificationContext(de.ubs.xdm.utils.modification.ModificationInternalContext privateContext)
-
-
Method Details
-
getReportStream
public static de.ubs.xdm.utils.modification.ModificationReportStream getReportStream()- Returns:
ModificationReportStream
-
indexOf
Returns the index of the column in the current table as it can be used as index against data- Parameters:
name- the name of the column- Returns:
- the zero based index or -1 if column is not present
-
getRule
public de.ubs.xdm.batch.client.model.ModificationRule getRule()Returns the rule, which was used to apply the modification method against this table.- Returns:
- A MethodRule (useful methods String getColumnPattern(), String getTablePattern(), String getSchemaPattern())
-
buildPoolTable
@Deprecated public void buildPoolTable(String methodName, String category, String url, String user, String password, String tableSchema, String tableName, String refreshInterval, String... columnNames) throws SQLException Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.This method uses the specified table in the respective database system to populate an internal pool table. The pool table name is build based on the specified category and method name.- Parameters:
methodName- The name of the modification method. This name is used to build the name of the pool table.category- The category of the modification method. This category is used to build the name of the pool table.url- The JDBC url in which the table is located that is used to populate the pool table.user- The JDBC user used to access the database system.password- The password for the user.tableSchema- The schema name of the table that is used as data source for the pool table.tableName- The table name that is used as data source for the pool table.refreshInterval- The refresh interval that controls if the data of the pool table should be refreshed or not.columnNames- List of columns that are used to populate the pool table.- Throws:
SQLException- the exception happened while building the table
-
buildShufflingPoolTable
@Deprecated public void buildShufflingPoolTable(String methodName, String category, String url, String user, String password, String tableSchema, String tableName, String refreshInterval, String... columnNames) throws SQLException Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.This method uses the specified table in the respective database system to populate an internal pool table. The pool table name is build based on the specified category and method name.- Parameters:
methodName- The name of the modification method. This name is used to build the name of the pool table.category- The category of the modification method. This category is used to build the name of the pool table.url- The JDBC url in which the table is located that is used to populate the pool table.user- The JDBC user used to access the database system.password- The password for the user.tableSchema- The schema name of the table that is used as data source for the pool table.tableName- The table name that is used as data source for the pool table.refreshInterval- The refresh interval that controls if the data of the pool table should be refreshed or not.columnNames- List of columns that are used to populate the pool table.- Throws:
SQLException- the exception happened while building the table
-
getInvocations
public long getInvocations()Get the number of invocations for a row of this context- Returns:
- the number of invocations of this context
-
getOverallRuntime
public long getOverallRuntime()The run time in milliseconds for this modification method in the given context- Returns:
- the runtime of all invocations in complete
-
setData
Sets the value in the current row.- Parameters:
i- The index of the column in the given tabledata- The data to be set. This must match the data type of the column that should receive the data and must correspond to one of the types defined in java.sql.SqlTypes.
-
put
Stores a value in scope of the current column. This allows you to store values over different rows while processing the column. The data will not be available in other tables that are processed by the same modification rule or method.- Parameters:
name- A symbolic name to store a valuevalue- The value to be stored
-
get
Retrieves a value from the store that works in the scope of one rule specified for a table. This method will return values written with the put() method.- Parameters:
name- The symbolic name of the stored value- Returns:
- the value mapped for key, null if key is not found
-
createPoolTableIfNotExists
Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.Creates pool table with given name of format category/name if not already existing. It acquires the column types by comparing given data with the source table. The given data may only contain those columns which are part of the pool table!- Parameters:
poolTableName- pool table name of format category/name.data- array of data containing the appropriate column types.
-
createPoolTableIfNotExists
Creates pool table with given name of format category/name if not already existing. It fetches the column types out of the source table by comparing its columns with the given mappedColumns.- Parameters:
poolTableName- pool table name of format category/name.mappedColumnNames- string containing the column names for pool table.
-
specialMapping
@Deprecated public Object specialMapping(Object data, String mappingName, String types, boolean takeRandom) Deprecated.method is substituted bypoolMappingGet(Object data, String poolTableName, String mappedColumns, boolean takeRandom)Utility function to access a mapping table. The mapping name of the mapping modification method is specified in the form category/name.- Parameters:
data- A data value.mappingName- The name of a mapping modification method in the form category/name.types- - The data types used, specified as a string containing the type number as defined in java.sql.SqlTypes.takeRandom- If true, then for a value not contained in the map a random value will be stored in the map, otherwise null.- Returns:
- The mapped object for key, null or a random value if not found
-
poolMappingGet
public Object poolMappingGet(Object data, String poolTableName, String mappedColumns, boolean takeRandom) Utility function to access a pool table. The name of the pool table is specified in the form category/name. If a pool table with the specified name does not yet exist, it will be created.- Parameters:
data- A single data value.poolTableName- The name of the specified pool table in the form category/name.mappedColumns- The names of the mapped columns, specified as a comma separated string.takeRandom- If true, then for a value not contained in the map, a random value will be stored in the map, otherwise null.- Returns:
- The mapped object for key, null or a random value if not found.
-
poolMappingGet
Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.Utility function to access a pool table. The name of the pool table is specified in the form category/name. If a pool table with the specified name does not yet exist, an exception will be thrown and the table will not be created.- Parameters:
data- A single data value.poolTableName- The name of the specified pool table in the form category/name.- Returns:
- The mapped object for key, null or a random value if not found.
-
specialMapping
@Deprecated public Object[] specialMapping(Object[] data, String poolTableName, String types, boolean takeRandom) Deprecated.method is substituted bypoolMapping(Object[] data, String poolTableName, String mappedColumns, boolean takeRandom)Utility function to access a pool table. The name of a pool table in the form category/name.- Parameters:
data- An array of data valuespoolTableName- The name of a pool table specified as category/nametypes- The data types used, specified as a string containing a comma separated list of numbers as defined in java.sql.SqlTypes.takeRandom- If true, for a value not contained in the map a random value will be stored in the map, otherwise store null.- Returns:
- the value mapped for key, null or a random value if not found
-
poolMappingGet
@Deprecated public Object[] poolMappingGet(Object[] data, String poolTableName, String mappedColumns, boolean takeRandom) Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.Utility function to access a pool table. The name of the pool table is specified in the form category/name. If a pool table with the specified name does not yet exist, it will be created.- Parameters:
data- An array of data values.poolTableName- The name of a pool table in the form category/name.mappedColumns- The names of the mapped columns, specified as a comma separated string.takeRandom- If true, then for a value not contained in the map, a random value will be stored in the map, otherwise null.- Returns:
- Values mapped for keys, null or random values if not found.
-
poolMappingGet
Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.Utility function to access a pool table. The name of the pool table is specified in the form category/name. If a pool table with the specified name does not yet exist, an exception will be thrown and the table will not be created.- Parameters:
data- An array of data values.poolTableName- The name of a pool table in the form category/name.- Returns:
- Values mapped for keys, null or random values if not found.
-
specialMappingPut
@Deprecated public void specialMappingPut(Object srcData, Object tgtData, String poolTableName, String types) Deprecated.method is substituted bypoolMappingPut(Object srcData, Object tgtData, String poolTableName, String mappedColumns)Utility function to modify a pool table. This method puts a value into a pool table.- Parameters:
srcData- The source data to use.tgtData- The target value to put in the map.poolTableName- The name of a pool table specified as category/name.types- The data type used, specified as a string containing a number as defined in java.sql.SqlTypes.
-
poolMappingPut
@Deprecated public void poolMappingPut(Object srcData, Object tgtData, String poolTableName, String mappedColumns) Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.Utility function to modify a pool table. This method puts a value into a pool table for mapping modification. If a pool table with the specified name does not yet exist, it will be created.- Parameters:
srcData- The source value to use.tgtData- The target value to put in the map.poolTableName- The name of a pool table specified in the form category/name.mappedColumns- The names of the mapped columns, specified as a comma separated string.
-
poolMappingPut
Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.Utility function to modify a pool table. This method puts a value into a pool table for mapping modification. If a pool table with the specified name does not yet exist, an exception will be thrown and the table will not be created.- Parameters:
srcData- The source value to use.tgtData- The target value to put in the map.poolTableName- The name of a pool table specified in the form category/name.
-
specialMappingPut
@Deprecated public void specialMappingPut(Object[] srcData, Object[] tgtData, String poolTableName, String types) Deprecated.method is substituted bypoolMappingPut(Object[] srcData, Object[] tgtData, String poolTableName, String mappedColumns)Utility function to modify a pool table. This method allows to put a value into a pool table.- Parameters:
srcData- The source data values to use.tgtData- The target corresponding values to put in the map.poolTableName- The name of a pool table specified as category/name.types- The data types used, specified as a string containing a comma separated list of numbers as defined in java.sql.SqlTypes.
-
poolMappingPut
@Deprecated public void poolMappingPut(Object[] srcData, Object[] tgtData, String poolTableName, String mappedColumns) Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.Utility function to modify a pool table. This method allows to put a value into an existing pool table. If a pool table with the specified name does not yet exist, it will be created.- Parameters:
srcData- The source values to use.tgtData- The target values to put in the map.poolTableName- The name of a pool table specified in the form category/name.mappedColumns- The names of the mapped columns, specified as a comma separated string.
-
poolMappingPut
Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.Utility function to modify a pool table. This method allows to put a value into an existing pool table. If a pool table with the specified name does not yet exist, an exception will be thrown and the table will not be created.- Parameters:
srcData- The source values to use.tgtData- The target values to put in the map.poolTableName- The name of a pool table specified in the form category/name.
-
specialGetMappingTable
Deprecated.method is substituted bygetPoolTable(String poolTableName)Utility function to retrieve a pool table as a java.util.MapUsage of this method will lock the pool table
- Parameters:
poolTableName- The name of a pool table as category/nametypes- The data types used. Entered as a string containing a comma separated list of numbers as defined in java.sql.SqlTypes.- Returns:
- A java.util.Map Object representing the mapping table
-
getPoolTable
Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.Utility function to retrieve a pool table as a java.util.Map. Usage of this method will lock the pool table. An exception will be thrown if the pool table does not yet exist.- Parameters:
poolTableName- The name of a pool table as category/name.- Returns:
- A java.util.Map Object representing the pool table.
-
specialGetMappingTableSize
Deprecated.method is substituted bygetPoolTableSize(String poolTableName)Utility function to retrieve the size of a pool table- Parameters:
poolTableName- The name of a pool table as category/nametypes- The data types used. Entered as a string containing a comma separated list of numbers as defined in java.sql.SqlTypes.- Returns:
- An integer representing the mapping table size
-
getPoolTableSize
Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.Utility function to retrieve the size of a pool table. An exception will be thrown if the pool table does not yet exist.- Parameters:
poolTableName- The name of a pool table specified as category/name.- Returns:
- An integer representing the pool table size.
-
getPoolTableColumnTypes
Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.Provides column types of a pool table as SqlTypes in form of a comma separated string, i.e. 12,4,8,12. If a pool table with given name does not exist, an exception will be thrown.- Parameters:
poolTableName- name of the pool table the column types should be returned for- Returns:
- comma separated string containing the SqlTypes of the pool table's columns
-
mappingTable
Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.This method provides access to mapping tables. Mapping tables will be generated once by their defined data source. This method can be used to access the mapping tables by giving objects as a key. The method will modify the values in the row as defined by the mapping table. A new array will be returned containing the mapped values. The mapping name defaults to the modification method specified in this modification rule. The value of columnsToPreserve gets a default value of an empty string.- Parameters:
row- The source values for the mapping.mappedColumns- Comma separated list containing the names of the columns to be used .- Returns:
- Object[]
-
mappingTable
@Deprecated public Object[] mappingTable(Object[] row, String mappedColumns, String columnsToPreserve) Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.This method provides access to mapping tables. Mapping tables will be generated once by their defined data source. This method can be used to access the mapping tables by giving objects as a key. The method will modify the values in the row as defined by the mapping table. A new array will be returned containing the mapped values. The mapping name defaults to the modification method specified in this modification rule.- Parameters:
row- The source values for the mappingmappedColumns- Comma separated list containing the names of the columns to be used .columnsToPreserve- The names of columns that should be preserved in a random mapping- Returns:
- Object[]
-
mappingTable
Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.This method provides access to mapping tables. Mapping tables will be generated once by their defined data source. This method can be used to access the mapping tables by giving objects as a key. The method will modify the values in the row as defined by the mapping table. A new array will be returned containing the mapped values. The value of columnsToPreserve has a default value of an empty string.- Parameters:
name- The name of a mapping modification method as category/namerow- The source values for the mappingmappedColumns- Comma separated list containing the names of the columns to be used .- Returns:
- Object[]
-
mappingTable
@Deprecated public Object[] mappingTable(String name, Object[] row, String mappedColumns, String columnsToPreserve) Deprecated.The pool tables are not compatible with a multi container XDM installation. Use ModificationUtils instead.This method provides access to mapping tables. Mapping tables will be generated once by their defined data source. This method can be used to access the mapping tables by giving objects as a key. The method will modify the values in the row as defined by the mapping table. A new array will be returned containing the mapped values.- Parameters:
name- The name of a mapping modification method as category/namerow- The source values for the mappingmappedColumns- Comma separated list containing the names of the columns to be used .columnsToPreserve- The names of columns that should be preserved in a random mapping- Returns:
- the mapped array of values
-
putPersistent
Deprecated.method is substituted bysessionPersistentPut(String mapName, Object key, Object value)Stores a persistent value for an entire run of the modification.- Parameters:
mapName- The name of the map in which to store the value.key- The key in the map.value- The value to be stored.
-
sessionPersistentPut
Stores a persistent value for an entire run of the modification.- Parameters:
mapName- The name of the map in which to store the value.key- The key in the map.value- The value to be stored.
-
getPersistent
Deprecated.method is substituted bysessionPersistentGet(String mapName, Object key)Retrieves a persistent value from the global map.- Parameters:
mapName- The name of the map in which the value is stored.key- The key in the map.- Returns:
- Object
-
sessionPersistentGet
Retrieves a persistent value from the global map.- Parameters:
mapName- The name of the map in which the value is stored.key- The key in the map.- Returns:
- Object
-
getCurrentTargetConnectionPool
- Returns:
- an internal
ConnectionPoolobject, that can be used to get a JDBC connection to the database. Use theget()method to retrieve thejava.sql.Connection. Use theput()method to release the connection afterwards.
-
getCurrentSourceConnectionPool
- Returns:
- an internal
ConnectionPoolobject, that can be used to get a JDBC connection to the database. Use theget()method to retrieve thejava.sql.Connection. Use theput()method to release the connection afterwards.
-
fetchSingleValueFromConnection
Executes a statement against the source or target connection and returns a single value. Note that with every call of this method, a new CONNECTION object will be taken from the connection pool instead of re-using one single connection for every call of this method.- Parameters:
scope- use "TARGET" or "SOURCE" to execute against the specific connection of the task. The respective connection is chosen based on the table the rule is applied on. It will always use the source or target connection the table relates to. Alternatively this can be the name of a connection parameter of type CONNECTION. Then the statement will be executed against the configured connection of the parameter.sql- An SQL statement that returns a result setparameter- You may use parameter markers (?) in your statement. Fill those values with parameters- Returns:
- The value of the first column in the first row, null if there is an empty result set
-
fetchSingleValueFromConnection
public Object fetchSingleValueFromConnection(Connection connection, String sql, Object... parameter) Executes a statement against the source or target connection and returns a single value. Note that with calling this method only one single CONNECTION object is taken from the ConnectionPool. This object will then be re-used for every further method call.- Parameters:
connection- An object of type java.sql.Connection. Can be either a connection provided as parameter of type CONNECTION or built by a ConnectionPool.sql- An SQL statement that returns a result setparameter- You may use parameter markers (?) in your statement. Fill those values with parameters- Returns:
- The value of the first column in the first row, null if there is an empty result set
-
getParameterConnectionPool
- Parameters:
scope- This is the name of a connection parameter of type Connection. Then the statement will be executed against the configured connection of the parameter- Returns:
- an internal
ConnectionPoolobject, that can be used to get a JDBC connection to the database. Use theget()method to retrieve thejava.sql.Connection. Use theput()method to release the connection afterwards. - Throws:
IOException- if connection configuration could not be deserialized. This indicates an internal XDM error.
-
getCurrentTableSchema
- Returns:
- the schema of the currently processed table Mapping rules are applied on the name if the scope of the modification rule is set to Target
-
getCurrentTableName
- Returns:
- the name of the currently processed table. Mapping rules are applied on the name if the scope of the modification rule is set to Target
-
getCurrentSourceTableSchema
- Returns:
- the source schema of the currently processed table.
-
getCurrentSourceTableName
- Returns:
- the source name of the currently processed table
-
getCurrentTableMappedSchema
- Returns:
- the mapped schema name of the currently processed table
-
getCurrentTableMappedName
- Returns:
- the mapped name of the currently processed table
-
parseTimestamp
public de.ubs.xdm.utils.core.HighPrecisionTimestamp parseTimestamp(String patternToSecond, String patternAfterSecond, String data) Parses a string and returns a HighPrecisionTimestamp, the internal Format for all date/time related data types. Use this type to ensure all date/time information is transported.- Parameters:
patternToSecond- A parser pattern as described in java.util.SimpleDateFormat up to and including the seconds.patternAfterSecond- The pattern of all digits after the seconds e.g '.SSS' for three decimal digits.data- The string to be parsed- Returns:
- The date represented as high precision timestamp
-
getCurrentColumn
This return an internal representation of the column. Only works for modification methods of type COLUMN. Column supports getName(), getType() (java.sqlTypes constants), getTypeName(), getLength(), getScale() etc.- Returns:
- The column object on which the method is currently processed
-
getCurrentTable
This return an internal representation of the table. Table supports getName(), getSchema(), getColumnList() etc. This is the source table if the scope of the modification rule is that to source, and the target table if the scope is set to target.- Returns:
- The table object on which the method is currently processed
-
getCurrentSourceTable
This return an internal representation of the source table. Table supports getName(), getSchema(), getColumnList() etc.- Returns:
- The source table object of the table on which the method is currently processed
-
getLogContext
- Overrides:
getLogContextin classScriptContext
-
defineReport
Defines a report to be written when modification is complete. All column values are strings.- Parameters:
name- A unique name for the reportcolumns- A comma separated list of column names.
-
defineReport
Defines a report to be written when modification is complete. All column values are strings.- Parameters:
name- A unique name for the reportignoreDuplicate- omit error message if report was already definedcolumns- A comma separated list of column names.
-
addReportRow
Adds a row to the named report. All values must be strings.- Parameters:
name- The unique report namevalues- Row values
-
getDataColumns
- Returns:
- the list of columns that are transported over the data
-
doesSourceTableContainsColumn
-
getColumnTypeClassification
-
loadLibrary
The use of theContext.evaluateReader()method has the effect of loading all the code supplied byjsLibReaderinto the current method scope.- Specified by:
loadLibraryin classScriptContext- Parameters:
jsLibReader- TheReaderfor the jslib specified by fileNamefileName- Name of the file containing the jslib (required by theevaluateReader()method- Throws:
IOException- that can originate fromjsLibReader
-
stashRow
Stashes a row to be fetched later with get unstashRows() method. The stashed array is a deep copy of the parameter. That means, that modifications on the data array after the stash are not changed in the stashed array.- Parameters:
data- The row to be saved.
-
unstashRows
Returns all rows that have been stashed with the stashRow(Object[]) data method. This method should usually be used to return collected rows from the apply() method. This method clears the current stash.- Returns:
- The list of saved rows
-