Subversion Repositories XServices

Rev

Rev 46 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 46 Rev 54
Line 14... Line 14...
14
 *   limitations under the License.
14
 *   limitations under the License.
15
 */
15
 */
Line 16... Line 16...
16
 
16
 
Line -... Line 17...
-
 
17
package net.brutex.xservices.ws.impl;
-
 
18
 
-
 
19
import java.util.Enumeration;
17
package net.brutex.xservices.ws.impl;
20
import java.util.Properties;
18
 
21
 
19
import javax.jws.WebService;
22
import javax.jws.WebService;
20
import net.brutex.xservices.types.FileSetResource;
23
import net.brutex.xservices.types.FileSetResource;
21
import net.brutex.xservices.types.HostConnection;
24
import net.brutex.xservices.types.HostConnection;
Line 48... Line 51...
48
 
51
 
49
	@WSDLDocumentation(value = "Get information about a host.")
52
	@WSDLDocumentation(value = "Get information about a host.")
50
	public ReturnCode getHostinfo(String hostname) {
53
	public ReturnCode getHostinfo(String hostname) {
51
		return antGetHostinfo(hostname, null);
54
		return antGetHostinfo(hostname, null);
-
 
55
	}
-
 
56
	
-
 
57
	@WSDLDocumentation(value = "Get XService information.")
-
 
58
	public ReturnCode getInfo() {
-
 
59
		ReturnCode r = new ReturnCode();
-
 
60
		r.returnCode = 0;
-
 
61
		// Get all system properties
-
 
62
		Properties props = System.getProperties();
-
 
63
 
-
 
64
		// Enumerate all system properties
-
 
65
		Enumeration<String> e = (Enumeration<String>) props.propertyNames();
-
 
66
		for (; e.hasMoreElements(); ) {
-
 
67
		    // Get property name
-
 
68
		    String propName = (String)e.nextElement();
-
 
69
 
-
 
70
		    // Get property value
-
 
71
		    String propValue = (String)props.get(propName);
-
 
72
		    r.stdOut = r.stdOut + propName + ": " + propValue + "\n";
-
 
73
		}
-
 
74
 
-
 
75
		return r;
-
 
76
	}
Line 52... Line 77...
52
	}
77
 
53
 
78
 
54
	public ReturnCode sendMailSimple(HostConnection mailhost, String from,
79
	public ReturnCode sendMailSimple(HostConnection mailhost, String from,
55
			String tolist, String subject, String message) {
80
			String tolist, String subject, String message) {
Line 103... Line 128...
103
		mail.setBccList(bcclist);
128
		mail.setBccList(bcclist);
104
		mail.setSubject(subject);
129
		mail.setSubject(subject);
105
		mail.setMessage(message);
130
		mail.setMessage(message);
106
		mail.setMessageMimeType(messagemimetype);
131
		mail.setMessageMimeType(messagemimetype);
107
		if (attachments != null) {
132
		if (attachments != null) {
108
			mail.addFileset(attachments.getAntFileSet(mail.getProject()));
133
			mail.addFileset(attachments.getAntResource(mail.getProject()));
109
		}
134
		}
110
		mail.setMailhost(mailhost);
135
		mail.setMailhost(mailhost);
111
		mail.setMailport(mailport);
136
		mail.setMailport(mailport);
112
		mail.setUser(user);
137
		mail.setUser(user);
113
		mail.setPassword(password);
138
		mail.setPassword(password);
Line 126... Line 151...
126
		sleep.setMinutes(minutes);
151
		sleep.setMinutes(minutes);
127
		sleep.setSeconds(seconds);
152
		sleep.setSeconds(seconds);
128
		sleep.setMilliseconds(milliseconds);
153
		sleep.setMilliseconds(milliseconds);
129
		return runner.postTask();
154
		return runner.postTask();
130
	}
155
	}
131
 
-
 
132
}
156
}