class HerdJmsDestinationResolver implements DestinationResolver {

    @Override
    public Destination resolveDestinationName(Session session, String destinationName, boolean pubSubDomain) throws JMSException
    {
        String sqsQueueName;

        switch (destinationName)
        {
            case SQS_DESTINATION_HERD_INCOMING:
                // Get the incoming SQS queue name.
                sqsQueueName = getSqsQueueName(ConfigurationValue.HERD_NOTIFICATION_SQS_INCOMING_QUEUE_NAME);
                break;
            case SQS_DESTINATION_STORAGE_POLICY_SELECTOR_JOB_SQS_QUEUE:
                // Get the storage policy selector job SQS queue name.
                sqsQueueName = getSqsQueueName(ConfigurationValue.STORAGE_POLICY_SELECTOR_JOB_SQS_QUEUE_NAME);
                break;
            case SQS_DESTINATION_SAMPLE_DATA_QUEUE:
                // Get the storage policy selector job SQS queue name.
                sqsQueueName = getSqsQueueName(ConfigurationValue.SAMPLE_DATA_SQS_QUEUE_NAME);
                break;
            case SQS_DESTINATION_SEARCH_INDEX_UPDATE_QUEUE:
                // Get the storage policy selector job SQS queue name.
                sqsQueueName = getSqsQueueName(ConfigurationValue.SEARCH_INDEX_UPDATE_SQS_QUEUE_NAME);
                break;
            default:
                LOGGER.warn("Failed to resolve the destination name: \"%s\".", destinationName);
                sqsQueueName = "";
                break;
        }

        Destination destination;

        try
        {
            destination = session.createQueue(sqsQueueName);
        }
        catch (Exception ex)
        {
            throw new IllegalStateException(String.format("Failed to resolve the SQS queue: \"%s\".", sqsQueueName), ex);
        }

        return destination;
    }

}