Skip to content

Accessing Masking Engine Rulesets

The JobInfo object represents the database connector's inventory on the masking engine. It contains all of the columns that are going to be masked along with the table and/or schema that they belong to.

Example Driver Support Task

public class DropIndexes implements Task {
        private JobInfo jobInfo;
        private LogService logService;
        private Connection targetConnection;

        @Override
        public String getTaskName() {
                return "Drop Indexes";
        }

        @Override
        public void setup(ComponentService serviceProvider) {
                this.jobInfo = serviceProvider.getJobInfo();
                this.targetConnection = serviceProvider.getTargetConnection();
                this.logService = serviceProvider.getLogService();
        }

        /**
         * This method is to structure all of the columns belonging to the jobInfo.
         *
         * @return A String of comma separated column names.
         */
        private String getCommaSeparatedColumnNames() {
                StringBuilder resultStringBuffer = new StringBuilder();
                for (TableInfo table : jobInfo.getTables()) {
                        resultStringBuffer.append(
                                        table.getColumns().stream()
                                                        .map(ColumnInfo::getName)
                                                        .map(this::singleQuoted)
                                                        .collect(Collectors.joining(",")));
                        resultStringBuffer.append(",");
                }
                String commaSeparatedResult = resultStringBuffer.toString();
                return commaSeparatedResult.substring(0, commaSeparatedResult.length() - 1);
        }
}

Some methods have been omitted for brevity.

Note

See the Javadocs for further information on the JobInfo, SchemaInfo, TableInfo and ColumnInfo interfaces.