package org.apache.airavata.common.utils;

/**
 * Created by Ajinkya on 3/22/17.
 */
public class DBEventManagerConstants {

    public static final String DB_EVENT_SERVICE_DISCOVERY_QUEUE = "db.event.service.discovery.queue";
    private final static String QUEUE_SUFFIX = ".queue";
    public final static String DB_EVENT_EXCHANGE_NAME = "db.event.exchange";

    enum DBEventService{

        USER_PROFILE("user.profile"),
        SHARING("sharing"),
        REGISTRY("registry");

        private final String name;
        DBEventService(String name) {
            this.name = name;
        }
        public String toString() {
            return this.name;
        }
    }

    public static String getQueueName(DBEventService dBEventService){
        return dBEventService.toString() + QUEUE_SUFFIX;
    }

}

@@ -359,16 +359,23 @@
 %22;%0A%0A    
+public 
 enum DBE
@@ -680,16 +680,145 @@
 %0A    %7D%0A%0A
+    /**%0A     * Get the queue-name of the service, given service-name as enum%0A     * @param dBEventService%0A     * @return%0A     */%0A
     publ
@@ -877,16 +877,17 @@
 Service)
+ 
 %7B%0A      
@@ -944,10 +944,686 @@
 %0A    %7D%0A%0A
+    /**%0A     * Get the queue-name of the service, given service-name as string%0A     * @param dbEventService%0A     * @return%0A     */%0A    public static String getQueueName(String dbEventService) %7B%0A        return getQueueName(getDBEventService(dbEventService));%0A    %7D%0A%0A    /**%0A     * Get the service as enum, given the service-name as string%0A     * @param dbEventService%0A     * @return%0A     */%0A    private static DBEventService getDBEventService(String dbEventService) %7B%0A        for (DBEventService service : DBEventService.values()) %7B%0A            if (service.toString().equals(dbEventService)) %7B%0A                return service;%0A            %7D%0A        %7D%0A        return null;%0A    %7D%0A
 %7D%0A

Add method to get dbevent service-queue-name given service-enum