]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.support/src/org/argeo/slc/lib/linux/DefaultRedhatDeploymentData.java
Adapt to changes in Commons
[gpl/argeo-slc.git] / org.argeo.slc.support / src / org / argeo / slc / lib / linux / DefaultRedhatDeploymentData.java
1 /*
2 * Copyright (C) 2007-2012 Argeo GmbH
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 package org.argeo.slc.lib.linux;
17
18 import org.argeo.slc.core.deploy.MultiResourceSet;
19 import org.argeo.slc.core.deploy.ResourceSet;
20
21 public class DefaultRedhatDeploymentData implements RedhatDeploymentData {
22 private ResourceSet configurationFiles;
23 private String runlevelsScript;
24 private String permissionsScript;
25
26 private RedhatDeploymentData parent;
27
28 public ResourceSet getConfigurationFiles() {
29 if (parent != null && parent.getConfigurationFiles() != null) {
30 MultiResourceSet mrs = new MultiResourceSet();
31 mrs.getResourceSets().add(parent.getConfigurationFiles());
32 mrs.getResourceSets().add(configurationFiles);
33 return mrs;
34 } else {
35 return configurationFiles;
36 }
37 }
38
39 public String getRunlevelsScript() {
40 if (parent != null && parent.getRunlevelsScript() != null)
41 return parent.getRunlevelsScript() + "\n" + runlevelsScript;
42 else
43 return runlevelsScript;
44 }
45
46 public String getPermissionsScript() {
47 if (parent != null && parent.getPermissionsScript() != null)
48 return parent.getPermissionsScript() + "\n" + permissionsScript;
49 else
50 return permissionsScript;
51 }
52
53 public void setRunlevelsScript(String runlevelsScript) {
54 this.runlevelsScript = runlevelsScript;
55 }
56
57 public void setConfigurationFiles(ResourceSet configurationFiles) {
58 this.configurationFiles = configurationFiles;
59 }
60
61 public void setPermissionsScript(String permissionsScript) {
62 this.permissionsScript = permissionsScript;
63 }
64
65 public void setParent(RedhatDeploymentData parentDeploymentData) {
66 this.parent = parentDeploymentData;
67 }
68
69 }