Package eu.planets_project.pp.plato.services.action

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


        StringBuffer runDescription = new StringBuffer();

        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);
                    }

                    if (migrationResult != null) {

                        if (migrationResult.isSuccessful() && migrationResult.getMigratedObject() != null) {
                           
                            experimentResultObject = a.getExperiment().getResults().get(record);
                            migrationResultObject = migrationResult.getMigratedObject();
                            experimentResultObject.setContentType(migrationResultObject.getContentType());
                            experimentResultObject.getFormatInfo().assignValues(migrationResultObject.getFormatInfo());

                            int size = saveTempFile(experimentResultObject,migrationResultObject);
                            experimentResultObject.getData().setSize(size);
View Full Code Here

TOP

Related Classes of eu.planets_project.pp.plato.services.action.MigrationResult

Copyright © 2018 www.massapicom. 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.