src/main/java/edu/ucla/library/bucketeer/verticles/FinalizeJobVerticle.java
private void sendSlackMessage(final String aChannelId, final String aMessageText, final Job aJob,
            final String aCsvData) {
        final Promise<Void> promise = Promise.promise();
        final JsonObject message = new JsonObject();

        message.put(Config.SLACK_CHANNEL_ID, aChannelId);
        message.put(Constants.SLACK_MESSAGE_TEXT, aMessageText);

        if (aJob != null && aCsvData != null) {
            message.put(Constants.JOB_NAME, aJob.getName());
            message.put(Constants.CSV_DATA, aCsvData);
        }

        // We cannot communicate with Slack so we can't send the expected CSV or notify of this error
        // Instead, we just log the error so that there is some record of this problem.
        promise.future().onFailure(handler -> {
            LOGGER.error(MessageCodes.BUCKETEER_522);
        });

        sendMessage(promise, message, SlackMessageVerticle.class.getName(), Integer.MAX_VALUE);
    }
/**
     * Send a message to the specified Slack channel with a list of metadata records.
     *
     * @param aMessageText Text of the message we want to send
     * @param aChannelId ID of the channel to which we want to send this message
     * @param aJob A job to notify a Slack user of the completion of
     * @param aCsvData The CSV data to send as a file attachment in the Slack message
     */
Send a message to the specified Slack channel with a list of metadata records.
@param aMessageText Text of the message we want to send
@param aChannelId ID of the channel to which we want to send this message
@param aJob A job to notify a Slack user of the completion of
@param aCsvData The CSV data to send as a file attachment in the Slack message
Send a message to the specified Slack channel with a list of metadata records . @param aMessageText Text of the message we want to send @param aChannelId ID of the channel to which we want to send this message @param aJob A job to notify a Slack user of the completion of @param aCsvData The CSV data to send as a file attachment in the Slack message
private void sendSlackMessage(final String aChannelId, final String aMessageText, final Job aJob,
            final String aCsvData) {
        final Promise<Void> promise = Promise.promise();
        final JsonObject message = new JsonObject();
        message.put(Config.SLACK_CHANNEL_ID, aChannelId);
        message.put(Constants.SLACK_MESSAGE_TEXT, aMessageText);
        if (aJob != null && aCsvData != null) {
            message.put(Constants.JOB_NAME, aJob.getName());
            message.put(Constants.CSV_DATA, aCsvData);
        }
        promise.future().onFailure(handler -> {
            LOGGER.error(MessageCodes.BUCKETEER_522);
        });
        sendMessage(promise, message, SlackMessageVerticle.class.getName(), Integer.MAX_VALUE);
    }
private void sendSlackMessage ( final String aChannelId , final String aMessageText , final Job aJob , final String aCsvData ) { final Promise < Void > promise = Promise . promise ( ) ; final JsonObject message = new JsonObject ( ) ; message . put ( Config . SLACK_CHANNEL_ID , aChannelId ) ; message . put ( Constants . SLACK_MESSAGE_TEXT , aMessageText ) ; if ( aJob != null && aCsvData != null ) { message . put ( Constants . JOB_NAME , aJob . getName ( ) ) ; message . put ( Constants . CSV_DATA , aCsvData ) ; } promise . future ( ) . onFailure ( handler -> { LOGGER . error ( MessageCodes . BUCKETEER_522 ) ; } ) ; sendMessage ( promise , message , SlackMessageVerticle . class . getName ( ) , Integer . MAX_VALUE ) ; }
Send a message to the specified Slack channel with a list of metadata records.
Send a message to the specified Slack channel with a list of metadata records .
// We cannot communicate with Slack so we can't send the expected CSV or notify of this error // Instead, we just log the error so that there is some record of this problem.