vSphere Client SDK API Documentation : version 5.5.0.1300321

com.vmware.vise.data.query
Class RelationalConstraint

java.lang.Object
  extended by com.vmware.vise.data.Constraint
      extended by com.vmware.vise.data.query.RelationalConstraint

@data
public class RelationalConstraint
extends Constraint

Defines the matching criteria based on some relation to the object queried.

Eg. VirtualMachines whose host is esx1.vmware.com


Field Summary
 Constraint constraintOnRelatedObject
          A constraint on the related objects by the given relationship.
 boolean hasInverseRelation
          Indicates whether the constraint given by constraintOnRelatedObject applies to the source, as opposed to the target of the relationship given in this instance.
 String relation
          The relation to match (the source type of the relation is defined by the isSourceConstrainted property).
 
Fields inherited from class com.vmware.vise.data.Constraint
targetType
 
Constructor Summary
RelationalConstraint()
           
 
Method Summary
 boolean equals(Object obj)
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

relation

public String relation
The relation to match (the source type of the relation is defined by the isSourceConstrainted property).


hasInverseRelation

public boolean hasInverseRelation
Indicates whether the constraint given by constraintOnRelatedObject applies to the source, as opposed to the target of the relationship given in this instance. It is useful when the client only knows one-way relationship between objects.

If true, the relation defined by constraintOnRelatedObject.targetType.relationship is used. Thus the constraint can be referred to as an inverse-RelationalConstraint (as the inverse relationship is used compared to the normal direction). Make sure to explicitly set the constraintOnRelatedObject.targetType value.

Example:

            RelationalConstraint {
               targetType = "VirtualMachine",
               relationship = "vm",   // HostSystem.vm relationship is used
               hasInverseRelation = true,
               constraintOnRelatedObject =
                  ObjectIdentityConstraint {
                     targetType = "HostSystem"
                     target = "host-1"
                  }
            }
 
If false (i.e. the target is constrained), the relation defined by this.targetType.relationship is used.

Example:

            RelationalConstraint {
               targetType = "VirtualMachine",
               relationship = "host",   // VirtualMachine.Host relationship is used
               hasInverseRelation = false,
               constraintOnRelatedObject =
                  ObjectIdentityConstraint {
                     targetType = null, // implicitly "HostSystem"
                     target = "host-1"
                  }
            }
 
Default value is false.


constraintOnRelatedObject

public Constraint constraintOnRelatedObject
A constraint on the related objects by the given relationship. This further filtering can be based on either the identity of the related objects or their properties or some further nested relationship.

Constructor Detail

RelationalConstraint

public RelationalConstraint()
Method Detail

equals

public boolean equals(Object obj)
Overrides:
equals in class Constraint

hashCode

public int hashCode()
Overrides:
hashCode in class Constraint

vSphere Client SDK API Documentation : version 5.5.0.1300321

Copyright @ 2012 VMware, Inc. All rights reserved.