Subversion Repositories XServices

Rev

Rev 12 | 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;
46 brianR 24
 
10 brianR 25
import net.brutex.xservices.types.ReturnCode;
46 brianR 26
import net.brutex.xservices.util.BrutexNamespaces;
6 brianR 27
 
46 brianR 28
 
6 brianR 29
/**
30
 *
31
 * @author Brian Rosenberger, bru@brutex.de
32
 */
46 brianR 33
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
34
public interface ArchiveService {
6 brianR 35
 
36
    public static final String WS_OPERATION_BZIP2 = "bzip2";
37
    public static final String WS_OPERATION_BZIP2_ARCHIVE = "bzip2FromArchive";
38
    public static final String WS_OPERATION_GZIP = "gzip";
39
    public static final String WS_OPERATION_GZIP_ARCHIVE = "gzipFromArchive";
40
    public static final String WS_OPERATION_UNZIP = "unzip";
41
    public static final String WS_OPERATION_GUNZIP = "gunzip";
42
    public static final String WS_OPERATION_BUNZIP2 = "bunzip2";
43
    public static final String WS_PARAM_SOURCEFILE = "source";
44
    public static final String WS_PARAM_SOURCEFILE_STRING = "srcfile";
45
    public static final String WS_PARAM_SOURCEURL = "srcurl";
46
    public static final String WS_PARAM_SOURCEARCHIVE = "archivesource";
47
    public static final String WS_PARAM_DESTFILE = "destfile";
48
    public static final String WS_PARAM_DESTDIR = "destdir";
49
    public static final String WS_PARAM_ENCODING = "encoding";
12 brianR 50
    public static final String WS_PARAM_OVERWRITE = "overwrite";
6 brianR 51
 
12 brianR 52
    @WebMethod(operationName = WS_OPERATION_BZIP2, action = WS_OPERATION_BZIP2)
10 brianR 53
    public ReturnCode bzip2(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
46 brianR 54
            @WebParam(name = WS_PARAM_DESTFILE) String file);
6 brianR 55
 
12 brianR 56
    @WebMethod(operationName = WS_OPERATION_BZIP2_ARCHIVE, action = WS_OPERATION_BZIP2_ARCHIVE)
10 brianR 57
    public ReturnCode bzip2FromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
46 brianR 58
            @WebParam(name = WS_PARAM_DESTFILE) String file);
6 brianR 59
 
12 brianR 60
    @WebMethod(operationName = WS_OPERATION_GZIP, action = WS_OPERATION_GZIP)
61
    public ReturnCode gzip(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
46 brianR 62
            @WebParam(name = WS_PARAM_DESTFILE) String file);
6 brianR 63
 
12 brianR 64
    @WebMethod(operationName = WS_OPERATION_GZIP_ARCHIVE, action = WS_OPERATION_GZIP_ARCHIVE)
65
    public ReturnCode gzipFromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
46 brianR 66
            @WebParam(name = WS_PARAM_DESTFILE) String file);
6 brianR 67
 
12 brianR 68
    @WebMethod(operationName = WS_OPERATION_GUNZIP, action = WS_OPERATION_GUNZIP)
69
    public ReturnCode gunzip(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
46 brianR 70
            @WebParam(name = WS_PARAM_DESTDIR) String dest);
6 brianR 71
 
72
    @WebMethod(operationName = WS_OPERATION_BUNZIP2)
12 brianR 73
    public ReturnCode bunzip2(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
46 brianR 74
            @WebParam(name = WS_PARAM_DESTDIR) String dest);
6 brianR 75
 
76
    @WebMethod(operationName = "gunzipFromURL")
12 brianR 77
    public ReturnCode gunzipFromURL(@WebParam(name = WS_PARAM_SOURCEURL) String src,
46 brianR 78
            @WebParam(name = WS_PARAM_DESTDIR) String dest);
6 brianR 79
 
80
    @WebMethod(operationName = "bunzip2FromURL")
12 brianR 81
    public ReturnCode bunzip2FromURL(@WebParam(name = WS_PARAM_SOURCEURL) String src,
46 brianR 82
            @WebParam(name = WS_PARAM_DESTDIR) String dest);
6 brianR 83
 
84
    @WebMethod(operationName = "zip")
12 brianR 85
    public ReturnCode zip(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
6 brianR 86
            @WebParam(name = WS_PARAM_DESTFILE) String file,
87
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
88
            @WebParam(name = WS_PARAM_ENCODING) String encoding,
46 brianR 89
            @WebParam(name = "compresslevel") int level);
6 brianR 90
 
91
    @WebMethod(operationName = "zipFromArchive")
12 brianR 92
    public ReturnCode zipFromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
6 brianR 93
            @WebParam(name = WS_PARAM_DESTFILE) String file,
94
            @WebParam(name = WS_PARAM_OVERWRITE) boolean update,
95
            @WebParam(name = WS_PARAM_ENCODING) String encoding,
46 brianR 96
            @WebParam(name = "compresslevel") int level);
6 brianR 97
 
98
    @WebMethod(operationName = "unzip")
12 brianR 99
    public ReturnCode unzip(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
6 brianR 100
            @WebParam(name = WS_PARAM_DESTDIR) String dest,
101
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
46 brianR 102
            @WebParam(name = WS_PARAM_ENCODING) String encoding);
6 brianR 103
 
104
    @WebMethod(operationName = "unrar")
12 brianR 105
    public ReturnCode unrar(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
46 brianR 106
            @WebParam(name = WS_PARAM_DESTDIR) String dest);
6 brianR 107
 
108
    @WebMethod(operationName = "untar")
12 brianR 109
    public ReturnCode untar(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
6 brianR 110
            @WebParam(name = WS_PARAM_DESTDIR) String dest,
111
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
46 brianR 112
            @WebParam(name = "compression") CompressionType compression);
6 brianR 113
}