Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Preservation metadata type and IPInterface inheritance #264

Merged
merged 3 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions src/main/java/org/roda_project/commons_ip2/model/IPInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,83 +23,83 @@

public interface IPInterface {

IP setId(String id);
IPInterface setId(String id);

Check warning on line 26 in src/main/java/org/roda_project/commons_ip2/model/IPInterface.java

View workflow job for this annotation

GitHub Actions / Checkstyle job

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./src/main/java/org/roda_project/commons_ip2/model/IPInterface.java:26:3: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)

String getId();

IP setIds(List<String> ids);
IPInterface setIds(List<String> ids);

Check warning on line 30 in src/main/java/org/roda_project/commons_ip2/model/IPInterface.java

View workflow job for this annotation

GitHub Actions / Checkstyle job

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./src/main/java/org/roda_project/commons_ip2/model/IPInterface.java:30:3: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)

List<String> getIds();

IP setProfile(String profile);
IPInterface setProfile(String profile);

Check warning on line 34 in src/main/java/org/roda_project/commons_ip2/model/IPInterface.java

View workflow job for this annotation

GitHub Actions / Checkstyle job

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./src/main/java/org/roda_project/commons_ip2/model/IPInterface.java:34:3: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)

String getProfile();

IP setType(IPType type);
IPInterface setType(IPType type);

Check warning on line 38 in src/main/java/org/roda_project/commons_ip2/model/IPInterface.java

View workflow job for this annotation

GitHub Actions / Checkstyle job

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./src/main/java/org/roda_project/commons_ip2/model/IPInterface.java:38:3: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)

String getType();

IP setContentType(IPContentType contentType);
IPInterface setContentType(IPContentType contentType);

Check warning on line 42 in src/main/java/org/roda_project/commons_ip2/model/IPInterface.java

View workflow job for this annotation

GitHub Actions / Checkstyle job

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./src/main/java/org/roda_project/commons_ip2/model/IPInterface.java:42:3: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)

IPContentType getContentType();

IP setContentInformationType(IPContentInformationType contentInformationType);
IPInterface setContentInformationType(IPContentInformationType contentInformationType);

Check warning on line 46 in src/main/java/org/roda_project/commons_ip2/model/IPInterface.java

View workflow job for this annotation

GitHub Actions / Checkstyle job

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./src/main/java/org/roda_project/commons_ip2/model/IPInterface.java:46:3: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)

IPContentInformationType getContentInformationType();

IP setStatus(IPStatus status);
IPInterface setStatus(IPStatus status);

Check warning on line 50 in src/main/java/org/roda_project/commons_ip2/model/IPInterface.java

View workflow job for this annotation

GitHub Actions / Checkstyle job

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./src/main/java/org/roda_project/commons_ip2/model/IPInterface.java:50:3: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)

IPStatus getStatus();

IP setCreateDate(XMLGregorianCalendar date);
IPInterface setCreateDate(XMLGregorianCalendar date);

Check warning on line 54 in src/main/java/org/roda_project/commons_ip2/model/IPInterface.java

View workflow job for this annotation

GitHub Actions / Checkstyle job

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./src/main/java/org/roda_project/commons_ip2/model/IPInterface.java:54:3: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)

Optional<XMLGregorianCalendar> getCreateDate();

IP setModificationDate(XMLGregorianCalendar date);
IPInterface setModificationDate(XMLGregorianCalendar date);

Check warning on line 58 in src/main/java/org/roda_project/commons_ip2/model/IPInterface.java

View workflow job for this annotation

GitHub Actions / Checkstyle job

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./src/main/java/org/roda_project/commons_ip2/model/IPInterface.java:58:3: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)

Optional<XMLGregorianCalendar> getModificationDate();

IP setBasePath(Path basePath);
IPInterface setBasePath(Path basePath);

Check warning on line 62 in src/main/java/org/roda_project/commons_ip2/model/IPInterface.java

View workflow job for this annotation

GitHub Actions / Checkstyle job

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./src/main/java/org/roda_project/commons_ip2/model/IPInterface.java:62:3: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)

Path getBasePath();

IP setAncestors(List<String> ancestors);
IPInterface setAncestors(List<String> ancestors);

List<String> getAncestors();

IP setDescription(String description);
IPInterface setDescription(String description);

String getDescription();

IP addAgent(IPAgent agent);
IPInterface addAgent(IPAgent agent);

IP addDescriptiveMetadata(IPDescriptiveMetadata descriptiveMetadata) throws IPException;
IPInterface addDescriptiveMetadata(IPDescriptiveMetadata descriptiveMetadata) throws IPException;

IP addPreservationMetadata(IPMetadata preservationMetadata) throws IPException;
IPInterface addPreservationMetadata(IPMetadata preservationMetadata) throws IPException;

IP addOtherMetadata(IPMetadata otherMetadata) throws IPException;
IPInterface addOtherMetadata(IPMetadata otherMetadata) throws IPException;

IP addRepresentation(IPRepresentation representation) throws IPException;
IPInterface addRepresentation(IPRepresentation representation) throws IPException;

IP addSchema(IPFileInterface schema);
IPInterface addSchema(IPFileInterface schema);

IP addDocumentation(IPFileInterface documentation);
IPInterface addDocumentation(IPFileInterface documentation);

IP addAgentToRepresentation(String representationID, IPAgent agent) throws IPException;
IPInterface addAgentToRepresentation(String representationID, IPAgent agent) throws IPException;

IP addDescriptiveMetadataToRepresentation(String representationID, IPDescriptiveMetadata descriptiveMetadata)
IPInterface addDescriptiveMetadataToRepresentation(String representationID, IPDescriptiveMetadata descriptiveMetadata)
throws IPException;

IP addPreservationMetadataToRepresentation(String representationID, IPMetadata preservationMetadata)
IPInterface addPreservationMetadataToRepresentation(String representationID, IPMetadata preservationMetadata)
throws IPException;

IP addOtherMetadataToRepresentation(String representationID, IPMetadata otherMetadata) throws IPException;
IPInterface addOtherMetadataToRepresentation(String representationID, IPMetadata otherMetadata) throws IPException;

IP addFileToRepresentation(String representationID, IPFileInterface file) throws IPException;
IPInterface addFileToRepresentation(String representationID, IPFileInterface file) throws IPException;

IP addSchemaToRepresentation(String representationID, IPFileInterface schema) throws IPException;
IPInterface addSchemaToRepresentation(String representationID, IPFileInterface schema) throws IPException;

IP addDocumentationToRepresentation(String representationID, IPFileInterface documentation) throws IPException;
IPInterface addDocumentationToRepresentation(String representationID, IPFileInterface documentation) throws IPException;

List<IPAgent> getAgents();

Expand Down Expand Up @@ -151,4 +151,4 @@
throw new ParseException("One must implement static method parse in a concrete class");
}

}
}
54 changes: 27 additions & 27 deletions src/main/java/org/roda_project/commons_ip2/model/impl/AIPWrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.roda_project.commons_ip.utils.IPException;
import org.roda_project.commons_ip.utils.ZipEntryInfo;
import org.roda_project.commons_ip2.model.AIP;
import org.roda_project.commons_ip2.model.IP;
import org.roda_project.commons_ip2.model.IPInterface;
import org.roda_project.commons_ip2.model.IPAgent;
import org.roda_project.commons_ip2.model.IPContentInformationType;
import org.roda_project.commons_ip2.model.IPContentType;
Expand Down Expand Up @@ -57,7 +57,7 @@ public String toString() {
}

@Override
public IP setId(final String id) {
public IPInterface setId(final String id) {
return aip.setId(id);
}

Expand All @@ -67,7 +67,7 @@ public String getId() {
}

@Override
public IP setIds(final List<String> ids) {
public IPInterface setIds(final List<String> ids) {
return aip.setIds(ids);
}

Expand All @@ -77,7 +77,7 @@ public List<String> getIds() {
}

@Override
public IP setProfile(final String profile) {
public IPInterface setProfile(final String profile) {
return aip.setProfile(profile);
}

Expand All @@ -87,7 +87,7 @@ public String getProfile() {
}

@Override
public IP setType(final IPEnums.IPType type) {
public IPInterface setType(final IPEnums.IPType type) {
return aip.setType(type);
}

Expand All @@ -107,7 +107,7 @@ public String getState() {
}

@Override
public IP setContentType(final IPContentType contentType) {
public IPInterface setContentType(final IPContentType contentType) {
return aip.setContentType(contentType);
}

Expand All @@ -117,7 +117,7 @@ public IPContentType getContentType() {
}

@Override
public IP setContentInformationType(IPContentInformationType contentInformationType) {
public IPInterface setContentInformationType(IPContentInformationType contentInformationType) {
return aip.setContentInformationType(contentInformationType);
}

Expand All @@ -127,7 +127,7 @@ public IPContentInformationType getContentInformationType() {
}

@Override
public IP setStatus(final IPEnums.IPStatus status) {
public IPInterface setStatus(final IPEnums.IPStatus status) {
return aip.setStatus(status);
}

Expand All @@ -137,7 +137,7 @@ public IPEnums.IPStatus getStatus() {
}

@Override
public IP setCreateDate(final XMLGregorianCalendar date) {
public IPInterface setCreateDate(final XMLGregorianCalendar date) {
return aip.setCreateDate(date);
}

Expand All @@ -147,7 +147,7 @@ public Optional<XMLGregorianCalendar> getCreateDate() {
}

@Override
public IP setModificationDate(final XMLGregorianCalendar date) {
public IPInterface setModificationDate(final XMLGregorianCalendar date) {
return aip.setModificationDate(date);
}

Expand All @@ -162,12 +162,12 @@ public List<String> getAncestors() {
}

@Override
public IP setAncestors(final List<String> ancestors) {
public IPInterface setAncestors(final List<String> ancestors) {
return aip.setAncestors(ancestors);
}

@Override
public IP setBasePath(final Path basePath) {
public IPInterface setBasePath(final Path basePath) {
return aip.setBasePath(basePath);
}

Expand All @@ -177,7 +177,7 @@ public Path getBasePath() {
}

@Override
public IP setDescription(final String description) {
public IPInterface setDescription(final String description) {
return aip.setDescription(description);
}

Expand All @@ -187,32 +187,32 @@ public String getDescription() {
}

@Override
public IP addAgent(final IPAgent aipAgent) {
public IPInterface addAgent(final IPAgent aipAgent) {
return aip.addAgent(aipAgent);
}

@Override
public IP addPreservationMetadata(final IPMetadata metadata) throws IPException {
public IPInterface addPreservationMetadata(final IPMetadata metadata) throws IPException {
return aip.addPreservationMetadata(metadata);
}

@Override
public IP addOtherMetadata(final IPMetadata metadata) throws IPException {
public IPInterface addOtherMetadata(final IPMetadata metadata) throws IPException {
return aip.addOtherMetadata(metadata);
}

@Override
public IP addDescriptiveMetadata(final IPDescriptiveMetadata metadata) throws IPException {
public IPInterface addDescriptiveMetadata(final IPDescriptiveMetadata metadata) throws IPException {
return aip.addDescriptiveMetadata(metadata);
}

@Override
public IP addRepresentation(final IPRepresentation aipRepresentation) throws IPException {
public IPInterface addRepresentation(final IPRepresentation aipRepresentation) throws IPException {
return aip.addRepresentation(aipRepresentation);
}

@Override
public IP addSchema(final IPFileInterface schema) {
public IPInterface addSchema(final IPFileInterface schema) {
return aip.addSchema(schema);
}

Expand All @@ -222,45 +222,45 @@ public AIP addSubmission(final IPFileInterface submission) {
}

@Override
public IP addDocumentation(final IPFileInterface documentationPath) {
public IPInterface addDocumentation(final IPFileInterface documentationPath) {
return aip.addDocumentation(documentationPath);
}

@Override
public IP addAgentToRepresentation(final String representationID, final IPAgent agent) throws IPException {
public IPInterface addAgentToRepresentation(final String representationID, final IPAgent agent) throws IPException {
return aip.addAgentToRepresentation(representationID, agent);
}

@Override
public IP addDescriptiveMetadataToRepresentation(final String representationID,
public IPInterface addDescriptiveMetadataToRepresentation(final String representationID,
final IPDescriptiveMetadata descriptiveMetadata) throws IPException {
return aip.addDescriptiveMetadataToRepresentation(representationID, descriptiveMetadata);
}

@Override
public IP addPreservationMetadataToRepresentation(final String representationID,
public IPInterface addPreservationMetadataToRepresentation(final String representationID,
final IPMetadata preservationMetadata) throws IPException {
return aip.addPreservationMetadataToRepresentation(representationID, preservationMetadata);
}

@Override
public IP addOtherMetadataToRepresentation(final String representationID, final IPMetadata otherMetadata)
public IPInterface addOtherMetadataToRepresentation(final String representationID, final IPMetadata otherMetadata)
throws IPException {
return aip.addOtherMetadataToRepresentation(representationID, otherMetadata);
}

@Override
public IP addFileToRepresentation(final String representationID, final IPFileInterface file) throws IPException {
public IPInterface addFileToRepresentation(final String representationID, final IPFileInterface file) throws IPException {
return aip.addFileToRepresentation(representationID, file);
}

@Override
public IP addSchemaToRepresentation(final String representationID, final IPFileInterface schema) throws IPException {
public IPInterface addSchemaToRepresentation(final String representationID, final IPFileInterface schema) throws IPException {
return aip.addSchemaToRepresentation(representationID, schema);
}

@Override
public IP addDocumentationToRepresentation(final String representationID, final IPFileInterface documentation)
public IPInterface addDocumentationToRepresentation(final String representationID, final IPFileInterface documentation)
throws IPException {
return aip.addDocumentationToRepresentation(representationID, documentation);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ protected void processMetadataFile(IPInterface ip, Logger logger, IPRepresentati
} else if (IPConstants.PRESERVATION.equalsIgnoreCase(metadataType)) {
IPMetadata preservationMetadata = new IPMetadata(metadataFile.get());
preservationMetadata.setCreateDate(mdRef.getCREATED());
preservationMetadata.setMetadataType(MetadataType.MetadataTypeEnum.valueOf(mdRef.getMDTYPE()));
preservationMetadata.setId(mdRef.getID());
if (representation == null) {
ip.addPreservationMetadata(preservationMetadata);
} else {
Expand Down
Loading