]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/deploy/SimpleExecutables.java
Unique launch
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / deploy / SimpleExecutables.java
1 /*
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.argeo.slc.core.deploy;
18
19 import java.io.File;
20 import java.util.Map;
21 import java.util.TreeMap;
22
23 import org.apache.commons.logging.Log;
24 import org.apache.commons.logging.LogFactory;
25 import org.argeo.slc.build.Distribution;
26 import org.argeo.slc.deploy.DeploymentData;
27 import org.argeo.slc.deploy.InstalledExecutables;
28 import org.argeo.slc.deploy.TargetData;
29
30 public class SimpleExecutables implements InstalledExecutables {
31 private final static Log log = LogFactory.getLog(SimpleExecutables.class);
32
33 private String baseDir;
34 private Map<String, String> paths = new TreeMap<String, String>();
35
36 private Distribution distribution;
37
38 public String getExecutablePath(String key) {
39 String path = paths.get(key);
40 if (path == null) {
41 if (log.isDebugEnabled())
42 log.debug("No executable path found for key " + key
43 + ", using the key as executable name.");
44 path = key;
45 }
46
47 if (baseDir != null)
48 path = baseDir + File.separator + path;
49 return path;
50 }
51
52 public String getDeployedSystemId() {
53 // TODO Auto-generated method stub
54 return null;
55 }
56
57 public DeploymentData getDeploymentData() {
58 // TODO Auto-generated method stub
59 return null;
60 }
61
62 public Distribution getDistribution() {
63 return distribution;
64 }
65
66 public TargetData getTargetData() {
67 // TODO Auto-generated method stub
68 return null;
69 }
70
71 public String getBaseDir() {
72 return baseDir;
73 }
74
75 public void setBaseDir(String baseDir) {
76 this.baseDir = baseDir;
77 }
78
79 public Map<String, String> getPaths() {
80 return paths;
81 }
82
83 public void setPaths(Map<String, String> paths) {
84 this.paths = paths;
85 }
86
87 public void setDistribution(Distribution distribution) {
88 this.distribution = distribution;
89 }
90
91 }