Package eu.planets_project.ifr.core.services.migration.genericwrapper1

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper1.GenericMigrationWrapper


                    logo = currentNode.getTextContent().trim();
                }
            }
        }
        if(title == null){
            throw new ConfigurationException("title not set in configfile");
        }
        if(creator == null){
            throw new ConfigurationException("creator not set in configfile");
        }
        ServiceDescription.Builder builder =
                new ServiceDescription.Builder(title,
                                               "eu.planets_project.ifr.services.migrate.Migrate");
        builder.author(creator);
        builder.classname(canonicalName);
        builder.description(description);
        builder.identifier(identifier);
        builder.instructions(instructions);
        builder.version(version);
        builder.tool(tool);
        builder.serviceProvider(publisher);
        builder.paths(paths.toArray(new eu.planets_project.services.datatypes.MigrationPath[paths.size()]));

        if(furtherinfo != null){
            try {
                builder.furtherInfo(new URI(furtherinfo));
            } catch (URISyntaxException e) {
                throw new ConfigurationException("furtherInfo not set to valid value", e);
            }
        }
        if(logo != null){
            try {
                builder.logo(new URI(logo));
            } catch (URISyntaxException e) {
                throw new ConfigurationException("logo not set to valid value", e);
            }
        }

        return builder.build();
View Full Code Here


        URI identifierURI = null;
        if(homepage != null){
            try {
                homepageURL = new URL(homepage);
            } catch (MalformedURLException e) {
                throw new ConfigurationException("Homepage not set to valid value", e);
            }
        }
        if(identifier != null){
            try {
                identifierURI = new URI(identifier);
            } catch (URISyntaxException e) {
                throw new ConfigurationException("identifier not set to valid value", e);
            }
        }

        Tool t = new Tool(identifierURI, name, version, description, homepageURL);
        return t;
View Full Code Here

        // the test for the file name mappings, as they are solely based on the
        // configuration file and what the generic wrapper is doing.

        if (!validIdentifiers.containsAll(usedIdentifiers)) {
            usedIdentifiers.removeAll(validIdentifiers);
            throw new MigrationException("Cannot build the command line. "
                    + "Missing values for these identifiers: "
                    + usedIdentifiers);
        }

        List<String> executableCommandLine = new ArrayList<String>();
View Full Code Here

                returnByReference = Boolean.valueOf(result);
            }


        } catch (Exception e) {
            throw new MigrationInitialisationException(
                    "Failed initialising migration path data from the configuration document: "
                    + configuration.getNodeName(), e);
        }

        //TODO parse and initialise the ServiceDescription
View Full Code Here

    }
      }
      this.log.info("Leaving getInstance");
      return migrationPaths;
  } catch (Exception e) {
      throw new MigrationPathConfigException(
        "Failed parsing migration path configuration document.", e);
  }

    }
View Full Code Here

    } else if (Constants.TOOL_PRESETS_ELEMENT
      .equals(currentSubNodeName)) {
        pathTemplate = configureToolPresets(currentSubNode,
          pathTemplate);
    } else {
        throw new MigrationPathConfigException(
          "Did not find any of the expected child elements "
            + "in this element: " + currentSubNodeName);
    }
      }
  }

  if (outputformatURI == null) {
      throw new MigrationPathConfigException(
        "The path element did not have a destination format URI.");
  }

  if (inputformatURIs.isEmpty()) {
      throw new MigrationPathConfigException(
        "The path element did not have any source format URIs.");
  }

  List<MigrationPath> result = createCliMigrationPathInstances(
    pathTemplate, inputformatURIs, outputformatURI);
View Full Code Here

  for (URI sourceFormatUri : sourceFomatURIs) {
      MigrationPath newPath;
      try {
    newPath = (MigrationPath) pathTemplate.clone();
      } catch (CloneNotSupportedException e) {
    throw new MigrationPathConfigException(
      "Failed copying path template when instantiating CliMigrationPath for migration path: "
        + sourceFomatURIs
        + " -> "
        + destinationFormatURI);
      }
View Full Code Here

            URI destinationFormat) throws NoSuchPathException {

        final PathKey pathKey = new PathKey(sourceFormat, destinationFormat);
        final MigrationPath migrationPath = this.migrationPaths.get(pathKey);
        if (migrationPath == null) {
            throw new NoSuchPathException(
                    "No migration path found for source format URI=\""
                            + sourceFormat + "\" and destination format URI=\""
                            + destinationFormat + "\"");
        }
        return migrationPath;
View Full Code Here

    @Before
    public void setUp() throws Exception {

  this.testParameters.add(new Parameter("mode", "complete"));

  DocumentLocator documentLocator = new DocumentLocator(
    "deprecatedGenericWrapperV1ExampleConfigFile.xml");
  this.genericWrapper = new GenericMigrationWrapper(documentLocator
    .getDocument(), this.getClass().getCanonicalName());

    }
View Full Code Here

    /**
     * @throws Exception
     */
    public MigrationPathsTest() throws Exception {
        final DocumentLocator documentLocator = new DocumentLocator(
                TEST_CONFIGURATION_FILE_NAME);
        final Document pathsConfiguration = documentLocator.getDocument();

        final MigrationPathsFactory migrationPathsFactory = new MigrationPathsFactory();
        this.migrationPathsToTest = migrationPathsFactory
                .getMigrationPaths(pathsConfiguration);
    }
View Full Code Here

TOP

Related Classes of eu.planets_project.ifr.core.services.migration.genericwrapper1.GenericMigrationWrapper

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.