COSMOS ${releaseVersion} data-collection Project
Public API Specification

org.eclipse.cosmos.dc.mgmt.annotations
Annotation Type ManagedRelation


@Target(value=FIELD)
@Retention(value=RUNTIME)
public @interface ManagedRelation

Annotation used to indicate a container that acts as storage for relationships between the property's manageable resource and other manageable resources. The containing class is expected to provide add and remove methods that add and remove resources from the container. The default behavior is to look for addXXX and removeXXX, where XXX is the name of the container. Calls to addXXX will create relations, and calls to removeXXX will remove them.


Required Element Summary
 java.lang.String type
          The type of the relation
 
Optional Element Summary
 java.lang.String addName
          The name of the "add" method.
 java.lang.String name
          The name of the relation
 java.lang.String namespace
          The namespace to be used for the relation.
 java.lang.String relatedClassName
          The name of the class corresponding to the related resource.
 java.lang.String removeName
          The name of the "add" method.
 java.lang.String[] roles
          The roles played by the participants in the relation.
 

Element Detail

type

public abstract java.lang.String type
The type of the relation

name

public abstract java.lang.String name
The name of the relation

Default:
""

addName

public abstract java.lang.String addName
The name of the "add" method. This method will be designated as the relation creator. If no addName is provided, the default of addXXX (where XXX is the name of the property) will be used.

Default:
""

removeName

public abstract java.lang.String removeName
The name of the "add" method. This method will be designated as the relation remover. If no removeName is provided, the default of removeXXX (where XXX is the name of the property) will be used.

Default:
""

relatedClassName

public abstract java.lang.String relatedClassName
The name of the class corresponding to the related resource. This name acts as a hint to the annotation processor to help identify add and remove methods.

Default:
""

namespace

public abstract java.lang.String namespace
The namespace to be used for the relation. If no namespace is provided, the namespace of ManagedResource annotation will be used.

Default:
""

roles

public abstract java.lang.String[] roles
The roles played by the participants in the relation. The first role is assigned to the resource the container belongs to, and the second role is assigned to the resource being added. If no roles are proved, the default roles of "container" and "contained" are used.

Default:
{"container", "contained"}

COSMOS ${releaseVersion} data-collection Project
Public API Specification