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

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

/*
* Created on Jul 19, 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 javax.servlet.ServletException;

import org.cafesip.jiplet.console.client.rpc.ConnectorElement;
import org.cafesip.jiplet.console.client.rpc.ConnectorService;
import org.cafesip.jiplet.console.server.ConnectorMgmt;
import org.cafesip.jiplet.console.server.Model;

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

/**
* @author Amit Chatterjee
*
*/
public class ConnectorServiceImpl extends RemoteServiceServlet implements
        ConnectorService
{
    /**
     * Comment for <code>serialVersionUID</code>
     */
    private static final long serialVersionUID = 792491160418385429L;

    /*
     * @see javax.servlet.GenericServlet#init()
     */
    @Override
    public void init() throws ServletException
    {
        try
        {
            Model.init();
        }
        catch (Exception e)
        {
            throw new ServletException(e);
        }
    }

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

    }

    public ConnectorElement getProperty(String connector) throws Exception
    {
        try
        {
            ConnectorMgmt con = new ConnectorMgmt();
            return con.viewConnectorProperty(connector);
        }
        catch (Exception e)
        {
            throw ExceptionHandler.getException(e, this);
        }
    }

    public ConnectorElement[] listProperties() throws Exception
    {
        try
        {
            ConnectorMgmt con = new ConnectorMgmt();
            return con.listProperties();

        }
        catch (Exception e)
        {
            throw ExceptionHandler.getException(e, this);
        }

    }
}
TOP

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

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.