add tag endpoints

This commit is contained in:
Mohamed Karray
2018-09-04 17:38:28 +02:00
parent dc35393c1c
commit 9b7e34b08b
17 changed files with 471 additions and 50 deletions

View File

@@ -36,13 +36,12 @@ package sonia.scm.repository.client.api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sonia.scm.repository.client.spi.PushCommand;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
//~--- JDK imports ------------------------------------------------------------
/**
*
* @author Sebastian Sdorra
@@ -88,6 +87,14 @@ public final class PushCommandBuilder
command.push();
}
public void pushTags() throws IOException {
if (logger.isDebugEnabled()) {
logger.debug("push tag changes back to main repository");
}
command.pushTags();
}
//~--- fields ---------------------------------------------------------------
/** Field description */

View File

@@ -36,15 +36,14 @@ package sonia.scm.repository.client.api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sonia.scm.repository.Tag;
import sonia.scm.repository.client.spi.TagCommand;
import sonia.scm.repository.client.spi.TagRequest;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
//~--- JDK imports ------------------------------------------------------------
/**
*
* @author Sebastian Sdorra
@@ -84,9 +83,10 @@ public final class TagCommandBuilder
*
* @throws IOException
*/
public Tag tag(String name) throws IOException
public Tag tag(String name, String username) throws IOException
{
request.setName(name);
request.setUsername(username);
if (logger.isDebugEnabled())
{

View File

@@ -44,11 +44,7 @@ import java.io.IOException;
public interface PushCommand
{
/**
* Method description
*
*
* @throws IOException
*/
public void push() throws IOException;
void push() throws IOException;
void pushTags() throws IOException;
}

View File

@@ -91,6 +91,7 @@ public final class TagRequest
{
this.name = null;
this.revision = null;
this.username = null;
}
/**
@@ -106,6 +107,7 @@ public final class TagRequest
return MoreObjects.toStringHelper(this)
.add("revision", revision)
.add("name", name)
.add("username", username)
.toString();
//J+
}
@@ -134,6 +136,10 @@ public final class TagRequest
this.revision = revision;
}
public void setUsername(String username) {
this.username = username;
}
//~--- get methods ----------------------------------------------------------
/**
@@ -158,6 +164,10 @@ public final class TagRequest
return revision;
}
public String getUserName() {
return username;
}
//~--- fields ---------------------------------------------------------------
/** Field description */
@@ -165,4 +175,6 @@ public final class TagRequest
/** Field description */
private String revision;
private String username;
}