Subversion Repositories XServices

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
64 brianR 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
 
46 brianR 17
package net.brutex.xservices.ws;
18
 
63 brianR 19
import java.util.List;
20
 
46 brianR 21
import javax.jws.WebMethod;
22
import javax.jws.WebParam;
23
import javax.jws.WebService;
64 brianR 24
import javax.xml.bind.annotation.XmlElement;
46 brianR 25
 
64 brianR 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;
30
 
46 brianR 31
import net.brutex.xservices.types.ArchiveResource;
54 brianR 32
import net.brutex.xservices.types.AttachmentType;
46 brianR 33
import net.brutex.xservices.types.FileResource;
34
import net.brutex.xservices.types.FileSetResource;
63 brianR 35
import net.brutex.xservices.types.ReplacePattern;
46 brianR 36
import net.brutex.xservices.types.ReturnCode;
37
import net.brutex.xservices.util.BrutexNamespaces;
64 brianR 38
import net.brutex.xservices.util.XServicesDocumentation;
39
/**
40
 * @author Brian Rosenberger
41
 *
42
 */
46 brianR 43
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
64 brianR 44
@WSDLDocumentationCollection(
45
    {
46
    	@WSDLDocumentation(value = BrutexNamespaces.BRUTEX_COPYRIGHT, placement = WSDLDocumentation.Placement.TOP)
47
    }
48
)
46 brianR 49
public interface FileService {
50
 
65 brianR 51
	public static final String OPERATION_BASENAME ="basename";
52
	public static final String OPERATION_DOWNLOADFILE ="downloadFile";
53
	public static final String OPERATION_UPLOADFILE ="uploadFile";
54
	public static final String OPERATION_COPY ="copy";
55
	public static final String OPERATION_COPYFILE ="copyFile";
56
	public static final String OPERATION_LOADRESOURCE = "loadResource";
57
	public static final String OPERATION_LOADRESOURCEFROMARCHIVE = "loadResourceFromArchive";
58
	public static final String OPERATION_ECHOTOFILE = "echoToFile";
59
	public static final String OPERATION_CHANGEOWNER = "changeOwner";
60
	public static final String OPERATION_CHANGEMODE = "changeMode";
61
	public static final String OPERATION_CHANGEGROUP = "changeGroup";
62
	public static final String OPERATION_REPLACEINFILE = "replaceInFile";
63
	public static final String OPERATION_REPLACEINFILE2 = "replaceInFile2";
64
	public static final String OPERATION_REPLACEINFILEREGEX = "replaceInFileRegEx";
65
 
64 brianR 66
	/**
67
	 * @param filename
68
	 * @param suffix
69
	 * @return The base name of the given file excluding the suffix.
70
	 */
71
	@WSDLDocumentation(value = "The base name of the given file excluding the suffix.")
65 brianR 72
	@WebMethod(operationName = OPERATION_BASENAME)
64 brianR 73
	public abstract String basename(
74
			@WebParam(name = "file") @XmlElement(required=true) String filename,
46 brianR 75
			@WebParam(name = "suffix") String suffix);
76
 
64 brianR 77
	/**
78
	 * @param res
79
	 * @return The file itself (MTOM attachment or inline base64) including some file metadata.
65 brianR 80
	 * @throws XServicesFault
64 brianR 81
	 */
82
	@WSDLDocumentation(XServicesDocumentation.SERVICE_OPERATION_DOWNLOADFILE)
65 brianR 83
	@WebMethod(operationName = OPERATION_DOWNLOADFILE)
54 brianR 84
	public abstract AttachmentType downloadFile(
65 brianR 85
			@WebParam(name = FileResource.XML_NAME) FileResource res) throws XServicesFault;
54 brianR 86
 
64 brianR 87
	/**
88
	 * @param file
89
	 * @return The file name of the file that has been uploaded.
65 brianR 90
	 * @throws XServicesFault
64 brianR 91
	 */
92
	@WSDLDocumentation(XServicesDocumentation.SERVICE_OPERATION_UPLOADFILE)
65 brianR 93
	@WebMethod(operationName = OPERATION_UPLOADFILE)
54 brianR 94
	public abstract String uploadFile(
65 brianR 95
			@WebParam(name = "file") AttachmentType file) throws XServicesFault;
54 brianR 96
 
64 brianR 97
	/**
98
	 * @param src
99
	 * @param todir
100
	 * @param plm
101
	 * @param overwrite
102
	 * @param encoding
103
	 * @return
104
	 * @throws XServicesFault
105
	 */
106
	@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_COPY)
65 brianR 107
	@WebMethod(operationName = OPERATION_COPY)
46 brianR 108
	public abstract ReturnCode copy(
65 brianR 109
			@WebParam(name =  FileSetResource.XML_NAME) @XmlElement(required=true) FileSetResource src,
64 brianR 110
			@WebParam(name = "todir") @XmlElement(required=true) String todir,
46 brianR 111
			@WebParam(name = "preservelastmodified") boolean plm,
112
			@WebParam(name = "overwrite") boolean overwrite,
113
			@WebParam(name = "encoding") String encoding) throws XServicesFault;
64 brianR 114
 
115
	/**
116
	 * @param fromFile
117
	 * @param tofile
118
	 * @param overwrite
119
	 * @return
120
	 * @throws XServicesFault
121
	 */
122
	@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_COPYFILE)
65 brianR 123
	@WebMethod(operationName = OPERATION_COPYFILE)
64 brianR 124
	public abstract ReturnCode copyFile(
125
			@WebParam(name = "fromFile") @XmlElement(required=true) String fromFile,
126
			@WebParam(name = "toFile") @XmlElement(required=true) String tofile,
127
			@WebParam(name = "overwrite") boolean overwrite) throws XServicesFault;
46 brianR 128
 
64 brianR 129
	/**
130
	 * @param res
131
	 * @param encoding
132
	 * @return content of the resource
65 brianR 133
	 * @throws XServicesFault
64 brianR 134
	 */
135
	@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_LOADRESOURCE)
65 brianR 136
	@WebMethod(operationName = OPERATION_LOADRESOURCE)
64 brianR 137
	public abstract String loadRes(
65 brianR 138
			@WebParam(name = FileResource.XML_NAME) FileResource res,
139
			@WebParam(name = "encoding") String encoding) throws XServicesFault;
46 brianR 140
 
64 brianR 141
	/**
142
	 * @param res
143
	 * @param encoding
144
	 * @return content of the resource
65 brianR 145
	 * @throws XServicesFault
64 brianR 146
	 */
147
	@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_LOADRESOURCEFROMARCHIVE)
65 brianR 148
	@WebMethod(operationName = OPERATION_LOADRESOURCEFROMARCHIVE)
64 brianR 149
	public abstract String loadResFromArchive(
46 brianR 150
			@WebParam(name = "archiveresource") ArchiveResource res,
65 brianR 151
			@WebParam(name = "encoding") String encoding) throws XServicesFault;
46 brianR 152
 
64 brianR 153
	/**
154
	 * @param message
155
	 * @param file
156
	 * @param encoding
157
	 * @param append
158
	 * @return
65 brianR 159
	 * @throws XServicesFault
64 brianR 160
	 */
161
	@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_ECHOTOFILE)
65 brianR 162
	@WebMethod(operationName = OPERATION_ECHOTOFILE)
46 brianR 163
	public abstract ReturnCode echo2file(
64 brianR 164
			@WebParam(name = "message") @XmlElement(required=true) String message,
165
			@WebParam(name = "file") @XmlElement(required=true) String file,
46 brianR 166
			@WebParam(name = "encoding") String encoding,
65 brianR 167
			@WebParam(name = "append") boolean append) throws XServicesFault;
46 brianR 168
 
65 brianR 169
	/**
170
	 * @param res
171
	 * @param owner
172
	 * @return
173
	 */
174
	@WebMethod(operationName = OPERATION_CHANGEOWNER)
46 brianR 175
	public abstract ReturnCode changeOwner(
65 brianR 176
			@WebParam(name =  FileSetResource.XML_NAME) FileSetResource res,
64 brianR 177
			@WebParam(name = "owner") @XmlElement(required=true) String owner);
46 brianR 178
 
65 brianR 179
	/**
180
	 * @param res
181
	 * @param group
182
	 * @return
183
	 */
184
	@WebMethod(operationName = OPERATION_CHANGEGROUP)
46 brianR 185
	public abstract ReturnCode changeGroup(
65 brianR 186
			@WebParam(name =  FileSetResource.XML_NAME) FileSetResource res,
64 brianR 187
			@WebParam(name = "group") @XmlElement(required=true) String group);
46 brianR 188
 
65 brianR 189
	/**
190
	 * @param res
191
	 * @param perm
192
	 * @return
193
	 */
194
	@WebMethod(operationName = OPERATION_CHANGEMODE)
46 brianR 195
	public abstract ReturnCode changeMode(
65 brianR 196
			@WebParam(name = FileSetResource.XML_NAME) FileSetResource res,
64 brianR 197
			@WebParam(name = "permissions") @XmlElement(required=true) String perm);
63 brianR 198
 
65 brianR 199
	/**
200
	 * @param res
201
	 * @param search
202
	 * @param replace
203
	 * @return
204
	 * @throws XServicesFault
205
	 */
206
	@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_REPLACEINFILE)
207
	@WebMethod(operationName = OPERATION_REPLACEINFILE)
63 brianR 208
	public abstract ReturnCode replaceInFile(
65 brianR 209
			@WebParam(name = FileResource.XML_NAME) @XmlElement(required=true) FileResource res,
64 brianR 210
			@WebParam(name = "search") @XmlElement(required=true) String search,
65 brianR 211
			@WebParam(name = "replace") @XmlElement(required=true) String replace) throws XServicesFault;
63 brianR 212
 
65 brianR 213
	/**
214
	 * @param res
215
	 * @param patternList
216
	 * @return
217
	 * @throws XServicesFault
218
	 */
219
	@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_REPLACEINFILE2)
220
	@WebMethod(operationName = OPERATION_REPLACEINFILE2)
63 brianR 221
	public abstract ReturnCode replaceInFile2(
65 brianR 222
			@WebParam(name = FileResource.XML_NAME) FileResource res,
223
			@WebParam(name = "patternList") List<ReplacePattern> patternList) throws XServicesFault;
63 brianR 224
 
65 brianR 225
	/**
226
	 * @param res
227
	 * @param search
228
	 * @param replace
229
	 * @param flags
230
	 * @return
231
	 * @throws XServicesFault
232
	 */
233
	@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_REPLACEINFILEREGEX)
234
	@WebMethod(operationName = OPERATION_REPLACEINFILEREGEX)
63 brianR 235
	public abstract ReturnCode replaceInFileRegEx(
65 brianR 236
			@WebParam(name = FileResource.XML_NAME) FileResource res,
63 brianR 237
			@WebParam(name = "search") String search,
238
			@WebParam(name = "replace") String replace,
65 brianR 239
			@WebParam(name = "flags") String flags) throws XServicesFault;
46 brianR 240
}