Subversion Repositories XServices

Compare Revisions

Ignore whitespace Rev 22 → Rev 44

/xservices/trunk/src/java/net/brutex/xservices/types/ContainsSelectorType.java
0,0 → 1,53
/*
* Copyright 2010 Brian Rosenberger (Brutex Network)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
 
package net.brutex.xservices.types;
 
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.apache.tools.ant.types.selectors.ContainsSelector;
import org.apache.tools.ant.types.selectors.FileSelector;
 
/**
*
* @author Brian Rosenberger, bru@brutex.de
*/
@XmlType
public class ContainsSelectorType implements SelectorTypeInterface {
public static final String XML_NAME="contains";
 
public ContainsSelectorType() {
}
 
public FileSelector getSelector() {
ContainsSelector selector = new ContainsSelector();
selector.setCasesensitive(casesensitive);
selector.setText(text);
selector.setIgnorewhitespace(ignorewhitespace);
return selector;
}
 
@XmlElement(required=true, nillable=false)
public String text;
 
@XmlElement(required=true, defaultValue="true")
public boolean casesensitive;
 
@XmlElement(required=true, defaultValue="false")
public boolean ignorewhitespace;
 
}
/xservices/trunk/src/java/net/brutex/xservices/types/SelectorType.java
0,0 → 1,36
/*
* Copyright 2010 Brian Rosenberger (Brutex Network)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
 
package net.brutex.xservices.types;
 
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import org.apache.tools.ant.types.selectors.FileSelector;
 
/**
*
* @author Brian Rosenberger, bru@brutex.de
*/
public abstract class SelectorType implements SelectorTypeInterface {
 
public SelectorType() {
}
 
@XmlElement(name=ContainsSelectorType.XML_NAME, nillable=true)
public List<ContainsSelectorType> contains;
 
 
}
/xservices/trunk/src/java/net/brutex/xservices/types/FileSetResource.java
31,7 → 31,7
* @author Brian Rosenberger, bru@brutex.de
*/
@XmlType(name = "FileSetType", namespace = "http://ws.xservices.brutex.net",
propOrder = {"type", "source", "includes", "excludes", "casesensitive"})
propOrder = {"type", "source", "filter", "excludes", "casesensitive"})
public class FileSetResource {
 
/**
51,8 → 51,9
* Pattern of files to include.
*
*/
@XmlElement(name = "includes", required = true, nillable = false, defaultValue = "**/*")
public String includes = "";
@XmlElement(name = PatternSetType.XML_NAME, required = true, nillable = true)
public PatternSetType filter;
 
/**
* Pattern of files to exclude.
*/
95,7 → 96,7
set.setDir(new File(source));
}
set.setProject(p);
set.setIncludes(includes);
//set.setIncludes(includes);
set.setExcludes(excludes);
set.setCaseSensitive(casesensitive);
 
/xservices/trunk/src/java/net/brutex/xservices/types/SelectorTypeInterface.java
0,0 → 1,16
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
 
package net.brutex.xservices.types;
 
import org.apache.tools.ant.types.selectors.FileSelector;
 
/**
*
* @author brian
*/
public interface SelectorTypeInterface {
public FileSelector getSelector();
}
/xservices/trunk/src/java/net/brutex/xservices/types/PatternElement.java
0,0 → 1,20
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
 
package net.brutex.xservices.types;
 
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
 
/**
*
* @author brian
*/
@XmlType()
public class PatternElement {
 
@XmlValue()
public String pattern;
}
/xservices/trunk/src/java/net/brutex/xservices/types/PatternSetType.java
0,0 → 1,41
/*
* Copyright 2010 Brian Rosenberger (Brutex Network)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.brutex.xservices.types;
 
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
 
/**
*
* @author Brian Rosenberger
*/
 
public class PatternSetType {
 
public static final String XML_NAME = "filter";
 
@XmlElement(required=false, nillable=false, defaultValue="**/*")
public List<PatternElement> include;
 
@XmlElement(required=false, nillable=false)
public List<PatternElement> exclude;
 
@XmlElement(required=false, nillable=true)
public SelectorType selector;
 
public PatternSetType() {
}
}
/xservices/trunk/src/java/net/brutex/xservices/ws/MiscService.java
23,6 → 23,7
import net.brutex.xservices.types.MailMimeType;
import net.brutex.xservices.types.ReturnCode;
import net.brutex.xservices.util.BrutexNamespaces;
import org.apache.cxf.annotations.WSDLDocumentation;
 
/**
*
31,9 → 32,24
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
public interface MiscService {
 
/**
* @param hostname
* @return
*/
@WebMethod(operationName = "getHostinfo")
public ReturnCode getHostinfo(@WebParam(name = "hostname") String hostname);
 
/**
*
* @param mailhost
* @param from
* @param tolist
* @param subject
* @param message
* @return
*/
@WebMethod(operationName = "sendMailSimple")
public ReturnCode sendMailSimple(@WebParam(name = "mailhost") HostConnection mailhost,
@WebParam(name = "from") String from,
41,6 → 57,16
@WebParam(name = "subject") String subject,
@WebParam(name = "message") String message);
 
/**
*
* @param mailhost
* @param from
* @param tolist
* @param subject
* @param message
* @param res
* @return
*/
@WebMethod(operationName = "sendMailSimpleWithAttachment")
public ReturnCode sendMailSimpleWithAttachment(@WebParam(name = "mailhost") HostConnection mailhost,
@WebParam(name = "from") String from,
49,6 → 75,22
@WebParam(name = "message") String message,
@WebParam(name = "attachments") FileSetResource res);
 
/**
*
* @param mailhost
* @param from
* @param tolist
* @param cclist
* @param bcclist
* @param subject
* @param mimetype
* @param charset
* @param message
* @param res
* @param ssl
* @param tls
* @return
*/
@WebMethod(operationName = "sendMail")
public ReturnCode sendMail(@WebParam(name = "mailhost") HostConnection mailhost,
@WebParam(name = "from") String from,
63,6 → 105,12
@WebParam(name = "useSSL") boolean ssl,
@WebParam(name = "useStartTLS") boolean tls);
 
/**
*
* @param minutes
* @param seconds
* @return
*/
@WebMethod(operationName = "sleep")
public ReturnCode sleep(@WebParam(name = "minutes") int minutes,
@WebParam(name = "seconds") int seconds);
/xservices/trunk/src/java/net/brutex/xservices/ws/MiscServiceImpl.java
22,6 → 22,8
import net.brutex.xservices.types.MailMimeType;
import net.brutex.xservices.types.ReturnCode;
import net.brutex.xservices.util.RunTask;
import org.apache.cxf.annotations.WSDLDocumentation;
import org.apache.cxf.annotations.WSDLDocumentationCollection;
import org.apache.tools.ant.taskdefs.HostInfo;
import org.apache.tools.ant.taskdefs.Sleep;
import org.apache.tools.ant.taskdefs.email.EmailTask;
30,10 → 32,20
*
* @author Brian Rosenberger, bru@brutex.de
*/
@WSDLDocumentationCollection(
{
@WSDLDocumentation("My portType documentation"),
@WSDLDocumentation(value = "My top level documentation",
placement = WSDLDocumentation.Placement.TOP),
@WSDLDocumentation(value = "My binding doc",
placement = WSDLDocumentation.Placement.BINDING)
}
)
@WebService(endpointInterface="net.brutex.xservices.ws.MiscService",
serviceName="MiscService")
public class MiscServiceImpl implements MiscService {
 
@WSDLDocumentation(value="Get information about a host.")
public ReturnCode getHostinfo(String hostname) {
return antGetHostinfo(hostname, null);
}