Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/// *******************************************************************************
// * Copyright (C) 2007, 2015:
// *
// * - Ferdinando Villa
// * - integratedmodelling.org
// * - any other authors listed in @author annotations
// *
// * All rights reserved. This file is part of the k.LAB software suite,
// * meant to enable modular, collaborative, integrated
// * development of interoperable data and model components. For
// * details, see http://integratedmodelling.org.
// *
// * This program is free software; you can redistribute it and/or
// * modify it under the terms of the Affero General Public License
// * Version 3 or any later version.
// *
// * This program 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
// * Affero General Public License for more details.
// *
// * You should have received a copy of the Affero General Public License
// * along with this program; if not, write to the Free Software
// * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// * The license is also available at: https://www.gnu.org/licenses/agpl.html
// *******************************************************************************/
// package org.integratedmodelling.engine.rest;
//
// import java.util.ArrayList;
// import java.util.Collection;
// import java.util.Date;
// import java.util.HashMap;
// import java.util.List;
// import java.util.concurrent.Executors;
// import java.util.concurrent.Future;
// import java.util.concurrent.ScheduledExecutorService;
// import java.util.concurrent.TimeUnit;
// import java.util.logging.Level;
//
// import org.integratedmodelling.api.auth.IUser;
// import org.integratedmodelling.api.configuration.IConfiguration;
// import org.integratedmodelling.api.runtime.ILegacySession;
// import org.integratedmodelling.common.auth.RESTUser;
// import org.integratedmodelling.common.configuration.KLAB;
// import org.integratedmodelling.engine.runtime.Session;
// import org.integratedmodelling.exceptions.ThinklabException;
// import org.integratedmodelling.exceptions.ThinklabInternalErrorException;
// import org.integratedmodelling.exceptions.ThinklabValidationException;
// import org.restlet.Component;
// import org.restlet.Context;
// import org.restlet.data.Protocol;
// import org.restlet.resource.ServerResource;
//
// public class RESTManager {
//
// /**
// * check on the status of sessions every this many seconds
// */
// private static final long SESSION_REAPER_PERIOD_SECONDS = 60;
//
// /**
// * remove a session when this timeout has been reached.
// */
// private static long SESSION_TIMEOUT_MINUTES = 60;
//
// RESTApplication _application;
//
// HashMap _components = new HashMap();
// HashMap _commands = new HashMap();
// /*
// * resource classes harvested from plugin code.
// */
// HashMap> _resources = new HashMap>();
//
// int sessionCount;
//
// HashMap _sessions = new HashMap();
// HashMap _authorized = new HashMap();
//
// private ScheduledExecutorService _executor;
// private Future> _future;
//
// public static RESTManager _this = null;
// volatile Boolean _monitoring = false;
//
//
// public static class RestCommand {
//
// public String[] options;
// public String[] arguments;
// public String id;
// public String description;
//
// public RestCommand(String path, String description, String argument, String options) {
//
// this.id = path;
// this.description = description;
// this.options = options.isEmpty() ? null : options.split(",");
// this.arguments = argument.isEmpty() ? null : argument.split(",");
// }
//
// public Object asArray() {
// return new Object[] { id, description, arguments, options };
// }
//
// public List