-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added missing SelectedItemsRequest implements; Simplified AIP requests (
#3269) Signed-off-by: sugarylump <[email protected]>
- Loading branch information
1 parent
cb3aa16
commit e6d01ab
Showing
22 changed files
with
477 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
package org.roda.core.data.utils; | ||
|
||
import org.roda.core.data.v2.generics.select.SelectedItemsAllRequest; | ||
import org.roda.core.data.v2.generics.select.SelectedItemsFilterRequest; | ||
import org.roda.core.data.v2.generics.select.SelectedItemsListRequest; | ||
import org.roda.core.data.v2.generics.select.SelectedItemsNoneRequest; | ||
import org.roda.core.data.v2.generics.select.SelectedItemsRequest; | ||
import org.roda.core.data.v2.index.select.SelectedItems; | ||
import org.roda.core.data.v2.index.select.SelectedItemsAll; | ||
import org.roda.core.data.v2.index.select.SelectedItemsFilter; | ||
import org.roda.core.data.v2.index.select.SelectedItemsList; | ||
import org.roda.core.data.v2.index.select.SelectedItemsNone; | ||
|
||
/** | ||
* @author Miguel Guimarães <[email protected]> | ||
|
@@ -25,6 +29,10 @@ public static SelectedItemsRequest convertToRESTRequest(SelectedItems<?> items) | |
request.setFilter(((SelectedItemsFilter<?>) items).getFilter()); | ||
request.setJustActive(((SelectedItemsFilter<?>) items).justActive()); | ||
return request; | ||
} else if (items instanceof SelectedItemsNone<?>) { | ||
return new SelectedItemsNoneRequest(); | ||
} else if (items instanceof SelectedItemsAll<?>) { | ||
return new SelectedItemsAllRequest(); | ||
} | ||
|
||
return new SelectedItemsListRequest(); | ||
|
18 changes: 18 additions & 0 deletions
18
...mon-data/src/main/java/org/roda/core/data/v2/generics/select/SelectedItemsAllRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.roda.core.data.v2.generics.select; | ||
|
||
import java.io.Serial; | ||
|
||
import com.fasterxml.jackson.annotation.JsonTypeName; | ||
|
||
/** | ||
* @author Alexandre Flores <[email protected]> | ||
*/ | ||
@JsonTypeName("SelectedItemsAllRequest") | ||
public class SelectedItemsAllRequest implements SelectedItemsRequest { | ||
@Serial | ||
private static final long serialVersionUID = 165811248428623687L; | ||
|
||
public SelectedItemsAllRequest() { | ||
// do nothing | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...on-data/src/main/java/org/roda/core/data/v2/generics/select/SelectedItemsNoneRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.roda.core.data.v2.generics.select; | ||
|
||
import java.io.Serial; | ||
|
||
import com.fasterxml.jackson.annotation.JsonTypeName; | ||
|
||
/** | ||
* @author Alexandre Flores <[email protected]> | ||
*/ | ||
@JsonTypeName("SelectedItemsNoneRequest") | ||
public class SelectedItemsNoneRequest implements SelectedItemsRequest { | ||
@Serial | ||
private static final long serialVersionUID = 4225008000954460297L; | ||
|
||
public SelectedItemsNoneRequest() { | ||
// do nothing | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
roda-common/roda-common-data/src/main/java/org/roda/core/data/v2/jobs/CreateJobRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package org.roda.core.data.v2.jobs; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
import java.util.Map; | ||
|
||
import org.roda.core.data.v2.generics.select.SelectedItemsRequest; | ||
|
||
/** | ||
* @author Alexandre Flores <[email protected]> | ||
*/ | ||
public class CreateJobRequest implements Serializable { | ||
|
||
@Serial | ||
private static final long serialVersionUID = 5136924368954184386L; | ||
|
||
private String name; | ||
private String plugin; | ||
private Map<String, String> pluginParameters; | ||
private SelectedItemsRequest sourceObjects; | ||
private String sourceObjectsClass; | ||
private String priority; | ||
private String parallelism; | ||
|
||
public CreateJobRequest() { | ||
// do nothing | ||
} | ||
|
||
public String getParallelism() { | ||
return parallelism; | ||
} | ||
|
||
public void setParallelism(String parallelism) { | ||
this.parallelism = parallelism; | ||
} | ||
|
||
public String getPriority() { | ||
return priority; | ||
} | ||
|
||
public void setPriority(String priority) { | ||
this.priority = priority; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getPlugin() { | ||
return plugin; | ||
} | ||
|
||
public void setPlugin(String plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
public Map<String, String> getPluginParameters() { | ||
return pluginParameters; | ||
} | ||
|
||
public void setPluginParameters(Map<String, String> pluginParameters) { | ||
this.pluginParameters = pluginParameters; | ||
} | ||
|
||
public SelectedItemsRequest getSourceObjects() { | ||
return sourceObjects; | ||
} | ||
|
||
public void setSourceObjects(SelectedItemsRequest sourceObjects) { | ||
this.sourceObjects = sourceObjects; | ||
} | ||
|
||
public String getSourceObjectsClass() { | ||
return sourceObjectsClass; | ||
} | ||
|
||
public void setSourceObjectsClass(String sourceObjectsClass) { | ||
this.sourceObjectsClass = sourceObjectsClass; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,87 @@ | ||
package org.roda.core.data.v2.user.requests; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import org.roda.core.data.common.SecureString; | ||
import org.roda.core.data.v2.generics.MetadataValue; | ||
import org.roda.core.data.v2.user.User; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
import org.roda.core.data.common.SecureString; | ||
import org.roda.core.data.v2.generics.MetadataValue; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
/** | ||
* @author António Lindo <[email protected]> | ||
*/ | ||
@JsonInclude(JsonInclude.Include.ALWAYS) | ||
public class CreateUserRequest implements Serializable { | ||
|
||
@Serial | ||
private static final long serialVersionUID = -2706255856347304025L; | ||
private static final long serialVersionUID = 2288990827132952813L; | ||
|
||
private User user; | ||
private String email; | ||
private String name; | ||
private String fullName; | ||
private Set<String> groups; | ||
private boolean guest; | ||
private SecureString password; | ||
private Set<MetadataValue> values; | ||
|
||
public CreateUserRequest(User user, SecureString password, Set<MetadataValue> values) { | ||
this.user = user; | ||
public CreateUserRequest(String email, String name, String fullName, Set<String> groups, boolean guest, | ||
SecureString password, Set<MetadataValue> values) { | ||
this.email = email; | ||
this.name = name; | ||
this.fullName = fullName; | ||
this.groups = groups; | ||
this.guest = guest; | ||
this.password = password; | ||
this.values = values; | ||
} | ||
|
||
public CreateUserRequest() { | ||
this.user = new User(); | ||
this.groups = new HashSet<>(); | ||
this.password = new SecureString(); | ||
this.values = new HashSet<>(); | ||
} | ||
|
||
public User getUser() { | ||
return user; | ||
public String getEmail() { | ||
return email; | ||
} | ||
|
||
public void setEmail(String email) { | ||
this.email = email; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getFullName() { | ||
return fullName; | ||
} | ||
|
||
public void setFullName(String fullName) { | ||
this.fullName = fullName; | ||
} | ||
|
||
public Set<String> getGroups() { | ||
return groups; | ||
} | ||
|
||
public void setGroups(Set<String> groups) { | ||
this.groups = groups; | ||
} | ||
|
||
public boolean getGuest() { | ||
return guest; | ||
} | ||
|
||
public void setGuest(boolean guest) { | ||
this.guest = guest; | ||
} | ||
|
||
public Set<MetadataValue> getValues() { | ||
|
@@ -47,10 +92,6 @@ public void setValues(Set<MetadataValue> values) { | |
this.values = values; | ||
} | ||
|
||
public void setUser(User user) { | ||
this.user = user; | ||
} | ||
|
||
public SecureString getPassword() { | ||
return password; | ||
} | ||
|
81 changes: 81 additions & 0 deletions
81
...da-common-data/src/main/java/org/roda/core/data/v2/user/requests/RegisterUserRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package org.roda.core.data.v2.user.requests; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
import org.roda.core.data.common.SecureString; | ||
import org.roda.core.data.v2.generics.MetadataValue; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
/** | ||
* @author António Lindo <[email protected]> | ||
*/ | ||
@JsonInclude(JsonInclude.Include.ALWAYS) | ||
public class RegisterUserRequest implements Serializable { | ||
|
||
@Serial | ||
private static final long serialVersionUID = 2288990827132952813L; | ||
|
||
private String email; | ||
private String name; | ||
private String fullName; | ||
private SecureString password; | ||
private Set<MetadataValue> values; | ||
|
||
public RegisterUserRequest(String email, String name, String fullName, SecureString password, | ||
Set<MetadataValue> values) { | ||
this.email = email; | ||
this.name = name; | ||
this.fullName = fullName; | ||
this.password = password; | ||
this.values = values; | ||
} | ||
|
||
public RegisterUserRequest() { | ||
this.password = new SecureString(); | ||
this.values = new HashSet<>(); | ||
} | ||
|
||
public String getEmail() { | ||
return email; | ||
} | ||
|
||
public void setEmail(String email) { | ||
this.email = email; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getFullName() { | ||
return fullName; | ||
} | ||
|
||
public void setFullName(String fullName) { | ||
this.fullName = fullName; | ||
} | ||
|
||
public Set<MetadataValue> getValues() { | ||
return values; | ||
} | ||
|
||
public void setValues(Set<MetadataValue> values) { | ||
this.values = values; | ||
} | ||
|
||
public SecureString getPassword() { | ||
return password; | ||
} | ||
|
||
public void setPassword(SecureString password) { | ||
this.password = password; | ||
} | ||
} |
Oops, something went wrong.