Package org.cafesip.jiplet.console.server.rpc

Source Code of org.cafesip.jiplet.console.server.rpc.ContextServiceImpl

/*
* Created on Jul 18, 2006
*
* Copyright 2005 CafeSip.org
*
* 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 org.cafesip.jiplet.console.server.rpc;

import org.cafesip.jiplet.console.client.rpc.ContextElement;
import org.cafesip.jiplet.console.client.rpc.ContextService;
import org.cafesip.jiplet.console.client.rpc.JipletElement;
import org.cafesip.jiplet.console.server.ContainerMgmt;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

/**
* @author Amit Chatterjee
*
*/
public class ContextServiceImpl extends RemoteServiceServlet implements
        ContextService
{

    /**
     * Comment for <code>serialVersionUID</code>
     */
    private static final long serialVersionUID = 8883426044009262019L;

    /*
     * @see org.cafesip.jiplet.console.client.ContextService#list()
     */
    public String[] list() throws Exception
    {
        try
        {
            ContainerMgmt con = new ContainerMgmt();
            return con.listContexts();
        }
        catch (Exception e)
        {
            throw ExceptionHandler.getException(e, this);
        }
    }

    public void delete(String name) throws Exception
    {
        try
        {
            ContainerMgmt con = new ContainerMgmt();
            con.deleteContext(name);
        }
        catch (Exception e)
        {
            throw ExceptionHandler.getException(e, this);
        }
    }

    public String[] listJiplets(String context) throws Exception
    {
        try
        {
            ContainerMgmt con = new ContainerMgmt();
            return con.listJiplets(context);
        }
        catch (Exception e)
        {
            throw ExceptionHandler.getException(e, this);
        }

    }

    public ContextElement getProperty(String context) throws Exception
    {
        try
        {
            ContainerMgmt con = new ContainerMgmt();
            return con.viewContextProperty(context);
        }
        catch (Exception e)
        {
            throw ExceptionHandler.getException(e, this);
        }
    }

    public JipletElement getJipletProperty(String context, String jiplet)
            throws Exception
    {
        try
        {
            ContainerMgmt con = new ContainerMgmt();
            return con.viewJipletProperty(context, jiplet);
        }
        catch (Exception e)
        {
            throw ExceptionHandler.getException(e, this);
        }
    }

    public JipletElement[] listJipletProperties(String context)
            throws Exception
    {
        try
        {
            ContainerMgmt con = new ContainerMgmt();
            return con.listJipletsProperties(context);
        }
        catch (Exception e)
        {
            throw ExceptionHandler.getException(e, this);
        }
    }

    public ContextElement[] listProperties() throws Exception
    {
        try
        {
            ContainerMgmt con = new ContainerMgmt();
            return con.listContextsProperties();
        }
        catch (Exception e)
        {
            throw ExceptionHandler.getException(e, this);
        }
    }
}
TOP

Related Classes of org.cafesip.jiplet.console.server.rpc.ContextServiceImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.