class ConnectionUpdateHandler extends AbstractResourceUpdateHandler<ConnectionBulletinBoard> {

    ConnectionBulletinBoard computeBoard(Connection connection, Connector oldConnector, Connector newConnector) {
        final DataManager dataManager = getDataManager();
        final String id = connection.getId().get();
        final ConnectionBulletinBoard board = dataManager.fetchByPropertyValue(ConnectionBulletinBoard.class, "targetResourceId", id).orElse(null);
        final ConnectionBulletinBoard.Builder builder;

        if (board != null) {
            builder = new ConnectionBulletinBoard.Builder()
                .createFrom(board);
        } else {
            builder = new ConnectionBulletinBoard.Builder()
                .id(KeyGenerator.createKey())
                .targetResourceId(id)
                .createdAt(System.currentTimeMillis());
        }


        List<LeveledMessage> messages = new ArrayList<>();
        messages.addAll(computeValidatorMessages(LeveledMessage.Builder::new, connection));
        messages.addAll(computePropertiesDiffMessages(LeveledMessage.Builder::new, oldConnector.getProperties(), newConnector.getProperties()));
        if (!connection.isDerived()) {
            messages.addAll(computeMissingMandatoryPropertiesMessages(
                LeveledMessage.Builder::new,
                newConnector.getProperties(),
                merge(newConnector.getConfiguredProperties(), connection.getConfiguredProperties()))
            );
        }
        messages.addAll(computeSecretsUpdateMessages(LeveledMessage.Builder::new, newConnector.getProperties(), connection.getConfiguredProperties()));

        builder.errors(countMessagesWithLevel(LeveledMessage.Level.ERROR, messages));
        builder.warnings(countMessagesWithLevel(LeveledMessage.Level.WARN, messages));
        builder.notices(countMessagesWithLevel(LeveledMessage.Level.INFO, messages));
        builder.putMetadata("connector-id", newConnector.getId().get());
        builder.putMetadata("connector-version-latest", Integer.toString(newConnector.getVersion()));
        builder.putMetadata("connector-version-connection", Integer.toString(oldConnector.getVersion()));
        builder.messages(messages);

        ConnectionBulletinBoard updated = builder.build();

        if (!updated.equals(board)) {
            return builder.updatedAt(System.currentTimeMillis()).build();
        }

        return null;
    }

    public  ConnectionUpdateHandler(DataManager dataManager, EncryptionComponent encryptionComponent, Validator validator);

}