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

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


        pathNode, XPathConstants.NODE);

      final String command = commandNode.getTextContent().trim();

      if (command.length() == 0) {
    throw new MigrationPathConfigException(
      "No command was specified in the '"
        + commandLineElementName + "' element in the '"
        + pathNode.getNodeName() + "' element.");
      }

      final NodeList parameterNodes = (NodeList) pathsXPath
        .evaluate(
          commandLineElementName
            + "/"
            + ConfigurationFileTagsV1.COMMANDPARAMETER_ELEMENT_XPATH,
          pathNode, XPathConstants.NODESET);

      final ArrayList<String> commandLineParameters = new ArrayList<String>();
      for (int parameterIndex = 0; parameterIndex < parameterNodes
        .getLength(); parameterIndex++) {

    final Node parameterNode = parameterNodes.item(parameterIndex);
    commandLineParameters
      .add(parameterNode.getTextContent().trim());
      }

      return new CommandLine(command, commandLineParameters);
  } catch (XPathExpressionException xpee) {
      throw new MigrationPathConfigException(
        "Failed reading command and parameters from the '"
          + commandLineElementName + "' element in the '"
          + pathNode.getNodeName() + "' element.", xpee);
  }
    }
View Full Code Here


    uriList.add(new URI(getAttributeValue(uriNode,
      ConfigurationFileTagsV1.VALUE_ATTRIBUTE)));
      }

      if (uriList.isEmpty()) {
    throw new MigrationPathConfigException("The element '"
      + pathNode.getNodeName()
      + "' has no URI elements in the '" + uriListElementName
      + "' list.");
      }
      return uriList;
  } catch (Exception exception) {
      throw new MigrationPathConfigException(
        "Failed reading URIs from the '" + uriListElementName
          + "' URI list element in the element '"
          + pathNode.getNodeName() + "'", exception);
  }
    }
View Full Code Here

  final NamedNodeMap attributes = elementWithAttributes.getAttributes();

  final Node attributeNode = attributes.getNamedItem(attributeName);
  if (attributeNode == null) {
      throw new MigrationPathConfigException("The attribute '"
        + attributeName + "' is not defined in element '"
        + elementWithAttributes.getNodeName() + "'");
  }
  final String attributeValue = attributeNode.getNodeValue();
  return attributeValue;
View Full Code Here

        .getNamedItem(ConfigurationFileTagsV1.VERSION_ATTRIBUTE);

      versionNumber = versionNode.getNodeValue();

  } catch (NullPointerException npe) {
      throw new MigrationPathConfigException(
        "Could not access the 'version' attribute of the 'serviceWrapping' element in the configuration document.",
        npe);

  } catch (Exception exception) {
      throw new MigrationPathConfigException(
        "Validation of the configuration file version number failed.",
        exception);
  }

  if (!ConfigurationFileTagsV1.CONFIGURATION_FORMAT_VERSION.toLowerCase()
    .equals(versionNumber.toLowerCase())) {
      throw new MigrationPathConfigException(
        "Invalid version number in configuration document '"
          + versionNumber
          + "'. Expected version '"
          + ConfigurationFileTagsV1.CONFIGURATION_FORMAT_VERSION);
  }
View Full Code Here

      throws NoSuchPathException {

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

     * @throws java.lang.Exception
     */
    @Before
    public void setUp() throws Exception {

  final DocumentLocator documentLocator = new DocumentLocator(
    CONFIG_FILE_NAME);

  serviceDescriptionFactory = new ServiceDescriptionFactory(this
    .getClass().getCanonicalName(), SERVICE_PROVIDER,
    documentLocator.getDocument());
    }
View Full Code Here

    /**
     * @throws java.lang.Exception
     */
    @Before
    public void setUp() throws Exception {
  DocumentLocator documentLocator = new DocumentLocator(TEST_CONFIG_FILE);
  Document testConfiguration = documentLocator.getDocument();
  this.migrationPathFactory = new DBMigrationPathFactory(testConfiguration);
    }
View Full Code Here

    public void setUp() throws Exception {

  final Configuration environmentConfiguration = ServiceConfig
    .getConfiguration("genericwrapper2_GenericMigrationWrapperTest");

  final DocumentLocator documentLocator = new DocumentLocator(
    "GenericWrapperConfigFileExample.xml");

  this.genericWrapper = new GenericMigrationWrapper(documentLocator
    .getDocument(), environmentConfiguration, this.getClass()
    .getCanonicalName());

  this.testParameters = new ArrayList<Parameter>();
    }
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 MigrationPathFactory migrationPathsFactory = new DBMigrationPathFactory(pathsConfiguration);
        this.migrationPathsToTest = migrationPathsFactory
                .getAllMigrationPaths();
    }
View Full Code Here

  }

  // Now create a digital object from the tools output.
  DigitalObject.Builder builder;

  final ParameterReader parameterReader = new ParameterReader(
    toolParameters);
  final boolean returnDataByReference = parameterReader
    .getBooleanParameter("returnByReference", true);

  final ToolIOProfile toolOutputProfile = migrationPath
    .getToolOutputProfile();
  if (toolOutputProfile.usePipedIO() == false) {
View Full Code Here

TOP

Related Classes of eu.planets_project.ifr.core.services.migration.genericwrapper2.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.