Subversion Repositories XServices

Compare Revisions

No changes between revisions

Ignore whitespace Rev 18 → Rev 17

/xservices/trunk/src/java/net/brutex/xservices/ws/MiscServiceImpl.java
17,13 → 17,9
package net.brutex.xservices.ws;
 
import javax.jws.WebService;
import net.brutex.xservices.types.FileSetResource;
import net.brutex.xservices.types.HostConnection;
import net.brutex.xservices.types.ReturnCode;
import net.brutex.xservices.util.RunTask;
import org.apache.tools.ant.taskdefs.HostInfo;
import org.apache.tools.ant.taskdefs.email.EmailTask;
import org.apache.tools.ant.taskdefs.email.Mailer;
 
/**
*
34,77 → 30,16
public class MiscServiceImpl implements MiscService {
 
public ReturnCode getHostinfo(String hostname) {
return antGetHostinfo(hostname, null);
return antGetHostinfo(hostname, "");
}
 
public ReturnCode sendMailSimple(HostConnection mailhost, String from, String tolist, String subject, String message) {
return sendMail(from,
from,
tolist,
"",
"",
subject,
message,
"text/plain",
null,
mailhost.hostname,
mailhost.port,
mailhost.user,
mailhost.password,
"utf-8",
false,
false);
}
 
 
 
private ReturnCode antGetHostinfo(String hostname, String prefix) {
HostInfo info = new HostInfo();
info.setTaskName("HostInfo");
RunTask runner = new RunTask(info);
info.setHost(hostname);
//info.setPrefix(prefix);
info.setPrefix(prefix);
return runner.postTask();
}
 
private ReturnCode sendMail(String from,
String replyto,
String tolist,
String cclist,
String bcclist,
String subject,
String message,
String messagemimetype,
FileSetResource attachments,
String mailhost,
int mailport,
String user,
String password,
String charset,
boolean tls,
boolean ssl) {
EmailTask mail = new EmailTask();
mail.setTaskName("Mail");
RunTask runner = new RunTask(mail);
mail.setFrom(from);
mail.setReplyTo(replyto);
mail.setToList(tolist);
mail.setCcList(cclist);
mail.setBccList(bcclist);
mail.setSubject(subject);
mail.setMessage(message);
mail.setMessageMimeType(messagemimetype);
if(attachments != null) {
mail.addFileset(attachments.getAntFileSet(mail.getProject()));
}
mail.setMailhost(mailhost);
mail.setMailport(mailport);
mail.setUser(user);
mail.setPassword(password);
mail.setCharset(charset);
mail.setSSL(ssl);
mail.setEnableStartTLS(tls);
return runner.postTask();
}
 
}
/xservices/trunk/src/java/net/brutex/xservices/ws/MiscService.java
19,7 → 19,6
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import net.brutex.xservices.types.HostConnection;
import net.brutex.xservices.types.ReturnCode;
import net.brutex.xservices.util.BrutexNamespaces;
 
32,11 → 31,4
 
@WebMethod(operationName="getHostinfo")
public ReturnCode getHostinfo(@WebParam(name="hostname") String hostname);
 
@WebMethod(operationName="sendMailSimple")
public ReturnCode sendMailSimple(@WebParam(name="mailhost") HostConnection mailhost,
@WebParam(name="from") String from,
@WebParam(name="to") String tolist,
@WebParam(name="subject") String subject,
@WebParam(name="message") String message);
}
/xservices/trunk/src/java/net/brutex/xservices/types/HostConnection.java
File deleted
/xservices/trunk/src/java/net/brutex/xservices/util/RunTask.java
49,7 → 49,7
log = new TimestampedLogger();
log.setOutputPrintStream(new PrintStream(out));
log.setErrorPrintStream(new PrintStream(err));
log.setMessageOutputLevel(Echo.EchoLevel.WARN.getLevel());
log.setMessageOutputLevel(Echo.EchoLevel.VERBOSE.getLevel());
 
antproject.addBuildListener(log);
 
/xservices/trunk/doc
Property changes:
Deleted: svn:ignore
-.~lock.XServices_V1.0-User_Guide.odt#