Codota Logo
Relationship
Code IndexAdd Codota to your IDE (free)

How to use
Relationship
in
org.oasis_open.docs.s_ramp.ns.s_ramp_v1

Best Java code snippets using org.oasis_open.docs.s_ramp.ns.s_ramp_v1.Relationship (Showing top 20 results out of 315)

  • Common ways to obtain Relationship
private void myMethod () {
Relationship r =
  • Codota Iconnew Relationship()
  • Smart code suggestions by Codota
}
origin: org.overlord.sramp/s-ramp-common

/**
 * Adds a new generic {@link Relationship} to the artifact.
 * @param artifact
 * @param relationshipType
 * @param targetUUID
 * @return the created {@link Relationship}
 */
public static Relationship addGenericRelationship(BaseArtifactType artifact, String relationshipType, String targetUUID) {
  Relationship relationship = null;
  for (Relationship r : artifact.getRelationship()) {
    if (r.getRelationshipType().equals(relationshipType)) {
      relationship = r;
      break;
    }
  }
  if (relationship == null) {
    relationship = new Relationship();
    relationship.setRelationshipType(relationshipType);
    artifact.getRelationship().add(relationship);
  }
  // TODO check for duplicates first?
  if (targetUUID != null) {
    Target target = new Target();
    target.setValue(targetUUID);
    relationship.getRelationshipTarget().add(target);
  }
  return relationship;
}
origin: org.artificer/artificer-repository-hibernate

/**
 * Updates the generic artifact relationships.
 * @param artifact
 * @throws Exception
 */
private void updateGenericRelationships(BaseArtifactType artifact) throws Exception {
  for (Relationship relationship : artifact.getRelationship()) {
    if (relationship.getRelationshipTarget().size() > 0) {
      setRelationships(relationship.getRelationshipType(), RelationshipType.GENERIC,
          relationship.getRelationshipTarget(), relationship.getOtherAttributes());
    }
  }
}
origin: org.overlord.sramp/s-ramp-common

/**
 * @see org.overlord.sramp.common.visitors.HierarchicalArtifactVisitorAdapter#visitBase(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType)
 */
@Override
protected void visitBase(BaseArtifactType artifact) {
  List<Relationship> relationships = artifact.getRelationship();
  if (relationships != null) {
    for (Relationship relationship : relationships) {
      String type = relationship.getRelationshipType();
      List<Target> targets = relationship.getRelationshipTarget();
      visitRelationships(type, targets);
    }
  }
  super.visitBase(artifact);
}
origin: org.overlord.sramp/s-ramp-integration-switchyard

/**
 * @see org.overlord.sramp.integration.switchyard.model.SwitchYardArtifactVisitor#visitComponentService(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ExtendedArtifactType)
 */
@Override
public void visitComponentService(ExtendedArtifactType artifact) {
  // Handle unresolved "implements" relationships
  Relationship relationship = SrampModelUtils.getGenericRelationship(artifact, SwitchYardModel.REL_IMPLEMENTS);
  if (relationship != null && relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF)) {
    String ref = relationship.getOtherAttributes().remove(SwitchYardXmlDeriver.UNRESOLVED_REF);
    if (ref.startsWith("java:")) { //$NON-NLS-1$
      String refInterfaceName = ref.substring(5);
      BaseArtifactType artifactRef = findJavaInterfaceArtifact(refInterfaceName);
      if (artifactRef != null) {
        Target target = new Target();
        target.setValue(artifactRef.getUuid());
        relationship.getRelationshipTarget().add(target);
      }
    } else if (ref.startsWith("wsdl:")) { //$NON-NLS-1$
      String refWsdl = ref.substring(5);
      BaseArtifactType artifactRef = findWsdlArtifact(refWsdl);
      if (artifactRef != null) {
        Target target = new Target();
        target.setValue(artifactRef.getUuid());
        relationship.getRelationshipTarget().add(target);
      }
    }
  }
}
origin: org.overlord.sramp/s-ramp-repository-jcr

Relationship relationship = new Relationship();
relationship.setRelationshipType(rtype);
if (rNode.hasProperty("sramp:relationshipTarget")) { //$NON-NLS-1$
  Property property = rNode.getProperty("sramp:relationshipTarget"); //$NON-NLS-1$
      Target target = new Target();
      target.setValue(targetUUID);
      relationship.getRelationshipTarget().add(target);
origin: org.artificer/artificer-common

/**
 * Gets the generic relationship from the artifact (by type).
 * @param artifact the s-ramp artifact
 * @param relationshipType the relationship type
 * @return the Relationship or null if not found
 */
public static Relationship getGenericRelationship(BaseArtifactType artifact, String relationshipType) {
  for (Relationship relationship : artifact.getRelationship()) {
    if (relationship.getRelationshipType().equals(relationshipType)) {
      return relationship;
    }
  }
  return null;
}
origin: org.artificer/artificer-api

/**
 * Create an instance of {@link Relationship }
 * 
 */
public Relationship createRelationship() {
  return new Relationship();
}
origin: org.overlord.sramp/s-ramp-integration-switchyard

relationship.getOtherAttributes().put(UNRESOLVED_REF, name);
  relationship.getOtherAttributes().put(UNRESOLVED_REF, "class:" + node.getAttribute("class")); //$NON-NLS-1$ //$NON-NLS-2$
  relationship.getOtherAttributes().put(UNRESOLVED_REF, "bean:" + node.getAttribute("bean")); //$NON-NLS-1$ //$NON-NLS-2$
origin: org.overlord.sramp/s-ramp-repository-jcr

/**
 * Updates the generic artifact relationships.
 * @param artifact
 * @throws RepositoryException
 */
private void updateGenericRelationships(BaseArtifactType artifact) throws Exception {
  // Create/Update all the relationships included in the artifact
  Set<String> updatedRelationshipTypes = new HashSet<String>();
  for (Relationship relationship : artifact.getRelationship()) {
    setRelationships(relationship.getRelationshipType(), -1, 0, null, true, relationship.getRelationshipTarget());
    updatedRelationshipTypes.add(relationship.getRelationshipType());
  }
  // Now remove any relationships that weren't just updated or created (the ones
  // not included on the artifact but that have existing JCR nodes).
  NodeIterator existingNodes = this.jcrNode.getNodes();
  while (existingNodes.hasNext()) {
    Node node = existingNodes.nextNode();
    // Only roemove generic relationships
    if (node.isNodeType("sramp:relationship") && node.hasProperty("sramp:generic") //$NON-NLS-1$ //$NON-NLS-2$
        && node.getProperty("sramp:generic").getBoolean()) { //$NON-NLS-1$
      String type = node.getProperty("sramp:relationshipType").getString(); //$NON-NLS-1$
      // If this relationship type was *not* updated above, then remove it because
      // it's not included in the latest artifact meta-data
      if (!updatedRelationshipTypes.contains(type)) {
        node.remove();
      }
    }
  }
}
origin: org.overlord.sramp/s-ramp-integration-switchyard

/**
 * @see org.overlord.sramp.integration.switchyard.model.SwitchYardArtifactVisitor#visitService(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ExtendedArtifactType)
 */
@Override
public void visitService(ExtendedArtifactType artifact) {
  // Handle unresolved "implements" relationships
  Relationship relationship = SrampModelUtils.getGenericRelationship(artifact, SwitchYardModel.REL_IMPLEMENTS);
  if (relationship != null && relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF)) {
    String ref = relationship.getOtherAttributes().remove(SwitchYardXmlDeriver.UNRESOLVED_REF);
    if (ref.startsWith("java:")) { //$NON-NLS-1$
      String refInterfaceName = ref.substring(5);
      BaseArtifactType artifactRef = findJavaInterfaceArtifact(refInterfaceName);
      if (artifactRef != null) {
        Target target = new Target();
        target.setValue(artifactRef.getUuid());
        relationship.getRelationshipTarget().add(target);
      }
    } else if (ref.startsWith("wsdl:")) { //$NON-NLS-1$
      String refWsdl = ref.substring(5);
      BaseArtifactType artifactRef = findWsdlArtifact(refWsdl);
      if (artifactRef != null) {
        Target target = new Target();
        target.setValue(artifactRef.getUuid());
        relationship.getRelationshipTarget().add(target);
      }
    }
  }
}
origin: org.overlord.sramp/s-ramp-api

xsdDocument.getImportedXsds().add(importedXsdTarget);
Relationship relationship = new Relationship();
  relationship.setRelationshipType("similarXsds");
  Target relationshipTarget = new Target();
  relationshipTarget.setValue("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa6b");
      new QName("xlink:href"),
      "http://example.org/s-ramp/xsd/XsdDocument/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa6b");
  relationship.getRelationshipTarget().add(relationshipTarget);
      new QName("xlink:href"),
      "http://example.org/s-ramp/xsd/XsdDocument/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa6c");
  relationship.getRelationshipTarget().add(relationshipTarget2);
xsdDocument.getRelationship().add(relationship);
origin: org.overlord.sramp/s-ramp-common

/**
 * Gets the generic relationship from the artifact (by type).
 * @param artifact the s-ramp artifact
 * @param relationshipType the relationship type
 * @return the Relationship or null if not found
 */
public static Relationship getGenericRelationship(BaseArtifactType artifact, String relationshipType) {
  for (Relationship relationship : artifact.getRelationship()) {
    if (relationship.getRelationshipType().equals(relationshipType)) {
      return relationship;
    }
  }
  return null;
}
origin: org.overlord.sramp/s-ramp-api

/**
 * Create an instance of {@link Relationship }
 * 
 */
public Relationship createRelationship() {
  return new Relationship();
}
origin: org.overlord.sramp/s-ramp-integration-switchyard

if (node.hasAttribute("class")) { //$NON-NLS-1$
  Relationship relationship = SrampModelUtils.addGenericRelationship(transformerArtifact, SwitchYardModel.REL_IMPLEMENTED_BY, null);
  relationship.getOtherAttributes().put(UNRESOLVED_REF, "class:" + node.getAttribute("class")); //$NON-NLS-1$ //$NON-NLS-2$
  relationship.getOtherAttributes().put(UNRESOLVED_REF, "bean:" + node.getAttribute("bean")); //$NON-NLS-1$ //$NON-NLS-2$
  relationship.getOtherAttributes().put(UNRESOLVED_REF, "xslt:" + node.getAttribute("xsltFile")); //$NON-NLS-1$ //$NON-NLS-2$
  relationship.getOtherAttributes().put(UNRESOLVED_REF, "smooks:" + node.getAttribute("config")); //$NON-NLS-1$ //$NON-NLS-2$
  relationship.getOtherAttributes().put(UNRESOLVED_REF, node.getAttribute("from")); //$NON-NLS-1$
  relationship.getOtherAttributes().put(UNRESOLVED_REF, node.getAttribute("to")); //$NON-NLS-1$
origin: org.artificer/artificer-common

Relationship relationship = null;
for (Relationship r : artifact.getRelationship()) {
  if (r.getRelationshipType().equals(relationshipType)) {
    relationship = r;
    break;
  relationship = new Relationship();
  relationship.setRelationshipType(relationshipType);
  artifact.getRelationship().add(relationship);
  target.setValue(targetUUID);
  target.getOtherAttributes().putAll(targetOtherAttributes);
  relationship.getRelationshipTarget().add(target);
relationship.getOtherAttributes().putAll(relationshipOtherAttributes);
origin: org.artificer/artificer-common

/**
 * @see HierarchicalArtifactVisitor#visitBase(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType)
 */
@Override
protected void visitBase(BaseArtifactType artifact) {
  // expansion
  String archiveUuid = artifact.getOtherAttributes().get(ArtificerConstants.ARTIFICER_EXPANDED_FROM_ARCHIVE_UUID_QNAME);
  if (StringUtils.isNotBlank(archiveUuid)) {
    visitRelationship("expandedFromArchive", archiveUuid, false);
  }
  List<Relationship> relationships = artifact.getRelationship();
  if (relationships != null) {
    for (Relationship relationship : relationships) {
      String type = relationship.getRelationshipType();
      List<Target> targets = relationship.getRelationshipTarget();
      visitRelationships(type, targets, true);
    }
  }
  super.visitBase(artifact);
}
origin: org.overlord.sramp/s-ramp-integration-switchyard

if (relationship != null && relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF)) {
  String ref = relationship.getOtherAttributes().remove(SwitchYardXmlDeriver.UNRESOLVED_REF);
  if (ref.startsWith("class:")) { //$NON-NLS-1$
    String refClassName = ref.substring(6);
      Target target = new Target();
      target.setValue(artifactRef.getUuid());
      relationship.getRelationshipTarget().add(target);
if (relationship != null && relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF)) {
  String ref = relationship.getOtherAttributes().remove(SwitchYardXmlDeriver.UNRESOLVED_REF);
  if (ref.startsWith("java:")) { //$NON-NLS-1$
    String refInterfaceName = ref.substring(5);
      Target target = new Target();
      target.setValue(artifactRef.getUuid());
      relationship.getRelationshipTarget().add(target);
      Target target = new Target();
      target.setValue(artifactRef.getUuid());
      relationship.getRelationshipTarget().add(target);
origin: org.artificer/artificer-common

relationshipNames.add(relationship.getRelationshipType());
origin: org.overlord.sramp/s-ramp-integration-switchyard

String ifaceName = iface.getAttribute("interface"); //$NON-NLS-1$
Relationship relationship = SrampModelUtils.addGenericRelationship(serviceArtifact, SwitchYardModel.REL_IMPLEMENTS, null);
relationship.getOtherAttributes().put(UNRESOLVED_REF, "java:" + ifaceName); //$NON-NLS-1$
String wsdlInfo = iface.getAttribute("interface"); //$NON-NLS-1$
Relationship relationship = SrampModelUtils.addGenericRelationship(serviceArtifact, SwitchYardModel.REL_IMPLEMENTS, null);
relationship.getOtherAttributes().put(UNRESOLVED_REF, "wsdl:" + wsdlInfo); //$NON-NLS-1$
origin: org.artificer/artificer-repository-hibernate

private void visitGenericRelationships(BaseArtifactType srampArtifact) throws Exception {
  for (ArtificerRelationship artificerRelationship : artificerArtifact.getRelationships()) {
    if (artificerRelationship.getType() == RelationshipType.GENERIC) {
      Relationship srampRelationship = new Relationship();
      srampRelationship.setRelationshipType(artificerRelationship.getName());
      for (ArtificerTarget artificerTarget : artificerRelationship.getTargets()) {
        Target srampTarget = createTarget(Target.class, artificerTarget);
        srampRelationship.getRelationshipTarget().add(srampTarget);
      }
      setOtherAttributes(artificerRelationship.getOtherAttributes(), srampRelationship.getOtherAttributes());
      srampArtifact.getRelationship().add(srampRelationship);
    }
  }
}
org.oasis_open.docs.s_ramp.ns.s_ramp_v1Relationship

Javadoc

Java class for anonymous complex type.

The following schema fragment specifies the expected content contained within this class.

 
<complexType> 
<complexContent> 
<restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 
<sequence> 
<element ref="{http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0}relationshipType"/> 
<element name="relationshipTarget" type="{http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0}target" maxOccurs="unbounded" minOccurs="0"/> 
</sequence> 
<anyAttribute/> 
</restriction> 
</complexContent> 
</complexType> 

Most used methods

  • getRelationshipTarget
    Gets the value of the relationshipTarget property. This accessor method returns a reference to the l
  • <init>
  • getRelationshipType
    Gets the value of the relationshipType property.
  • setRelationshipType
    Sets the value of the relationshipType property.
  • getOtherAttributes
    Gets a map that contains attributes that aren't bound to any typed property on this class. the map i

Popular in Java

  • Reading from database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • getContentResolver (Context)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • Runner (org.openjdk.jmh.runner)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now