001/**
002 * Copyright 2016 Tampere University of Technology, Pori Department
003 * 
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 * 
008 *   http://www.apache.org/licenses/LICENSE-2.0
009 * 
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package service.tut.pori.apilta.sensors.datatypes;
017
018import org.apache.commons.lang3.NotImplementedException;
019import org.quartz.JobBuilder;
020
021import service.tut.pori.tasks.TaskJob;
022import service.tut.pori.tasks.datatypes.Task;
023
024/**
025 * job class for executing virtual sensor tasks
026 * 
027 */
028public class VirtualSensorTaskJob extends TaskJob {
029
030  @Override
031  protected void executeTask() {
032    //TODO go through the public (or the tasks the user has permissions to access) tasks and the tasks that have used the selected back ends, create result sets with matching values
033    throw new NotImplementedException("Not implemented");
034  }
035  
036  /**
037   * This method will return a builder initialized with the default values set in the task. 
038   * 
039   * This basic implementation only sets the task identifier.
040   * 
041   * Note: the given task must have a single unique identifier.
042   * 
043   * @param task the task used for initialization
044   * @return job builder
045   * @throws IllegalArgumentException if the task contains invalid data for builder initialization
046   */
047  public static JobBuilder getBuilder(Task task)  throws IllegalArgumentException {
048    return getBuilder(task, VirtualSensorTaskJob.class);
049  }
050}