ApplicationConfig.java [src/java/d] Revision:   Date:
/*
 * $Id$
 * 
 * This file is part of the Cloud Services Integration Platform (CSIP).
 * 2010-2015, Colorado State University.
 *
 * CSIP/LMOD is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, version 2.1.
 *
 * CSIP/LMOD is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this package.  If not, see <http://www.gnu.org/licenses/lgpl.txt>.
 */
package d;

import csip.Config;
import csip.ContextConfig;
import java.util.HashSet;
import java.util.Set;
import javax.servlet.ServletContext;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.Context;

/**
 *
 * @author User
 */
@javax.ws.rs.ApplicationPath("")
public class ApplicationConfig extends Application {
    @Context
    private ServletContext context;
    
    @Override
    public Set<Class<?>> getClasses() {
        Set<Class<?>> resources = new HashSet<>();
        addRestResourceClasses(resources);
        ContextConfig.filterServices(context, resources);
        Config.register(resources);
        return resources;
    }


    /**
     * Do not modify addRestResourceClasses() method. It is automatically
     * populated with all resources defined in the project. If required, comment
     * out calling this method in getClasses().
     */
    private void addRestResourceClasses(Set<Class<?>> resources) {
        resources.add(csip.ArchiveService.class);        
        resources.add(csip.CatalogService.class);
        resources.add(csip.ControlService.class);
        resources.add(csip.DynamicPyModelDataService.class);
        resources.add(csip.QueryService.class);
        //resources.add(csip.QueueingModelDataService.class);
        resources.add(csip.ReportService.class);
        resources.add(csip.UIService.class);
        resources.add(d.ps.V1_0.class);
    }

}