Permalink
Browse files

Merge pull request #3 from cummingsengineering/master

Add API for managing CouchDB replication configuration
  • Loading branch information...
2 parents 3fc2756 + b5e341f commit 002d5b174c96bc19ec4e07a4376c87f9bf072c64 @mbreese committed Jan 31, 2012
View
@@ -2,7 +2,7 @@
<project name="couchdb4j" basedir="." default="jar">
<property name="version.major" value="0"/>
- <property name="version.minor" value="3.0-SVN"/>
+ <property name="version.minor" value="3.1"/>
<property name="java.src.dir" value="src/java"/>
<property name="lib.dir" value="lib/"/>
@@ -0,0 +1,86 @@
+/**
+ * Copyright (c) 2011 Cummings Engineering Consultants, Inc.
+ *
+ * Licensed 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 com.fourspaces.couchdb;
+
+/**
+ * This class encapsulates the data for a task running on a couch server (as returned from the query to "_active_tasks")
+ *
+ * @author anthony.payne
+ *
+ */
+public class CouchTask {
+
+ /** Key of JSON field for the task type */
+ public static final String TASK_TYPE_KEY = "type";
+ /** Key of the JSON field for the task */
+ public static final String TASK_TASK_KEY = "task";
+ /** Key for the JSON field for the status of the task */
+ public static final String TASK_STATUS_KEY = "status";
+ /** Key for the JSON field for the pid field of the task */
+ public static final String TASK_PID_KEY = "pid";
+
+ /** Type of task */
+ protected String type;
+ /** Details of the task */
+ protected String task;
+ /** Status of the task */
+ protected String status;
+ /** PID of the task */
+ protected String pid;
+
+
+ /**
+ * @param type Type of task
+ * @param task Task details
+ * @param status Status of task
+ * @param pid PID of task
+ */
+ public CouchTask(final String type, final String task, final String status, final String pid) {
+ this.type = type;
+ this.task = task;
+ this.status = status;
+ this.pid = pid;
+ }
+
+ /**
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * @return the task
+ */
+ public String getTask() {
+ return task;
+ }
+
+ /**
+ * @return the status
+ */
+ public String getStatus() {
+ return status;
+ }
+
+ /**
+ * @return the pid
+ */
+ public String getPid() {
+ return pid;
+ }
+}
Oops, something went wrong.

0 comments on commit 002d5b1

Please sign in to comment.