当前位置: 首页>>代码示例>>Java>>正文


Java SnmpStatusException.snmpRspNoAccess方法代码示例

本文整理汇总了Java中com.sun.jmx.snmp.SnmpStatusException.snmpRspNoAccess方法的典型用法代码示例。如果您正苦于以下问题:Java SnmpStatusException.snmpRspNoAccess方法的具体用法?Java SnmpStatusException.snmpRspNoAccess怎么用?Java SnmpStatusException.snmpRspNoAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.jmx.snmp.SnmpStatusException的用法示例。


在下文中一共展示了SnmpStatusException.snmpRspNoAccess方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createNewEntry

import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
public void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
    throws SnmpStatusException {
    if (factory != null)
        factory.createNewEntry(req, rowOid, depth, this);
    else
        throw new SnmpStatusException(
            SnmpStatusException.snmpRspNoAccess);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:JvmMemMgrPoolRelTableMeta.java

示例2: findHandlingNode

import com.sun.jmx.snmp.SnmpStatusException; //导入方法依赖的package包/类
@Override
final synchronized void findHandlingNode(SnmpVarBind varbind,
                                         long[] oid, int depth,
                                         SnmpRequestTree handlers)
    throws SnmpStatusException {

    final int  length = oid.length;

    if (handlers == null)
        throw new SnmpStatusException(SnmpStatusException.snmpRspGenErr);

    if (depth >= length)
        throw new SnmpStatusException(SnmpStatusException.noAccess);

    if (oid[depth] != nodeId)
        throw new SnmpStatusException(SnmpStatusException.noAccess);

    if (depth+2 >= length)
        throw new SnmpStatusException(SnmpStatusException.noAccess);

    // Checks that the oid is valid
    // validateOid(oid,depth);

    // Gets the part of the OID that identifies the entry
    final SnmpOid entryoid = new SnmpEntryOid(oid, depth+2);

    // Finds the entry: false means that the entry does not exists
    final Object data = handlers.getUserData();
    final boolean hasEntry = contains(entryoid, data);

    // Fails if the entry is not found and the table does not
    // not support creation.
    // We know that the entry does not exists if (isentry == false).
    if (!hasEntry) {
        if (!handlers.isCreationAllowed()) {
            // we're not doing a set
            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
        } else if (!isCreationEnabled())
            // we're doing a set but creation is disabled.
            throw new
                SnmpStatusException(SnmpStatusException.snmpRspNoAccess);
    }

    final long   var  = oid[depth+1];

    // Validate the entry id
    if (hasEntry) {
        // The entry already exists - validate the id
        validateVarEntryId(entryoid,var,data);
    }

    // Registers this node for the identified entry.
    //
    if (handlers.isSetRequest() && isRowStatus(entryoid,var,data))

        // We only try to identify the RowStatus for SET operations
        //
        handlers.add(this,depth,entryoid,varbind,(!hasEntry),varbind);

    else
        handlers.add(this,depth,entryoid,varbind,(!hasEntry));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:63,代码来源:SnmpMibTable.java


注:本文中的com.sun.jmx.snmp.SnmpStatusException.snmpRspNoAccess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。