Subversion Repositories XServices

Rev

Rev 54 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6 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
package net.brutex.xservices.ws;
17
 
18
import javax.jws.WebMethod;
19
import javax.jws.WebParam;
20
import javax.jws.WebService;
21
import net.brutex.xservices.types.ArchiveResource;
22
import net.brutex.xservices.types.CompressionType;
23
import net.brutex.xservices.types.FileResource;
54 brianR 24
import net.brutex.xservices.types.FileSetResource;
46 brianR 25
 
10 brianR 26
import net.brutex.xservices.types.ReturnCode;
46 brianR 27
import net.brutex.xservices.util.BrutexNamespaces;
6 brianR 28
 
46 brianR 29
 
6 brianR 30
/**
31
 *
32
 * @author Brian Rosenberger, bru@brutex.de
33
 */
46 brianR 34
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
35
public interface ArchiveService {
6 brianR 36
 
37
    public static final String WS_OPERATION_BZIP2 = "bzip2";
38
    public static final String WS_OPERATION_BZIP2_ARCHIVE = "bzip2FromArchive";
39
    public static final String WS_OPERATION_GZIP = "gzip";
40
    public static final String WS_OPERATION_GZIP_ARCHIVE = "gzipFromArchive";
41
    public static final String WS_OPERATION_UNZIP = "unzip";
42
    public static final String WS_OPERATION_GUNZIP = "gunzip";
43
    public static final String WS_OPERATION_BUNZIP2 = "bunzip2";
44
    public static final String WS_PARAM_SOURCEFILE = "source";
45
    public static final String WS_PARAM_SOURCEFILE_STRING = "srcfile";
46
    public static final String WS_PARAM_SOURCEURL = "srcurl";
47
    public static final String WS_PARAM_SOURCEARCHIVE = "archivesource";
48
    public static final String WS_PARAM_DESTFILE = "destfile";
49
    public static final String WS_PARAM_DESTDIR = "destdir";
50
    public static final String WS_PARAM_ENCODING = "encoding";
12 brianR 51
    public static final String WS_PARAM_OVERWRITE = "overwrite";
65 brianR 52
    public static final String WS_PARAM_COMPRESS = "compresslevel";
6 brianR 53
 
65 brianR 54
    /**
55
     * @param src
56
     * @param file
57
     * @return
58
     * @throws XServicesFault
59
     */
12 brianR 60
    @WebMethod(operationName = WS_OPERATION_BZIP2, action = WS_OPERATION_BZIP2)
10 brianR 61
    public ReturnCode bzip2(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
65 brianR 62
            @WebParam(name = WS_PARAM_DESTFILE) String file) throws XServicesFault;
6 brianR 63
 
65 brianR 64
    /**
65
     * @param src
66
     * @param file
67
     * @return
68
     * @throws XServicesFault
69
     */
12 brianR 70
    @WebMethod(operationName = WS_OPERATION_BZIP2_ARCHIVE, action = WS_OPERATION_BZIP2_ARCHIVE)
10 brianR 71
    public ReturnCode bzip2FromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
65 brianR 72
            @WebParam(name = WS_PARAM_DESTFILE) String file) throws XServicesFault;
6 brianR 73
 
65 brianR 74
    /**
75
     * @param src
76
     * @param file
77
     * @return
78
     * @throws XServicesFault
79
     */
12 brianR 80
    @WebMethod(operationName = WS_OPERATION_GZIP, action = WS_OPERATION_GZIP)
81
    public ReturnCode gzip(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
65 brianR 82
            @WebParam(name = WS_PARAM_DESTFILE) String file) throws XServicesFault;
6 brianR 83
 
65 brianR 84
    /**
85
     * @param src
86
     * @param file
87
     * @return
88
     * @throws XServicesFault
89
     */
12 brianR 90
    @WebMethod(operationName = WS_OPERATION_GZIP_ARCHIVE, action = WS_OPERATION_GZIP_ARCHIVE)
91
    public ReturnCode gzipFromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
65 brianR 92
            @WebParam(name = WS_PARAM_DESTFILE) String file) throws XServicesFault;
6 brianR 93
 
65 brianR 94
    /**
95
     * @param src
96
     * @param dest
97
     * @return
98
     * @throws XServicesFault
99
     */
12 brianR 100
    @WebMethod(operationName = WS_OPERATION_GUNZIP, action = WS_OPERATION_GUNZIP)
101
    public ReturnCode gunzip(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
65 brianR 102
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
6 brianR 103
 
65 brianR 104
    /**
105
     * @param src
106
     * @param dest
107
     * @return
108
     * @throws XServicesFault
109
     */
6 brianR 110
    @WebMethod(operationName = WS_OPERATION_BUNZIP2)
12 brianR 111
    public ReturnCode bunzip2(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
65 brianR 112
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
6 brianR 113
 
65 brianR 114
    /**
115
     * @param src
116
     * @param dest
117
     * @return
118
     * @throws XServicesFault
119
     */
6 brianR 120
    @WebMethod(operationName = "gunzipFromURL")
12 brianR 121
    public ReturnCode gunzipFromURL(@WebParam(name = WS_PARAM_SOURCEURL) String src,
65 brianR 122
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
6 brianR 123
 
65 brianR 124
    /**
125
     * @param src
126
     * @param dest
127
     * @return
128
     * @throws XServicesFault
129
     */
6 brianR 130
    @WebMethod(operationName = "bunzip2FromURL")
12 brianR 131
    public ReturnCode bunzip2FromURL(@WebParam(name = WS_PARAM_SOURCEURL) String src,
65 brianR 132
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
6 brianR 133
 
65 brianR 134
    /**
135
     * @param src
136
     * @param file
137
     * @param overwrite
138
     * @param encoding
139
     * @param level
140
     * @return
141
     * @throws XServicesFault
142
     */
6 brianR 143
    @WebMethod(operationName = "zip")
12 brianR 144
    public ReturnCode zip(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
6 brianR 145
            @WebParam(name = WS_PARAM_DESTFILE) String file,
146
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
147
            @WebParam(name = WS_PARAM_ENCODING) String encoding,
65 brianR 148
            @WebParam(name = WS_PARAM_COMPRESS) int level) throws XServicesFault;
6 brianR 149
 
65 brianR 150
    /**
151
     * @param src
152
     * @param file
153
     * @param update
154
     * @param encoding
155
     * @param level
156
     * @return
157
     * @throws XServicesFault
158
     */
6 brianR 159
    @WebMethod(operationName = "zipFromArchive")
12 brianR 160
    public ReturnCode zipFromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
6 brianR 161
            @WebParam(name = WS_PARAM_DESTFILE) String file,
162
            @WebParam(name = WS_PARAM_OVERWRITE) boolean update,
163
            @WebParam(name = WS_PARAM_ENCODING) String encoding,
65 brianR 164
            @WebParam(name = "compresslevel") int level) throws XServicesFault;
6 brianR 165
 
65 brianR 166
    /**
167
     * @param src
168
     * @param dest
169
     * @param overwrite
170
     * @param encoding
171
     * @return
172
     * @throws XServicesFault
173
     */
6 brianR 174
    @WebMethod(operationName = "unzip")
12 brianR 175
    public ReturnCode unzip(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
6 brianR 176
            @WebParam(name = WS_PARAM_DESTDIR) String dest,
177
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
65 brianR 178
            @WebParam(name = WS_PARAM_ENCODING) String encoding) throws XServicesFault;
6 brianR 179
 
65 brianR 180
    /**
181
     * @param src
182
     * @param dest
183
     * @return
184
     * @throws XServicesFault
185
     */
6 brianR 186
    @WebMethod(operationName = "unrar")
12 brianR 187
    public ReturnCode unrar(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
65 brianR 188
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
6 brianR 189
 
65 brianR 190
    /**
191
     * @param src
192
     * @param dest
193
     * @param overwrite
194
     * @param compression
195
     * @return
196
     * @throws XServicesFault
197
     */
6 brianR 198
    @WebMethod(operationName = "untar")
12 brianR 199
    public ReturnCode untar(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
6 brianR 200
            @WebParam(name = WS_PARAM_DESTDIR) String dest,
201
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
65 brianR 202
            @WebParam(name = "compression") CompressionType compression) throws XServicesFault;
6 brianR 203
}