예제 #1
0
 private MatchingDictionary createRequirementIdsNodeTemplateIdsDictionary(
     List<AgnosticComponent> agnosticComponents) {
   MatchingDictionary dictionary = new MatchingDictionary();
   for (AgnosticComponent agnosticComponent : agnosticComponents)
     dictionary.addDictionaryEntrys(agnosticComponent.getRequirementsIds(), agnosticComponent);
   return dictionary;
 }
예제 #2
0
  private void addRelationTemplateToAgnosticRelation(
      TRelationshipTemplate relationshipTemplate,
      MatchingDictionary capabilitiesIdsNodeTemplateIdsDictionary,
      MatchingDictionary requirementsIdsNodeTemplateIdsDictionary)
      throws TopologyTemplateFormatException {

    TRequirement source = (TRequirement) relationshipTemplate.getSourceElement().getRef();
    TCapability target = (TCapability) relationshipTemplate.getTargetElement().getRef();

    if ((source == null) || (target == null)) {
      throw new TopologyTemplateFormatException(
          "Inconsistent relation"
              + relationshipTemplate.getId()
              + " source or target do not defined correctly");
    } else {
      AgnosticComponent nodeTemplateSourceId =
          requirementsIdsNodeTemplateIdsDictionary.get(source.getId());
      AgnosticComponent nodeTemplateTargetId =
          capabilitiesIdsNodeTemplateIdsDictionary.get(target.getId());
      addRelationAgnosticRelation(nodeTemplateSourceId, nodeTemplateTargetId);
    }
  }