Package com.cloudbees.camaaloth

Source Code of com.cloudbees.camaaloth.Application

package com.cloudbees.camaaloth;

import net.sf.json.JSONObject;

import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;

/**
* <pre>
*  _________
*  |o^o^o^o^o|
*  {   _!_   }
*   \   !   /
*    `.   .'
*      )=(
*     ( + )
*      ) (
*  .--'   `--.
*  `---------'
*
* </pre>
* Camaaloth Grail : application to run just as-if deployed on RUN@Cloud ... but locally
*
* @author <a href="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a>
*/
public class Application {

    /* package */ int appPort;
    /* package */ String appId;
    /* package */ Path appDir;
    /* package */ Path pkgDir;
    /* package */ Path genappDir;
    /* package */ Path controlDir;
    /* package */ Path logDir;
    /* package */ JSONObject metadata;

    public Path getPkgDir() {
        return pkgDir;
    }

    public Path getLogDir() {
        return logDir;
    }

    public Path getGenappDir() {
        return genappDir;
    }

    public Path getControlDir() {
        return controlDir;
    }

    public int getAppPort() {
        return appPort;
    }

    public String getAppId() {
        return appId;
    }

    public Path getAppDir() {
        return appDir;
    }

    public JSONObject getMetadata() {
        return metadata;
    }


    public Map<String, String> getEnv() {
        Map<String, String> env = new HashMap<>();
        JSONObject metadataenv = metadata.getJSONObject("app").getJSONObject("env");
        for (Object k : metadataenv.keySet()) {
            String key = k.toString();
            env.put(key, metadataenv.getString(key));
        }
        return env;

    }
}
TOP

Related Classes of com.cloudbees.camaaloth.Application

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.