diff --git a/scm-core/src/main/java/sonia/scm/repository/Changeset.java b/scm-core/src/main/java/sonia/scm/repository/Changeset.java index 379582c8c8..dc12dc382f 100644 --- a/scm-core/src/main/java/sonia/scm/repository/Changeset.java +++ b/scm-core/src/main/java/sonia/scm/repository/Changeset.java @@ -56,6 +56,7 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; /** + * Represents a changeset/commit of a repository. * * @author Sebastian Sdorra */ @@ -71,18 +72,18 @@ public class Changeset extends BasicPropertiesAware //~--- constructors --------------------------------------------------------- /** - * Constructs ... + * Constructs a new instance of changeset. * */ public Changeset() {} /** - * Constructs ... + * Constructs a new instance of changeset. * * - * @param id - * @param date - * @param author + * @param id id of the changeset + * @param date date of the changeset + * @param author author of the changeset */ public Changeset(String id, Long date, Person author) { @@ -90,13 +91,13 @@ public class Changeset extends BasicPropertiesAware } /** - * Constructs ... + * Constructs a new instance of changeset. * * - * @param id - * @param date - * @param author - * @param description + * @param id id of the changeset + * @param date date of the changeset + * @param author author of the changeset + * @param description description of the changeset */ public Changeset(String id, Long date, Person author, String description) { @@ -155,7 +156,7 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * {@inheritDoc} * * * @return @@ -194,10 +195,10 @@ public class Changeset extends BasicPropertiesAware //~--- get methods ---------------------------------------------------------- /** - * Method description + * Returns the author of the changeset. * * - * @return + * @return author of the changeset */ public Person getAuthor() { @@ -205,10 +206,10 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Returns the branches of the changeset. * * - * @return + * @return branches of the changeset */ public List getBranches() { @@ -221,10 +222,10 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Returns the creation date of the changeset. * * - * @return + * @return date of the changeset */ public Long getDate() { @@ -232,10 +233,10 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Return the description (commit message) of the changeset. * * - * @return + * @return description of the changeset */ public String getDescription() { @@ -243,10 +244,10 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Returns the id of the changeset. * * - * @return + * @return id of the changeset */ public String getId() { @@ -254,10 +255,10 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Returns the file modifications, which was done with this changeset. * * - * @return + * @return file modifications */ public Modifications getModifications() { @@ -270,7 +271,7 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Return the ids of the parent changesets. * * * @return @@ -287,10 +288,10 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Returns tags associated with this changeset. * * - * @return + * @return tags of the changeset */ public List getTags() { @@ -303,10 +304,10 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Returns true if the changeset is valid. * * - * @return + * @return true if the changeset is valid */ @Override public boolean isValid() @@ -318,10 +319,10 @@ public class Changeset extends BasicPropertiesAware //~--- set methods ---------------------------------------------------------- /** - * Method description + * Sets the author of the changeset. * * - * @param author + * @param author author of the changeset */ public void setAuthor(Person author) { @@ -329,10 +330,10 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Sets the branches of the changeset. * * - * @param branches + * @param branches branches of the changeset */ public void setBranches(List branches) { @@ -340,10 +341,10 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Sets the date of the changeset. * * - * @param date + * @param date date of the changeset */ public void setDate(Long date) { @@ -351,10 +352,10 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Sets the description (commit message) of the changeset. * * - * @param description + * @param description description of the changeset */ public void setDescription(String description) { @@ -362,10 +363,10 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Sets the id of the changeset. * * - * @param id + * @param id id of the changeset */ public void setId(String id) { @@ -373,10 +374,10 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Sets the file modification of the changeset. * * - * @param modifications + * @param modifications file modifications */ public void setModifications(Modifications modifications) { @@ -384,10 +385,10 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Sets the parents of the changeset. * * - * @param parents + * @param parents parents of the changeset * @since 1.11 */ public void setParents(List parents) @@ -396,10 +397,10 @@ public class Changeset extends BasicPropertiesAware } /** - * Method description + * Sets the tags of the changeset * * - * @param tags + * @param tags tags of the changeset */ public void setTags(List tags) { diff --git a/scm-core/src/main/java/sonia/scm/repository/ChangesetPagingResult.java b/scm-core/src/main/java/sonia/scm/repository/ChangesetPagingResult.java index 2b1b455939..0d2faad088 100644 --- a/scm-core/src/main/java/sonia/scm/repository/ChangesetPagingResult.java +++ b/scm-core/src/main/java/sonia/scm/repository/ChangesetPagingResult.java @@ -47,6 +47,8 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; /** + * The changeset paging result is used to do a paging over the + * {@link Changeset}s of a {@link Repository}. * * @author Sebastian Sdorra */ @@ -61,17 +63,17 @@ public class ChangesetPagingResult implements Iterable, Serializable //~--- constructors --------------------------------------------------------- /** - * Constructs ... + * Constructs a new changeset paging result. * */ public ChangesetPagingResult() {} /** - * Constructs ... + * Constructs a new changeset paging result. * * - * @param total - * @param changesets + * @param total total number of changesets + * @param changesets current list of fetched changesets */ public ChangesetPagingResult(int total, List changesets) { @@ -82,10 +84,10 @@ public class ChangesetPagingResult implements Iterable, Serializable //~--- methods -------------------------------------------------------------- /** - * Method description + * Returns an iterator which can iterate over the current list of changesets. * * - * @return + * @return iterator for current list of changesets * @since 1.8 */ @Override @@ -104,10 +106,10 @@ public class ChangesetPagingResult implements Iterable, Serializable //~--- get methods ---------------------------------------------------------- /** - * Method description + * Returns the current list of changesets. * * - * @return + * @return current list of changesets */ public List getChangesets() { @@ -115,10 +117,10 @@ public class ChangesetPagingResult implements Iterable, Serializable } /** - * Method description + * Returns the total number of changesets. * * - * @return + * @return total number of changesets */ public int getTotal() { @@ -128,10 +130,10 @@ public class ChangesetPagingResult implements Iterable, Serializable //~--- set methods ---------------------------------------------------------- /** - * Method description + * Sets the current list of changesets. * * - * @param changesets + * @param changesets current list of changesets */ public void setChangesets(List changesets) { @@ -139,10 +141,10 @@ public class ChangesetPagingResult implements Iterable, Serializable } /** - * Method description + * Sets the total number of changesets * * - * @param total + * @param total total number of changesets */ public void setTotal(int total) { @@ -151,11 +153,11 @@ public class ChangesetPagingResult implements Iterable, Serializable //~--- fields --------------------------------------------------------------- - /** Field description */ + /** current list of changesets */ @XmlElement(name = "changeset") @XmlElementWrapper(name = "changesets") private List changesets; - /** Field description */ + /** total number of changesets */ private int total; } diff --git a/scm-core/src/main/java/sonia/scm/repository/PostReceiveRepositoryHook.java b/scm-core/src/main/java/sonia/scm/repository/PostReceiveRepositoryHook.java index b4308a6784..61f7c5f18f 100644 --- a/scm-core/src/main/java/sonia/scm/repository/PostReceiveRepositoryHook.java +++ b/scm-core/src/main/java/sonia/scm/repository/PostReceiveRepositoryHook.java @@ -39,7 +39,9 @@ import java.util.Arrays; import java.util.Collection; /** + * Base class for asynchronous post receive repository hook. * + * @see RepositoryHookType#POST_RECEIVE * @author Sebastian Sdorra * @since 1.8 */ @@ -47,7 +49,7 @@ public abstract class PostReceiveRepositoryHook implements RepositoryHook { /** - * Method description + * {@inheritDoc} * * * @return @@ -59,7 +61,7 @@ public abstract class PostReceiveRepositoryHook implements RepositoryHook } /** - * Method description + * {@inheritDoc} * * * @return diff --git a/scm-core/src/main/java/sonia/scm/repository/PreReceiveRepositoryHook.java b/scm-core/src/main/java/sonia/scm/repository/PreReceiveRepositoryHook.java index 58a8288628..95cb092e8e 100644 --- a/scm-core/src/main/java/sonia/scm/repository/PreReceiveRepositoryHook.java +++ b/scm-core/src/main/java/sonia/scm/repository/PreReceiveRepositoryHook.java @@ -39,7 +39,9 @@ import java.util.Arrays; import java.util.Collection; /** + * Base class for pre receive repository hooks. * + * @see RepositoryHookType#PRE_RECEIVE * @author Sebastian Sdorra * @since 1.8 */ @@ -47,7 +49,7 @@ public abstract class PreReceiveRepositoryHook implements RepositoryHook { /** - * Method description + * {@inheritDoc} * * * @return @@ -59,7 +61,7 @@ public abstract class PreReceiveRepositoryHook implements RepositoryHook } /** - * Method description + * {@inheritDoc} * * * @return diff --git a/scm-core/src/main/java/sonia/scm/repository/RepositoryHookEvent.java b/scm-core/src/main/java/sonia/scm/repository/RepositoryHookEvent.java index 9065e3568c..44ae70b6db 100644 --- a/scm-core/src/main/java/sonia/scm/repository/RepositoryHookEvent.java +++ b/scm-core/src/main/java/sonia/scm/repository/RepositoryHookEvent.java @@ -38,6 +38,7 @@ package sonia.scm.repository; import java.util.Collection; /** + * Repository hook event represents an change event of a repository. * * @author Sebastian Sdorra * @since 1.6 @@ -46,36 +47,38 @@ public interface RepositoryHookEvent { /** - * Method description + * Returns a collection of changesets which are added with this repository + * event. * * - * @return + * @return a collection of added changesets */ public Collection getChangesets(); /** - * Method description + * Returns the repository which was modified. * * - * @return + * @return modified repository */ public Repository getRepository(); /** - * Method description + * Returns the type of hook event. * * - * @return + * @return type of hook event */ public RepositoryHookType getType(); //~--- set methods ---------------------------------------------------------- /** - * Method description + * Sets the modified repository. This method is only for internal use and + * should never be called on a hook. * * - * @param repository + * @param repository modified repository */ void setRepository(Repository repository); } diff --git a/scm-core/src/main/java/sonia/scm/repository/RepositoryHookType.java b/scm-core/src/main/java/sonia/scm/repository/RepositoryHookType.java index d0abfa463d..d1dab76d4b 100644 --- a/scm-core/src/main/java/sonia/scm/repository/RepositoryHookType.java +++ b/scm-core/src/main/java/sonia/scm/repository/RepositoryHookType.java @@ -34,6 +34,7 @@ package sonia.scm.repository; /** + * Type of repository hook. * * @author Sebastian Sdorra * @since 1.6 @@ -42,11 +43,18 @@ public enum RepositoryHookType { /** + * A pre receive hook is invoked when new changesets are pushed to the + * repository, but they are not yet stored in the repository. A pre receive + * hook can be used to reject the new incoming changesets. + * * @since 1.8 */ PRE_RECEIVE, /** + * A post receive hook is invoked when new changesets are stored in the + * repository. + * * @since 1.6 */ POST_RECEIVE diff --git a/scm-core/src/main/java/sonia/scm/repository/RepositoryType.java b/scm-core/src/main/java/sonia/scm/repository/RepositoryType.java index 9a562cc279..df932ade8d 100644 --- a/scm-core/src/main/java/sonia/scm/repository/RepositoryType.java +++ b/scm-core/src/main/java/sonia/scm/repository/RepositoryType.java @@ -42,6 +42,7 @@ import sonia.scm.repository.api.Command; import java.util.Set; /** + * The type (mercurial, subversion, git) of a {@link Repository}. * * @author Sebastian Sdorra * @since 1.18 @@ -57,12 +58,12 @@ public class RepositoryType extends Type public RepositoryType() {} /** - * Constructs ... + * Constructs a new {@link RepositoryType} object. * * - * @param name - * @param displayName - * @param supportedCommands + * @param name name of the type + * @param displayName display name of the type + * @param supportedCommands supported commands of the type */ public RepositoryType(String name, String displayName, Set supportedCommands) @@ -74,10 +75,10 @@ public class RepositoryType extends Type //~--- get methods ---------------------------------------------------------- /** - * Method description + * Returns a set of commands, which are supported of the repository type. * * - * @return + * @return set of supported commands */ public Set getSupportedCommands() { @@ -86,6 +87,6 @@ public class RepositoryType extends Type //~--- fields --------------------------------------------------------------- - /** Field description */ + /** set of supported commands */ private Set supportedCommands; } diff --git a/scm-core/src/main/java/sonia/scm/repository/RepositoryTypePredicate.java b/scm-core/src/main/java/sonia/scm/repository/RepositoryTypePredicate.java index ac7d389a60..69116ed50a 100644 --- a/scm-core/src/main/java/sonia/scm/repository/RepositoryTypePredicate.java +++ b/scm-core/src/main/java/sonia/scm/repository/RepositoryTypePredicate.java @@ -30,6 +30,7 @@ */ + package sonia.scm.repository; //~--- non-JDK imports -------------------------------------------------------- @@ -37,6 +38,7 @@ package sonia.scm.repository; import com.google.common.base.Predicate; /** + * Used to filter collections of repositories by its type. * * @author Sebastian Sdorra * @since 1.16 @@ -45,10 +47,10 @@ public class RepositoryTypePredicate implements Predicate { /** - * Constructs ... + * Constructs new {@link RepositoryTypePredicate} object. * * - * @param type + * @param type type to filter */ public RepositoryTypePredicate(String type) { @@ -58,12 +60,12 @@ public class RepositoryTypePredicate implements Predicate //~--- methods -------------------------------------------------------------- /** - * Method description + * Return true if the repository is from the given type. * * - * @param repository + * @param repository repository to check * - * @return + * @return true if the repository is from the given type */ @Override public boolean apply(Repository repository) @@ -73,6 +75,6 @@ public class RepositoryTypePredicate implements Predicate //~--- fields --------------------------------------------------------------- - /** Field description */ + /** type to filter */ private String type; }