com.sun.jmx.snmp.InetAddressAcl Java Examples

The following examples show how to use com.sun.jmx.snmp.InetAddressAcl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SnmpAdaptorServer.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Common initializations.
 */
private void init(InetAddressAcl acl, int p, InetAddress a) {

    root= new SnmpMibTree();

    // The default Agent is initialized with a SnmpErrorHandlerAgent agent.
    root.setDefaultAgent(new SnmpErrorHandlerAgent());

    // For the trap time, use the time the agent started ...
    //
    startUpTime= java.lang.System.currentTimeMillis();
    maxActiveClientCount = 10;

    // Create the default message factory
    pduFactory = new SnmpPduFactoryBER() ;

    port = p ;
    ipacl = acl ;
    address = a ;

    if ((ipacl == null) && (useAcl == true))
        throw new IllegalArgumentException("ACL object cannot be null") ;

    threadService = new ThreadService(threadNumber);
}
 
Example #2
Source File: SnmpAdaptorServer.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Common initializations.
 */
private void init(InetAddressAcl acl, int p, InetAddress a) {

    root= new SnmpMibTree();

    // The default Agent is initialized with a SnmpErrorHandlerAgent agent.
    root.setDefaultAgent(new SnmpErrorHandlerAgent());

    // For the trap time, use the time the agent started ...
    //
    startUpTime= java.lang.System.currentTimeMillis();
    maxActiveClientCount = 10;

    // Create the default message factory
    pduFactory = new SnmpPduFactoryBER() ;

    port = p ;
    ipacl = acl ;
    address = a ;

    if ((ipacl == null) && (useAcl == true))
        throw new IllegalArgumentException("ACL object cannot be null") ;

    threadService = new ThreadService(threadNumber);
}
 
Example #3
Source File: SnmpAdaptorServer.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void createSnmpRequestHandler(SnmpAdaptorServer server,
                                      int id,
                                      DatagramSocket s,
                                      DatagramPacket p,
                                      SnmpMibTree tree,
                                      Vector<SnmpMibAgent> m,
                                      InetAddressAcl a,
                                      SnmpPduFactory factory,
                                      SnmpUserDataFactory dataFactory,
                                      MBeanServer f,
                                      ObjectName n) {
    final SnmpRequestHandler handler =
        new SnmpRequestHandler(this, id, s, p, tree, m, a, factory,
                               dataFactory, f, n);
    threadService.submitTask(handler);
}
 
Example #4
Source File: SnmpRequestHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Full constructor
 */
public SnmpRequestHandler(SnmpAdaptorServer server, int id,
                          DatagramSocket s, DatagramPacket p,
                          SnmpMibTree tree, Vector<SnmpMibAgent> m,
                          InetAddressAcl a,
                          SnmpPduFactory factory,
                          SnmpUserDataFactory dataFactory,
                          MBeanServer f, ObjectName n)
{
    super(server, id, f, n);

    // Need a reference on SnmpAdaptorServer for getNext & getBulk,
    // in case of oid equality (mib overlapping).
    //
    adaptor = server;
    socket = s;
    packet = p;
    root= tree;
    mibs = new Vector<>(m);
    subs= new Hashtable<>(mibs.size());
    ipacl = a;
    pduFactory = factory ;
    userDataFactory = dataFactory ;
    //thread.start();
}
 
Example #5
Source File: SnmpAdaptorServer.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Common initializations.
 */
private void init(InetAddressAcl acl, int p, InetAddress a) {

    root= new SnmpMibTree();

    // The default Agent is initialized with a SnmpErrorHandlerAgent agent.
    root.setDefaultAgent(new SnmpErrorHandlerAgent());

    // For the trap time, use the time the agent started ...
    //
    startUpTime= java.lang.System.currentTimeMillis();
    maxActiveClientCount = 10;

    // Create the default message factory
    pduFactory = new SnmpPduFactoryBER() ;

    port = p ;
    ipacl = acl ;
    address = a ;

    if ((ipacl == null) && (useAcl == true))
        throw new IllegalArgumentException("ACL object cannot be null") ;

    threadService = new ThreadService(threadNumber);
}
 
Example #6
Source File: SnmpAdaptorServer.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void createSnmpRequestHandler(SnmpAdaptorServer server,
                                      int id,
                                      DatagramSocket s,
                                      DatagramPacket p,
                                      SnmpMibTree tree,
                                      Vector<SnmpMibAgent> m,
                                      InetAddressAcl a,
                                      SnmpPduFactory factory,
                                      SnmpUserDataFactory dataFactory,
                                      MBeanServer f,
                                      ObjectName n) {
    final SnmpRequestHandler handler =
        new SnmpRequestHandler(this, id, s, p, tree, m, a, factory,
                               dataFactory, f, n);
    threadService.submitTask(handler);
}
 
Example #7
Source File: SnmpAdaptorServer.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Common initializations.
 */
private void init(InetAddressAcl acl, int p, InetAddress a) {

    root= new SnmpMibTree();

    // The default Agent is initialized with a SnmpErrorHandlerAgent agent.
    root.setDefaultAgent(new SnmpErrorHandlerAgent());

    // For the trap time, use the time the agent started ...
    //
    startUpTime= java.lang.System.currentTimeMillis();
    maxActiveClientCount = 10;

    // Create the default message factory
    pduFactory = new SnmpPduFactoryBER() ;

    port = p ;
    ipacl = acl ;
    address = a ;

    if ((ipacl == null) && (useAcl == true))
        throw new IllegalArgumentException("ACL object cannot be null") ;

    threadService = new ThreadService(threadNumber);
}
 
Example #8
Source File: SnmpRequestHandler.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Full constructor
 */
public SnmpRequestHandler(SnmpAdaptorServer server, int id,
                          DatagramSocket s, DatagramPacket p,
                          SnmpMibTree tree, Vector<SnmpMibAgent> m,
                          InetAddressAcl a,
                          SnmpPduFactory factory,
                          SnmpUserDataFactory dataFactory,
                          MBeanServer f, ObjectName n)
{
    super(server, id, f, n);

    // Need a reference on SnmpAdaptorServer for getNext & getBulk,
    // in case of oid equality (mib overlapping).
    //
    adaptor = server;
    socket = s;
    packet = p;
    root= tree;
    mibs = new Vector<>(m);
    subs= new Hashtable<>(mibs.size());
    ipacl = a;
    pduFactory = factory ;
    userDataFactory = dataFactory ;
    //thread.start();
}
 
Example #9
Source File: SnmpAdaptorServer.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
private void createSnmpRequestHandler(SnmpAdaptorServer server,
                                      int id,
                                      DatagramSocket s,
                                      DatagramPacket p,
                                      SnmpMibTree tree,
                                      Vector<SnmpMibAgent> m,
                                      InetAddressAcl a,
                                      SnmpPduFactory factory,
                                      SnmpUserDataFactory dataFactory,
                                      MBeanServer f,
                                      ObjectName n) {
    final SnmpRequestHandler handler =
        new SnmpRequestHandler(this, id, s, p, tree, m, a, factory,
                               dataFactory, f, n);
    threadService.submitTask(handler);
}
 
Example #10
Source File: SnmpRequestHandler.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Full constructor
 */
public SnmpRequestHandler(SnmpAdaptorServer server, int id,
                          DatagramSocket s, DatagramPacket p,
                          SnmpMibTree tree, Vector<SnmpMibAgent> m,
                          InetAddressAcl a,
                          SnmpPduFactory factory,
                          SnmpUserDataFactory dataFactory,
                          MBeanServer f, ObjectName n)
{
    super(server, id, f, n);

    // Need a reference on SnmpAdaptorServer for getNext & getBulk,
    // in case of oid equality (mib overlapping).
    //
    adaptor = server;
    socket = s;
    packet = p;
    root= tree;
    mibs = new Vector<>(m);
    subs= new Hashtable<>(mibs.size());
    ipacl = a;
    pduFactory = factory ;
    userDataFactory = dataFactory ;
    //thread.start();
}
 
Example #11
Source File: SnmpRequestHandler.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Full constructor
 */
public SnmpRequestHandler(SnmpAdaptorServer server, int id,
                          DatagramSocket s, DatagramPacket p,
                          SnmpMibTree tree, Vector<SnmpMibAgent> m,
                          InetAddressAcl a,
                          SnmpPduFactory factory,
                          SnmpUserDataFactory dataFactory,
                          MBeanServer f, ObjectName n)
{
    super(server, id, f, n);

    // Need a reference on SnmpAdaptorServer for getNext & getBulk,
    // in case of oid equality (mib overlapping).
    //
    adaptor = server;
    socket = s;
    packet = p;
    root= tree;
    mibs = new Vector<>(m);
    subs= new Hashtable<>(mibs.size());
    ipacl = a;
    pduFactory = factory ;
    userDataFactory = dataFactory ;
    //thread.start();
}
 
Example #12
Source File: SnmpAdaptorServer.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
private void createSnmpRequestHandler(SnmpAdaptorServer server,
                                      int id,
                                      DatagramSocket s,
                                      DatagramPacket p,
                                      SnmpMibTree tree,
                                      Vector<SnmpMibAgent> m,
                                      InetAddressAcl a,
                                      SnmpPduFactory factory,
                                      SnmpUserDataFactory dataFactory,
                                      MBeanServer f,
                                      ObjectName n) {
    final SnmpRequestHandler handler =
        new SnmpRequestHandler(this, id, s, p, tree, m, a, factory,
                               dataFactory, f, n);
    threadService.submitTask(handler);
}
 
Example #13
Source File: SnmpRequestHandler.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Full constructor
 */
public SnmpRequestHandler(SnmpAdaptorServer server, int id,
                          DatagramSocket s, DatagramPacket p,
                          SnmpMibTree tree, Vector<SnmpMibAgent> m,
                          InetAddressAcl a,
                          SnmpPduFactory factory,
                          SnmpUserDataFactory dataFactory,
                          MBeanServer f, ObjectName n)
{
    super(server, id, f, n);

    // Need a reference on SnmpAdaptorServer for getNext & getBulk,
    // in case of oid equality (mib overlapping).
    //
    adaptor = server;
    socket = s;
    packet = p;
    root= tree;
    mibs = new Vector<>(m);
    subs= new Hashtable<>(mibs.size());
    ipacl = a;
    pduFactory = factory ;
    userDataFactory = dataFactory ;
    //thread.start();
}
 
Example #14
Source File: SnmpAdaptorServer.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private void createSnmpRequestHandler(SnmpAdaptorServer server,
                                      int id,
                                      DatagramSocket s,
                                      DatagramPacket p,
                                      SnmpMibTree tree,
                                      Vector<SnmpMibAgent> m,
                                      InetAddressAcl a,
                                      SnmpPduFactory factory,
                                      SnmpUserDataFactory dataFactory,
                                      MBeanServer f,
                                      ObjectName n) {
    final SnmpRequestHandler handler =
        new SnmpRequestHandler(this, id, s, p, tree, m, a, factory,
                               dataFactory, f, n);
    threadService.submitTask(handler);
}
 
Example #15
Source File: SnmpRequestHandler.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Full constructor
 */
public SnmpRequestHandler(SnmpAdaptorServer server, int id,
                          DatagramSocket s, DatagramPacket p,
                          SnmpMibTree tree, Vector<SnmpMibAgent> m,
                          InetAddressAcl a,
                          SnmpPduFactory factory,
                          SnmpUserDataFactory dataFactory,
                          MBeanServer f, ObjectName n)
{
    super(server, id, f, n);

    // Need a reference on SnmpAdaptorServer for getNext & getBulk,
    // in case of oid equality (mib overlapping).
    //
    adaptor = server;
    socket = s;
    packet = p;
    root= tree;
    mibs = new Vector<>(m);
    subs= new Hashtable<>(mibs.size());
    ipacl = a;
    pduFactory = factory ;
    userDataFactory = dataFactory ;
    //thread.start();
}
 
Example #16
Source File: SnmpAdaptorServer.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Common initializations.
 */
private void init(InetAddressAcl acl, int p, InetAddress a) {

    root= new SnmpMibTree();

    // The default Agent is initialized with a SnmpErrorHandlerAgent agent.
    root.setDefaultAgent(new SnmpErrorHandlerAgent());

    // For the trap time, use the time the agent started ...
    //
    startUpTime= java.lang.System.currentTimeMillis();
    maxActiveClientCount = 10;

    // Create the default message factory
    pduFactory = new SnmpPduFactoryBER() ;

    port = p ;
    ipacl = acl ;
    address = a ;

    if ((ipacl == null) && (useAcl == true))
        throw new IllegalArgumentException("ACL object cannot be null") ;

    threadService = new ThreadService(threadNumber);
}
 
Example #17
Source File: SnmpRequestHandler.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Full constructor
 */
public SnmpRequestHandler(SnmpAdaptorServer server, int id,
                          DatagramSocket s, DatagramPacket p,
                          SnmpMibTree tree, Vector<SnmpMibAgent> m,
                          InetAddressAcl a,
                          SnmpPduFactory factory,
                          SnmpUserDataFactory dataFactory,
                          MBeanServer f, ObjectName n)
{
    super(server, id, f, n);

    // Need a reference on SnmpAdaptorServer for getNext & getBulk,
    // in case of oid equality (mib overlapping).
    //
    adaptor = server;
    socket = s;
    packet = p;
    root= tree;
    mibs = new Vector<>(m);
    subs= new Hashtable<>(mibs.size());
    ipacl = a;
    pduFactory = factory ;
    userDataFactory = dataFactory ;
    //thread.start();
}
 
Example #18
Source File: SnmpAdaptorServer.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private void createSnmpRequestHandler(SnmpAdaptorServer server,
                                      int id,
                                      DatagramSocket s,
                                      DatagramPacket p,
                                      SnmpMibTree tree,
                                      Vector<SnmpMibAgent> m,
                                      InetAddressAcl a,
                                      SnmpPduFactory factory,
                                      SnmpUserDataFactory dataFactory,
                                      MBeanServer f,
                                      ObjectName n) {
    final SnmpRequestHandler handler =
        new SnmpRequestHandler(this, id, s, p, tree, m, a, factory,
                               dataFactory, f, n);
    threadService.submitTask(handler);
}
 
Example #19
Source File: SnmpAdaptorServer.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private void createSnmpRequestHandler(SnmpAdaptorServer server,
                                      int id,
                                      DatagramSocket s,
                                      DatagramPacket p,
                                      SnmpMibTree tree,
                                      Vector<SnmpMibAgent> m,
                                      InetAddressAcl a,
                                      SnmpPduFactory factory,
                                      SnmpUserDataFactory dataFactory,
                                      MBeanServer f,
                                      ObjectName n) {
    final SnmpRequestHandler handler =
        new SnmpRequestHandler(this, id, s, p, tree, m, a, factory,
                               dataFactory, f, n);
    threadService.submitTask(handler);
}
 
Example #20
Source File: SnmpRequestHandler.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Full constructor
 */
public SnmpRequestHandler(SnmpAdaptorServer server, int id,
                          DatagramSocket s, DatagramPacket p,
                          SnmpMibTree tree, Vector<SnmpMibAgent> m,
                          InetAddressAcl a,
                          SnmpPduFactory factory,
                          SnmpUserDataFactory dataFactory,
                          MBeanServer f, ObjectName n)
{
    super(server, id, f, n);

    // Need a reference on SnmpAdaptorServer for getNext & getBulk,
    // in case of oid equality (mib overlapping).
    //
    adaptor = server;
    socket = s;
    packet = p;
    root= tree;
    mibs = new Vector<>(m);
    subs= new Hashtable<>(mibs.size());
    ipacl = a;
    pduFactory = factory ;
    userDataFactory = dataFactory ;
    //thread.start();
}
 
Example #21
Source File: SnmpAdaptorServer.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Common initializations.
 */
private void init(InetAddressAcl acl, int p, InetAddress a) {

    root= new SnmpMibTree();

    // The default Agent is initialized with a SnmpErrorHandlerAgent agent.
    root.setDefaultAgent(new SnmpErrorHandlerAgent());

    // For the trap time, use the time the agent started ...
    //
    startUpTime= java.lang.System.currentTimeMillis();
    maxActiveClientCount = 10;

    // Create the default message factory
    pduFactory = new SnmpPduFactoryBER() ;

    port = p ;
    ipacl = acl ;
    address = a ;

    if ((ipacl == null) && (useAcl == true))
        throw new IllegalArgumentException("ACL object cannot be null") ;

    threadService = new ThreadService(threadNumber);
}
 
Example #22
Source File: AdaptorBootstrap.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Retrieve the Trap Target List from the ACL file.
 **/
@SuppressWarnings("unchecked")
private static List<NotificationTarget> getTargetList(InetAddressAcl acl,
                                                      int defaultTrapPort) {
    final ArrayList<NotificationTarget> result =
            new ArrayList<>();
    if (acl != null) {
        if (log.isDebugOn())
            log.debug("getTargetList",Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.processing"));

        final Enumeration<InetAddress> td = acl.getTrapDestinations();
        for (; td.hasMoreElements() ;) {
            final InetAddress targetAddr = td.nextElement();
            final Enumeration<String> tc =
                acl.getTrapCommunities(targetAddr);
            for (;tc.hasMoreElements() ;) {
                final String community = tc.nextElement();
                final NotificationTarget target =
                    new NotificationTargetImpl(targetAddr,
                                               defaultTrapPort,
                                               community);
                if (log.isDebugOn())
                    log.debug("getTargetList",
                              Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.adding",
                                            target.toString()));
                result.add(target);
            }
        }
    }
    return result;
}
 
Example #23
Source File: AdaptorBootstrap.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Retrieve the Trap Target List from the ACL file.
 **/
@SuppressWarnings("unchecked")
private static List<NotificationTarget> getTargetList(InetAddressAcl acl,
                                                      int defaultTrapPort) {
    final ArrayList<NotificationTarget> result =
            new ArrayList<>();
    if (acl != null) {
        if (log.isDebugOn())
            log.debug("getTargetList",Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.processing"));

        final Enumeration<InetAddress> td = acl.getTrapDestinations();
        for (; td.hasMoreElements() ;) {
            final InetAddress targetAddr = td.nextElement();
            final Enumeration<String> tc =
                acl.getTrapCommunities(targetAddr);
            for (;tc.hasMoreElements() ;) {
                final String community = tc.nextElement();
                final NotificationTarget target =
                    new NotificationTargetImpl(targetAddr,
                                               defaultTrapPort,
                                               community);
                if (log.isDebugOn())
                    log.debug("getTargetList",
                              Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.adding",
                                            target.toString()));
                result.add(target);
            }
        }
    }
    return result;
}
 
Example #24
Source File: AdaptorBootstrap.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Retrieve the Trap Target List from the ACL file.
 **/
@SuppressWarnings("unchecked")
private static List<NotificationTarget> getTargetList(InetAddressAcl acl,
                                                      int defaultTrapPort) {
    final ArrayList<NotificationTarget> result =
            new ArrayList<>();
    if (acl != null) {
        if (log.isDebugOn())
            log.debug("getTargetList",Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.processing"));

        final Enumeration<InetAddress> td = acl.getTrapDestinations();
        for (; td.hasMoreElements() ;) {
            final InetAddress targetAddr = td.nextElement();
            final Enumeration<String> tc =
                acl.getTrapCommunities(targetAddr);
            for (;tc.hasMoreElements() ;) {
                final String community = tc.nextElement();
                final NotificationTarget target =
                    new NotificationTargetImpl(targetAddr,
                                               defaultTrapPort,
                                               community);
                if (log.isDebugOn())
                    log.debug("getTargetList",
                              Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.adding",
                                            target.toString()));
                result.add(target);
            }
        }
    }
    return result;
}
 
Example #25
Source File: AdaptorBootstrap.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Retrieve the Trap Target List from the ACL file.
 **/
@SuppressWarnings("unchecked")
private static List<NotificationTarget> getTargetList(InetAddressAcl acl,
                                                      int defaultTrapPort) {
    final ArrayList<NotificationTarget> result =
            new ArrayList<>();
    if (acl != null) {
        if (log.isDebugOn())
            log.debug("getTargetList",Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.processing"));

        final Enumeration<InetAddress> td = acl.getTrapDestinations();
        for (; td.hasMoreElements() ;) {
            final InetAddress targetAddr = td.nextElement();
            final Enumeration<String> tc =
                acl.getTrapCommunities(targetAddr);
            for (;tc.hasMoreElements() ;) {
                final String community = tc.nextElement();
                final NotificationTarget target =
                    new NotificationTargetImpl(targetAddr,
                                               defaultTrapPort,
                                               community);
                if (log.isDebugOn())
                    log.debug("getTargetList",
                              Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.adding",
                                            target.toString()));
                result.add(target);
            }
        }
    }
    return result;
}
 
Example #26
Source File: AdaptorBootstrap.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Retrieve the Trap Target List from the ACL file.
 **/
@SuppressWarnings("unchecked")
private static List<NotificationTarget> getTargetList(InetAddressAcl acl,
                                                      int defaultTrapPort) {
    final ArrayList<NotificationTarget> result =
            new ArrayList<>();
    if (acl != null) {
        if (log.isDebugOn())
            log.debug("getTargetList",Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.processing"));

        final Enumeration<InetAddress> td = acl.getTrapDestinations();
        for (; td.hasMoreElements() ;) {
            final InetAddress targetAddr = td.nextElement();
            final Enumeration<String> tc =
                acl.getTrapCommunities(targetAddr);
            for (;tc.hasMoreElements() ;) {
                final String community = tc.nextElement();
                final NotificationTarget target =
                    new NotificationTargetImpl(targetAddr,
                                               defaultTrapPort,
                                               community);
                if (log.isDebugOn())
                    log.debug("getTargetList",
                              Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.adding",
                                            target.toString()));
                result.add(target);
            }
        }
    }
    return result;
}
 
Example #27
Source File: AdaptorBootstrap.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Retrieve the Trap Target List from the ACL file.
 **/
@SuppressWarnings("unchecked")
private static List<NotificationTarget> getTargetList(InetAddressAcl acl,
                                                      int defaultTrapPort) {
    final ArrayList<NotificationTarget> result =
            new ArrayList<>();
    if (acl != null) {
        if (log.isDebugOn())
            log.debug("getTargetList",Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.processing"));

        final Enumeration<InetAddress> td = acl.getTrapDestinations();
        for (; td.hasMoreElements() ;) {
            final InetAddress targetAddr = td.nextElement();
            final Enumeration<String> tc =
                acl.getTrapCommunities(targetAddr);
            for (;tc.hasMoreElements() ;) {
                final String community = tc.nextElement();
                final NotificationTarget target =
                    new NotificationTargetImpl(targetAddr,
                                               defaultTrapPort,
                                               community);
                if (log.isDebugOn())
                    log.debug("getTargetList",
                              Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.adding",
                                            target.toString()));
                result.add(target);
            }
        }
    }
    return result;
}
 
Example #28
Source File: SnmpAdaptorServerMBean.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the Ip address based ACL used by this SNMP protocol adaptor.
 * @return The <CODE>InetAddressAcl</CODE> implementation.
 *
 * @since 1.5
 */
public InetAddressAcl getInetAddressAcl();
 
Example #29
Source File: SnmpAdaptorServer.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Initializes this SNMP protocol adaptor using the default port (161)
 * and the specified IP address based ACL implementation.
 *
 * @param acl The <CODE>InetAddressAcl</CODE> implementation.
 *        <code>null</code> means no ACL - everybody is authorized.
 *
 * @since 1.5
 */
public SnmpAdaptorServer(InetAddressAcl acl) {
    this(false, acl, com.sun.jmx.snmp.ServiceName.SNMP_ADAPTOR_PORT,
         null) ;
}
 
Example #30
Source File: SnmpAdaptorServer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the Ip address based ACL used by this SNMP protocol adaptor.
 * @return The <CODE>InetAddressAcl</CODE> implementation.
 *
 * @since 1.5
 */
@Override
public InetAddressAcl getInetAddressAcl() {
    return ipacl;
}