@Override public void markAuditTable(ChangeTypeBehaviorRegistry changeTypeBehaviorRegistry, ChangeAuditDao artifactDeployerDao, DeployExecution deployExecution) { artifactDeployerDao.insertNewChange(this.getArtifact(), deployExecution); for (Change replacedChange : this.replacedChanges) { artifactDeployerDao.deleteChange(replacedChange); } }
@Override public void unmanageObject(Change change, ChangeAuditDao changeAuditDao) { changeAuditDao.deleteObjectChanges(change); } }
@Override public void manage(Change change, ChangeAuditDao changeAuditDao, DeployExecution deployExecution) { changeAuditDao.updateOrInsertChange(change, deployExecution); }
@Override public boolean accept(PhysicalSchema each) { return dbMetadataManager.getTableInfo(each, getArtifactDeployerDao().getAuditContainerName(), new DaSchemaInfoLevel().setRetrieveTables(true)) != null; } });
@Override public void manage(Change change, ChangeAuditDao changeAuditDao, DeployExecution deployExecution) { changeAuditDao.insertNewChange(change, deployExecution); }
@Override public void unmanage(Change change, ChangeAuditDao changeAuditDao) { changeAuditDao.deleteChange(change); }
@Override public boolean accept(PhysicalSchema each) { return dbMetadataManager.getTableInfo(each, getArtifactDeployerDao().getAuditContainerName(), new DaSchemaInfoLevel().setRetrieveTables(true)) != null; } });
@Override public void manage(Change change, ChangeAuditDao changeAuditDao, DeployExecution deployExecution) { changeAuditDao.insertNewChange(change, deployExecution); }
@Override public void unmanage(Change change, ChangeAuditDao changeAuditDao) { changeAuditDao.deleteChange(change); }
@Override public void markAuditTable(ChangeTypeBehaviorRegistry changeTypeBehaviorRegistry, ChangeAuditDao artifactDeployerDao, DeployExecution deployExecution) { artifactDeployerDao.insertNewChange(this.getArtifact(), deployExecution); for (Change replacedChange : this.replacedChanges) { artifactDeployerDao.deleteChange(replacedChange); } }
@Override public void manage(Change change, ChangeAuditDao changeAuditDao, DeployExecution deployExecution) { changeAuditDao.updateOrInsertChange(change, deployExecution); }
private Predicate<? super ChecksumEntry> getPlatformInclusionPredicate(DbEnvironment env) { // 1) exclude those tables that are excluded by default from source code, e.g. explain tables or others that users configure ImmutableSet<Predicate<? super ChecksumEntry>> schemaObjectNamePredicates = env.getSchemas().collect(new Function<Schema, Predicate<? super ChecksumEntry>>() { @Override public Predicate<? super ChecksumEntry> valueOf(Schema schema) { return schema.getObjectExclusionPredicateBuilder().build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1); } }); // 2) exclude the audit tables MutableMultimap<String, String> tablesToExclude = Multimaps.mutable.set.empty(); tablesToExclude.putAll(ChangeType.TABLE_STR, Sets.immutable.with( env.getPlatform().convertDbObjectName().valueOf(getArtifactDeployerDao().getAuditContainerName()), env.getPlatform().convertDbObjectName().valueOf(dbChecksumManager.getChecksumContainerName()), env.getPlatform().convertDbObjectName().valueOf(getDeployExecutionDao().getExecutionContainerName()), env.getPlatform().convertDbObjectName().valueOf(getDeployExecutionDao().getExecutionAttributeContainerName()) )); ObjectTypeAndNamePredicateBuilder auditTablePredicateBuilder = new ObjectTypeAndNamePredicateBuilder(tablesToExclude.toImmutable(), ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE); Predicates<? super ChecksumEntry> auditTablePredicate = auditTablePredicateBuilder.build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1); return auditTablePredicate.and(schemaObjectNamePredicates); }
@Override public void unmanageObject(Change change, ChangeAuditDao changeAuditDao) { changeAuditDao.deleteObjectChanges(change); } }
@Override public void manage(Change change, ChangeAuditDao changeAuditDao, DeployExecution deployExecution) { for (Change staticData : getSubChanges(change)) { changeAuditDao.updateOrInsertChange(staticData, deployExecution); } }
private Predicate<? super ChecksumEntry> getPlatformInclusionPredicate(DbEnvironment env) { // 1) exclude those tables that are excluded by default from source code, e.g. explain tables or others that users configure ImmutableSet<Predicate<? super ChecksumEntry>> schemaObjectNamePredicates = env.getSchemas().collect(new Function<Schema, Predicate<? super ChecksumEntry>>() { @Override public Predicate<? super ChecksumEntry> valueOf(Schema schema) { return schema.getObjectExclusionPredicateBuilder().build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1); } }); // 2) exclude the audit tables MutableMultimap<String, String> tablesToExclude = Multimaps.mutable.set.empty(); tablesToExclude.putAll(ChangeType.TABLE_STR, Sets.immutable.with( env.getPlatform().convertDbObjectName().valueOf(getArtifactDeployerDao().getAuditContainerName()), env.getPlatform().convertDbObjectName().valueOf(dbChecksumManager.getChecksumContainerName()), env.getPlatform().convertDbObjectName().valueOf(getDeployExecutionDao().getExecutionContainerName()), env.getPlatform().convertDbObjectName().valueOf(getDeployExecutionDao().getExecutionAttributeContainerName()) )); ObjectTypeAndNamePredicateBuilder auditTablePredicateBuilder = new ObjectTypeAndNamePredicateBuilder(tablesToExclude.toImmutable(), ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE); Predicates<? super ChecksumEntry> auditTablePredicate = auditTablePredicateBuilder.build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1); return auditTablePredicate.and(schemaObjectNamePredicates); }
@Override public void markAuditTable(ChangeTypeBehaviorRegistry changeTypeBehaviorRegistry, ChangeAuditDao artifactDeployerDao, DeployExecution deployExecution) { LOG.info("Marking audit table due to reason: {}", this.message); artifactDeployerDao.updateOrInsertChange(getArtifact(), deployExecution); } }
@Override public void markAuditTable(ChangeTypeBehaviorRegistry changeTypeBehaviorRegistry, ChangeAuditDao artifactDeployerDao, DeployExecution deployExecution) { LOG.info("Marking audit table due to reason: {}", this.message); artifactDeployerDao.updateOrInsertChange(getArtifact(), deployExecution); } }
@Override public void manage(Change change, ChangeAuditDao changeAuditDao, DeployExecution deployExecution) { for (Change staticData : getSubChanges(change)) { changeAuditDao.updateOrInsertChange(staticData, deployExecution); } }