All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.testvagrant.optimuscloud.configuration.ConfigurationLoader Maven / Gradle / Ivy

Go to download

The Java Client provides access to Optimus cloud for all java based projects.

There is a newer version: 1.1.0
Show newest version
package com.testvagrant.optimuscloud.configuration;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ConfigurationLoader {


    private static Properties properties;

    public ConfigurationLoader() {
        InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream(getConfigFileName() + ".properties");
        try {
            properties = new Properties();
            if(resourceAsStream!=null)
                properties.load(resourceAsStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    protected String getAkiraHost() {
        return properties.getProperty("optimus-cloud",System.getProperty("optimus-cloud","http://localhost:6889"));
    }

    protected String getMdbHost() {
        return properties.getProperty("mdb",System.getProperty("mdb","http://localhost:9909"));
    }

    protected String getMatchMakerHost() {
        return properties.getProperty("match-maker",System.getProperty("match-maker","http://localhost:6898"));
    }

    protected String getRabbitMQHost(){return properties.getProperty("rabbitmq",System.getProperty("rabbitmq","http://localhost:5672"));}

    private String getConfigFileName() {
        return System.getProperty("config","config");
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy