LENS-1201: [Code cleanup] Move API classes to correct place.

Project: http://git-wip-us.apache.org/repos/asf/lens/repo
Commit: http://git-wip-us.apache.org/repos/asf/lens/commit/d7efa9e3
Tree: http://git-wip-us.apache.org/repos/asf/lens/tree/d7efa9e3
Diff: http://git-wip-us.apache.org/repos/asf/lens/diff/d7efa9e3

Branch: refs/heads/current-release-line
Commit: d7efa9e3147c11e14a02008f24ea7e056b566ca0
Parents: 36627ce
Author: Lavkesh Lahngir <lavk...@linux.com>
Authored: Fri Jun 24 16:16:04 2016 +0530
Committer: Rajat Khandelwal <rajatgupt...@gmail.com>
Committed: Fri Jun 24 16:16:04 2016 +0530

----------------------------------------------------------------------
 .../lens/api/query/SchedulerJobHandle.java      | 86 -------------------
 .../apache/lens/api/query/SchedulerJobInfo.java | 70 ---------------
 .../api/query/SchedulerJobInstanceHandle.java   | 90 --------------------
 .../api/query/SchedulerJobInstanceInfo.java     | 84 ------------------
 .../lens/api/scheduler/SchedulerJobHandle.java  | 78 +++++++++++++++++
 .../lens/api/scheduler/SchedulerJobInfo.java    | 69 +++++++++++++++
 .../scheduler/SchedulerJobInstanceHandle.java   | 84 ++++++++++++++++++
 .../api/scheduler/SchedulerJobInstanceInfo.java | 87 +++++++++++++++++++
 .../scheduler/SchedulerJobInstanceState.java    | 23 +++++
 .../lens/api/scheduler/SchedulerJobState.java   | 23 +++++
 .../lens/api/scheduler/SchedulerJobStats.java   | 29 +++++++
 .../server/api/events/SchedulerAlarmEvent.java  |  2 +-
 .../server/api/scheduler/SchedulerJobStats.java | 29 -------
 .../server/api/scheduler/SchedulerService.java  |  6 +-
 .../server/scheduler/SchedulerServiceImpl.java  |  7 +-
 .../notification/services/AlarmService.java     |  4 +-
 .../notification/services/AlarmServiceTest.java |  2 +-
 17 files changed, 399 insertions(+), 374 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobHandle.java
----------------------------------------------------------------------
diff --git 
a/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobHandle.java 
b/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobHandle.java
deleted file mode 100644
index 4a2baba..0000000
--- a/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobHandle.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.lens.api.query;
-
-import java.io.Serializable;
-import java.util.UUID;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.lens.api.UUIDAdapter;
-
-import org.apache.commons.lang.StringUtils;
-
-import lombok.AccessLevel;
-import lombok.AllArgsConstructor;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-
-/**
- * Handle for <code>SchedulerJob</code>.
- */
-@XmlRootElement
-@AllArgsConstructor
-@NoArgsConstructor(access = AccessLevel.PROTECTED)
-@EqualsAndHashCode(callSuper = false)
-public class SchedulerJobHandle implements Serializable {
-
-  /**
-   * The Constant serialVersionUID.
-   */
-  private static final long serialVersionUID = 1L;
-
-  /**
-   * The handle id.
-   */
-  @XmlElement
-  @Getter
-  @XmlJavaTypeAdapter(UUIDAdapter.class)
-  private UUID handleId;
-
-  /**
-   * From string.
-   *
-   * @param handle the handle for scheduler job
-   * @return the handle for
-   */
-  public static SchedulerJobHandle fromString(String handle) {
-    return new SchedulerJobHandle(UUID.fromString(handle));
-  }
-
-  public String getHandleIdString() {
-    if (handleId == null) {
-      return StringUtils.EMPTY;
-    }
-    return handleId.toString();
-  }
-
-  /**
-   * String representation of the SchedulerJobHandle.
-   * @return string representation of the handleId
-   */
-  @Override
-  public String toString() {
-    return getHandleIdString();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobInfo.java
----------------------------------------------------------------------
diff --git 
a/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobInfo.java 
b/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobInfo.java
deleted file mode 100644
index 92260b5..0000000
--- a/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobInfo.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.lens.api.query;
-
-import org.apache.lens.api.scheduler.XJob;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-/**
- * POJO to represent the <code>job</code> table in the database.
- */
-@Data
-@AllArgsConstructor
-public class SchedulerJobInfo {
-
-  /**
-   * ID of the job.
-   * Each job has a unique id which can be used to query it.
-   *
-   * @param id new value for ID.
-   * @return ID for the current job.
-   */
-  private SchedulerJobHandle id;
-
-  /**
-   * Definition of the job scheduled.
-   */
-  private XJob job;
-
-  /**
-   * @param userName userName to be set.
-   * @return name of the user who scheduled this job.
-   */
-  private String userName;
-
-  /**
-   * @param status status of this job.
-   * @return current status of this job
-   */
-  private String status;
-
-  /**
-   * @param createdOn time to be set as createdOn.
-   * @return time when this job was submitted.
-   */
-  private long createdOn;
-
-  /**
-   * @param modifiedOn time to be set as modifiedOn time for this job.
-   * @return last modified time for this job
-   */
-  private long modifiedOn;
-
-}

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobInstanceHandle.java
----------------------------------------------------------------------
diff --git 
a/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobInstanceHandle.java
 
b/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobInstanceHandle.java
deleted file mode 100644
index f19d3f0..0000000
--- 
a/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobInstanceHandle.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.lens.api.query;
-
-import java.io.Serializable;
-import java.util.UUID;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.lens.api.UUIDAdapter;
-
-import org.apache.commons.lang.StringUtils;
-
-import lombok.AccessLevel;
-import lombok.AllArgsConstructor;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-
-/**
- * Handle for <code>SchedulerJobInstance</code>
- */
-@XmlRootElement
-@AllArgsConstructor
-@NoArgsConstructor(access = AccessLevel.PROTECTED)
-@EqualsAndHashCode(callSuper = false)
-public class SchedulerJobInstanceHandle implements Serializable {
-
-  /**
-   * The Constant serialVersionUID.
-   */
-  private static final long serialVersionUID = 1L;
-
-  /**
-   * The handle id.
-   */
-  @XmlElement
-  @Getter
-  @XmlJavaTypeAdapter(UUIDAdapter.class)
-  private UUID handleId;
-
-  /**
-   * From string.
-   *
-   * @param handle the handle
-   * @return the <code>SchedulerJobInstance</code>'s handle
-   */
-  public static SchedulerJobInstanceHandle fromString(String handle) {
-    return new SchedulerJobInstanceHandle(UUID.fromString(handle));
-  }
-
-  /**
-   * Returns handle id as a string.
-   * @return handleId as a string.
-   */
-  public String getHandleIdString() {
-    if (handleId == null) {
-      return StringUtils.EMPTY;
-    }
-    return handleId.toString();
-  }
-
-  /**
-   * String representation of the SchedulerJobInstanceHandle.
-   * @return the handleID as a string
-   */
-  @Override
-  public String toString() {
-    return getHandleIdString();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobInstanceInfo.java
----------------------------------------------------------------------
diff --git 
a/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobInstanceInfo.java
 
b/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobInstanceInfo.java
deleted file mode 100644
index 9146cf0..0000000
--- 
a/lens-api/src/main/java/org/apache/lens/api/query/SchedulerJobInstanceInfo.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.lens.api.query;
-
-import org.apache.lens.api.LensSessionHandle;
-
-import lombok.Data;
-/**
- * POJO for an instance of SchedulerJob.
- */
-@Data
-public class SchedulerJobInstanceInfo {
-
-  /**
-   * @param id new id for the instance of scheduler job.
-   * @return unique id for this instance of scheduler job.
-   */
-  private SchedulerJobInstanceHandle id;
-
-  /**
-   * @param jobId new id for the scheduler job.
-   * @return id for the scheduler job to which this instance belongs.
-   */
-  private SchedulerJobHandle jobId;
-
-  /**
-   * @param sessionHandle new session handle.
-   * @return session handle for this instance.
-   */
-  private LensSessionHandle sessionHandle;
-
-  /**
-   * @param startTime start time to be set for the instance.
-   * @return actual start time of this instance.
-   */
-  private long startTime;
-
-  /**
-   * @param endTime end time to be set for the instance.
-   * @return actual finish time of this instance.
-   */
-  private long endTime;
-
-  /**
-   * @param resultPath result path to be set.
-   * @return result path of this instance.
-   */
-  private String resultPath;
-
-  /**
-   * @param query query to be set
-   * @return query of this instance.
-   */
-  private String query;
-
-  /**
-   * @param status status to be set.
-   * @return status of this instance.
-   */
-  private String status;
-
-  /**
-   * @param createdOn time to be set as created_on time for the instance.
-   * @return created_on time of this instance.
-   */
-  private long createdOn;
-
-}

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobHandle.java
----------------------------------------------------------------------
diff --git 
a/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobHandle.java 
b/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobHandle.java
new file mode 100644
index 0000000..2e3aab8
--- /dev/null
+++ 
b/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobHandle.java
@@ -0,0 +1,78 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.apache.lens.api.scheduler;
+
+import java.io.Serializable;
+import java.util.UUID;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.apache.lens.api.UUIDAdapter;
+
+import lombok.*;
+
+/**
+ * Handle for <code>SchedulerJob</code>.
+ */
+@XmlRootElement
+@AllArgsConstructor
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
+@EqualsAndHashCode(callSuper = false)
+public class SchedulerJobHandle implements Serializable {
+
+  /**
+   * The Constant serialVersionUID.
+   */
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * The handle id.
+   */
+  @XmlElement
+  @Getter
+  @XmlJavaTypeAdapter(UUIDAdapter.class)
+  @NonNull
+  private UUID handleId;
+
+  /**
+   * From string.
+   *
+   * @param handle the handle for scheduler job
+   * @return the handle for
+   */
+  public static SchedulerJobHandle fromString(@NonNull String handle) {
+    return new SchedulerJobHandle(UUID.fromString(handle));
+  }
+
+  public String getHandleIdString() {
+    return handleId.toString();
+  }
+
+  /**
+   * String representation of the SchedulerJobHandle.
+   * @return string representation of the handleId
+   */
+  @Override
+  public String toString() {
+    return getHandleIdString();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInfo.java
----------------------------------------------------------------------
diff --git 
a/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInfo.java 
b/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInfo.java
new file mode 100644
index 0000000..0561834
--- /dev/null
+++ b/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInfo.java
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.apache.lens.api.scheduler;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+/**
+ * POJO to represent the <code>job</code> table in the database.
+ */
+@Data
+@AllArgsConstructor
+public class SchedulerJobInfo {
+
+  /**
+   * ID of the job.
+   * Each job has a unique id which can be used to query it.
+   *
+   * @param id new value for ID.
+   * @return ID for the current job.
+   */
+  private SchedulerJobHandle id;
+
+  /**
+   * Definition of the job scheduled.
+   */
+  private XJob job;
+
+  /**
+   * @param userName userName to be set.
+   * @return name of the user who scheduled this job.
+   */
+  private String userName;
+
+  /**
+   * @param state state of this job.
+   * @return current state of this job
+   */
+  private SchedulerJobState state;
+
+  /**
+   * @param createdOn time to be set as createdOn.
+   * @return time when this job was submitted.
+   */
+  private long createdOn;
+
+  /**
+   * @param modifiedOn time to be set as modifiedOn time for this job.
+   * @return last modified time for this job
+   */
+  private long modifiedOn;
+
+}

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInstanceHandle.java
----------------------------------------------------------------------
diff --git 
a/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInstanceHandle.java
 
b/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInstanceHandle.java
new file mode 100644
index 0000000..129afe1
--- /dev/null
+++ 
b/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInstanceHandle.java
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.apache.lens.api.scheduler;
+
+import java.io.Serializable;
+import java.util.UUID;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.apache.lens.api.UUIDAdapter;
+
+import lombok.*;
+
+/**
+ * Handle for <code>SchedulerJobInstance</code>
+ */
+@XmlRootElement
+@AllArgsConstructor
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
+@EqualsAndHashCode(callSuper = false)
+public class SchedulerJobInstanceHandle implements Serializable {
+
+  /**
+   * The Constant serialVersionUID.
+   */
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * The handle id.
+   */
+  @XmlElement
+  @Getter
+  @XmlJavaTypeAdapter(UUIDAdapter.class)
+  @NonNull
+  private UUID handleId;
+
+  /**
+   * From string.
+   *
+   * @param handle the handle
+   * @return the <code>SchedulerJobInstance</code>'s handle
+   */
+  public static SchedulerJobInstanceHandle fromString(@NonNull String handle) {
+    return new SchedulerJobInstanceHandle(UUID.fromString(handle));
+  }
+
+  /**
+   * Returns handle id as a string.
+   *
+   * @return handleId as a string.
+   */
+  public String getHandleIdString() {
+    return handleId.toString();
+  }
+
+  /**
+   * String representation of the SchedulerJobInstanceHandle.
+   *
+   * @return the handleID as a string
+   */
+  @Override
+  public String toString() {
+    return getHandleIdString();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInstanceInfo.java
----------------------------------------------------------------------
diff --git 
a/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInstanceInfo.java
 
b/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInstanceInfo.java
new file mode 100644
index 0000000..cb0d938
--- /dev/null
+++ 
b/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInstanceInfo.java
@@ -0,0 +1,87 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.apache.lens.api.scheduler;
+
+import org.apache.lens.api.LensSessionHandle;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+/**
+ * POJO for an instance of SchedulerJob.
+ */
+@Data
+@AllArgsConstructor
+public class SchedulerJobInstanceInfo {
+
+  /**
+   * @param id new id for the instance of scheduler job.
+   * @return unique id for this instance of scheduler job.
+   */
+  private SchedulerJobInstanceHandle id;
+
+  /**
+   * @param jobId new id for the scheduler job.
+   * @return id for the scheduler job to which this instance belongs.
+   */
+  private SchedulerJobHandle jobId;
+
+  /**
+   * @param sessionHandle new session handle.
+   * @return session handle for this instance.
+   */
+  private LensSessionHandle sessionHandle;
+
+  /**
+   * @param startTime start time to be set for the instance.
+   * @return actual start time of this instance.
+   */
+  private long startTime;
+
+  /**
+   * @param endTime end time to be set for the instance.
+   * @return actual finish time of this instance.
+   */
+  private long endTime;
+
+  /**
+   * @param resultPath result path to be set.
+   * @return result path of this instance.
+   */
+  private String resultPath;
+
+  /**
+   * @param query query to be set
+   * @return query of this instance.
+   */
+  private String query;
+
+  /**
+   * @param state state to be set.
+   * @return state of this instance.
+   */
+  private SchedulerJobInstanceState state;
+
+  /**
+   * @param createdOn time to be set as created_on time for the instance.
+   * @return created_on time of this instance.
+   */
+  private long createdOn;
+
+}

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInstanceState.java
----------------------------------------------------------------------
diff --git 
a/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInstanceState.java
 
b/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInstanceState.java
new file mode 100644
index 0000000..c66add6
--- /dev/null
+++ 
b/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobInstanceState.java
@@ -0,0 +1,23 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.apache.lens.api.scheduler;
+
+public enum SchedulerJobInstanceState {
+  WAITING, LAUNCHED, FAILED, SUCCEEDED, KILLED, TIMEOUT
+}

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobState.java
----------------------------------------------------------------------
diff --git 
a/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobState.java 
b/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobState.java
new file mode 100644
index 0000000..82c55c8
--- /dev/null
+++ 
b/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobState.java
@@ -0,0 +1,23 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.apache.lens.api.scheduler;
+
+public enum SchedulerJobState {
+  NEW, SCHEDULED, EXPIRED, PAUSED
+}

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobStats.java
----------------------------------------------------------------------
diff --git 
a/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobStats.java 
b/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobStats.java
new file mode 100644
index 0000000..9938a10
--- /dev/null
+++ 
b/lens-api/src/main/java/org/apache/lens/api/scheduler/SchedulerJobStats.java
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.lens.api.scheduler;
+
+import lombok.Data;
+
+/**
+ * Stats for a scheduler's job.
+ */
+@Data
+public class SchedulerJobStats {
+
+}

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-server-api/src/main/java/org/apache/lens/server/api/events/SchedulerAlarmEvent.java
----------------------------------------------------------------------
diff --git 
a/lens-server-api/src/main/java/org/apache/lens/server/api/events/SchedulerAlarmEvent.java
 
b/lens-server-api/src/main/java/org/apache/lens/server/api/events/SchedulerAlarmEvent.java
index 2bcf0d6..3ca7eb9 100644
--- 
a/lens-server-api/src/main/java/org/apache/lens/server/api/events/SchedulerAlarmEvent.java
+++ 
b/lens-server-api/src/main/java/org/apache/lens/server/api/events/SchedulerAlarmEvent.java
@@ -18,7 +18,7 @@
 
 package org.apache.lens.server.api.events;
 
-import org.apache.lens.api.query.SchedulerJobHandle;
+import org.apache.lens.api.scheduler.SchedulerJobHandle;
 
 import org.joda.time.DateTime;
 

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-server-api/src/main/java/org/apache/lens/server/api/scheduler/SchedulerJobStats.java
----------------------------------------------------------------------
diff --git 
a/lens-server-api/src/main/java/org/apache/lens/server/api/scheduler/SchedulerJobStats.java
 
b/lens-server-api/src/main/java/org/apache/lens/server/api/scheduler/SchedulerJobStats.java
deleted file mode 100644
index 4952057..0000000
--- 
a/lens-server-api/src/main/java/org/apache/lens/server/api/scheduler/SchedulerJobStats.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.lens.server.api.scheduler;
-
-import lombok.Data;
-
-/**
- * Stats for a scheduler's job.
- */
-@Data
-public class SchedulerJobStats {
-
-}

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-server-api/src/main/java/org/apache/lens/server/api/scheduler/SchedulerService.java
----------------------------------------------------------------------
diff --git 
a/lens-server-api/src/main/java/org/apache/lens/server/api/scheduler/SchedulerService.java
 
b/lens-server-api/src/main/java/org/apache/lens/server/api/scheduler/SchedulerService.java
index b6ec093..700a255 100644
--- 
a/lens-server-api/src/main/java/org/apache/lens/server/api/scheduler/SchedulerService.java
+++ 
b/lens-server-api/src/main/java/org/apache/lens/server/api/scheduler/SchedulerService.java
@@ -23,11 +23,7 @@ import java.util.Date;
 import java.util.List;
 
 import org.apache.lens.api.LensSessionHandle;
-import org.apache.lens.api.query.SchedulerJobHandle;
-import org.apache.lens.api.query.SchedulerJobInfo;
-import org.apache.lens.api.query.SchedulerJobInstanceHandle;
-import org.apache.lens.api.query.SchedulerJobInstanceInfo;
-import org.apache.lens.api.scheduler.XJob;
+import org.apache.lens.api.scheduler.*;
 import org.apache.lens.server.api.error.LensException;
 
 

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-server/src/main/java/org/apache/lens/server/scheduler/SchedulerServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/lens-server/src/main/java/org/apache/lens/server/scheduler/SchedulerServiceImpl.java
 
b/lens-server/src/main/java/org/apache/lens/server/scheduler/SchedulerServiceImpl.java
index ce98601..706d54a 100644
--- 
a/lens-server/src/main/java/org/apache/lens/server/scheduler/SchedulerServiceImpl.java
+++ 
b/lens-server/src/main/java/org/apache/lens/server/scheduler/SchedulerServiceImpl.java
@@ -23,15 +23,10 @@ import java.util.Date;
 import java.util.List;
 
 import org.apache.lens.api.LensSessionHandle;
-import org.apache.lens.api.query.SchedulerJobHandle;
-import org.apache.lens.api.query.SchedulerJobInfo;
-import org.apache.lens.api.query.SchedulerJobInstanceHandle;
-import org.apache.lens.api.query.SchedulerJobInstanceInfo;
-import org.apache.lens.api.scheduler.XJob;
+import org.apache.lens.api.scheduler.*;
 import org.apache.lens.server.BaseLensService;
 import org.apache.lens.server.api.error.LensException;
 import org.apache.lens.server.api.health.HealthStatus;
-import org.apache.lens.server.api.scheduler.SchedulerJobStats;
 import org.apache.lens.server.api.scheduler.SchedulerService;
 
 import org.apache.hive.service.cli.CLIService;

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-server/src/main/java/org/apache/lens/server/scheduler/notification/services/AlarmService.java
----------------------------------------------------------------------
diff --git 
a/lens-server/src/main/java/org/apache/lens/server/scheduler/notification/services/AlarmService.java
 
b/lens-server/src/main/java/org/apache/lens/server/scheduler/notification/services/AlarmService.java
index f575bc8..a4cdd83 100644
--- 
a/lens-server/src/main/java/org/apache/lens/server/scheduler/notification/services/AlarmService.java
+++ 
b/lens-server/src/main/java/org/apache/lens/server/scheduler/notification/services/AlarmService.java
@@ -18,7 +18,7 @@
 
 package org.apache.lens.server.scheduler.notification.services;
 
-import org.apache.lens.api.query.SchedulerJobHandle;
+import org.apache.lens.api.scheduler.SchedulerJobHandle;
 import org.apache.lens.api.scheduler.XFrequency;
 import org.apache.lens.api.scheduler.XFrequencyEnum;
 import org.apache.lens.server.LensServices;
@@ -41,7 +41,7 @@ import lombok.extern.slf4j.Slf4j;
  * This service is used primarily by Scheduler to get alarm notifications for 
scheduled queries.
  *
  * As a schedule this service accepts start time, frequency, end time and 
timeZone. It also requires the
- * {@link org.apache.lens.api.query.SchedulerJobHandle} which it sends as part 
of the
+ * {@link SchedulerJobHandle} which it sends as part of the
  * {@link org.apache.lens.server.api.events.SchedulerAlarmEvent} to inform the 
scheduler about the job for which
  * job the notification has been generated.
  */

http://git-wip-us.apache.org/repos/asf/lens/blob/d7efa9e3/lens-server/src/test/java/org/apache/lens/server/scheduler/notification/services/AlarmServiceTest.java
----------------------------------------------------------------------
diff --git 
a/lens-server/src/test/java/org/apache/lens/server/scheduler/notification/services/AlarmServiceTest.java
 
b/lens-server/src/test/java/org/apache/lens/server/scheduler/notification/services/AlarmServiceTest.java
index 838b9b8..06883ae 100644
--- 
a/lens-server/src/test/java/org/apache/lens/server/scheduler/notification/services/AlarmServiceTest.java
+++ 
b/lens-server/src/test/java/org/apache/lens/server/scheduler/notification/services/AlarmServiceTest.java
@@ -23,7 +23,7 @@ import static org.testng.Assert.assertTrue;
 
 import java.util.*;
 
-import org.apache.lens.api.query.SchedulerJobHandle;
+import org.apache.lens.api.scheduler.SchedulerJobHandle;
 import org.apache.lens.api.scheduler.XFrequency;
 import org.apache.lens.api.scheduler.XFrequencyEnum;
 import org.apache.lens.server.EventServiceImpl;

Reply via email to