Subversion Repositories XServices

Rev

Rev 72 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 72 Rev 78
Line 16... Line 16...
16
 
16
 
Line 17... Line 17...
17
package net.brutex.xservices.ws.impl;
17
package net.brutex.xservices.ws.impl;
18
 
18
 
-
 
19
import java.util.Enumeration;
Line 19... Line 20...
19
import java.util.Enumeration;
20
import java.util.Properties;
20
import java.util.Properties;
21
import java.util.UUID;
21
 
22
 
-
 
23
import javax.jws.WebService;
22
import javax.jws.WebService;
24
import net.brutex.xservices.types.FileSetResource;
23
import net.brutex.xservices.types.FileSetResource;
25
import net.brutex.xservices.types.HostConnection;
24
import net.brutex.xservices.types.HostConnection;
26
import net.brutex.xservices.types.HostinfoType;
25
import net.brutex.xservices.types.MailMimeType;
27
import net.brutex.xservices.types.MailMimeType;
26
import net.brutex.xservices.types.ReturnCode;
28
import net.brutex.xservices.types.ReturnCode;
Line 36... Line 38...
36
 
38
 
37
/**
39
/**
38
 * 
40
 * 
39
 * @author Brian Rosenberger, bru@brutex.de
41
 * @author Brian Rosenberger, bru@brutex.de
40
 */
-
 
41
@WebService(
-
 
42
		targetNamespace = BrutexNamespaces.WS_XSERVICES, 
42
 */
43
		endpointInterface = "net.brutex.xservices.ws.MiscService", 
-
 
44
		serviceName = "MiscService"
-
 
45
			)
43
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES, endpointInterface = "net.brutex.xservices.ws.MiscService", serviceName = "MiscService")
Line 46... Line 44...
46
public class MiscServiceImpl implements MiscService {
44
public class MiscServiceImpl implements MiscService {
-
 
45
 
-
 
46
	public HostinfoType getHostinfo(String hostname) {
-
 
47
		HostInfo info = new HostInfo();
47
 
48
		info.setTaskName("HostInfo");
-
 
49
		RunTask runner = new RunTask(info);
-
 
50
		info.setHost(hostname);
-
 
51
		// info.setPrefix(prefix);
-
 
52
		ReturnCode ret = runner.postTask();
-
 
53
		HostinfoType infotype = new HostinfoType(
-
 
54
				ret.getProperty("NAME"),
-
 
55
				ret.getProperty("DOMAIN"), 
-
 
56
				ret.getProperty("ADDR4"),
48
	public ReturnCode getHostinfo(String hostname) {
57
				ret.getProperty("ADDR6"));
Line 49... Line 58...
49
		return antGetHostinfo(hostname, null);
58
		return infotype;
50
	}
59
	}
51
	
60
 
52
	public ReturnCode getInfo() {
61
	public ReturnCode getInfo() {
53
		ReturnCode r = new ReturnCode();
62
		ReturnCode r = new ReturnCode();
Line 54... Line 63...
54
		r.returnCode = 0;
63
		r.returnCode = 0;
-
 
64
		// Get all system properties
55
		// Get all system properties
65
		Properties props = System.getProperties();
56
		Properties props = System.getProperties();
66
 
57
 
67
		// Enumerate all system properties
58
		// Enumerate all system properties
68
		@SuppressWarnings("unchecked")
Line 67... Line 77...
67
		}
77
		}
Line 68... Line 78...
68
 
78
 
69
		return r;
79
		return r;
Line 70... Line -...
70
	}
-
 
71
 
80
	}
72
 
81
 
73
	public ReturnCode sendMailSimple(HostConnection mailhost, String from,
82
	public ReturnCode sendMailSimple(HostConnection mailhost, String from,
74
			String tolist, String subject, String message) {
83
			String tolist, String subject, String message) {
75
		return sendMail(from, from, tolist, "", "", subject, message,
84
		return sendMail(from, from, tolist, "", "", subject, message,
Line 96... Line 105...
96
 
105
 
97
	public ReturnCode sleep(int minutes, int seconds) {
106
	public ReturnCode sleep(int minutes, int seconds) {
98
		return sleep(0, minutes, seconds, 0);
107
		return sleep(0, minutes, seconds, 0);
Line 99... Line -...
99
	}
-
 
100
 
108
	}
101
	private ReturnCode antGetHostinfo(String hostname, String prefix) {
-
 
102
		HostInfo info = new HostInfo();
-
 
103
		info.setTaskName("HostInfo");
-
 
104
		RunTask runner = new RunTask(info);
-
 
105
		info.setHost(hostname);
109
 
106
		// info.setPrefix(prefix);
110
	public String generateUUID() {
Line 107... Line 111...
107
		return runner.postTask();
111
		return UUID.randomUUID().toString();
108
	}
112
	}
109
 
113