1 20 21 package org.snmp4j.agent.mo.snmp.tc; 22 23 import org.snmp4j.agent.*; 24 import org.snmp4j.agent.mo.*; 25 import org.snmp4j.smi.*; 26 import org.snmp4j.agent.mo.snmp.TimeStamp; 27 import org.snmp4j.agent.mo.snmp.TimeStampScalar; 28 import org.snmp4j.agent.mo.snmp.SNMPv2MIB; 29 import org.snmp4j.agent.mo.snmp.SNMPv2TC; 30 31 public class TimeStampTC implements TextualConvention { 32 33 private OctetString defaultContext; 34 35 public TimeStampTC() { 36 } 37 38 47 public TimeStampTC(OctetString defaultContext) { 48 this.defaultContext = defaultContext; 49 } 50 51 public MOColumn createColumn(int columnID, int syntax, MOAccess access, 52 Variable defaultValue, 53 boolean mutableInService) { 54 return new TimeStamp(columnID, access, 55 SNMPv2MIB.getSysUpTime(defaultContext)); 56 } 57 58 public MOScalar createScalar(OID oid, MOAccess access, Variable value) { 59 return new TimeStampScalar(oid, access, 60 SNMPv2MIB.getSysUpTime(defaultContext)); 61 } 62 63 public String getModuleName() { 64 return SNMPv2TC.MODULE_NAME; 65 } 66 67 public String getName() { 68 return SNMPv2TC.TIMESTAMP; 69 } 70 } 71 | Popular Tags |