class SchemaChangedListener extends PostGovernanceRepositoryEventListener {

    @Override
    protected Optional<GovernanceEvent> createGovernanceEvent(final DataChangedEvent event) {
        // TODO Consider removing the following one.
        if (configurationNode.getSchemasPath().equals(event.getKey())) {
            return createSchemaNamesUpdatedEvent(event.getValue());
        }
        String schemaName = configurationNode.getSchemaName(event.getKey());
        if (Strings.isNullOrEmpty(schemaName) || !isValidNodeChangedEvent(schemaName, event.getKey())) {
            return Optional.empty();
        }
        if (ChangedType.ADDED == event.getChangedType()) {
            return Optional.of(createAddedEvent(schemaName));
        }
        if (ChangedType.UPDATED == event.getChangedType()) {
            return Optional.of(createUpdatedEvent(schemaName, event));
        }
        if (ChangedType.DELETED == event.getChangedType()) {
            existedSchemaNames.remove(schemaName);
            return Optional.of(new SchemaDeletedEvent(schemaName));
        }
        return Optional.empty();
    }

    public  SchemaChangedListener(final ConfigurationRepository configurationRepository, final Collection<String> schemaNames);

}