merge with 2.0.0-m3

This commit is contained in:
Sebastian Sdorra
2018-07-16 10:36:29 +02:00
18 changed files with 346 additions and 316 deletions

View File

@@ -53,5 +53,11 @@ public interface ModelObject
*
* @return unique id
*/
public String getId();
String getId();
void setLastModified(Long timestamp);
Long getCreationDate();
void setCreationDate(Long timestamp);
}

View File

@@ -42,15 +42,9 @@ package sonia.scm.group;
public class GroupAlreadyExistsException extends GroupException
{
/** Field description */
private static final long serialVersionUID = 4042878550219750430L;
/**
* Constructs a new instance.
*
* @param name The name (aka id) of the group
*/
public GroupAlreadyExistsException(String name) {
super(name + " group already exists");
public GroupAlreadyExistsException(Group group) {
super(group.getName() + " group already exists");
}
}

View File

@@ -52,7 +52,7 @@ public class GroupNotFoundException extends GroupException
* Constructs a new GroupNotFoundException.
*
*/
public GroupNotFoundException() {
super("group does not exists");
public GroupNotFoundException(Group group) {
super("group " + group.getName() + " does not exist");
}
}

View File

@@ -52,17 +52,11 @@ public class RepositoryNotFoundException extends RepositoryException
* error detail message.
*
*/
public RepositoryNotFoundException() {}
public RepositoryNotFoundException(Repository repository) {
super("repository " + repository.getName() + "/" + repository.getNamespace() + " does not exist");
}
/**
* Constructs a new {@link RepositoryNotFoundException} with the specified
* error detail message.
*
*
* @param message error detail message
*/
public RepositoryNotFoundException(String message)
{
super(message);
public RepositoryNotFoundException(String repositoryId) {
super("repository with id " + repositoryId + " does not exist");
}
}

View File

@@ -177,8 +177,7 @@ public final class RepositoryServiceFactory
if (repository == null)
{
throw new RepositoryNotFoundException(
"could not find a repository with id ".concat(repositoryId));
throw new RepositoryNotFoundException(repositoryId);
}
return create(repository);

View File

@@ -41,19 +41,11 @@ package sonia.scm.user;
public class UserAlreadyExistsException extends UserException
{
/** Field description */
private static final long serialVersionUID = 9182294539718090814L;
//~--- constructors ---------------------------------------------------------
/**
* Constructs a new instance.
*
* @param name The name (aka id) of the user
* @since 1.5
*/
public UserAlreadyExistsException(String name)
{
super(name + " user already exists");
public UserAlreadyExistsException(User user) {
super(user.getName() + " user already exists");
}
}

View File

@@ -51,7 +51,7 @@ public class UserNotFoundException extends UserException
* Constructs a new UserNotFoundException.
*
*/
public UserNotFoundException() {
super("user does not exists");
public UserNotFoundException(User user) {
super("user " + user.getName() + " does not exist");
}
}