Subversion Repositories XServices

Rev

Rev 12 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

/*
 *   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.ws;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import net.brutex.xservices.types.ArchiveResource;
import net.brutex.xservices.types.CompressionType;
import net.brutex.xservices.types.FileResource;

import net.brutex.xservices.types.ReturnCode;
import net.brutex.xservices.util.BrutexNamespaces;


/**
 *
 * @author Brian Rosenberger, bru@brutex.de
 */
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
public interface ArchiveService {

    public static final String WS_OPERATION_BZIP2 = "bzip2";
    public static final String WS_OPERATION_BZIP2_ARCHIVE = "bzip2FromArchive";
    public static final String WS_OPERATION_GZIP = "gzip";
    public static final String WS_OPERATION_GZIP_ARCHIVE = "gzipFromArchive";
    public static final String WS_OPERATION_UNZIP = "unzip";
    public static final String WS_OPERATION_GUNZIP = "gunzip";
    public static final String WS_OPERATION_BUNZIP2 = "bunzip2";
    public static final String WS_PARAM_SOURCEFILE = "source";
    public static final String WS_PARAM_SOURCEFILE_STRING = "srcfile";
    public static final String WS_PARAM_SOURCEURL = "srcurl";
    public static final String WS_PARAM_SOURCEARCHIVE = "archivesource";
    public static final String WS_PARAM_DESTFILE = "destfile";
    public static final String WS_PARAM_DESTDIR = "destdir";
    public static final String WS_PARAM_ENCODING = "encoding";
    public static final String WS_PARAM_OVERWRITE = "overwrite";

    @WebMethod(operationName = WS_OPERATION_BZIP2, action = WS_OPERATION_BZIP2)
    public ReturnCode bzip2(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
            @WebParam(name = WS_PARAM_DESTFILE) String file);

    @WebMethod(operationName = WS_OPERATION_BZIP2_ARCHIVE, action = WS_OPERATION_BZIP2_ARCHIVE)
    public ReturnCode bzip2FromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
            @WebParam(name = WS_PARAM_DESTFILE) String file);

    @WebMethod(operationName = WS_OPERATION_GZIP, action = WS_OPERATION_GZIP)
    public ReturnCode gzip(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
            @WebParam(name = WS_PARAM_DESTFILE) String file);

    @WebMethod(operationName = WS_OPERATION_GZIP_ARCHIVE, action = WS_OPERATION_GZIP_ARCHIVE)
    public ReturnCode gzipFromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
            @WebParam(name = WS_PARAM_DESTFILE) String file);

    @WebMethod(operationName = WS_OPERATION_GUNZIP, action = WS_OPERATION_GUNZIP)
    public ReturnCode gunzip(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
            @WebParam(name = WS_PARAM_DESTDIR) String dest);

    @WebMethod(operationName = WS_OPERATION_BUNZIP2)
    public ReturnCode bunzip2(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
            @WebParam(name = WS_PARAM_DESTDIR) String dest);

    @WebMethod(operationName = "gunzipFromURL")
    public ReturnCode gunzipFromURL(@WebParam(name = WS_PARAM_SOURCEURL) String src,
            @WebParam(name = WS_PARAM_DESTDIR) String dest);

    @WebMethod(operationName = "bunzip2FromURL")
    public ReturnCode bunzip2FromURL(@WebParam(name = WS_PARAM_SOURCEURL) String src,
            @WebParam(name = WS_PARAM_DESTDIR) String dest);

    @WebMethod(operationName = "zip")
    public ReturnCode zip(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
            @WebParam(name = WS_PARAM_DESTFILE) String file,
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
            @WebParam(name = WS_PARAM_ENCODING) String encoding,
            @WebParam(name = "compresslevel") int level);

    @WebMethod(operationName = "zipFromArchive")
    public ReturnCode zipFromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
            @WebParam(name = WS_PARAM_DESTFILE) String file,
            @WebParam(name = WS_PARAM_OVERWRITE) boolean update,
            @WebParam(name = WS_PARAM_ENCODING) String encoding,
            @WebParam(name = "compresslevel") int level);

    @WebMethod(operationName = "unzip")
    public ReturnCode unzip(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
            @WebParam(name = WS_PARAM_DESTDIR) String dest,
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
            @WebParam(name = WS_PARAM_ENCODING) String encoding);

    @WebMethod(operationName = "unrar")
    public ReturnCode unrar(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
            @WebParam(name = WS_PARAM_DESTDIR) String dest);

    @WebMethod(operationName = "untar")
    public ReturnCode untar(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
            @WebParam(name = WS_PARAM_DESTDIR) String dest,
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
            @WebParam(name = "compression") CompressionType compression);
}