/xservices/trunk/src/java/net/brutex/xservices/types/ant/DateInfoType.java |
---|
0,0 → 1,66 |
/* |
* Copyright 2013 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.ant; |
import java.util.Date; |
import java.util.GregorianCalendar; |
import java.util.TimeZone; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlType; |
import net.brutex.xservices.types.DateFormatType; |
/** |
* @author Brian Rosenberger, bru(at)brutex.de |
* |
*/ |
@XmlType(name="DateInfoType", namespace="http://ws.xservices.brutex.net", propOrder={"isoDate", "rfcDate", "millis"}) |
public class DateInfoType |
{ |
public static final String XML_NAME = "DateInfoType"; |
private final GregorianCalendar date; |
private final TimeZone zone; |
public DateInfoType(GregorianCalendar date, TimeZone zone) |
{ |
this.date = date; |
this.zone = zone; |
} |
public DateInfoType() |
{ |
this.zone = TimeZone.getDefault(); |
this.date = new GregorianCalendar(this.zone); |
} |
@XmlElement(name="timestamp") |
public long getMillis() |
{ |
return this.date.getTimeInMillis(); |
} |
@XmlElement(name="iso8601date") |
public Date getIsoDate() |
{ |
return this.date.getTime(); |
} |
@XmlElement(name="rfc822date") |
public String getRfcDate() |
{ |
return DateFormatType.RFC822.format(this.date.getTime(), null, null); |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/ant/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.ant; |
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/ant/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.ant; |
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/ant/FileSetResource.java |
---|
0,0 → 1,132 |
/* |
* 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.ant; |
import java.io.File; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlEnum; |
import javax.xml.bind.annotation.XmlType; |
import org.apache.tools.ant.Project; |
import org.apache.tools.ant.types.FileSet; |
import org.apache.tools.ant.types.Resource; |
import org.apache.tools.ant.types.TarFileSet; |
import org.apache.tools.ant.types.ZipFileSet; |
/** |
* Set of files from various sources. |
* |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
@XmlType(name = "FileSetType", namespace = "http://ws.xservices.brutex.net", |
propOrder = {"type", "source", "filter", "excludes", "casesensitive"}) |
public class FileSetResource implements ResourceSetInterface { |
public static final String XML_NAME = "fileset"; |
/** |
* Type of FileSet |
*/ |
@XmlElement(name = "FileSetType", required = true, nillable = false, defaultValue = "FILES") |
public FileSetType type = FileSetType.FILES; |
/** |
* File set source. |
* |
* Depends on the file set type. This is either an archive file or a |
* directory. |
*/ |
@XmlElement(name = "source", required = true, nillable = false) |
public String source = ""; |
/** |
* Pattern of files to include. |
* |
*/ |
@XmlElement(name = PatternSetType.XML_NAME, required = true, nillable = true) |
public PatternSetType filter; |
/** |
* Pattern of files to exclude. |
*/ |
@XmlElement(name = "excludes", required = false, nillable = true, defaultValue = "") |
public String excludes = ""; |
/** |
* Case sensitivity for include/ exclude patterns. |
*/ |
@XmlElement(name = "casesensitive", required = true, nillable = false, defaultValue = "true") |
public boolean casesensitive = true; |
/** |
* Get Ant FileSet for this file set. |
* |
* @param p Ant project |
* @return Ant FileSet for this file set. |
*/ |
public FileSet getAntResource(Project p) { |
FileSet set = null; |
switch (type) { |
case ZIP: |
ZipFileSet zset = new ZipFileSet(); |
zset.setSrc(new File(source)); |
zset.setEncoding(System.getProperty("file.encoding")); |
set = zset; |
break; |
case TAR: |
TarFileSet tset = new TarFileSet(); |
tset.setSrc(new File(source)); |
set = tset; |
break; |
case GZTAR: |
Resource res = new FileResource(FileResource.Type.GZIP, source).getAntResource(p); |
TarFileSet gzset = new TarFileSet(); |
gzset.setSrcResource(res); |
set = gzset; |
break; |
default: //FILES |
set = new FileSet(); |
set.setDir(new File(source)); |
} |
set.setProject(p); |
//set.setIncludes(includes); |
set.setExcludes(excludes); |
set.setCaseSensitive(casesensitive); |
return set; |
} |
/** |
* File set types. |
*/ |
@XmlEnum() |
@XmlType(name="resourcetype") |
public enum FileSetType { |
/** |
* Set of files (this is based on a directory, so provide a path only |
* as file set source). |
*/ |
FILES, |
/** |
* Set of files inside a ZIP archive. |
*/ |
ZIP, |
/** |
* Set of files inside a TAR archive (without compression). |
*/ |
TAR, |
/** |
* Set of files inside a gzip compressed TAR archive. |
*/ |
GZTAR |
} |
} |
/xservices/trunk/src/java/net/brutex/xservices/types/ant/SelectorTypeInterface.java |
---|
0,0 → 1,27 |
/* |
* Copyright 2011 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.ant; |
import org.apache.tools.ant.types.selectors.FileSelector; |
/** |
* |
* @author Brian Rosenberger |
*/ |
public interface SelectorTypeInterface { |
public FileSelector getSelector(); |
} |
/xservices/trunk/src/java/net/brutex/xservices/types/ant/ResourceSetInterface.java |
---|
0,0 → 1,35 |
/* |
* Copyright 2011 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. |
*/ |
/** |
* Wrapper for Ant Resource Sets. A resource set |
* is simply a collection of resources. |
* |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
package net.brutex.xservices.types.ant; |
import org.apache.tools.ant.Project; |
import org.apache.tools.ant.types.ResourceCollection; |
/** |
* Wrapper for Ant Resource Collection. |
* |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
public interface ResourceSetInterface { |
public ResourceCollection getAntResource(Project p); |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/ant/AntProperty.java |
---|
0,0 → 1,75 |
/* |
* 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.ant; |
import java.util.ArrayList; |
import java.util.List; |
import java.util.Map; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlRootElement; |
/** |
* Generic key/ value pairs. |
* |
* @author Brian Rosenberger |
*/ |
@XmlRootElement |
public class AntProperty { |
/** |
* Key of the entry. |
*/ |
@XmlElement(required=true) |
public String name =""; |
/** |
* Value of the entry. |
*/ |
@XmlElement(required=true) |
public String value=""; |
/** |
* Converts a Map<String, String> into a list of |
* AntProperties. |
* @param map The map to convert |
* @return A list of key/value pairs |
*/ |
public static List<AntProperty> createAntPropertyList(Map<String, String> map) { |
List<AntProperty> list = new ArrayList<AntProperty>(); |
for(Map.Entry<String, String> e : map.entrySet()) { |
list.add(new AntProperty(e.getKey(), e.getValue())); |
} |
return list; |
} |
/** |
* Creates a new AntProperty. |
* @param name |
* @param value |
*/ |
public AntProperty(String name, String value) { |
this.name = name; |
this.value = value; |
} |
/** |
* Creates a new AntProperty. |
*/ |
public AntProperty() { |
} |
} |
/xservices/trunk/src/java/net/brutex/xservices/types/ant/FileResource.java |
---|
0,0 → 1,139 |
/* |
* 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.ant; |
import java.io.File; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlEnum; |
import javax.xml.bind.annotation.XmlType; |
import net.brutex.xservices.util.BrutexNamespaces; |
import org.apache.tools.ant.Project; |
import org.apache.tools.ant.types.Resource; |
import org.apache.tools.ant.types.resources.BZip2Resource; |
import org.apache.tools.ant.types.resources.GZipResource; |
import org.apache.tools.ant.types.resources.URLResource; |
/** |
* File based resource declaration. |
* |
* |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
@XmlType(name="FileResourceType", namespace=BrutexNamespaces.WS_XSERVICES) |
public class FileResource |
implements ResourceInterface { |
public static final String XML_NAME = "file"; |
/** |
* File resource type. |
*/ |
@XmlElement(defaultValue = "FILE", nillable = false, required = true) |
public Type type = Type.FILE; |
/** |
* URI to file. |
* |
* Examples:<br> |
* <code>c:/path/to/myfile.txt<br> |
* /usr/share/file<br> |
* http://server/path/file.zip</code> |
*/ |
@XmlElement(nillable = false, required = true) |
public String uri; |
/** |
* File resource type. |
* |
* Defines the wrapper around the source. |
*/ |
@XmlEnum(value=String.class) |
public enum Type { |
/** |
* Plain file from OS accessible file system. |
*/ |
FILE, |
/** |
* File from URL (http, https, ftp, ...) |
*/ |
URL, |
/** |
* File from file system with on-the-fly GZIP decompression |
*/ |
GZIP, |
/** |
* File from file system with on-the-fly BZIP2 decompression |
*/ |
BZIP2 |
} |
/** |
* Creates a FileResource. |
* |
* @param type file resource type |
* @param uri file resource uri |
*/ |
public FileResource(Type type, String uri) { |
this.type = type; |
this.uri = uri; |
} |
/** |
* Create an empty FileResource |
*/ |
public FileResource() { |
} |
/** |
* Get Apache Ant Resource type. |
* |
* @param p Ant project |
* @return This FileResource as Ant Resource |
*/ |
public Resource getAntResource(Project p) { |
Resource res = null; |
switch (type) { |
case URL: |
URLResource ures = new URLResource(uri); |
res = ures; |
break; |
case GZIP: |
GZipResource gres = new GZipResource( |
new org.apache.tools.ant.types.resources.FileResource(new File(uri))); |
res = gres; |
break; |
case BZIP2: |
BZip2Resource bres = new BZip2Resource( |
new org.apache.tools.ant.types.resources.FileResource(new File(uri))); |
res = bres; |
break; |
default: |
//Default is Type FILE |
res = new org.apache.tools.ant.types.resources.FileResource(new File(uri)); |
} |
res.setProject(p); |
return res; |
} |
} |
/xservices/trunk/src/java/net/brutex/xservices/types/ant/PatternElement.java |
---|
0,0 → 1,31 |
/* |
* Copyright 2011 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.ant; |
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/ant/ResourceInterface.java |
---|
0,0 → 1,37 |
/* |
* 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.ant; |
import org.apache.tools.ant.Project; |
import org.apache.tools.ant.types.Resource; |
/** |
* Wrapper for a single file like Ant Resources. |
* |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
public interface ResourceInterface { |
/** |
* Get this resource as Ant Resource. |
* |
* @param p Ant project |
* @return this resource as Ant Resource |
*/ |
Resource getAntResource(Project p); |
} |
/xservices/trunk/src/java/net/brutex/xservices/types/ant/ArchiveResource.java |
---|
0,0 → 1,123 |
/* |
* 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.ant; |
import java.io.File; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlEnum; |
import javax.xml.bind.annotation.XmlType; |
import net.brutex.xservices.util.BrutexNamespaces; |
import org.apache.tools.ant.Project; |
import org.apache.tools.ant.types.Resource; |
import org.apache.tools.ant.types.resources.TarResource; |
import org.apache.tools.ant.types.resources.ZipResource; |
import org.apache.tools.tar.TarEntry; |
import org.apache.tools.zip.ZipEntry; |
/** |
* Resource from archive declaration. |
* |
* Defines a resource within an archive. |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
@XmlType(namespace = BrutexNamespaces.WS_XSERVICES, name="ArchiveResourceType") |
public class ArchiveResource |
implements ResourceInterface { |
/** |
* Archive Type. |
*/ |
@XmlElement(defaultValue = "ZIP", nillable = false, required = true) |
public ArchiveType type = ArchiveType.ZIP; |
/** |
* Archive file. |
* |
* Path and filename of the archive to use. |
*/ |
@XmlElement(nillable = false, required = true) |
public String archive; |
/** |
* URI within the archive. |
* |
* This is usually a filename or a path/filename combination. Relative paths |
* are based from the archive root. It depends on how the archive has been |
* created whether or not it is possible to use relative paths, absolute |
* paths are required otherwise. Uses "/" as separator. |
*/ |
@XmlElement(nillable = false, required = true) |
public String uri; |
/** |
* Supported archive types. |
*/ |
@XmlEnum(value=String.class) |
public enum ArchiveType { |
/** |
* Zip archive type. |
*/ |
ZIP, |
/** |
* Tar archive type, without compression |
*/ |
TAR, |
/** |
* Tar archive type, with GZIP compression |
*/ |
GZTAR |
} |
/** |
* Get Apache Ant Resource Type. |
* |
* @param p Ant project |
* @return this ArchiveResource as Ant Resource |
*/ |
public Resource getAntResource(Project p) { |
Resource res = null; |
switch (type) { |
case TAR: |
TarEntry tarentry = new TarEntry(uri); |
TarResource tres = new TarResource(new File(archive), tarentry); |
res = tres; |
break; |
case GZTAR: |
TarResource gres = new TarResource(new org.apache.tools.ant.types.resources.GZipResource( |
new org.apache.tools.ant.types.resources.FileResource( |
new File(archive))), new TarEntry(uri)); |
res = gres; |
break; |
default: //This is type ZIP also |
ZipEntry zipentry = new ZipEntry(uri); |
if (zipentry.getTime() == -1) { |
zipentry.setTime(System.currentTimeMillis()); |
} |
res = new ZipResource(new File(archive), null, zipentry); |
break; |
} |
res.setProject(p); |
return res; |
} |
} |
/xservices/trunk/src/java/net/brutex/xservices/types/ant/AttachmentType.java |
---|
0,0 → 1,69 |
/* |
* Copyright 2011 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.ant; |
import java.io.File; |
import java.io.IOException; |
import javax.activation.DataHandler; |
import javax.xml.bind.annotation.XmlMimeType; |
import net.brutex.xservices.util.BrutexNamespaces; |
import org.apache.cxf.aegis.type.java5.XmlElement; |
import org.apache.cxf.aegis.type.java5.XmlType; |
/** |
* Represents a single file based attachment type. |
* @author Brian Rosenberger, bru@brutex.de |
* @since 0.4.0 |
*/ |
@XmlType(name=AttachmentType.XML_NAME, namespace=BrutexNamespaces.WS_XSERVICES) |
public class AttachmentType { |
public static final String XML_NAME="attachment"; |
private DataHandler content; |
private String filename = null; |
@XmlMimeType("application/octet-stream") |
@XmlElement(minOccurs="1") |
public void setContent(DataHandler content) { |
this.content = content; |
} |
public DataHandler getContent() { |
return content; |
} |
public String getFilename() { |
if(filename==null || filename.equals("")) { |
try { |
filename = File.createTempFile("XServices_", ".tmp").getPath(); |
} catch (IOException e) { |
// TODO Auto-generated catch block |
e.printStackTrace(); |
} |
} |
return filename; |
} |
public void setFilename(String filename) { |
this.filename = filename; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/ant/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.ant; |
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/types/ant/CollectionType.java |
---|
0,0 → 1,84 |
/* |
* 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.ant; |
import java.util.UUID; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlType; |
/** |
* Defines a collection of storable objects. |
* |
* @author Brian Rosenberger |
* @since 1.0 |
*/ |
@XmlType() |
public class CollectionType { |
private String name=""; |
final private UUID uuid; |
/** |
* @return the name |
*/ |
public String getName() { |
return name; |
} |
/** |
* @param name the name to set |
*/ |
@XmlElement(required=true) |
public void setName(String name) { |
this.name = name; |
} |
/** |
* @return |
*/ |
public String getUuid() { |
return uuid.toString(); |
} |
/** |
* @param name |
* @param uuid |
*/ |
public CollectionType(String name, UUID uuid) { |
this.name = name; |
this.uuid = uuid; |
} |
/** |
* @param name |
* @param uuid |
*/ |
public CollectionType(String name) { |
this.name = name; |
this.uuid = UUID.randomUUID(); |
} |
/** |
*/ |
public CollectionType() { |
this.name = ""; |
this.uuid = UUID.randomUUID(); |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/scm/FileType.java |
---|
0,0 → 1,160 |
/* |
* Copyright 2012 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.scm; |
import java.io.File; |
import java.util.ArrayList; |
import java.util.List; |
import javax.xml.bind.annotation.XmlAccessType; |
import javax.xml.bind.annotation.XmlAccessorType; |
import javax.xml.bind.annotation.XmlRootElement; |
import javax.xml.bind.annotation.XmlType; |
/** |
* @author Brian Rosenberger, bru(at)brutex.de |
* @since 0.5.0-20120817 |
*/ |
@XmlAccessorType(XmlAccessType.FIELD) |
@XmlType(propOrder={"localFilename", "repositoryFilename", "description", "headRevision", "branch", "totalRevisions", "revisions"}) |
@XmlRootElement |
public class FileType { |
String localFilename; |
String repositoryFilename; |
String description; |
String headRevision; |
String branch; |
String totalRevisions; |
final List<Revision> revisions = new ArrayList<Revision>(); |
/** |
* @return the revisions |
*/ |
public List<Revision> getRevisions() { |
return revisions; |
} |
public void addRevision(Revision revision) { |
this.revisions.add(revision); |
} |
/** |
* @return the totalRevisions |
*/ |
public String getTotalRevisions() { |
return totalRevisions; |
} |
/** |
* @param totalRevisions the totalRevisions to set |
*/ |
public void setTotalRevisions(String totalRevisions) { |
this.totalRevisions = totalRevisions; |
} |
public FileType() { |
} |
public FileType(File file, String repositoryname, String description) { |
if(file!= null ) { |
this.localFilename = file.toURI().toString(); |
} else { |
localFilename = ""; |
} |
this.repositoryFilename = repositoryname; |
this.description = description; |
} |
/** |
* @return the localFilename |
*/ |
public String getLocalFilename() { |
return localFilename; |
} |
/** |
* @param localFilename the localFilename to set |
*/ |
public void setLocalFilename(String localFilename) { |
this.localFilename = localFilename; |
} |
/** |
* @return the repositoryFilename |
*/ |
public String getRepositoryFilename() { |
return repositoryFilename; |
} |
/** |
* @param repositoryFilename the repositoryFilename to set |
*/ |
public void setRepositoryFilename(String repositoryFilename) { |
this.repositoryFilename = repositoryFilename; |
} |
/** |
* @return the description |
*/ |
public String getDescription() { |
return description; |
} |
/** |
* @param description the description to set |
*/ |
public void setDescription(String description) { |
this.description = description; |
} |
/** |
* @return the headRevision |
*/ |
public String getHeadRevision() { |
return headRevision; |
} |
/** |
* @param headRevision the headRevision to set |
*/ |
public void setHeadRevision(String headRevision) { |
this.headRevision = headRevision; |
} |
/** |
* @return the branch |
*/ |
public String getBranch() { |
return branch; |
} |
/** |
* @param branch the branch to set |
*/ |
public void setBranch(String branch) { |
this.branch = branch; |
} |
public void clearRevisionList() { |
this.revisions.clear(); |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/scm/ModuleType.java |
---|
0,0 → 1,123 |
/* |
* Copyright 2012 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.scm; |
import javax.xml.bind.annotation.XmlRootElement; |
import javax.xml.bind.annotation.XmlType; |
@XmlType(propOrder={"name", "status", "description", "path", "type", "revision"}) |
@XmlRootElement |
public class ModuleType { |
String name; |
String revision; |
String status; |
String description; |
String path; |
String type; |
public ModuleType(String name, String status, String path, String type) { |
this.name = name; |
this.status = status; |
this.description = ""; |
this.revision = ""; |
this.path = "/" + path; |
this.type = type; |
} |
public ModuleType() { |
//JAXB |
} |
/** |
* @return the name |
*/ |
public String getName() { |
return name; |
} |
/** |
* @param name the name to set |
*/ |
public void setName(String name) { |
this.name = name; |
} |
/** |
* @return the revision |
*/ |
public String getRevision() { |
return revision; |
} |
/** |
* @param revision the revision to set |
*/ |
public void setRevision(String revision) { |
this.revision = revision; |
} |
/** |
* @return the status |
*/ |
public String getStatus() { |
return status; |
} |
/** |
* @param status the status to set |
*/ |
public void setStatus(String status) { |
this.status = status; |
} |
/** |
* @return the description |
*/ |
public String getDescription() { |
return description; |
} |
/** |
* @param description the description to set |
*/ |
public void setDescription(String description) { |
this.description = description; |
} |
/** |
* @return the path |
*/ |
public String getPath() { |
return path; |
} |
/** |
* @param path the path to set |
*/ |
public void setPath(String path) { |
this.path = path; |
} |
/** |
* @return the type |
*/ |
public String getType() { |
return type; |
} |
/** |
* @param type the type to set |
*/ |
public void setType(String type) { |
this.type = type; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/scm/Tag.java |
---|
0,0 → 1,75 |
/* |
* Copyright 2012 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.scm; |
import javax.xml.bind.annotation.XmlRootElement; |
import javax.xml.bind.annotation.XmlType; |
/** |
* @author Brian Rosenberger, bru(at)brutex.de |
* @since 0.5.0-20120817 |
* |
*/ |
@XmlType(name="TagType", propOrder={"name", "comment"}) |
@XmlRootElement |
public class Tag { |
private String name; |
private String comment; |
public Tag() { |
} |
/** |
* @param name |
* @param comment |
*/ |
public Tag(String name, String comment) { |
super(); |
this.name = name; |
this.comment = comment; |
} |
/** |
* @param name the name to set |
*/ |
public void setName(String name) { |
this.name = name; |
} |
/** |
* @param comment the comment to set |
*/ |
public void setComment(String comment) { |
this.comment = comment; |
} |
/* (non-Javadoc) |
* @see net.brutex.xservices.types.scm.SCTag#getName() |
*/ |
public String getName() { |
return name; |
} |
/* (non-Javadoc) |
* @see net.brutex.xservices.types.scm.SCTag#getComment() |
*/ |
public String getComment() { |
return comment; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/scm/Revision.java |
---|
0,0 → 1,78 |
/* |
* Copyright 2012 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.scm; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlRootElement; |
import javax.xml.bind.annotation.XmlType; |
/** |
* @author Brian Rosenberger, bru(at)brutex.de |
* @since 0.5.0-20120817 |
* |
*/ |
@XmlType(name="RevisionType", propOrder={"revision", "comment"}) |
@XmlRootElement |
public class Revision { |
private String revision; |
private String comment; |
public Revision() { |
} |
public Revision(String revision, String comment) { |
super(); |
this.revision = revision; |
this.comment = comment; |
} |
/* (non-Javadoc) |
* @see net.brutex.xservices.types.scm.SCRevision#getRevision() |
*/ |
@XmlElement(required=true, nillable=false) |
public String getRevision() { |
return revision; |
} |
/* (non-Javadoc) |
* @see net.brutex.xservices.types.scm.SCRevision#getComment() |
*/ |
@XmlElement(required=false, nillable=true) |
public String getComment() { |
return comment; |
} |
/** |
* @param revision the revision to set |
*/ |
public void setRevision(String revision) { |
this.revision = revision; |
} |
/** |
* @param comment the comment to set |
*/ |
public void setComment(String comment) { |
this.comment = comment; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/StringMatchType.java |
---|
0,0 → 1,50 |
/* |
* Copyright 2012 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.math.BigInteger; |
import java.util.ArrayList; |
import java.util.List; |
import javax.xml.bind.annotation.XmlType; |
import com.sun.xml.txw2.annotation.XmlElement; |
/** |
* |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
@XmlType |
public class StringMatchType { |
public final List<StringMatchDetails> stringlist = new ArrayList<StringMatchDetails>(); |
public int size=0; |
public StringMatchType() {} |
public synchronized void addStringMatch(StringMatchDetails match) { |
this.stringlist.add(match); |
this.size++; |
} |
public synchronized void addStringMatch(long start, long end, String content) { |
StringMatchDetails details = new StringMatchDetails(start, end, content); |
this.addStringMatch( details ); |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/StringMatchDetails.java |
---|
0,0 → 1,32 |
/* |
* Copyright 2012 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; |
public class StringMatchDetails { |
public long startPosition; |
public long endPosition; |
public String content; |
public StringMatchDetails() { |
} |
public StringMatchDetails(long start, long end, String content) { |
this.startPosition = start; |
this.endPosition = end; |
this.content = content; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/FileInfoListType.java |
---|
0,0 → 1,47 |
package net.brutex.xservices.types; |
import java.io.File; |
import java.io.FileFilter; |
import java.util.ArrayList; |
import java.util.List; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlRootElement; |
@XmlRootElement |
public class FileInfoListType { |
private List<FileInfoType> list = new ArrayList<FileInfoType>(); |
public void setDirectory(File dir, final boolean withDirectories, final boolean withFiles, int depth) { |
if(depth <=0) return; |
File[] files = dir.listFiles(new FileFilter() { |
public boolean accept(File pathname) { |
if(!withFiles && !pathname.isFile()) return false; |
return true; |
} |
}); |
if(files==null) return; |
for( File e : files) { |
if(e.isDirectory()) setDirectory(e, withDirectories, withFiles, depth-1); |
if( (withDirectories && e.isDirectory()) |
|| withFiles && e.isFile()) { |
this.list.add(new FileInfoType(e)); |
} |
} |
} |
public void setDirectory(String dir, final boolean withDirectories, final boolean withFiles, int depth) { |
setDirectory( (new File(dir)), withDirectories, withFiles, depth); |
} |
@XmlElement(name="FileInfoList") |
public List<FileInfoType> getFiles() { |
return list; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/FileInfoType.java |
---|
0,0 → 1,91 |
package net.brutex.xservices.types; |
import java.io.File; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlRootElement; |
import javax.xml.bind.annotation.XmlType; |
@XmlRootElement |
public class FileInfoType { |
private String name; |
private String path; |
private long filesize; |
private boolean canWrite; |
private boolean isDirectory; |
public FileInfoType() { |
} |
public FileInfoType(File file) { |
this.name = file.getName(); |
this.path = file.getAbsolutePath().replace('\\', '/'); |
this.canWrite = file.canWrite(); |
this.filesize = file.length(); |
this.isDirectory = file.isDirectory(); } |
/** |
* @return the name |
*/ |
@XmlElement(name="name") |
public String getName() { |
return name; |
} |
/** |
* @param name the name to set |
*/ |
public void setName(String name) { |
this.name = name; |
} |
/** |
* @return the path |
*/ |
@XmlElement(name="path") |
public String getPath() { |
return path; |
} |
/** |
* @param path the path to set |
*/ |
public void setPath(String path) { |
this.path = path; |
} |
/** |
* @return the filesize |
*/ |
@XmlElement(name="size") |
public long getFilesize() { |
return filesize; |
} |
/** |
* @param filesize the filesize to set |
*/ |
public void setFilesize(long filesize) { |
this.filesize = filesize; |
} |
/** |
* @return the canWrite |
*/ |
@XmlElement(name="isWritable") |
public boolean isCanWrite() { |
return canWrite; |
} |
/** |
* @return the isDirectory |
*/ |
@XmlElement(name="isDirectory") |
public boolean isDirectory() { |
return isDirectory; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/RuntimeInfoType.java |
---|
0,0 → 1,63 |
/* |
* Copyright 2012 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; |
/* |
* Information about processors and memory |
*/ |
public class RuntimeInfoType { |
private final Runtime runtime = Runtime.getRuntime(); |
@XmlElement |
public int getAvailableProcessors() { |
return runtime.availableProcessors(); |
} |
@XmlElement |
public long getFreeMemory() { |
return runtime.freeMemory(); |
} |
@XmlElement |
public long getFreeMemoryMB() { |
return runtime.freeMemory() / 1024; |
} |
@XmlElement |
public long getMaxMemory() { |
return runtime.maxMemory(); |
} |
@XmlElement |
public long getMaxMemoryMB() { |
return runtime.maxMemory() / 1024; |
} |
@XmlElement |
public long getTotalMemory() { |
return runtime.totalMemory(); |
} |
@XmlElement |
public long getTotalMemoryMB() { |
return runtime.totalMemory() / 1024; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/SchedulerStatisticsType.java |
---|
0,0 → 1,50 |
/* |
* Copyright 2012 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.Date; |
import java.util.GregorianCalendar; |
import java.util.List; |
import java.util.TimeZone; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlList; |
import javax.xml.bind.annotation.XmlType; |
import org.quartz.Scheduler; |
import org.quartz.SchedulerException; |
import org.quartz.core.QuartzScheduler; |
@XmlType |
public class SchedulerStatisticsType { |
private final Scheduler scheduler; |
public SchedulerStatisticsType() { |
scheduler = null; |
} |
public SchedulerStatisticsType(Scheduler scheduler2) { |
this.scheduler = scheduler2; |
} |
@XmlList |
public List<String> getCalendarNames() throws SchedulerException { |
return scheduler.getCalendarNames(); |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/StringReplaceType.java |
---|
0,0 → 1,37 |
/* |
* Copyright 2012 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.XmlType; |
/** |
* |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
@XmlType |
public class StringReplaceType { |
public String string; |
public int count; |
public StringReplaceType() {} |
public StringReplaceType(String string, int count) { |
this(); |
this.string = string; |
this.count = count; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/DateTimeUnits.java |
---|
0,0 → 1,74 |
/* |
* Copyright 2011 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.XmlEnum; |
import javax.xml.bind.annotation.XmlEnumValue; |
/** |
* Different pre-defined date formats. |
* |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
@XmlEnum(value = String.class) |
public enum DateTimeUnits { |
/** |
* milliseconds |
*/ |
@XmlEnumValue("milliseconds") |
MILLISECONDS("milliseconds"), |
/** |
* seconds |
*/ |
@XmlEnumValue("seconds") |
SECONDS("seconds"), |
/** |
* minutes |
*/ |
@XmlEnumValue("minutes") |
MINUTES("minutes"), |
/** |
* hours |
*/ |
@XmlEnumValue("hours") |
HOURS("hours"), |
/** |
* days |
*/ |
@XmlEnumValue("days") |
DAYS("days"), |
@XmlEnumValue("years") |
YEARS("years"); |
private String value; |
DateTimeUnits(String value) { |
this.value = value; |
} |
/** |
* Return the value of the enum. |
* @return String representation of the mime type |
*/ |
public String value() { |
return value; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/DateFormatType.java |
---|
0,0 → 1,111 |
/* |
* Copyright 2011 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.text.ParseException; |
import java.text.SimpleDateFormat; |
import java.util.Date; |
import java.util.Locale; |
import java.util.TimeZone; |
import javax.xml.bind.annotation.XmlEnum; |
import javax.xml.bind.annotation.XmlEnumValue; |
import javax.xml.bind.annotation.XmlType; |
import net.brutex.xservices.util.BrutexNamespaces; |
/** |
* Different pre-defined date formats. |
* |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
@XmlEnum() |
public enum DateFormatType { |
/** |
* ISO 8601 format (2011-05-24T14:39+01:00) |
*/ |
@XmlEnumValue("ISO 8601") |
ISO8601("ISO 8601", "yyyy-MM-dd'T'HH:mm:ss.SSSZ"), |
/** |
* RFC822 format (2011-05-24T14:39+0100) |
*/ |
@XmlEnumValue("RFC 822") |
RFC822("RFC 822", "yyyy-MM-dd'T'HH:mm:ss.SSSZ"), |
/** |
* yyyy/mm/dd |
*/ |
@XmlEnumValue("DateOnly-slashed") |
YYYYMMDD("DateOnly-slashed", "yyyy/MM/dd"), |
/** |
* dd.mm.yyyy |
*/ |
@XmlEnumValue("DateOnly-dotted") |
DDMMYYYY("DateOnly-dotted", "dd.MM.yyyy"), |
/** |
* dd.mm.yyyy |
*/ |
@XmlEnumValue("DateOnly-dashed") |
DDMMYYYYdashed("DateOnly-dashed", "dd-MM-yyyy"); |
private String value; |
private String format; |
DateFormatType(String value, String format) { |
this.value = value; |
this.format = format; |
} |
/** |
* Return the value of the enum. |
* @return String representation of the mime type |
*/ |
public String value() { |
return value; |
} |
public String format(Date date, Locale locale, TimeZone timezone) { |
if(date==null) return ""; |
if(locale==null) locale = Locale.getDefault(); |
if(timezone==null) timezone = TimeZone.getDefault(); |
String result = ""; |
SimpleDateFormat f; |
if(this.equals(ISO8601)) { |
//apply ISO8061 hack |
f = new SimpleDateFormat(RFC822.format, locale); |
f.setTimeZone(timezone); |
result = f.format(date); |
result = result.substring(0, 26) + ":" + result.substring(26); |
} else { |
f = new SimpleDateFormat(this.format, locale); |
f.setTimeZone(timezone); |
result = f.format(date); |
} |
return result; |
} |
public Date parse(String s, Locale locale, TimeZone timezone) |
throws ParseException { |
if(locale==null) locale = Locale.getDefault(); |
if(timezone==null) timezone = TimeZone.getDefault(); |
SimpleDateFormat fin = new SimpleDateFormat(this.format, locale); |
fin.setTimeZone(timezone); |
Date date = fin.parse(s); |
return date; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/DateInfoType.java |
---|
0,0 → 1,96 |
/* |
* Copyright 2012 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.text.SimpleDateFormat; |
import java.util.Date; |
import java.util.GregorianCalendar; |
import java.util.TimeZone; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlType; |
import net.brutex.xservices.util.BrutexNamespaces; |
/** |
* Date object representation with different formats |
* |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
@XmlType(name=DateInfoType.XML_NAME, namespace=BrutexNamespaces.WS_XSERVICES, |
propOrder={"isoDate","rfcDate", "millis"}) |
public class DateInfoType { |
public static final String XML_NAME="DateInfoType"; |
private final GregorianCalendar date; |
private final TimeZone zone; |
/** |
* Create a new DateInfoType |
* @param date date/time |
*/ |
public DateInfoType(GregorianCalendar date, TimeZone zone) { |
this.date = date; |
this.zone = zone; |
} |
/** |
* Create a new DateInfoType with current date/time |
*/ |
public DateInfoType() { |
this.zone = TimeZone.getDefault(); |
this.date = new GregorianCalendar(zone); |
} |
/** |
* @return milliseconds since 01.01.1970 |
*/ |
@XmlElement(name="timestamp") |
public long getMillis() { |
return date.getTimeInMillis(); |
} |
/** |
* Get date formated according to ISO8601 (done by jaxb->xsd:datetime conversion) |
* @return date |
*/ |
@XmlElement(name="iso8601date") |
public Date getIsoDate() { |
//String format = DateFormatType.ISO8601.format(); |
//SimpleDateFormat f = new SimpleDateFormat(format); |
//String text = f.format(date.getTime()); |
//Fix missing colon in java timezone |
//return text.substring(0, 22) + ":" + text.substring(22); |
return date.getTime(); |
} |
/** |
* Get date formated according to RFC822 (also java standard) |
* @return date string |
*/ |
@XmlElement(name="rfc822date") |
public String getRfcDate() { |
return DateFormatType.RFC822.format(date.getTime(), null, null); |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/DateInfoExtendedType.java |
---|
0,0 → 1,69 |
/* |
* Copyright 2011 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.text.SimpleDateFormat; |
import java.util.GregorianCalendar; |
import java.util.TimeZone; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlType; |
import net.brutex.xservices.util.BrutexNamespaces; |
/** |
* @author Brian Rosenberger |
* |
*/ |
@XmlType(namespace=BrutexNamespaces.WS_XSERVICES) |
public class DateInfoExtendedType extends DateInfoType { |
private GregorianCalendar date = null; |
private TimeZone zone = null; |
@SuppressWarnings("unused") |
public DateInfoExtendedType() { |
super(); |
} |
public DateInfoExtendedType(GregorianCalendar date, TimeZone zone) { |
this.date = date; |
this.zone = zone; |
} |
@XmlElement(name = "format1") |
public String getFormat1() { |
return DateFormatType.DDMMYYYY.format(date.getTime(), null, null); |
} |
/** |
* @return |
*/ |
@XmlElement(name = "format2") |
public String getFormat2() { |
return DateFormatType.YYYYMMDD.format(date.getTime(), null, null); |
} |
@XmlElement(name = "format3") |
public String getFormat3() { |
String format = "HH:mm:ss"; |
SimpleDateFormat f = new SimpleDateFormat(format); |
return f.format(date.getTime()); |
} |
// yyyy-MM-dd'T'HH:mm:ssZ |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/TimeZoneType.java |
---|
0,0 → 1,81 |
/* |
* Copyright 2012 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.TimeZone; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlType; |
import net.brutex.xservices.util.BrutexNamespaces; |
/** |
* Different pre-defined date formats. |
* |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
@XmlType(name=TimeZoneType.XML_NAME, namespace=BrutexNamespaces.WS_XSERVICES) |
public class TimeZoneType { |
public static final String XML_NAME = "timezone"; |
private String id; |
private String displayname; |
private TimeZone timezone; |
private long offset; |
public TimeZoneType(TimeZone timezone) { |
this.timezone = timezone; |
this.id = timezone.getID(); |
this.displayname = timezone.getDisplayName(); |
this.offset = timezone.getRawOffset()/1000; |
} |
public TimeZoneType() { |
this(TimeZone.getDefault()); |
} |
/** |
* @return the id |
*/ |
@XmlElement |
public String getId() { |
return id; |
} |
/** |
* @return the displayname |
*/ |
@XmlElement |
public String getDisplayname() { |
return displayname; |
} |
/** |
* @return the timezone |
*/ |
public TimeZone getTimezone() { |
return timezone; |
} |
/** |
* @return the offset |
*/ |
@XmlElement |
public long getOffset() { |
return offset; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/ReturnCode.java |
---|
0,0 → 1,100 |
/* |
* 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 javax.xml.bind.annotation.XmlType; |
import net.brutex.xservices.types.ant.AntProperty; |
import net.brutex.xservices.util.BrutexNamespaces; |
/** |
* |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
@XmlType(namespace=BrutexNamespaces.WS_XSERVICES, name="ReturnCodeType") |
public class ReturnCode { |
/** |
* Numeric return code. |
* |
* The numeric return code of the last operation on the underlying operation |
* systen (OS). In general the return code indicates the failure or success |
* of a command. Which value indicates success is dependent on the OS, most |
* linux based systems use "0" for success. |
*/ |
@XmlElement(required=true, nillable=false) |
public int returnCode=0; |
/** |
* Standard Out as provided by the OS. |
* |
* The stdOut given by the last operation (if any). |
*/ |
@XmlElement(name="stdOut", nillable=false) |
public String stdOut=""; |
/** |
* The Standard Error as provided by the OS. |
* |
* The stdErr given by the last operation (if any). The presents of any |
* value here ususally indicates that a failure has occured. |
*/ |
@XmlElement(name="stdErr", nillable=false) |
public String stdErr=""; |
@XmlElement(name="propertyList", nillable=true) |
public List<AntProperty> property = null; |
/** |
* Create a new ReturnCode default constructor. |
*/ |
public ReturnCode() { |
} |
/** |
* Create a new ReturnCode. |
* |
* @param returnCode return code integer value |
* @param stdOut standard out string |
* @param stdErr standard error string |
*/ |
public ReturnCode(int returnCode, String stdOut, String stdErr, List<AntProperty> props) { |
this.returnCode = returnCode; |
this.stdOut = stdOut; |
this.stdErr = stdErr; |
this.property = props; |
} |
/** |
* @param key |
* @return |
*/ |
public String getProperty(String key) { |
for(AntProperty prop : this.property) { |
if(key.equals(prop.name)) return prop.value; |
} |
return null; |
} |
/** |
* @return |
*/ |
public String getStdOut() { return this.stdOut; } |
} |
/xservices/trunk/src/java/net/brutex/xservices/types/TargetNodeType.java |
---|
0,0 → 1,60 |
/* |
* Copyright 2012 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 net.brutex.xservices.util.BrutexNamespaces; |
/** |
* Defines target nodes. |
* |
* @author Brian Rosenberger |
* @since 1.0 |
*/ |
@XmlType(name=TargetNodeType.XML_NAME, namespace=BrutexNamespaces.WS_XSERVICES) |
public class TargetNodeType { |
public static final String XML_NAME = "targetnode"; |
private String name=""; |
/** |
* @return the name |
*/ |
public String getName() { |
return name; |
} |
/** |
* @param name the name to set |
*/ |
@XmlElement(required=true) |
public void setName(String name) { |
this.name = name; |
} |
/** |
* |
*/ |
public TargetNodeType() { |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/HostinfoType.java |
---|
0,0 → 1,118 |
/* |
* Copyright 2012 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 net.brutex.xservices.util.BrutexNamespaces; |
import org.apache.cxf.aegis.type.java5.XmlType; |
/** |
* Host information. |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
@XmlType(name=HostinfoType.XML_NAME, namespace=BrutexNamespaces.WS_XSERVICES) |
public class HostinfoType { |
public final static String XML_NAME="hostinfo"; |
private String name; |
private String domain; |
private String ip4; |
private String ip6; |
/** |
* Create a new HostinfoType. |
*/ |
public HostinfoType() { |
} |
/** |
* Create a new HostinfoType. |
* |
* @param name |
* @param domain |
* @param ip4 |
* @param ip6 |
*/ |
public HostinfoType(String name, String domain, String ip4, String ip6) { |
this.name = name; |
this.domain = domain; |
this.ip4 = ip4; |
this.ip6 = ip6; |
} |
/** |
* Get the host name. |
* |
* @return the name |
*/ |
public String getName() { |
return name; |
} |
/** |
* Set the host name. |
* |
* @param name the name to set |
*/ |
public void setName(String name) { |
this.name = name; |
} |
/** |
* Get the host domain. |
* |
* @return the domain |
*/ |
public String getDomain() { |
return domain; |
} |
/** |
* Set the host domain. |
* |
* @param domain the domain to set |
*/ |
public void setDomain(String domain) { |
this.domain = domain; |
} |
/** |
* Get the IP address version 4 representation for this host. |
* @return the ip4 |
*/ |
public String getIp4() { |
return ip4; |
} |
/** |
* Set the IP address version 4. |
* @param ip4 the ip4 to set |
*/ |
public void setIp4(String ip4) { |
this.ip4 = ip4; |
} |
/** |
* Get the IP address version 6 representation for this host. |
* @return the ip6 |
*/ |
public String getIp6() { |
return ip6; |
} |
/** |
* Set the IP address version 6 representation for this host. |
* @param ip6 the ip6 to set |
*/ |
public void setIp6(String ip6) { |
this.ip6 = ip6; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/MailMimeType.java |
---|
0,0 → 1,55 |
/* |
* 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.XmlEnum; |
import javax.xml.bind.annotation.XmlEnumValue; |
/** |
* MIME types for email messages. |
* This type restricts the mime types to be used within the |
* email body. |
* |
* @author Brian Rosenberger, bru@brutex.de |
* @since 0.4.0 |
*/ |
@XmlEnum(value = String.class) |
public enum MailMimeType { |
/** |
* Plain text. |
*/ |
@XmlEnumValue("text/plain") |
PLAIN("text/plain"), |
/** |
* HTML |
*/ |
@XmlEnumValue("text/html") |
HTML("text/html"); |
private String value; |
MailMimeType(String value) { |
this.value = value; |
} |
/** |
* Return the value of the enum. |
* @return String representation of the mime type |
*/ |
public String value() { |
return value; |
} |
} |
/xservices/trunk/src/java/net/brutex/xservices/types/ScheduledJob.java |
---|
0,0 → 1,135 |
/* |
* Copyright 2011 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.GregorianCalendar; |
import javax.xml.bind.annotation.XmlAccessType; |
import javax.xml.bind.annotation.XmlAccessorType; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlType; |
import net.brutex.xservices.util.BrutexNamespaces; |
/** |
* Scheduled job type |
* |
* @author Brian Rosenberger |
* @since 0.5.0 |
* |
*/ |
@XmlType(namespace=BrutexNamespaces.WS_XSERVICES) |
@XmlAccessorType(XmlAccessType.FIELD) |
public class ScheduledJob { |
@XmlElement(required=true,name="name") |
private String name; |
@XmlElement(required=false, name="description") |
private String description; |
@XmlElement(required=true, name="datetime") |
private GregorianCalendar date; |
@XmlElement(name="script") |
private String script; |
/** |
* Create a new scheduled job. |
* |
* @param name Job name. |
* @param datetime Scheduled date and time. |
* @param script The script to execute. |
*/ |
public ScheduledJob(String name, GregorianCalendar datetime, String script) { |
this.name = name; |
this.date = datetime; |
this.script = script; |
this.description = null; |
} |
/** |
* Create a new scheduled job. |
* |
* @param name Job name. |
* @param datetime Scheduled date and time. |
* @param script The script to execute. |
* @param description Job description. |
*/ |
public ScheduledJob(String name, GregorianCalendar datetime, String script, String description) { |
this.name = name; |
this.date = datetime; |
this.script = script; |
this.description = description; |
} |
/** |
* Create a new scheduled job. |
*/ |
public ScheduledJob() { |
this.name = null; |
this.date=null; |
this.script=null; |
} |
/** |
* Set name of the job. |
* @param name |
*/ |
public void setName(String name) { |
this.name = name; |
} |
/** |
* Get name of the job. |
* @return job name |
*/ |
public String getName() { |
return name; |
} |
/** |
* Set scheduled date. |
* @param date |
*/ |
public void setDate(GregorianCalendar date) { |
this.date = date; |
} |
/** |
* get scheduled date. |
* @return date |
*/ |
public GregorianCalendar getDate() { |
return date; |
} |
public void setScript(String script) { |
this.script = script; |
} |
public String getScript() { |
return script; |
} |
public void setDescription(String desc) { |
this.description = desc; |
} |
public String getDescription() { |
return description; |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/ReplacePattern.java |
---|
0,0 → 1,75 |
/* |
* 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.ArrayList; |
import java.util.List; |
import java.util.Map; |
import javax.xml.bind.annotation.XmlElement; |
import javax.xml.bind.annotation.XmlRootElement; |
/** |
* Generic key/ value pairs. |
* |
* @author Brian Rosenberger |
*/ |
@XmlRootElement |
public class ReplacePattern { |
/** |
* Search string. |
*/ |
@XmlElement(required=true) |
public String search =""; |
/** |
* Replace string. |
*/ |
@XmlElement(required=true) |
public String replace=""; |
/** |
* Converts a Map<String, String> into a list of |
* ReplacePattern. |
* @param map The map to convert |
* @return A list of key/value pairs |
*/ |
public static List<ReplacePattern> createAntPropertyList(Map<String, String> map) { |
List<ReplacePattern> list = new ArrayList<ReplacePattern>(); |
for(Map.Entry<String, String> e : map.entrySet()) { |
list.add(new ReplacePattern(e.getKey(), e.getValue())); |
} |
return list; |
} |
/** |
* Creates a new ReplacePattern. |
* @param name |
* @param value |
*/ |
public ReplacePattern(String search, String replace) { |
this.search = search; |
this.replace = replace; |
} |
/** |
* Creates a new ReplacePattern. |
*/ |
public ReplacePattern() { |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/HostConnection.java |
---|
0,0 → 1,44 |
/* |
* 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; |
/** |
* |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
@XmlType(name="connection") |
public class HostConnection { |
public HostConnection() { |
} |
@XmlElement(name="hostname", required=true, nillable=false) |
public String hostname; |
@XmlElement(name="port", required=false, nillable=false) |
public int port; |
@XmlElement(name="user", required=false, nillable=false) |
public String user; |
@XmlElement(name="password", required=false, nillable=false) |
public String password; |
} |
/xservices/trunk/src/java/net/brutex/xservices/types/CompressionType.java |
---|
0,0 → 1,28 |
/* |
* 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.XmlEnum; |
/** |
* |
* @author Brian Rosenberger, bru@brutex.de |
*/ |
@XmlEnum() |
public enum CompressionType { |
NONE, GZIP, BZIP2 |
} |