Class ManagedObject

Object
com.tailf.ncs.alarmman.common.ManagedObject

public class ManagedObject extends Object

The Managed object is the object within a managed device that is a component of an Alarm.

Managed object represents one element in the key:

/al:alarms/alarms/alarm-list/alarm/device
/al:alarms/alarms/alarm-list/alarm/type
/al:alarms/alarms/alarm-list/alarm/managed-object
/al:alarms/alarms/alarm-list/alarm/specific-problem

in the alarm list: /al:alarms/alarm-list/alarm.

The ManagedObject is a union of the types:

  • ConfObjectRef - Which is the YANG type instance-identifier

  • ConfOID - Which is the YANG type object-identifier

  • ConfBuf - Which is the YANG type string

Which means that there is a constructor for each of the above types for creating an instance of ManagedObject.

It is important to choose the correct type for the object being created. Specifically, the ConfBuf type MUST NOT be used if the type is really an instance-identifier or object-identifier. The reason for this is that when such an object is passed back-and-forth over text-based protocols such as NETCONF, WebUI, and REST, the conversion from the internal representation to string and then back to the internal representation MUST result in the same internal representation as the original object had.

  • Constructor Details

    • ManagedObject

      public ManagedObject(ConfBuf value)
      Creates a ManagedObject as a general string.
      Parameters:
      value - the ConfBuf representing the ManagedObject
    • ManagedObject

      public ManagedObject(ConfObjectRef value)
      Creates a ManagedObject as a ConfObjectRef.
      Parameters:
      value - the ConfObjectRef representing the ManagedObject
    • ManagedObject

      public ManagedObject(ConfOID value)
      Creates a ManagedObject as a ConfOID.
      Parameters:
      value - the ConfOID representing the ManagedObject
    • ManagedObject

      public ManagedObject(ConfPath value) throws ConfException
      Creates a ManagedObject as a ConfObjectRef defined from a ConfPath.
      Parameters:
      value - the ConfPath representing the ManagedObject
      Throws:
      ConfException
    • ManagedObject

      public ManagedObject(ConfValue value)
      Parameters:
      value - A value matching the typedef managed-object-t in tailf-ncs-alarms.yang. Specifically, the value can have one of the following types: ConfBuf, ConfObjectRef, ConfOID
      Throws:
      IllegalArgumentException - If the supplied value is not of one of the types listed above
    • ManagedObject

      public ManagedObject(String value)
      Constructor that takes a string representation of one of the below listed types. The string is first checked to see if it represents an XPath and in this case a ConfObjectRef is set. Otherwise, the string is checked to see if it represents an OID and if so a ConfOID is set. Otherwise a ConfBuf is set.
      Parameters:
      value - String representation of typedef managed-object-t in tailf-ncs-alarms.yang. Specifically, the value can be a string representation of one of the following types: ConfBuf, ConfObjectRef, ConfOID
    • ManagedObject

      public ManagedObject(String value, MountIdInterface mountGetter)
  • Method Details

    • getAsConfValue

      public ConfValue getAsConfValue()
      Get the ConfValue representation of this managedObject. Since the modeled managedObject is a union of ConfBuf, ConfObjectRef and ConfOID, the returned value can be either one of these three.
      Returns:
      ConfValue the ConfValue representation of this ManagedObject
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object