Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
SugaryLump committed Oct 23, 2024
1 parent 14a05f6 commit c9206ae
Show file tree
Hide file tree
Showing 19 changed files with 1,504 additions and 8 deletions.
1 change: 1 addition & 0 deletions roda-common/roda-common-data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
<schemaDirectory>src/main/resources/backfill</schemaDirectory>
<schemaIncludes>
<include>add_documents.xsd</include>
<include>delete_document_ids.xsd</include>
</schemaIncludes>
<cleanPackageDirectories>true</cleanPackageDirectories>
<generatePackage>org.roda.core.plugins.base.maintenance.backfill.beans</generatePackage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,7 @@ public enum OrchestratorType {
// Generate Backfill Plugin Parameters

public static final String PLUGIN_PARAMS_BLOCK_SIZE = "parameter.block_size";
public static final String PLUGIN_PARAMS_VALIDATE_AGAINST = "parameter.validate_against";

public static final String PLUGIN_CATEGORY_CONVERSION = "conversion";
public static final String PLUGIN_CATEGORY_CHARACTERIZATION = "characterization";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="delete">
<xs:complexType>
<xs:sequence>
<xs:element name="id" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
package org.roda.core.plugins.base.maintenance.backfill;

import org.roda.core.data.exceptions.AuthorizationDeniedException;
import org.roda.core.data.exceptions.GenericException;
import org.roda.core.data.exceptions.NotFoundException;
import org.roda.core.data.exceptions.RequestNotValidException;
import org.roda.core.data.v2.index.IsIndexed;
import org.roda.core.data.v2.ip.AIP;
import org.roda.core.data.v2.ip.IndexedAIP;
import org.roda.core.model.ModelService;
import org.roda.core.plugins.Plugin;

import java.util.List;

/**
* @author Alexandre Flores <[email protected]>
*/
public class GenerateAIPBackfillPlugin extends GenerateBackfillPlugin<AIP> {
public class GenerateAIPBackfillPlugin extends GenerateRODAEntityBackfillPlugin<AIP> {

@Override
protected <I extends IsIndexed> Class<I> getIndexClass() {
return (Class<I>) IndexedAIP.class;
}

@Override
protected AIP retrieveModelObject(ModelService model, String id) throws AuthorizationDeniedException, NotFoundException, GenericException, RequestNotValidException {
return model.retrieveAIP(id);
}

@Override
public Plugin<AIP> cloneMe() {
return new GenerateAIPBackfillPlugin();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
package org.roda.core.plugins.base.maintenance.backfill;

import java.util.List;

import org.roda.core.data.common.RodaConstants;
import org.roda.core.data.v2.LiteOptionalWithCause;
import org.roda.core.data.v2.Void;
import org.roda.core.data.v2.index.IsIndexed;
import org.roda.core.data.v2.jobs.PluginType;
import org.roda.core.data.v2.jobs.Report;
import org.roda.core.data.v2.log.LogEntry;
import org.roda.core.index.IndexService;
import org.roda.core.model.ModelService;
import org.roda.core.plugins.AbstractPlugin;
import org.roda.core.plugins.Plugin;
import org.roda.core.plugins.PluginException;
import org.roda.core.storage.StorageService;

/**
* @author Alexandre Flores <[email protected]>
*/
public class GenerateActionLogBackfillPlugin extends AbstractPlugin<Void> {
@Override
public String getName() {
return "Generate complete action log index backfill";
}

@Override
public String getDescription() {
return "";
}

@Override
public RodaConstants.PreservationEventType getPreservationEventType() {
return null;
}

@Override
public String getPreservationEventDescription() {
return "";
}

@Override
public String getPreservationEventSuccessMessage() {
return "";
}

@Override
public String getPreservationEventFailureMessage() {
return "";
}

@Override
public String getPreservationEventSkippedMessage() {
return super.getPreservationEventSkippedMessage();
}

@Override
public PluginType getType() {
return PluginType.MISC;
}

@Override
public List<String> getCategories() {
return List.of();
}

@Override
public Plugin<Void> cloneMe() {
return new GenerateActionLogBackfillPlugin();
}

@Override
public boolean areParameterValuesValid() {
return false;
}

@Override
public void init() throws PluginException {

}

@Override
public List<Class<Void>> getObjectClasses() {
return List.of(Void.class);
}

@Override
public Report beforeAllExecute(IndexService index, ModelService model, StorageService storage) throws PluginException {
return null;
}

@Override
public Report execute(IndexService index, ModelService model, StorageService storage, List<LiteOptionalWithCause> list) throws PluginException {
return null;
}

@Override
public Report afterAllExecute(IndexService index, ModelService model, StorageService storage) throws PluginException {
return null;
}

@Override
public void shutdown() {

}

@Override
public String getVersionImpl() {
return "";
}
}
Loading

0 comments on commit c9206ae

Please sign in to comment.