ApplicationConfig.java [src/java/m] Revision: default  Date:
/*
 * $Id$
 *
 * This file is part of the Cloud Services Integration Platform (CSIP),
 * a Model-as-a-Service framework, API, and application suite.
 *
 * 2012-2017, OMSLab, Colorado State University.
 *
 * OMSLab licenses this file to you under the MIT license.
 * See the LICENSE file in the project root for more information.
 */
package m;

import csip.Config;

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<>();
    addCsipCoreClasses(resources);
    addRestResourceClasses(resources);
    
    Config.register(resources, context);
    return resources;
  }
  
  private void addCsipCoreClasses(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.GzipWriterInterceptor.class);
    resources.add(csip.QueryService.class);
    resources.add(csip.QueueingModelDataService.class);
    resources.add(csip.ReportService.class);
    resources.add(csip.UIService.class);
  }

  /**
   * Do not modify addRestResourceClasses() method. It is automatically
   * re-generated by NetBeans REST support to populate given list with all
   * resources defined in the project.
   */
  private void addRestResourceClasses(Set<Class<?>> resources) {
        resources.add(m.weps.V0_1.class);
        resources.add(m.weps.V1_0.class);
        resources.add(m.wepsIntegrated.V1_0.class);
        resources.add(m.windgen.V1_0.class);
        resources.add(m.windgen.V2_0.class);
        resources.add(m.windgen.interp_wdb.V1_0.class);
        resources.add(m.windgen.interpolate.V1_0.class);
  }
}