public class EntityRelations<T extends BrooklynObject>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static RelationshipType<Entity,Entity> |
ACTIVE_CHILD_OF
Inverse of
ACTIVE_PARENT_OF . |
static RelationshipType<Entity,Entity> |
ACTIVE_PARENT_OF
ACTIVE_PARENT_OF indicates that one entity is should be considered as the logical parent of another,
e.g. |
static RelationshipType<Entity,Entity> |
GROUP_CONTAINS
GROUP_CONTAINS indicates that one entity, typically a Group ,
has zero or more entities which are labelled as "members" of that group entity. |
static RelationshipType<Entity,Policy> |
HAS_POLICY
HAS_POLICY indicates that an entity has a policy associated to it. |
static RelationshipType<Entity,Entity> |
HAS_TARGET
HAS_TARGET indicates that one entity directs to one or more other entities. |
static RelationshipType<Entity,Entity> |
IN_GROUP
Inverse of
GROUP_CONTAINS . |
static RelationshipType<Entity,Entity> |
MANAGED_BY
Inverse of
MANAGER_OF . |
static RelationshipType<Entity,Entity> |
MANAGER_OF
MANAGER_OF indicates that one entity is the manager of another entity,
in the internal Brooklyn management hierarchy model. |
static RelationshipType<Policy,Entity> |
POLICY_FOR
Inverse of
HAS_POLICY . |
static RelationshipType<Entity,Entity> |
TARGETTED_BY
Inverse of
HAS_TARGET . |
Constructor and Description |
---|
EntityRelations() |
Modifier and Type | Method and Description |
---|---|
static <T extends BrooklynObject,U extends BrooklynObject> |
add(T source,
RelationshipType<? super T,? super U> relationship,
U target)
As
BrooklynObject.RelationSupport.add(RelationshipType, BrooklynObject) for the given object. |
static <T extends BrooklynObject,U extends BrooklynObject> |
getRelations(RelationshipType<? super T,U> relationship,
T source)
As
BrooklynObject.RelationSupport.getRelations(RelationshipType) for the given object. |
static <T extends BrooklynObject> |
getRelationshipTypes(T source)
As
BrooklynObject.RelationSupport.getRelationshipTypes() for the given object. |
static RelationshipType<? extends BrooklynObject,? extends BrooklynObject> |
lookup(ManagementContext mgmt,
java.lang.String relationshipTypeName)
Find the typed Relationship instance for the given relationship name, if known;
behaviour is not guaranteed by the API if not known (hence the Beta marker),
it may fail fast or return null or create a poor-man's relationship instance.
|
static <T extends BrooklynObject,U extends BrooklynObject> |
remove(T source,
RelationshipType<? super T,? super U> relationship,
U target)
As
BrooklynObject.RelationSupport.remove(RelationshipType, BrooklynObject) for the given object. |
public static final RelationshipType<Entity,Entity> MANAGER_OF
MANAGER_OF
indicates that one entity is the manager of another entity,
in the internal Brooklyn management hierarchy model.
Apart from root Application
entities, every deployed entity must have exactly one manager.
The inverse relationship is MANAGED_BY
.public static final RelationshipType<Entity,Entity> MANAGED_BY
MANAGER_OF
.public static final RelationshipType<Entity,Entity> GROUP_CONTAINS
GROUP_CONTAINS
indicates that one entity, typically a Group
,
has zero or more entities which are labelled as "members" of that group entity.
What membership means will depend on the group entity.
An entity may be a member of any number of other entities.
The inverse relationship is IN_GROUP
.public static final RelationshipType<Entity,Entity> IN_GROUP
GROUP_CONTAINS
.public static final RelationshipType<Entity,Entity> HAS_TARGET
HAS_TARGET
indicates that one entity directs to one or more other entities.
What this targeting relationship means depends on the targetter.
The inverse relationship is TARGETTED_BY
.public static final RelationshipType<Entity,Entity> TARGETTED_BY
HAS_TARGET
.public static final RelationshipType<Entity,Entity> ACTIVE_PARENT_OF
ACTIVE_PARENT_OF
indicates that one entity is should be considered as the logical parent of another,
e.g. for presentation purposes to the end user.
Frequently this relationship coincides with a MANAGED_BY
relationship,
but sometimes some managed children are there for purposes the designers consider less important,
and they can choose to suppress the ACTIVE_PARENT_OF
relationship
so that the active children is a subset of the managed children.
One recommended consideration is whether the child should be shown in a default tree view. Whilst a user can always fina a way to see all managed children, it may be the case that only some of those are of primary interest, and it is to identify those that this relationship exists.
It is permitted that an entity be an ACTIVE_PARENT_OF
an entity for which it is not a manager,
but in most cases a different relationship type is more appropriate where there is not also a management relationship.
The inverse relationship is ACTIVE_CHILD_OF
,
and an entity should normally be an ACTIVE_CHILD_OF
zero or one entities.
public static final RelationshipType<Entity,Entity> ACTIVE_CHILD_OF
ACTIVE_PARENT_OF
.public static final RelationshipType<Entity,Policy> HAS_POLICY
HAS_POLICY
indicates that an entity has a policy associated to it.
The inverse relationship is POLICY_FOR
.public static final RelationshipType<Policy,Entity> POLICY_FOR
HAS_POLICY
.public static RelationshipType<? extends BrooklynObject,? extends BrooklynObject> lookup(ManagementContext mgmt, java.lang.String relationshipTypeName)
public static <T extends BrooklynObject> java.util.Set<RelationshipType<? super T,? extends BrooklynObject>> getRelationshipTypes(T source)
BrooklynObject.RelationSupport.getRelationshipTypes()
for the given object. Callers can use either method.
See AbstractBasicRelationSupport
for a discussion of why double dispatch is used and both methods are present.public static <T extends BrooklynObject,U extends BrooklynObject> java.util.Set<U> getRelations(RelationshipType<? super T,U> relationship, T source)
BrooklynObject.RelationSupport.getRelations(RelationshipType)
for the given object. Callers can use either method.
See AbstractBasicRelationSupport
for a discussion of why double dispatch is used and both methods are present.public static <T extends BrooklynObject,U extends BrooklynObject> void add(T source, RelationshipType<? super T,? super U> relationship, U target)
BrooklynObject.RelationSupport.add(RelationshipType, BrooklynObject)
for the given object. Callers can use either method.
See AbstractBasicRelationSupport
for a discussion of why double dispatch is used and both methods are present.public static <T extends BrooklynObject,U extends BrooklynObject> void remove(T source, RelationshipType<? super T,? super U> relationship, U target)
BrooklynObject.RelationSupport.remove(RelationshipType, BrooklynObject)
for the given object. Callers can use either method.
See AbstractBasicRelationSupport
for a discussion of why double dispatch is used and both methods are present.