Subversion Repositories XServices

Rev

Rev 63 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 63 Rev 64
-
 
1
/*
-
 
2
 *   Copyright 2010 Brian Rosenberger (Brutex Network)
-
 
3
 *
-
 
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
-
 
5
 *   you may not use this file except in compliance with the License.
-
 
6
 *   You may obtain a copy of the License at
-
 
7
 *
-
 
8
 *       http://www.apache.org/licenses/LICENSE-2.0
-
 
9
 *
-
 
10
 *   Unless required by applicable law or agreed to in writing, software
-
 
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
-
 
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
13
 *   See the License for the specific language governing permissions and
-
 
14
 *   limitations under the License.
-
 
15
 */
-
 
16
 
1
package net.brutex.xservices.ws;
17
package net.brutex.xservices.ws;
2
 
18
 
3
import java.util.List;
19
import java.util.List;
4
 
-
 
5
import javax.activation.DataHandler;
20
 
6
import javax.jws.WebMethod;
21
import javax.jws.WebMethod;
7
import javax.jws.WebParam;
22
import javax.jws.WebParam;
8
import javax.jws.WebService;
23
import javax.jws.WebService;
-
 
24
import javax.xml.bind.annotation.XmlElement;
-
 
25
 
-
 
26
import org.apache.cxf.annotations.WSDLDocumentation;
-
 
27
import org.apache.cxf.annotations.WSDLDocumentationCollection;
-
 
28
 
-
 
29
import com.sun.xml.internal.ws.api.model.wsdl.WSDLDescriptorKind;
9
 
30
 
10
import net.brutex.xservices.types.ArchiveResource;
31
import net.brutex.xservices.types.ArchiveResource;
11
import net.brutex.xservices.types.AttachmentType;
32
import net.brutex.xservices.types.AttachmentType;
12
import net.brutex.xservices.types.FileResource;
33
import net.brutex.xservices.types.FileResource;
13
import net.brutex.xservices.types.FileSetResource;
34
import net.brutex.xservices.types.FileSetResource;
14
import net.brutex.xservices.types.ReplacePattern;
35
import net.brutex.xservices.types.ReplacePattern;
15
import net.brutex.xservices.types.ReturnCode;
36
import net.brutex.xservices.types.ReturnCode;
16
import net.brutex.xservices.util.BrutexNamespaces;
37
import net.brutex.xservices.util.BrutexNamespaces;
-
 
38
import net.brutex.xservices.util.XServicesDocumentation;
-
 
39
/**
-
 
40
 * @author Brian Rosenberger
-
 
41
 *
-
 
42
 */
17
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
43
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
-
 
44
@WSDLDocumentationCollection(
-
 
45
    {
-
 
46
    	@WSDLDocumentation(value = BrutexNamespaces.BRUTEX_COPYRIGHT, placement = WSDLDocumentation.Placement.TOP)
-
 
47
    }
-
 
48
)
18
public interface FileService {
49
public interface FileService {
-
 
50
 
-
 
51
	/**
-
 
52
	 * @param filename
-
 
53
	 * @param suffix
-
 
54
	 * @return The base name of the given file excluding the suffix. 
-
 
55
	 */
19
 
56
	@WSDLDocumentation(value = "The base name of the given file excluding the suffix.")
20
	@WebMethod(operationName = "basename")
57
	@WebMethod(operationName = "basename")
21
	public abstract ReturnCode basename(
58
	public abstract String basename(
22
			@WebParam(name = "file") String filename,
59
			@WebParam(name = "file") @XmlElement(required=true) String filename,
-
 
60
			@WebParam(name = "suffix") String suffix);
-
 
61
 
-
 
62
	/**
-
 
63
	 * @param res
-
 
64
	 * @return The file itself (MTOM attachment or inline base64) including some file metadata.
23
			@WebParam(name = "suffix") String suffix);
65
	 */
24
 
66
	@WSDLDocumentation(XServicesDocumentation.SERVICE_OPERATION_DOWNLOADFILE)
25
	@WebMethod(operationName = "downloadFile")
67
	@WebMethod(operationName = "downloadFile")
26
	public abstract AttachmentType downloadFile(
68
	public abstract AttachmentType downloadFile(
27
			@WebParam(name = "file") FileResource res);
69
			@WebParam(name = "file") FileResource res);
-
 
70
	
-
 
71
	/**
-
 
72
	 * @param file
-
 
73
	 * @return The file name of the file that has been uploaded.
-
 
74
	 */
28
	
75
	@WSDLDocumentation(XServicesDocumentation.SERVICE_OPERATION_UPLOADFILE)
29
	@WebMethod(operationName = "uploadFile")
76
	@WebMethod(operationName = "uploadFile")
30
	public abstract String uploadFile(
77
	public abstract String uploadFile(
31
			@WebParam(name = "file") AttachmentType file);
78
			@WebParam(name = "file") AttachmentType file);
-
 
79
			
-
 
80
	/**
-
 
81
	 * @param src
-
 
82
	 * @param todir
-
 
83
	 * @param plm
-
 
84
	 * @param overwrite
-
 
85
	 * @param encoding
-
 
86
	 * @return 
-
 
87
	 * @throws XServicesFault
-
 
88
	 */
32
			
89
	@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_COPY)
33
	@WebMethod(operationName = "copy")
90
	@WebMethod(operationName = "copy")
34
	public abstract ReturnCode copy(
91
	public abstract ReturnCode copy(
35
			@WebParam(name = "fileset") FileSetResource src,
92
			@WebParam(name = "fileset") @XmlElement(required=true) FileSetResource src,
36
			@WebParam(name = "todir") String todir,
93
			@WebParam(name = "todir") @XmlElement(required=true) String todir,
37
			@WebParam(name = "preservelastmodified") boolean plm,
94
			@WebParam(name = "preservelastmodified") boolean plm,
38
			@WebParam(name = "overwrite") boolean overwrite,
95
			@WebParam(name = "overwrite") boolean overwrite,
39
			@WebParam(name = "encoding") String encoding) throws XServicesFault;
96
			@WebParam(name = "encoding") String encoding) throws XServicesFault;
40
 
97
	
-
 
98
	/**
-
 
99
	 * @param fromFile
-
 
100
	 * @param tofile
-
 
101
	 * @param overwrite
-
 
102
	 * @return
-
 
103
	 * @throws XServicesFault
-
 
104
	 */
-
 
105
	@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_COPYFILE)
-
 
106
	@WebMethod(operationName = "copyFile")
-
 
107
	public abstract ReturnCode copyFile(
-
 
108
			@WebParam(name = "fromFile") @XmlElement(required=true) String fromFile,
-
 
109
			@WebParam(name = "toFile") @XmlElement(required=true) String tofile,
-
 
110
			@WebParam(name = "overwrite") boolean overwrite) throws XServicesFault;
-
 
111
 
-
 
112
	/**
-
 
113
	 * @param res
-
 
114
	 * @param encoding
-
 
115
	 * @return content of the resource
-
 
116
	 */
-
 
117
	@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_LOADRESOURCE)
41
	@WebMethod(operationName = "loadResource")
118
	@WebMethod(operationName = "loadResource")
42
	public abstract ReturnCode loadRes(
119
	public abstract String loadRes(
43
			@WebParam(name = "resource") FileResource res,
120
			@WebParam(name = "resource") FileResource res,
44
			@WebParam(name = "encoding") String encoding);
121
			@WebParam(name = "encoding") String encoding);
-
 
122
 
-
 
123
	/**
-
 
124
	 * @param res
-
 
125
	 * @param encoding
-
 
126
	 * @return content of the resource
-
 
127
	 */
45
 
128
	@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_LOADRESOURCEFROMARCHIVE)
46
	@WebMethod(operationName = "loadResourceFromArchive")
129
	@WebMethod(operationName = "loadResourceFromArchive")
47
	public abstract ReturnCode loadResFromArchive(
130
	public abstract String loadResFromArchive(
48
			@WebParam(name = "archiveresource") ArchiveResource res,
131
			@WebParam(name = "archiveresource") ArchiveResource res,
49
			@WebParam(name = "encoding") String encoding);
132
			@WebParam(name = "encoding") String encoding);
-
 
133
 
-
 
134
	/**
-
 
135
	 * @param message
-
 
136
	 * @param file
-
 
137
	 * @param encoding
-
 
138
	 * @param append
-
 
139
	 * @return
-
 
140
	 */
50
 
141
	@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_ECHOTOFILE)
51
	@WebMethod(operationName = "echoToFile")
142
	@WebMethod(operationName = "echoToFile")
52
	public abstract ReturnCode echo2file(
143
	public abstract ReturnCode echo2file(
53
			@WebParam(name = "message") String message,
144
			@WebParam(name = "message") @XmlElement(required=true) String message,
54
			@WebParam(name = "file") String file,
145
			@WebParam(name = "file") @XmlElement(required=true) String file,
55
			@WebParam(name = "encoding") String encoding,
146
			@WebParam(name = "encoding") String encoding,
56
			@WebParam(name = "append") boolean append);
147
			@WebParam(name = "append") boolean append);
57
 
148
 
58
	@WebMethod(operationName = "changeOwner")
149
	@WebMethod(operationName = "changeOwner")
59
	public abstract ReturnCode changeOwner(
150
	public abstract ReturnCode changeOwner(
60
			@WebParam(name = "fileset") FileSetResource res,
151
			@WebParam(name = "fileset") FileSetResource res,
61
			@WebParam(name = "owner") String owner);
152
			@WebParam(name = "owner") @XmlElement(required=true) String owner);
62
 
153
 
63
	@WebMethod(operationName = "changeGroup")
154
	@WebMethod(operationName = "changeGroup")
64
	public abstract ReturnCode changeGroup(
155
	public abstract ReturnCode changeGroup(
65
			@WebParam(name = "fileset") FileSetResource res,
156
			@WebParam(name = "fileset") FileSetResource res,
66
			@WebParam(name = "group") String group);
157
			@WebParam(name = "group") @XmlElement(required=true) String group);
67
 
158
 
68
	@WebMethod(operationName = "changeMode")
159
	@WebMethod(operationName = "changeMode")
69
	public abstract ReturnCode changeMode(
160
	public abstract ReturnCode changeMode(
70
			@WebParam(name = "fileset") FileSetResource res,
161
			@WebParam(name = "fileset") FileSetResource res,
71
			@WebParam(name = "permissions") String perm);
162
			@WebParam(name = "permissions") @XmlElement(required=true) String perm);
72
	
163
	
73
	@WebMethod(operationName = "replaceInFile")
164
	@WebMethod(operationName = "replaceInFile")
74
	public abstract ReturnCode replaceInFile(
165
	public abstract ReturnCode replaceInFile(
75
			@WebParam(name = "file") FileResource res,
166
			@WebParam(name = "file") @XmlElement(required=true) FileResource res,
76
			@WebParam(name = "search") String search,
167
			@WebParam(name = "search") @XmlElement(required=true) String search,
77
			@WebParam(name = "replace") String replace);
168
			@WebParam(name = "replace") @XmlElement(required=true) String replace);
78
	
169
	
79
	@WebMethod(operationName = "replaceInFile2")
170
	@WebMethod(operationName = "replaceInFile2")
80
	public abstract ReturnCode replaceInFile2(
171
	public abstract ReturnCode replaceInFile2(
81
			@WebParam(name = "file") FileResource res,
172
			@WebParam(name = "file") FileResource res,
82
			@WebParam(name = "patternList") List<ReplacePattern> patternList);
173
			@WebParam(name = "patternList") List<ReplacePattern> patternList);
83
	
174
	
84
	@WebMethod(operationName = "replaceInFileRegEx")
175
	@WebMethod(operationName = "replaceInFileRegEx")
85
	public abstract ReturnCode replaceInFileRegEx(
176
	public abstract ReturnCode replaceInFileRegEx(
86
			@WebParam(name = "file") FileResource res,
177
			@WebParam(name = "file") FileResource res,
87
			@WebParam(name = "search") String search,
178
			@WebParam(name = "search") String search,
88
			@WebParam(name = "replace") String replace,
179
			@WebParam(name = "replace") String replace,
89
			@WebParam(name = "flags") String flags);
180
			@WebParam(name = "flags") String flags);
90
}
181
}
91
 
182
 
92
Generated by GNU Enscript 1.6.5.90.
183
Generated by GNU Enscript 1.6.5.90.
93
 
184
 
94
 
185