use person class for author parameter

This commit is contained in:
Sebastian Sdorra
2012-07-14 16:41:49 +02:00
parent 55e5b1eb54
commit 5d86c7d1cf
17 changed files with 144 additions and 46 deletions

View File

@@ -33,13 +33,16 @@ package sonia.scm.repository.client.api;
//~--- non-JDK imports --------------------------------------------------------
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sonia.scm.repository.client.spi.AddCommand;
import sonia.scm.util.Util;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
/**
*
* @author Sebastian Sdorra
@@ -78,6 +81,8 @@ public final class AddCommandBuilder
* @param pathes
*
* @return
*
* @throws IOException
*/
public AddCommandBuilder add(String path, String... pathes) throws IOException
{
@@ -99,6 +104,8 @@ public final class AddCommandBuilder
*
*
* @param path
*
* @throws IOException
*/
private void add(String path) throws IOException
{

View File

@@ -33,12 +33,15 @@ package sonia.scm.repository.client.api;
//~--- non-JDK imports --------------------------------------------------------
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sonia.scm.repository.client.spi.BranchCommand;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
/**
*
* @author Sebastian Sdorra
@@ -75,6 +78,8 @@ public final class BranchCommandBuilder
* @param name
*
* @return
*
* @throws IOException
*/
public BranchCommandBuilder branch(String name) throws IOException
{

View File

@@ -26,6 +26,9 @@
* http://bitbucket.org/sdorra/scm-manager
*
*/
package sonia.scm.repository.client.api;
/**

View File

@@ -34,15 +34,19 @@ package sonia.scm.repository.client.api;
//~--- non-JDK imports --------------------------------------------------------
import com.google.common.collect.Lists;
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sonia.scm.repository.Changeset;
import sonia.scm.repository.Person;
import sonia.scm.repository.client.spi.CommitCommand;
import sonia.scm.repository.client.spi.CommitRequest;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
/**
*
* @author Sebastian Sdorra
@@ -97,8 +101,10 @@ public final class CommitCommandBuilder
* @param message
*
* @return
*
* @throws IOException
*/
public Changeset commit(String author, String message) throws IOException
public Changeset commit(Person author, String message) throws IOException
{
request.setAuthor(author);
request.setMessage(message);

View File

@@ -33,12 +33,15 @@ package sonia.scm.repository.client.api;
//~--- non-JDK imports --------------------------------------------------------
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sonia.scm.repository.client.spi.PushCommand;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
/**
*
* @author Sebastian Sdorra
@@ -71,6 +74,8 @@ public final class PushCommandBuilder
/**
* Method description
*
*
* @throws IOException
*/
public void push() throws IOException
{

View File

@@ -33,13 +33,16 @@ package sonia.scm.repository.client.api;
//~--- non-JDK imports --------------------------------------------------------
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sonia.scm.repository.client.spi.RemoveCommand;
import sonia.scm.util.Util;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
/**
*
* @author Sebastian Sdorra
@@ -78,8 +81,11 @@ public final class RemoveCommandBuilder
* @param pathes
*
* @return
*
* @throws IOException
*/
public RemoveCommandBuilder remove(String path, String... pathes) throws IOException
public RemoveCommandBuilder remove(String path, String... pathes)
throws IOException
{
remove(path);
@@ -99,6 +105,8 @@ public final class RemoveCommandBuilder
*
*
* @param path
*
* @throws IOException
*/
private void remove(String path) throws IOException
{

View File

@@ -69,6 +69,8 @@ public final class RepositoryClientFactory
* @param workingCopy
*
* @return
*
* @throws IOException
*/
public RepositoryClient create(File main, File workingCopy) throws IOException
{
@@ -86,9 +88,12 @@ public final class RepositoryClientFactory
* @param workingCopy
*
* @return
*
* @throws IOException
*/
public RepositoryClient create(String url, String username, String password,
File workingCopy) throws IOException
File workingCopy)
throws IOException
{
return new RepositoryClient(provider.create(url, username, password,
workingCopy));

View File

@@ -33,7 +33,6 @@ package sonia.scm.repository.client.api;
//~--- non-JDK imports --------------------------------------------------------
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,6 +40,10 @@ 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;
/**
*
* @author Sebastian Sdorra
@@ -77,6 +80,8 @@ public final class TagCommandBuilder
* @param name
*
* @return
*
* @throws IOException
*/
public Tag tag(String name) throws IOException
{

View File

@@ -31,6 +31,8 @@
package sonia.scm.repository.client.spi;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
/**
@@ -48,6 +50,8 @@ public interface AddCommand
* @param path
*
* @param file
*
* @throws IOException
*/
public void add(String path) throws IOException;
}

View File

@@ -26,11 +26,19 @@
* http://bitbucket.org/sdorra/scm-manager
*
*/
package sonia.scm.repository.client.spi;
import java.io.IOException;
//~--- non-JDK imports --------------------------------------------------------
import sonia.scm.repository.Branch;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
/**
*
* @author Sebastian Sdorra
@@ -38,5 +46,16 @@ import sonia.scm.repository.Branch;
*/
public interface BranchCommand
{
/**
* Method description
*
*
* @param name
*
* @return
*
* @throws IOException
*/
public Branch branch(String name) throws IOException;
}

View File

@@ -33,9 +33,12 @@ package sonia.scm.repository.client.spi;
//~--- non-JDK imports --------------------------------------------------------
import java.io.IOException;
import sonia.scm.repository.Changeset;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
/**
*
* @author Sebastian Sdorra
@@ -51,6 +54,8 @@ public interface CommitCommand
* @param request
*
* @return
*
* @throws IOException
*/
public Changeset commit(CommitRequest request) throws IOException;
}

View File

@@ -35,6 +35,8 @@ package sonia.scm.repository.client.spi;
import com.google.common.base.Objects;
import sonia.scm.repository.Person;
//~--- JDK imports ------------------------------------------------------------
import java.util.List;
@@ -125,7 +127,7 @@ public final class CommitRequest
*
* @param author
*/
public void setAuthor(String author)
public void setAuthor(Person author)
{
this.author = author;
}
@@ -162,7 +164,7 @@ public final class CommitRequest
*
* @return
*/
String getAuthor()
Person getAuthor()
{
return author;
}
@@ -192,7 +194,7 @@ public final class CommitRequest
//~--- fields ---------------------------------------------------------------
/** Field description */
private String author;
private Person author;
/** Field description */
private String message;

View File

@@ -31,6 +31,8 @@
package sonia.scm.repository.client.spi;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
/**
@@ -44,6 +46,8 @@ public interface PushCommand
/**
* Method description
*
*
* @throws IOException
*/
public void push() throws IOException;
}

View File

@@ -31,6 +31,8 @@
package sonia.scm.repository.client.spi;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
/**
@@ -48,6 +50,8 @@ public interface RemoveCommand
* @param file
*
* @param path
*
* @throws IOException
*/
public void remove(String path) throws IOException;
}

View File

@@ -52,8 +52,11 @@ public interface RepositoryClientFactoryProvider
* @param workingCopy
*
* @return
*
* @throws IOException
*/
public RepositoryClientProvider create(File main, File workingCopy) throws IOException;
public RepositoryClientProvider create(File main, File workingCopy)
throws IOException;
/**
* Method description
@@ -65,7 +68,10 @@ public interface RepositoryClientFactoryProvider
* @param workingCopy
*
* @return
*
* @throws IOException
*/
public RepositoryClientProvider create(String url, String username,
String password, File workingCopy) throws IOException;
String password, File workingCopy)
throws IOException;
}

View File

@@ -33,9 +33,12 @@ package sonia.scm.repository.client.spi;
//~--- non-JDK imports --------------------------------------------------------
import java.io.IOException;
import sonia.scm.repository.Tag;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
/**
*
* @author Sebastian Sdorra
@@ -51,6 +54,8 @@ public interface TagCommand
* @param request
*
* @return
*
* @throws IOException
*/
public Tag tag(TagRequest request) throws IOException;
}

View File

@@ -82,6 +82,16 @@ public final class TagRequest
return Objects.hashCode(revision, name);
}
/**
* Method description
*
*/
public void reset()
{
this.name = null;
this.revision = null;
}
/**
* Method description
*
@@ -99,35 +109,6 @@ public final class TagRequest
//J+
}
public void reset(){
this.name = null;
this.revision = null;
}
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @return
*/
String getName()
{
return name;
}
/**
* Method description
*
*
* @return
*/
String getRevision()
{
return revision;
}
//~--- set methods ----------------------------------------------------------
/**
@@ -152,6 +133,30 @@ public final class TagRequest
this.revision = revision;
}
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @return
*/
String getName()
{
return name;
}
/**
* Method description
*
*
* @return
*/
String getRevision()
{
return revision;
}
//~--- fields ---------------------------------------------------------------
/** Field description */