/** * Convenience method for clearing the current elements and setting the given one as single element */ public void setElement(TExtensibleElements element) { this.getServiceTemplateOrNodeTypeOrNodeTypeImplementation().clear(); this.getServiceTemplateOrNodeTypeOrNodeTypeImplementation().add(element); }
/** * Convenience method for <code>this.getServiceTemplateOrNodeTypeOrNodeTypeImplementation().get(0)</code> */ @XmlTransient @JsonIgnore public TExtensibleElements getElement() { return this.getServiceTemplateOrNodeTypeOrNodeTypeImplementation().get(0); }
@JsonIgnore @NonNull public List<TRelationshipTypeImplementation> getRelationshipTypeImplementations() { return getServiceTemplateOrNodeTypeOrNodeTypeImplementation().stream() .filter(x -> x instanceof TRelationshipTypeImplementation) .map(TRelationshipTypeImplementation.class::cast) .collect(Collectors.toList()); }
@JsonIgnore @NonNull public List<TArtifactType> getArtifactTypes() { return getServiceTemplateOrNodeTypeOrNodeTypeImplementation().stream() .filter(x -> x instanceof TArtifactType) .map(TArtifactType.class::cast) .collect(Collectors.toList()); }
@JsonIgnore @NonNull public List<TNodeTypeImplementation> getNodeTypeImplementations() { return getServiceTemplateOrNodeTypeOrNodeTypeImplementation().stream() .filter(x -> x instanceof TNodeTypeImplementation) .map(TNodeTypeImplementation.class::cast) .collect(Collectors.toList()); }
@JsonIgnore @NonNull public List<TPolicyTemplate> getPolicyTemplates() { return getServiceTemplateOrNodeTypeOrNodeTypeImplementation().stream() .filter(x -> x instanceof TPolicyTemplate) .map(TPolicyTemplate.class::cast) .collect(Collectors.toList()); }
@JsonIgnore @NonNull public List<TNodeType> getNodeTypes() { return getServiceTemplateOrNodeTypeOrNodeTypeImplementation().stream() .filter(x -> x instanceof TNodeType) .map(TNodeType.class::cast) .collect(Collectors.toList()); }
@JsonIgnore @NonNull public List<TServiceTemplate> getServiceTemplates() { return getServiceTemplateOrNodeTypeOrNodeTypeImplementation().stream() .filter(x -> x instanceof TServiceTemplate) .map(TServiceTemplate.class::cast) .collect(Collectors.toList()); }
@JsonIgnore @NonNull public List<TCapabilityType> getCapabilityTypes() { return getServiceTemplateOrNodeTypeOrNodeTypeImplementation().stream() .filter(x -> x instanceof TCapabilityType) .map(TCapabilityType.class::cast) .collect(Collectors.toList()); }
@JsonIgnore @NonNull public List<TRelationshipType> getRelationshipTypes() { return getServiceTemplateOrNodeTypeOrNodeTypeImplementation().stream() .filter(x -> x instanceof TRelationshipType) .map(TRelationshipType.class::cast) .collect(Collectors.toList()); }
@JsonIgnore @NonNull public List<TArtifactTemplate> getArtifactTemplates() { return getServiceTemplateOrNodeTypeOrNodeTypeImplementation().stream() .filter(x -> x instanceof TArtifactTemplate) .map(TArtifactTemplate.class::cast) .collect(Collectors.toList()); }
@JsonIgnore @NonNull public List<TRequirementType> getRequirementTypes() { return getServiceTemplateOrNodeTypeOrNodeTypeImplementation().stream() .filter(x -> x instanceof TRequirementType) .map(TRequirementType.class::cast) .collect(Collectors.toList()); }
@JsonIgnore @NonNull public List<TPolicyType> getPolicyTypes() { return getServiceTemplateOrNodeTypeOrNodeTypeImplementation().stream() .filter(x -> x instanceof TPolicyType) .map(TPolicyType.class::cast) .collect(Collectors.toList()); }
@Override @SuppressWarnings("unchecked") public <T extends TEntityType> T getType(QName qname, Class<T> type) { T res = null; if (this.entityTypeDataCache.containsKey(type)) { Map<QName, TEntityType> map = this.entityTypeDataCache.get(type); if (map.containsKey(qname)) { res = (T) map.get(qname); } } if (res == null) { // not yet seen, try to fetch resource for (WebResource wr: this.repositoryResources) { String path = Util.getURLpathFragmentForCollection(type); TDefinitions definitions = WineryRepositoryClient.getDefinitions(wr, path, qname.getNamespaceURI(), qname.getLocalPart()); if (definitions == null) { // in case of an error, just try the next one continue; } res = (T) definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation().get(0); this.cache(res, qname); break; } } return res; }
Iterator<TExtensibleElements> iterator = defs.getServiceTemplateOrNodeTypeOrNodeTypeImplementation().iterator(); boolean found = false; TExtensibleElements next = null;
if (definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation().isEmpty()) { result = null; LOGGER.error("Type {}/{} was found, but did not return any data", nsAndId.getNamespace(), nsAndId.getId()); } else { LOGGER.trace("Probably found valid data for {}/{}", nsAndId.getNamespace(), nsAndId.getId()); result = (T) definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation().get(0);
List<TExtensibleElements> componentInstanceList = defs.getServiceTemplateOrNodeTypeOrNodeTypeImplementation(); for (final TExtensibleElements ci : componentInstanceList) {