org.overlord.sramp.common
Class SrampModelUtils

java.lang.Object
  extended by org.overlord.sramp.common.SrampModelUtils

public class SrampModelUtils
extends Object

A collection of utilities for dealing with the s-ramp models.

Author:
eric.wittmann@redhat.com

Constructor Summary
SrampModelUtils()
           
 
Method Summary
static Relationship addGenericRelationship(BaseArtifactType artifact, String relationshipType, String targetUUID)
          Adds a new generic Relationship to the artifact.
static String getCustomProperty(BaseArtifactType artifact, String propName)
          Gets the value of one of the s-ramp custom properties.
static Relationship getGenericRelationship(BaseArtifactType artifact, String relationshipType)
          Gets the generic relationship from the artifact (by type).
static void setCustomProperty(BaseArtifactType artifact, String propName, String propValue)
          Convenience method to help set a custom s-ramp property on the given artifact.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SrampModelUtils

public SrampModelUtils()
Method Detail

setCustomProperty

public static void setCustomProperty(BaseArtifactType artifact,
                                     String propName,
                                     String propValue)
Convenience method to help set a custom s-ramp property on the given artifact.

Parameters:
artifact -
propName -
propValue -

getCustomProperty

public static String getCustomProperty(BaseArtifactType artifact,
                                       String propName)
Gets the value of one of the s-ramp custom properties.

Parameters:
artifact - the s-ramp artifact
propName - the name of the custom property
Returns:
the custom property value or null if not found

addGenericRelationship

public static Relationship addGenericRelationship(BaseArtifactType artifact,
                                                  String relationshipType,
                                                  String targetUUID)
Adds a new generic Relationship to the artifact.

Parameters:
artifact -
relationshipType -
targetUUID -
Returns:
the created Relationship

getGenericRelationship

public static Relationship getGenericRelationship(BaseArtifactType artifact,
                                                  String relationshipType)
Gets the generic relationship from the artifact (by type).

Parameters:
artifact - the s-ramp artifact
relationshipType - the relationship type
Returns:
the Relationship or null if not found


Copyright © 2011-2013 JBoss, a division of Red Hat. All Rights Reserved.