alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Java example source code file (SnmpGenericMetaServer.java)

This example Java source code file (SnmpGenericMetaServer.java) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Learn more about this Java project at its project page.

Java - Java tags/keywords

jmx, object, snmp, snmpgenericmetaserver, snmpstatusexception, snmpvalue, string

The SnmpGenericMetaServer.java Java example source code

/*
 * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

package com.sun.jmx.snmp.agent;

// jmx imports
//
import com.sun.jmx.snmp.SnmpValue;
import com.sun.jmx.snmp.SnmpStatusException;

/**
 * <p>
 * This interface defines the methods that must be implemented by an
 * SNMP metadata object that needs to interact with an
 * {@link com.sun.jmx.snmp.agent.SnmpGenericObjectServer} object.
 * </p>
 *
 * <p>
 * All these methods are usually generated by <code>mibgen when
 * run in generic-metadata mode.
 * </p>
 *
 * <p>
 * This interface is used internally between the generated Metadata and
 * the SNMP runtime and you shouldn't need to worry about it, because
 * you will never have to use it directly.
 * </b>

* * <p>This API is a Sun Microsystems internal API and is subject * to change without notice.</b>

**/ public interface SnmpGenericMetaServer { /** * Construct an attribute value (as returned by Attribute::getValue()) * from an SnmpValue. The returned attribute value can be used to * construct an Attribute object. * * @param id The OID arc identifying the variable for which the * value is constructed. * @param value The SnmpValue from which the Attribute::value will be * constructed. * @return The attribute value built from the given <code>value. * @exception SnmpStatusException if the attribute value cannot be built * from the given SnmpValue <code>value. * */ Object buildAttributeValue(long id, SnmpValue value) throws SnmpStatusException; /** * Construct an SnmpValue from an Attribute value as returned by * Attribute::getValue(). * * @param id The OID arc identifying the variable for which the * value is constructed. * @param value The attribute value as returned by Attribute::getValue(). * * @return The SnmpValue built from the given <code>value. * @exception SnmpStatusException if the SnmpValue cannot be built from * the given <code>value. **/ SnmpValue buildSnmpValue(long id, Object value) throws SnmpStatusException; /** * Return the name of the attribute corresponding to the * SNMP variable identified by the given <code>id. * * @param id The OID arc identifying the variable. * * @return The name of the variable identified by the given * <code>id. * * @exception SnmpStatusException if the given <code>id does not * correspond to a known variable. */ String getAttributeName(long id) throws SnmpStatusException; /** * Check the access rights for a SET operation. * * @param x The new requested value. * @param id The OID arc identifying the variable for which the SET is * requested. * @param data A contextual object containing user-data. * This object is allocated through the <code> * {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code> * for each incoming SNMP request. * @exception SnmpStatusException if the SET operation must be rejected. */ void checkSetAccess(SnmpValue x, long id, Object data) throws SnmpStatusException; /** * Check the access rights for a GET operation. * * @param id The OID arc identifying the variable for which the SET is * requested. * @param data A contextual object containing user-data. * This object is allocated through the <code> * {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code> * for each incoming SNMP request. * @exception SnmpStatusException if the SET operation must be rejected. */ void checkGetAccess(long id, Object data) throws SnmpStatusException; }

Other Java examples (source code examples)

Here is a short list of links related to this Java SnmpGenericMetaServer.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.