Examples of SysUpTime


Examples of org.snmp4j.agent.mo.snmp.SysUpTime

    return response;
  }

  protected TimeTicks getContextSysUpTime(OctetString context) {
    MasterContextInfo info = (MasterContextInfo) contextInfo.get(context);
    SysUpTime contextSysUpTime;
    if (info == null) {
      MOContextScope scope =
          new DefaultMOContextScope(context,
                                    SnmpConstants.sysUpTime, true,
                                    SnmpConstants.sysUpTime, true);
      ManagedObject mo = getManagedObject(context, new DefaultMOQuery(scope));
      if (mo instanceof SysUpTime) {
        contextSysUpTime = (SysUpTime) mo;
      }
      else {
        /**@todo May be we can use an integer of the found object to
         * initialize the time?
         */
        LOGGER.warn("SysUpTime could not be found in '"+context+
                    "' context, using a new instance instead");
        contextSysUpTime = new SysUpTimeImpl();
      }
      contextInfo.put(context,
                      new MasterContextInfo(context, contextSysUpTime));
    }
    else {
      contextSysUpTime = info.getUpTime();
    }
    if (contextSysUpTime != null) {
      return contextSysUpTime.get();
    }
    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.