maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From denn...@apache.org
Subject svn commit: r1379894 - in /maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira: JiraQueryBuilder.java JqlQueryBuilder.java ParameterQueryBuilder.java
Date Sat, 01 Sep 2012 23:20:56 GMT
Author: dennisl
Date: Sat Sep  1 23:20:55 2012
New Revision: 1379894

URL: http://svn.apache.org/viewvc?rev=1379894&view=rev
Log:
Extract an interface to make sure that both ways of querying JIRA are kept in sync.

Added:
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraQueryBuilder.java
  (with props)
Modified:
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java
  (contents, props changed)
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/ParameterQueryBuilder.java
  (contents, props changed)

Added: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraQueryBuilder.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraQueryBuilder.java?rev=1379894&view=auto
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraQueryBuilder.java
(added)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraQueryBuilder.java
Sat Sep  1 23:20:55 2012
@@ -0,0 +1,56 @@
+package org.apache.maven.plugin.jira;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.plugin.logging.Log;
+
+/**
+ * An interface for building a search query for JIRA.
+ *
+ * @author Dennis Lundberg
+ * @version $Id$
+ * @since 2.8
+ */
+public interface JiraQueryBuilder
+{
+    String build();
+
+    JiraQueryBuilder components( String components );
+
+    JiraQueryBuilder filter( String filter );
+
+    JiraQueryBuilder fixVersion( String fixVersion );
+
+    JiraQueryBuilder fixVersionIds( String fixVersionIds );
+
+    Log getLog();
+
+    JiraQueryBuilder priorityIds( String priorityIds );
+
+    JiraQueryBuilder project( String project );
+
+    JiraQueryBuilder resolutionIds( String resolutionIds );
+
+    JiraQueryBuilder sortColumnNames( String sortColumnNames );
+
+    JiraQueryBuilder statusIds( String statusIds );
+
+    JiraQueryBuilder typeIds( String typeIds );
+}

Propchange: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraQueryBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraQueryBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author Id

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java?rev=1379894&r1=1379893&r2=1379894&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java
Sat Sep  1 23:20:55 2012
@@ -30,9 +30,11 @@ import org.apache.maven.plugin.logging.L
  * Only a limited set of JQL is supported.
  *
  * @author ton.swieb@finalist.com
+ * @version $Id$
  * @since 2.8
  */
 public class JqlQueryBuilder
+    implements JiraQueryBuilder
 {
     /**
      * Log for debug output.
@@ -50,7 +52,7 @@ public class JqlQueryBuilder
         this.log = log;
     }
 
-    public JqlQueryBuilder project( String project )
+    public JiraQueryBuilder project( String project )
     {
         addSingleValue( "project", project );
         return this;
@@ -63,43 +65,43 @@ public class JqlQueryBuilder
      * @param fixVersionIds
      * @return
      */
-    public JqlQueryBuilder fixVersionIds( String fixVersionIds )
+    public JiraQueryBuilder fixVersionIds( String fixVersionIds )
     {
         addCommaSeparatedValues( "fixVersion", fixVersionIds );
         return this;
     }
 
-    public JqlQueryBuilder statusIds( String statusIds )
+    public JiraQueryBuilder statusIds( String statusIds )
     {
         addCommaSeparatedValues( "status", statusIds );
         return this;
     }
 
-    public JqlQueryBuilder priorityIds( String priorityIds )
+    public JiraQueryBuilder priorityIds( String priorityIds )
     {
         addCommaSeparatedValues( "priority", priorityIds );
         return this;
     }
 
-    public JqlQueryBuilder resolutionIds( String resolutionIds )
+    public JiraQueryBuilder resolutionIds( String resolutionIds )
     {
         addCommaSeparatedValues( "resolution", resolutionIds );
         return this;
     }
 
-    public JqlQueryBuilder components( String components )
+    public JiraQueryBuilder components( String components )
     {
         addCommaSeparatedValues( "component", components );
         return this;
     }
 
-    public JqlQueryBuilder typeIds( String typeIds )
+    public JiraQueryBuilder typeIds( String typeIds )
     {
         addCommaSeparatedValues( "type", typeIds );
         return this;
     }
 
-    public JqlQueryBuilder filter( String filter )
+    public JiraQueryBuilder filter( String filter )
     {
         this.filter = filter;
         return this;
@@ -112,13 +114,13 @@ public class JqlQueryBuilder
      * @param fixVersion
      * @return
      */
-    public JqlQueryBuilder fixVersion( String fixVersion )
+    public JiraQueryBuilder fixVersion( String fixVersion )
     {
         addSingleValue( "fixVersion", fixVersion );
         return this;
     }
 
-    public JqlQueryBuilder sortColumnNames( String sortColumnNames )
+    public JiraQueryBuilder sortColumnNames( String sortColumnNames )
     {
         if ( sortColumnNames != null )
         {

Propchange: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author Id

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/ParameterQueryBuilder.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/ParameterQueryBuilder.java?rev=1379894&r1=1379893&r2=1379894&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/ParameterQueryBuilder.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/ParameterQueryBuilder.java
Sat Sep  1 23:20:55 2012
@@ -29,9 +29,12 @@ import org.apache.maven.plugin.logging.L
  * JIRA 3.x way of constructing a search query based on URL parameters.
  * 
  * @author ton.swieb@finalist.com
+ * @version $Id$
  * @since 2.8
  */
-public class ParameterQueryBuilder {
+public class ParameterQueryBuilder
+    implements JiraQueryBuilder
+{
     /** Log for debug output. */
     protected Log log;
     private String filter = "";
@@ -78,7 +81,15 @@ public class ParameterQueryBuilder {
         typeMap.put( "Sub-task", "7" );
     }
 
-    public ParameterQueryBuilder fixVersionIds( String fixVersionIds )
+    /**
+     * This method has no effect in this implementation.
+     */
+    public JiraQueryBuilder fixVersion( String fixVersion )
+    {
+        return this;
+    }
+
+    public JiraQueryBuilder fixVersionIds( String fixVersionIds )
     {
         // add fix versions
         if ( fixVersionIds != null )
@@ -96,7 +107,7 @@ public class ParameterQueryBuilder {
         return this;
     }
 
-    public ParameterQueryBuilder statusIds( String statusIds )
+    public JiraQueryBuilder statusIds( String statusIds )
     {
         // get the Status Ids
         if ( statusIds != null )
@@ -129,7 +140,7 @@ public class ParameterQueryBuilder {
         return this;
     }
 
-    public ParameterQueryBuilder priorityIds( String priorityIds )
+    public JiraQueryBuilder priorityIds( String priorityIds )
     {
         // get the Priority Ids
         if ( priorityIds != null )
@@ -150,7 +161,15 @@ public class ParameterQueryBuilder {
         return this;
     }
 
-    public ParameterQueryBuilder resolutionIds( String resolutionIds )
+    /**
+     * This method has no effect in this implementation.
+     */
+    public JiraQueryBuilder project( String project )
+    {
+        return this;
+    }
+
+    public JiraQueryBuilder resolutionIds( String resolutionIds )
     {
         // get the Resolution Ids
         if ( resolutionIds != null )
@@ -171,7 +190,7 @@ public class ParameterQueryBuilder {
         return this;
     }
 
-    public ParameterQueryBuilder components( String components )
+    public JiraQueryBuilder components( String components )
     {
         // add components
         if ( components != null )
@@ -190,7 +209,7 @@ public class ParameterQueryBuilder {
         return this;
     }
 
-    public ParameterQueryBuilder typeIds( String typeIds )
+    public JiraQueryBuilder typeIds( String typeIds )
     {
         // get the Type Ids
         if ( typeIds != null )
@@ -210,7 +229,7 @@ public class ParameterQueryBuilder {
         return this;
     }
 
-    public ParameterQueryBuilder sortColumnNames( String sortColumnNames )
+    public JiraQueryBuilder sortColumnNames( String sortColumnNames )
     {
         // get the Sort order
         int validSortColumnNames = 0;
@@ -312,7 +331,7 @@ public class ParameterQueryBuilder {
         return this;
     }
 
-    public ParameterQueryBuilder filter( String filter )
+    public JiraQueryBuilder filter( String filter )
     {
         this.filter = filter;
         return this;

Propchange: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/ParameterQueryBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author Id



Mime
View raw message