Subversion Repositories XServices

Rev

Rev 73 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 73 Rev 82
1
/*
1
/*
2
 *   Copyright 2010 Brian Rosenberger (Brutex Network)
2
 *   Copyright 2010 Brian Rosenberger (Brutex Network)
3
 *
3
 *
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
5
 *   you may not use this file except in compliance with 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
6
 *   You may obtain a copy of the License at
7
 *
7
 *
8
 *       http://www.apache.org/licenses/LICENSE-2.0
8
 *       http://www.apache.org/licenses/LICENSE-2.0
9
 *
9
 *
10
 *   Unless required by applicable law or agreed to in writing, software
10
 *   Unless required by applicable law or agreed to in writing, software
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *   See the License for the specific language governing permissions and
13
 *   See the License for the specific language governing permissions and
14
 *   limitations under the License.
14
 *   limitations under the License.
15
 */
15
 */
16
 
16
 
17
package net.brutex.xservices.types;
17
package net.brutex.xservices.types;
18
 
18
 
19
import java.util.List;
19
import java.util.List;
20
import javax.xml.bind.annotation.XmlElement;
20
import javax.xml.bind.annotation.XmlElement;
21
import javax.xml.bind.annotation.XmlType;
21
import javax.xml.bind.annotation.XmlType;
-
 
22
 
-
 
23
import net.brutex.xservices.types.ant.AntProperty;
22
import net.brutex.xservices.util.BrutexNamespaces;
24
import net.brutex.xservices.util.BrutexNamespaces;
23
 
25
 
24
/**
26
/**
25
 *
27
 *
26
 * @author Brian Rosenberger, bru@brutex.de
28
 * @author Brian Rosenberger, bru@brutex.de
27
 */
29
 */
28
@XmlType(namespace=BrutexNamespaces.WS_XSERVICES, name="ReturnCodeType")
30
@XmlType(namespace=BrutexNamespaces.WS_XSERVICES, name="ReturnCodeType")
29
public class ReturnCode {
31
public class ReturnCode {
30
 
32
 
31
    /**
33
    /**
32
     * Numeric return code.
34
     * Numeric return code.
33
     *
35
     *
34
     * The numeric return code of the last operation on the underlying operation
36
     * The numeric return code of the last operation on the underlying operation
35
     * systen (OS). In general the return code indicates the failure or success
37
     * systen (OS). In general the return code indicates the failure or success
36
     * of a command. Which value indicates success is dependent on the OS, most
38
     * of a command. Which value indicates success is dependent on the OS, most
37
     * linux based systems use "0" for success.
39
     * linux based systems use "0" for success.
38
     */
40
     */
39
    @XmlElement(required=true, nillable=false)
41
    @XmlElement(required=true, nillable=false)
40
    public int returnCode=0;
42
    public int returnCode=0;
41
 
43
 
42
    /**
44
    /**
43
     * Standard Out as provided by the OS.
45
     * Standard Out as provided by the OS.
44
     *
46
     *
45
     * The stdOut given by the last operation (if any).
47
     * The stdOut given by the last operation (if any).
46
     */
48
     */
47
    @XmlElement(name="stdOut", nillable=false)
49
    @XmlElement(name="stdOut", nillable=false)
48
    public String stdOut="";
50
    public String stdOut="";
49
 
51
 
50
    /**
52
    /**
51
     * The Standard Error as provided by the OS.
53
     * The Standard Error as provided by the OS.
52
     *
54
     *
53
     * The stdErr given by the last operation (if any). The presents of any
55
     * The stdErr given by the last operation (if any). The presents of any
54
     * value here ususally indicates that a failure has occured.
56
     * value here ususally indicates that a failure has occured.
55
     */
57
     */
56
    @XmlElement(name="stdErr", nillable=false)
58
    @XmlElement(name="stdErr", nillable=false)
57
    public String stdErr="";
59
    public String stdErr="";
58
 
60
 
59
 
61
 
60
    @XmlElement(name="propertyList", nillable=true)
62
    @XmlElement(name="propertyList", nillable=true)
61
    public List<AntProperty> property = null;
63
    public List<AntProperty> property = null;
62
 
64
 
63
    /**
65
    /**
64
     * Create a new ReturnCode default constructor.
66
     * Create a new ReturnCode default constructor.
65
     */
67
     */
66
    public ReturnCode() {
68
    public ReturnCode() {
67
    }
69
    }
68
 
70
 
69
    /**
71
    /**
70
     * Create a new ReturnCode.
72
     * Create a new ReturnCode.
71
     *
73
     *
72
     * @param returnCode    return code integer value
74
     * @param returnCode    return code integer value
73
     * @param stdOut        standard out string
75
     * @param stdOut        standard out string
74
     * @param stdErr        standard error string
76
     * @param stdErr        standard error string
75
     */
77
     */
76
    public ReturnCode(int returnCode, String stdOut, String stdErr, List<AntProperty> props) {
78
    public ReturnCode(int returnCode, String stdOut, String stdErr, List<AntProperty> props) {
77
        this.returnCode = returnCode;
79
        this.returnCode = returnCode;
78
        this.stdOut = stdOut;
80
        this.stdOut = stdOut;
79
        this.stdErr = stdErr;
81
        this.stdErr = stdErr;
80
        this.property = props;
82
        this.property = props;
81
    }
83
    }
82
    
84
    
83
    /**
85
    /**
84
     * @param key
86
     * @param key
85
     * @return
87
     * @return
86
     */
88
     */
87
    public String getProperty(String key) {
89
    public String getProperty(String key) {
88
    	for(AntProperty prop : this.property) {
90
    	for(AntProperty prop : this.property) {
89
    		if(key.equals(prop.name)) return prop.value;
91
    		if(key.equals(prop.name)) return prop.value;
90
    	}
92
    	}
91
    	return null;
93
    	return null;
92
    }
94
    }
93
    
95
    
94
    /**
96
    /**
95
     * @return
97
     * @return
96
     */
98
     */
97
    public String getStdOut() { return this.stdOut; }
99
    public String getStdOut() { return this.stdOut; }
98
}
100
}