Examples of MigrationPathConfigException


Examples of eu.planets_project.ifr.core.services.migration.genericwrapper1.exceptions.MigrationPathConfigException

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

    }
View Full Code Here

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper1.exceptions.MigrationPathConfigException

    } 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

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper1.exceptions.MigrationPathConfigException

  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

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper2.exceptions.MigrationPathConfigException

    migrationPaths
      .addAll(createMigrationPathInstances(currentPathNode));
      }
      return migrationPaths;
  } catch (Exception exception) {
      throw new MigrationPathConfigException(
        "Failed parsing the migration path configurations in the "
          + "configuration document.", exception);
  }
    }
View Full Code Here

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper2.exceptions.MigrationPathConfigException

  // Get the output format
  final List<URI> outputFormatURIs = getURIList(pathNode,
    ConfigurationFileTagsV1.OUTPUT_FORMAT_ELEMENT);

  if (outputFormatURIs.size() != 1) {
      throw new MigrationPathConfigException(String.format(
        "The '%s' element of a '%s' element must contain exactly "
          + "one format URI element and not "
          + outputFormatURIs.size() + " elements.",
        ConfigurationFileTagsV1.OUTPUT_FORMAT_ELEMENT, pathNode
          .getNodeName()));
View Full Code Here

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper2.exceptions.MigrationPathConfigException

      final Map<String, String> tempFileMapping = getTempFileDeclarations(
        pathNode, toolIOProfileElementName);

      if (!tempFileMapping.isEmpty() && toolIOProfile.usePipedIO()) {
    throw new MigrationPathConfigException(
      "Both piped IO and temporary file is specified in the "
        + "tool IO profile. Only one type may be "
        + "specified in the '"
        + toolIOProfileElementName
        + "' element of the '" + pathNode.getNodeName()
        + "' element.");
      }

      if (tempFileMapping.isEmpty() && !toolIOProfile.usePipedIO()) {
    throw new MigrationPathConfigException(
      "Either piped IO or a temporary file must be specified"
        + " in the '" + toolIOProfileElementName
        + "' element of the '" + pathNode.getNodeName()
        + "' element.");
      }

      if (tempFileMapping.size() > 1) {
    throw new MigrationPathConfigException(
      "Only one temporary file may be specified in the tool"
        + " IO profile. " + tempFileMapping.size()
        + " were specified in the '"
        + toolIOProfileElementName
        + "' element of the '" + pathNode.getNodeName()
        + "' element.");
      }

      if (!toolIOProfile.usePipedIO()) {
    // Based on the above code, we are sure that the temp. file map
    // contains exactly one element, thus this is OK.
    final String tempFileLabel = tempFileMapping.keySet()
      .iterator().next();
    toolIOProfile.setCommandLineFileLabel(tempFileLabel);
    toolIOProfile.setDesiredTempFileName(tempFileMapping
      .get(tempFileLabel));
      }

      return toolIOProfile;
  } catch (XPathExpressionException xPathExpressionException) {
      throw new MigrationPathConfigException(
        "Failed reading tool IO profile information from the '"
          + toolIOProfileElementName + "' element in the '"
          + pathNode.getNodeName() + "' element.",
        xPathExpressionException);
  }
View Full Code Here

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper2.exceptions.MigrationPathConfigException

      final Node elementWithDefaultAttribute = (Node) pathsXPath
        .evaluate(nameOfElementWithDefaultAttribute, pathNode,
          XPathConstants.NODE);

      if (elementWithDefaultAttribute == null) {
    throw new MigrationPathConfigException("No '"
      + nameOfElementWithDefaultAttribute
      + "' element declared in node: "
      + pathNode.getNodeName());
      }

      final String defaultAttributeValue = getAttributeValue(
        elementWithDefaultAttribute,
        ConfigurationFileTagsV1.DEFAULT_ATTRIBUTE);

      if (defaultAttributeValue.length() == 0) {
    throw new MigrationPathConfigException(String.format(
      "Empty '%s' attribute declared in node: ",
      ConfigurationFileTagsV1.DEFAULT_ATTRIBUTE)
      + elementWithDefaultAttribute.getNodeName());
      }

      return defaultAttributeValue;
  } catch (XPathExpressionException xPathExpressionException) {
      throw new MigrationPathConfigException(String.format(
        "Failed reading the '%s' attribute of the '",
        ConfigurationFileTagsV1.DEFAULT_ATTRIBUTE)
        + nameOfElementWithDefaultAttribute
        + "' element in the '"
        + pathNode.getNodeName() + "' element.",
View Full Code Here

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper2.exceptions.MigrationPathConfigException

    final Node presetNode = presetNodes.item(presetIndex);

    final String presetName = getAttributeValue(presetNode,
      ConfigurationFileTagsV1.NAME_ATTRIBUTE);
    if (presetName.length() == 0) {
        throw new MigrationPathConfigException(
          "Empty \"name\" attribute declared in node: "
            + presetNode.getNodeName());
    }

    final String defaultPresetName = getAttributeValue(presetNode,
      ConfigurationFileTagsV1.DEFAULT_ATTRIBUTE);

    final Node descriptionNode = (Node) pathsXPath.evaluate(
      ConfigurationFileTagsV1.DESCRIPTION_ELEMENT,
      presetNode, XPathConstants.NODE);

    final String description = descriptionNode.getTextContent();

    final Collection<PresetSetting> presetSettings = getPresetSettings(presetNode);

    final Preset newPreset = new Preset(presetName, presetSettings,
      defaultPresetName);
    newPreset.setDescription(description);

    presets.add(newPreset);
      }

      toolPresets = new ToolPresets();
      toolPresets.setToolPresets(presets);

      String defaultPresetName = null;
      if (presets.size() > 0) {
    defaultPresetName = getDefaultAttributeValue(pathNode,
      presetsElementName);
      }
      toolPresets.setDefaultPresetName(defaultPresetName);
      return toolPresets;
  } catch (XPathExpressionException xpee) {
      throw new MigrationPathConfigException(
        "Failed reading tool preset elements from the '"
          + presetsElementName + "' element in the '"
          + pathNode.getNodeName() + "' element.", xpee);
  }
    }
View Full Code Here

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper2.exceptions.MigrationPathConfigException

    final String settingsName = getAttributeValue(settingsNode,
      ConfigurationFileTagsV1.NAME_ATTRIBUTE);

    if (settingsName.length() == 0) {
        throw new MigrationPathConfigException(
          "Empty \"name\" attribute declared in node: "
            + settingsNode.getNodeName());
    }

    Collection<Parameter> parameters = getSettingsParameters(settingsNode);

    final Node descriptionNode = (Node) pathsXPath.evaluate(
      ConfigurationFileTagsV1.DESCRIPTION_ELEMENT,
      settingsNode, XPathConstants.NODE);

    final String description = descriptionNode.getTextContent();

    final PresetSetting presetSetting = new PresetSetting(
      settingsName, parameters);
    presetSetting.setDescription(description);
    presetSettings.add(presetSetting);
      }

      return presetSettings;
  } catch (XPathExpressionException xpee) {
      throw new MigrationPathConfigException(
        "Failed reading preset settings elements from the '"
          + presetNode.getNodeName() + "' element.", xpee);
  }

    }
View Full Code Here

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper2.exceptions.MigrationPathConfigException

    final Node parameterNode = parameterNodes.item(parameterIndex);

    final String parameterName = getAttributeValue(parameterNode,
      ConfigurationFileTagsV1.NAME_ATTRIBUTE);
    if (parameterName == null) {
        throw new MigrationPathConfigException(
          "No \"name\" attribute declared in node: "
            + parameterNode.getNodeName());
    }

    final Node descriptionNode = (Node) pathsXPath.evaluate(
      ConfigurationFileTagsV1.DESCRIPTION_ELEMENT,
      parameterNode, XPathConstants.NODE);

    String description = null;
    if (descriptionNode != null) {
        description = descriptionNode.getTextContent();
    }

    final Builder parameterBuilder = new Builder(parameterName,
      null);
    parameterBuilder.description(description);

    toolParameters.add(parameterBuilder.build());
      }

      return toolParameters;
  } catch (XPathExpressionException xpee) {
      throw new MigrationPathConfigException(
        "Failed reading tool parameter elements from the '"
          + nameOfElementContainingParameters
          + "' element in the '" + pathNode.getNodeName()
          + "' element.", xpee);
  }
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.