Class DateAndTime<T extends org.snmp4j.smi.OctetString>

    • Constructor Detail

      • DateAndTime

        public DateAndTime​(int columnID,
                           MOAccess access,
                           T defaultValue,
                           boolean mutableInService)
      • DateAndTime

        public DateAndTime​(int columnID,
                           MOAccess access,
                           T defaultValue)
    • Method Detail

      • validateDateAndTime

        public static int validateDateAndTime​(org.snmp4j.smi.Variable dateAndTime)
        Tests a variable for DateAndTime conformance.
        Parameters:
        dateAndTime - a Variable.
        Returns:
        SnmpConstants.SNMP_ERROR_SUCCESS if dateAndTime is valid or an appropriate SNMP error code if not.
      • makeDateAndTime

        public static org.snmp4j.smi.OctetString makeDateAndTime​(GregorianCalendar dateAndTime)
        Creates a DateAndTime OctetString value from a GregorianCalendar.
        Parameters:
        dateAndTime - a GregorianCalendar instance.
        Returns:
        the corresponding DateAndTime OctetString.
      • makeDateAndTime

        public static <T extends org.snmp4j.smi.OctetString> T makeDateAndTime​(GregorianCalendar dateAndTime,
                                                                               T os)
        Creates a DateAndTime OctetString value from a GregorianCalendar.
        Type Parameters:
        T - the OctetString type to return and modify.
        Parameters:
        dateAndTime - a GregorianCalendar instance.
        os - the OctetString instance where to store the value.
        Returns:
        the os instance with the set calendar value.
        Since:
        2.0.5
      • makeCalendar

        public static GregorianCalendar makeCalendar​(org.snmp4j.smi.OctetString dateAndTimeValue)
        Creates a GregorianCalendar from a properly formatted DateAndTime OctetString.
        Parameters:
        dateAndTimeValue - an OctetString conforming to the DateAndTime TC.
        Returns:
        the corresponding GregorianCalendar instance.
      • validate

        public int validate​(T newValue,
                            T oldValue)
        Overrides:
        validate in class MOMutableColumn<T extends org.snmp4j.smi.OctetString>
      • createMOScalar

        public static MOScalar<org.snmp4j.smi.OctetString> createMOScalar​(org.snmp4j.smi.OID oid,
                                                                          MOAccess access,
                                                                          org.snmp4j.smi.OctetString value,
                                                                          boolean localtime)
        Create a MOScalar DateAndTime instance.
        Parameters:
        oid - the OID of the scalar (including the .0 suffix).
        access - the MOAccess instance defining the maximum access rights.
        value - the initial value.
        localtime - if true the returned DateAndTime instance will always return the local time (does only makes sense for a read-only instance). Otherwise the value last set will be returned on GET like requests.
        Returns:
        the MOScalar instance.