Examples of IMigrationAction


Examples of eu.planets_project.pp.plato.services.action.IMigrationAction

     * @param e
     * @param filename
     * @param data
     */
    private MigrationResult runExperiment(MassMigrationExperiment e, String filename, byte[] data) {
        IMigrationAction service = getService(e.getAction());
        DetailedExperimentInfo eInfo = e.getResult().get(filename);
        if (eInfo == null) {
            eInfo = new DetailedExperimentInfo();
            e.getResult().put(filename, eInfo);
        }
       
        // remove old results
        eInfo.getMeasurements().clear();
       
       
        // why does this expect an instance of SampleObject ??!!
        SampleObject r = new SampleObject();
        r.getData().setData(data);
        r.setFullname(filename);
       
        Measurement success = new Measurement();
        success.setProperty(new MeasurableProperty(new BooleanScale(), MigrationResult.MIGRES_SUCCESS));
        success.setValue(success.getProperty().getScale().createValue());
       
        Measurement report = new Measurement();
        report.setProperty(new MeasurableProperty(new FreeStringScale(), MigrationResult.MIGRES_REPORT));
        report.setValue(report.getProperty().getScale().createValue());
       
        try {
            MigrationResult result = service.migrate(e.getAction(), r);
            if (result.isSuccessful()) {
                /* put all info to toolExperience */
                eInfo.getMeasurements().putAll(result.getMeasurements());

                ((BooleanValue)success.getValue()).setValue("true");
View Full Code Here

Examples of eu.planets_project.pp.plato.services.action.IMigrationAction

        if (action instanceof IMigrationAction) {
            DigitalObject migrationResultObject;
            DigitalObject experimentResultObject;
            MigrationResult migrationResult = null;
            IMigrationAction migrationAction = (IMigrationAction) action;
            //                int nextIndex = experimentStatus.getNextSampleIndex();
            SampleObject record = experimentStatus.getNextSample(); //null;
            //                if (nextIndex >= 0 && nextIndex < selectedPlan.getSampleRecordsDefinition().getRecords().size()) {
            //                    record = selectedPlan.getSampleRecordsDefinition().getRecords().get(nextIndex);
            //                }
            //experimentStatus.getNextSample();
            while (record != null) {
                if (record.isDataExistent()) {

                    // objectTomigrate is only being read, needs to be merged to lazily get the data out
                    SampleObject objectToMigrate = em.merge(record);

                    try {
                        // ACTION HAPPENS HERE:
                        migrationResult =  migrationAction.migrate(pad, objectToMigrate);
                    } catch (NullPointerException npe) {
                        log.error("Caught nullpointer exception when running a migration tool. ### WRONG CONFIGURATION? ###",npe);
                    } catch (Throwable t) {
                        log.error("Caught unchecked exception when running a migration tool: "+t.getMessage(),t);
                        //throw new PlatoServiceException("Could not run service "+a.getName()+" on object "+record.getShortName(),t);
View Full Code Here

Examples of eu.scape_project.planning.model.interfaces.actions.IMigrationAction

            setProgramOutputForAlternative(a, msg, false);
        }

        if (action instanceof IMigrationAction) {
            IMigrationAction migrationAction = (IMigrationAction) action;
            SampleObject record = experimentStatus.getNextSample();
            while (record != null) {
                if (record.isDataExistent()) {
                    MigrationResult migrationResult = null;

                    try {
                        DigitalObject workflow = a.getExperiment().getWorkflow();
                        if (workflow != null) {
                            byte[] workflowData = byteStreamManager.load(workflow.getPid());
                            workflow.getData().setData(workflowData);
                        }
                        DigitalObject objectToMigrate = digitalObjectManager.getCopyOfDataFilledDigitalObject(record);
                        migrationResult = migrationAction.migrate(a, objectToMigrate);
                    } catch (StorageException e) {
                        log.error("Failed to load sample object", e);
                    } catch (NullPointerException e) {
                        log.error(
                            "Caught nullpointer exception when running a migration tool. ### WRONG CONFIGURATION? ###",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.