Relationship (Common API)

Overview - Common API - Client API - Admin API - Runtime API

Relationship

A Relationship is a typed pointer to an instance. I.e the relationship with namespace = 'org.acme', type = 'Vehicle' and id = 'ABC' creates a pointer that points at an instance of org.acme.Vehicle with the id ABC.

Applications should retrieve instances from Factory

Details

  • Extends Identifiable

  • Module common

See also

Method Summary

Name Returns Description
fromURI Relationship Contructs a Relationship instance from a URI representation (created using toURI)
isRelationship boolean Determine if this identifiable is a relationship
toString String Returns the string representation of this class

Inherited Method Summary

Supertype Name Returns Description
Typed getType string Get the type of the instance (a short name, not including namespace)
Identifiable getIdentifier string Get the identifier of this instance
Identifiable getFullyQualifiedIdentifier string Get the fully qualified identifier of this instance
Identifiable isResource boolean Determine if this identifiable is a resource
Identifiable toURI String Returns a URI representation of a reference to this identifiable
Identifiable setIdentifier void Set the identifier of this instance
Typed getFullyQualifiedType string Get the fully-qualified type name of the instance (including namespace)
Typed getNamespace string Get the namespace of the instance
Typed setPropertyValue void Sets a property on this Resource
Typed addArrayValue void Adds a value to an array property on this Resource
Typed instanceOf boolean Check to see if this instance is an instance of the specified fully qualified type name

Method Details

toString

String toString( )

Returns the string representation of this class

Returns

String - the string representation of the class

See also

Parameters

No parameters

isRelationship

boolean isRelationship( )

Determine if this identifiable is a relationship.

Returns

boolean - True if this identifiable is a relationship, false if not.

See also

Parameters

No parameters

fromURI

Relationship fromURI( ModelManager modelmanager, String uriasstring, [String defaultnamespace], [String defaulttype] )

Contructs a Relationship instance from a URI representation (created using toURI).

Returns

Relationship - the relationship

See also

Parameters

Name Type Mandatory Description
modelManager ModelManager Yes the model manager to bind the relationship to
uriAsString String Yes the URI as a string, generated using Identifiable.toURI()
defaultNamespace String Yes default namespace to use for backwards compatability (optional)
defaultType String Yes default type to use for backwards compatability (optional)

Inherited methods

getIdentifier

string getIdentifier( )

Inherited from: Identifiable

Get the identifier of this instance

Returns

string - The identifier for this object

See also

Parameters

No parameters

setIdentifier

void setIdentifier( string id )

Inherited from: Identifiable

Set the identifier of this instance

See also

Parameters

Name Type Mandatory Description
id string Yes the new identifier for this object

getFullyQualifiedIdentifier

string getFullyQualifiedIdentifier( )

Inherited from: Identifiable

Get the fully qualified identifier of this instance. (namespace '.' type '#' identifier).

Returns

string - the fully qualified identifier of this instance

See also

Parameters

No parameters

isResource

boolean isResource( )

Inherited from: Identifiable

Determine if this identifiable is a resource.

Returns

boolean - True if this identifiable is a resource, false if not.

See also

Parameters

No parameters

toURI

String toURI( )

Inherited from: Identifiable

Returns a URI representation of a reference to this identifiable

Returns

String - the URI for the identifiable

See also

Parameters

No parameters

getType

string getType( )

Inherited from: Typed

Get the type of the instance (a short name, not including namespace).

Returns

string - The type of this object

See also

Parameters

No parameters

getFullyQualifiedType

string getFullyQualifiedType( )

Inherited from: Typed

Get the fully-qualified type name of the instance (including namespace).

Returns

string - The fully-qualified type name of this object

See also

Parameters

No parameters

getNamespace

string getNamespace( )

Inherited from: Typed

Get the namespace of the instance.

Returns

string - The namespace of this object

See also

Parameters

No parameters

setPropertyValue

void setPropertyValue( string propname, string value )

Inherited from: Typed

Sets a property on this Resource

See also

Parameters

Name Type Mandatory Description
propName string Yes the name of the field
value string Yes the value of the property

addArrayValue

void addArrayValue( string propname, string value )

Inherited from: Typed

Adds a value to an array property on this Resource

See also

Parameters

Name Type Mandatory Description
propName string Yes the name of the field
value string Yes the value of the property

instanceOf

boolean instanceOf( String fqt )

Inherited from: Typed

Check to see if this instance is an instance of the specified fully qualified type name.

Returns

boolean - True if this instance is an instance of the specified fully qualified type name, false otherwise.

See also

Parameters

Name Type Mandatory Description
fqt String Yes The fully qualified type name.