Examples of SnmpV3AdaptorServer


Examples of com.sun.management.comm.SnmpV3AdaptorServer

    private SnmpV3AdaptorServer getSnmpAdaptor(
            SNMPConnectionHandlerCfg configuration) {

        Validator.ensureNotNull(configuration);
        SnmpV3AdaptorServer adaptor = null;
        try {

            // Set the USM security file
            String usmConfigPath = configuration.getSecurityAgentFile();
            File file = StaticUtils.getFileForPath(usmConfigPath);
            if ((!file.isFile()) || (!file.exists())) {
                return null;
            }
            System.setProperty("jdmk.security.file", file.getAbsolutePath());
            // Create the Security Parameters for the engine
            SnmpEngineParameters engineParameters = new SnmpEngineParameters();

            // Set V3 Security parameters
            engineParameters.activateEncryption();

            // Create the UACL controller
            UserAcl uacls = (UserAcl) new SNMPUserAcl(configuration);
            engineParameters.setUserAcl(uacls);

            // V1/V2 Security parameters
            InetAddressAcl acls =
                    (InetAddressAcl) new SNMPInetAddressAcl(configuration);

            adaptor = new SnmpV3AdaptorServer(engineParameters, null, acls,
                    configuration.getListenPort(), null);

            // Enable the community to context translation for V1/V2 to V3
            adaptor.enableCommunityStringAtContext();

            return adaptor;
        } catch (Exception ex) {
            TRACER.debugError("Could not instanciate the SNMP Adaptor");
            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.