本文整理汇总了Java中com.sun.jmx.snmp.SnmpStatusException.noSuchObject方法的典型用法代码示例。如果您正苦于以下问题:Java SnmpStatusException.noSuchObject方法的具体用法?Java SnmpStatusException.noSuchObject怎么用?Java SnmpStatusException.noSuchObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.jmx.snmp.SnmpStatusException
的用法示例。
在下文中一共展示了SnmpStatusException.noSuchObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
/**
* Get the value of a scalar variable
*/
public SnmpValue get(long var, Object data)
throws SnmpStatusException {
switch((int)var) {
case 4:
return new SnmpInt(node.getJvmOSProcessorCount());
case 3:
return new SnmpString(node.getJvmOSVersion());
case 2:
return new SnmpString(node.getJvmOSArch());
case 1:
return new SnmpString(node.getJvmOSName());
default:
break;
}
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}
示例2: validateOid
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
/**
* Validate the specified OID.
*
* <p>
* @param oid The OID array.
*
* @param pos The position in the array.
*
* @exception SnmpStatusException If the validation fails.
*/
final void validateOid(long[] oid, int pos) throws SnmpStatusException {
final int length= oid.length;
// Control the length of the oid
//
if (pos +2 >= length) {
throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
}
// Check that the entry identifier is specified
//
if (oid[pos] != nodeId) {
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}
}
示例3: getAttributeName
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
/**
* Return the name of the attribute corresponding to the SNMP variable identified by "id".
*/
public String getAttributeName(long id)
throws SnmpStatusException {
switch((int)id) {
case 3:
return "JvmJITCompilerTimeMonitoring";
case 2:
return "JvmJITCompilerTimeMs";
case 1:
return "JvmJITCompilerName";
default:
break;
}
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}
示例4: getChild
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
SnmpMibNode getChild(long id) throws SnmpStatusException {
// first we need to retrieve the identifier in the list of children
//
final int pos= getInsertAt(id);
if (pos >= nbChildren) {
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}
if (varList[pos] != (int) id) {
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}
// Access the node
//
SnmpMibNode child = null;
try {
child = children.elementAtNonSync(pos);
} catch(ArrayIndexOutOfBoundsException e) {
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}
if (child == null) {
throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
}
return child;
}
示例5: getAttributeName
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
/**
* Return the name of the attribute corresponding to the SNMP variable identified by "id".
*/
public String getAttributeName(long id)
throws SnmpStatusException {
switch((int)id) {
case 4:
return "JvmClassesVerboseLevel";
case 3:
return "JvmClassesUnloadedCount";
case 2:
return "JvmClassesTotalLoadedCount";
case 1:
return "JvmClassesLoadedCount";
default:
break;
}
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}
示例6: getAttributeName
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
/**
* Return the name of the attribute corresponding to the SNMP variable identified by "id".
*/
public String getAttributeName(long id)
throws SnmpStatusException {
switch((int)id) {
case 4:
return "JvmOSProcessorCount";
case 3:
return "JvmOSVersion";
case 2:
return "JvmOSArch";
case 1:
return "JvmOSName";
default:
break;
}
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}
示例7: findHandlingNode
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
@Override
void findHandlingNode(SnmpVarBind varbind,
long[] oid, int depth,
SnmpRequestTree handlers)
throws SnmpStatusException {
final int length = oid.length;
SnmpMibNode node = null;
if (handlers == null)
throw new SnmpStatusException(SnmpStatusException.snmpRspGenErr);
if (depth > length) {
// Nothing is left... the oid is not valid
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
} else if (depth == length) {
// The oid is not complete...
throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
} else {
// Some children variable or subobject is being querried
// getChild() will raise an exception if no child is found.
//
final SnmpMibNode child= getChild(oid[depth]);
// XXXX zzzz : what about null children?
// (variables for nested groups)
// if child==null, then we're dealing with a variable or
// a table: we register this node.
// This behaviour should be overriden in subclasses,
// in particular in group meta classes: the group
// meta classes that hold tables should take care
// of forwarding this call to all the tables involved.
//
if (child == null)
handlers.add(this,depth,varbind);
else
child.findHandlingNode(varbind,oid,depth+1,handlers);
}
}
示例8: get
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
/**
* Get the value of a scalar variable
*/
public SnmpValue get(long var, Object data)
throws SnmpStatusException {
switch((int)var) {
case 3:
return new SnmpString(node.getJvmMemMgrRelPoolName());
case 2:
return new SnmpString(node.getJvmMemMgrRelManagerName());
default:
break;
}
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}
示例9: getAttributeName
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
/**
* Return the name of the attribute corresponding to the SNMP variable identified by "id".
*/
public String getAttributeName(long id)
throws SnmpStatusException {
switch((int)id) {
case 2:
return "JvmRTLibraryPathItem";
case 1:
return "JvmRTLibraryPathIndex";
default:
break;
}
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}
示例10: get
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
/**
* Get the value of a scalar variable
*/
public SnmpValue get(long var, Object data)
throws SnmpStatusException {
switch((int)var) {
case 6:
return new SnmpInt(node.getJvmThreadCpuTimeMonitoring());
case 5:
return new SnmpInt(node.getJvmThreadContentionMonitoring());
case 4:
return new SnmpCounter64(node.getJvmThreadTotalStartedCount());
case 3:
return new SnmpCounter(node.getJvmThreadPeakCount());
case 2:
return new SnmpGauge(node.getJvmThreadDaemonCount());
case 1:
return new SnmpGauge(node.getJvmThreadCount());
case 10: {
throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
}
case 7:
return new SnmpCounter64(node.getJvmThreadPeakCountReset());
default:
break;
}
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}
示例11: get
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
/**
* Get the value of a scalar variable
*/
public SnmpValue get(long var, Object data)
throws SnmpStatusException {
switch((int)var) {
case 3:
return new SnmpCounter64(node.getJvmMemGCTimeMs());
case 2:
return new SnmpCounter64(node.getJvmMemGCCount());
default:
break;
}
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}
示例12: getAttributeName
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
/**
* Return the name of the attribute corresponding to the SNMP variable identified by "id".
*/
public String getAttributeName(long id)
throws SnmpStatusException {
switch((int)id) {
case 3:
return "JvmMemMgrRelPoolName";
case 2:
return "JvmMemMgrRelManagerName";
default:
break;
}
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}
示例13: getAttributeName
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
/**
* Return the name of the attribute corresponding to the SNMP variable identified by "id".
*/
public String getAttributeName(long id)
throws SnmpStatusException {
switch((int)id) {
case 6:
return "JvmThreadCpuTimeMonitoring";
case 5:
return "JvmThreadContentionMonitoring";
case 4:
return "JvmThreadTotalStartedCount";
case 3:
return "JvmThreadPeakCount";
case 2:
return "JvmThreadDaemonCount";
case 1:
return "JvmThreadCount";
case 10: {
throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
}
case 7:
return "JvmThreadPeakCountReset";
default:
break;
}
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}
示例14: registerGetException
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
@Override
public void registerGetException(SnmpVarBind var,
SnmpStatusException exception)
throws SnmpStatusException {
// The index in the exception must correspond to
// the SNMP index ...
//
if (version == SnmpDefinitions.snmpVersionOne)
throw new SnmpStatusException(exception, getVarIndex(var)+1);
if (var == null)
throw exception;
// If we're doing a getnext ==> endOfMibView
if (getnextflag) {
var.value = SnmpVarBind.endOfMibView;
return;
}
final int errorCode = mapGetException(exception.getStatus(),
version);
// Now take care of V2 errorCodes that can be stored
// in the varbind itself:
if (errorCode ==
SnmpStatusException.noSuchObject)
// noSuchObject => noSuchObject
var.value= SnmpVarBind.noSuchObject;
else if (errorCode ==
SnmpStatusException.noSuchInstance)
// noSuchInstance => noSuchInstance
var.value= SnmpVarBind.noSuchInstance;
else
throw new SnmpStatusException(errorCode, getVarIndex(var)+1);
}
示例15: get
import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
/**
* Get the value of a scalar variable
*/
public SnmpValue get(long var, Object data)
throws SnmpStatusException {
switch((int)var) {
case 23: {
throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
}
case 22: {
throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
}
case 21: {
throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
}
case 9:
return new SnmpInt(node.getJvmRTBootClassPathSupport());
case 20: {
throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
}
case 8:
return new SnmpString(node.getJvmRTManagementSpecVersion());
case 7:
return new SnmpString(node.getJvmRTSpecVersion());
case 6:
return new SnmpString(node.getJvmRTSpecVendor());
case 5:
return new SnmpString(node.getJvmRTSpecName());
case 4:
return new SnmpString(node.getJvmRTVMVersion());
case 3:
return new SnmpString(node.getJvmRTVMVendor());
case 12:
return new SnmpCounter64(node.getJvmRTStartTimeMs());
case 11:
return new SnmpCounter64(node.getJvmRTUptimeMs());
case 2:
return new SnmpString(node.getJvmRTVMName());
case 1:
return new SnmpString(node.getJvmRTName());
case 10:
return new SnmpInt(node.getJvmRTInputArgsCount());
default:
break;
}
throw new SnmpStatusException(SnmpStatusException.noSuchObject);
}