Java 类com.sun.jmx.snmp.SnmpPeer 实例源码

项目:OpenJSharp    文件:SnmpAdaptorServer.java   
/**
 * Sends a trap using SNMP V1 trap format.
 * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
 * The community string used is the one located in the
 * <CODE>SnmpPeer</CODE> parameters
 * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
 * @param agentAddr The agent address to be used for the trap.
 * @param enterpOid The enterprise OID to be used for the trap.
 * @param generic The generic number of the trap.
 * @param specific The specific number of the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 * @param time The time stamp (overwrite the current time).
 *
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit
 * defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public void snmpV1Trap(SnmpPeer peer,
                       SnmpIpAddress agentAddr,
                       SnmpOid enterpOid,
                       int generic,
                       int specific,
                       SnmpVarBindList varBindList,
                       SnmpTimeticks time)
    throws IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    snmpV1Trap(peer.getDestAddr(),
               peer.getDestPort(),
               agentAddr,
               p.getRdCommunity(),
               enterpOid,
               generic,
               specific,
               varBindList,
               time);
}
项目:jdk8u-jdk    文件:SnmpAdaptorServer.java   
/**
 * Sends a trap using SNMP V1 trap format.
 * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
 * The community string used is the one located in the
 * <CODE>SnmpPeer</CODE> parameters
 * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
 * @param agentAddr The agent address to be used for the trap.
 * @param enterpOid The enterprise OID to be used for the trap.
 * @param generic The generic number of the trap.
 * @param specific The specific number of the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 * @param time The time stamp (overwrite the current time).
 *
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit
 * defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public void snmpV1Trap(SnmpPeer peer,
                       SnmpIpAddress agentAddr,
                       SnmpOid enterpOid,
                       int generic,
                       int specific,
                       SnmpVarBindList varBindList,
                       SnmpTimeticks time)
    throws IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    snmpV1Trap(peer.getDestAddr(),
               peer.getDestPort(),
               agentAddr,
               p.getRdCommunity(),
               enterpOid,
               generic,
               specific,
               varBindList,
               time);
}
项目:jdk8u_jdk    文件:SnmpAdaptorServer.java   
/**
 * Sends a trap using SNMP V1 trap format.
 * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
 * The community string used is the one located in the
 * <CODE>SnmpPeer</CODE> parameters
 * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
 * @param agentAddr The agent address to be used for the trap.
 * @param enterpOid The enterprise OID to be used for the trap.
 * @param generic The generic number of the trap.
 * @param specific The specific number of the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 * @param time The time stamp (overwrite the current time).
 *
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit
 * defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public void snmpV1Trap(SnmpPeer peer,
                       SnmpIpAddress agentAddr,
                       SnmpOid enterpOid,
                       int generic,
                       int specific,
                       SnmpVarBindList varBindList,
                       SnmpTimeticks time)
    throws IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    snmpV1Trap(peer.getDestAddr(),
               peer.getDestPort(),
               agentAddr,
               p.getRdCommunity(),
               enterpOid,
               generic,
               specific,
               varBindList,
               time);
}
项目:lookaside_java-1.8.0-openjdk    文件:SnmpAdaptorServer.java   
/**
 * Sends a trap using SNMP V1 trap format.
 * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
 * The community string used is the one located in the
 * <CODE>SnmpPeer</CODE> parameters
 * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
 * @param agentAddr The agent address to be used for the trap.
 * @param enterpOid The enterprise OID to be used for the trap.
 * @param generic The generic number of the trap.
 * @param specific The specific number of the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 * @param time The time stamp (overwrite the current time).
 *
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit
 * defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public void snmpV1Trap(SnmpPeer peer,
                       SnmpIpAddress agentAddr,
                       SnmpOid enterpOid,
                       int generic,
                       int specific,
                       SnmpVarBindList varBindList,
                       SnmpTimeticks time)
    throws IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    snmpV1Trap(peer.getDestAddr(),
               peer.getDestPort(),
               agentAddr,
               p.getRdCommunity(),
               enterpOid,
               generic,
               specific,
               varBindList,
               time);
}
项目:infobip-open-jdk-8    文件:SnmpAdaptorServer.java   
/**
 * Sends a trap using SNMP V1 trap format.
 * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
 * The community string used is the one located in the
 * <CODE>SnmpPeer</CODE> parameters
 * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
 * @param agentAddr The agent address to be used for the trap.
 * @param enterpOid The enterprise OID to be used for the trap.
 * @param generic The generic number of the trap.
 * @param specific The specific number of the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 * @param time The time stamp (overwrite the current time).
 *
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit
 * defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public void snmpV1Trap(SnmpPeer peer,
                       SnmpIpAddress agentAddr,
                       SnmpOid enterpOid,
                       int generic,
                       int specific,
                       SnmpVarBindList varBindList,
                       SnmpTimeticks time)
    throws IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    snmpV1Trap(peer.getDestAddr(),
               peer.getDestPort(),
               agentAddr,
               p.getRdCommunity(),
               enterpOid,
               generic,
               specific,
               varBindList,
               time);
}
项目:jdk8u-dev-jdk    文件:SnmpAdaptorServer.java   
/**
 * Sends a trap using SNMP V1 trap format.
 * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
 * The community string used is the one located in the
 * <CODE>SnmpPeer</CODE> parameters
 * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
 * @param agentAddr The agent address to be used for the trap.
 * @param enterpOid The enterprise OID to be used for the trap.
 * @param generic The generic number of the trap.
 * @param specific The specific number of the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 * @param time The time stamp (overwrite the current time).
 *
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit
 * defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public void snmpV1Trap(SnmpPeer peer,
                       SnmpIpAddress agentAddr,
                       SnmpOid enterpOid,
                       int generic,
                       int specific,
                       SnmpVarBindList varBindList,
                       SnmpTimeticks time)
    throws IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    snmpV1Trap(peer.getDestAddr(),
               peer.getDestPort(),
               agentAddr,
               p.getRdCommunity(),
               enterpOid,
               generic,
               specific,
               varBindList,
               time);
}
项目:OLD-OpenJDK8    文件:SnmpAdaptorServer.java   
/**
 * Sends a trap using SNMP V1 trap format.
 * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
 * The community string used is the one located in the
 * <CODE>SnmpPeer</CODE> parameters
 * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
 * @param agentAddr The agent address to be used for the trap.
 * @param enterpOid The enterprise OID to be used for the trap.
 * @param generic The generic number of the trap.
 * @param specific The specific number of the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 * @param time The time stamp (overwrite the current time).
 *
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit
 * defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public void snmpV1Trap(SnmpPeer peer,
                       SnmpIpAddress agentAddr,
                       SnmpOid enterpOid,
                       int generic,
                       int specific,
                       SnmpVarBindList varBindList,
                       SnmpTimeticks time)
    throws IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    snmpV1Trap(peer.getDestAddr(),
               peer.getDestPort(),
               agentAddr,
               p.getRdCommunity(),
               enterpOid,
               generic,
               specific,
               varBindList,
               time);
}
项目:OpenJSharp    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occurred while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:OpenJSharp    文件:SnmpAdaptorServer.java   
/**
 * Send the specified trap PDU to the passed <CODE>SnmpPeer</CODE>.
 * @param peer The destination peer. The Read community string is used of
 * <CODE>SnmpParameters</CODE> is used as the trap community string.
 * @param pdu The pdu to send.
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit defined
 * by <CODE>bufferSize</CODE>.
 * @since 1.5
 */
@Override
public void snmpPduTrap(SnmpPeer peer,
                        SnmpPduPacket pdu)
    throws IOException, SnmpStatusException {
    if(peer != null) {
        pdu.port = peer.getDestPort();
        sendTrapPdu(peer.getDestAddr(), pdu);
    }
    else {
        pdu.port = getTrapPort().intValue();
        sendTrapPdu(pdu);
    }
}
项目:jdk8u-jdk    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occurred while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:jdk8u-jdk    文件:SnmpAdaptorServer.java   
/**
 * Send the specified trap PDU to the passed <CODE>SnmpPeer</CODE>.
 * @param peer The destination peer. The Read community string is used of
 * <CODE>SnmpParameters</CODE> is used as the trap community string.
 * @param pdu The pdu to send.
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit defined
 * by <CODE>bufferSize</CODE>.
 * @since 1.5
 */
@Override
public void snmpPduTrap(SnmpPeer peer,
                        SnmpPduPacket pdu)
    throws IOException, SnmpStatusException {
    if(peer != null) {
        pdu.port = peer.getDestPort();
        sendTrapPdu(peer.getDestAddr(), pdu);
    }
    else {
        pdu.port = getTrapPort().intValue();
        sendTrapPdu(pdu);
    }
}
项目:jdk8u_jdk    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occurred while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:jdk8u_jdk    文件:SnmpAdaptorServer.java   
/**
 * Send the specified trap PDU to the passed <CODE>SnmpPeer</CODE>.
 * @param peer The destination peer. The Read community string is used of
 * <CODE>SnmpParameters</CODE> is used as the trap community string.
 * @param pdu The pdu to send.
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit defined
 * by <CODE>bufferSize</CODE>.
 * @since 1.5
 */
@Override
public void snmpPduTrap(SnmpPeer peer,
                        SnmpPduPacket pdu)
    throws IOException, SnmpStatusException {
    if(peer != null) {
        pdu.port = peer.getDestPort();
        sendTrapPdu(peer.getDestAddr(), pdu);
    }
    else {
        pdu.port = getTrapPort().intValue();
        sendTrapPdu(pdu);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occurred while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:SnmpAdaptorServer.java   
/**
 * Send the specified trap PDU to the passed <CODE>SnmpPeer</CODE>.
 * @param peer The destination peer. The Read community string is used of
 * <CODE>SnmpParameters</CODE> is used as the trap community string.
 * @param pdu The pdu to send.
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit defined
 * by <CODE>bufferSize</CODE>.
 * @since 1.5
 */
@Override
public void snmpPduTrap(SnmpPeer peer,
                        SnmpPduPacket pdu)
    throws IOException, SnmpStatusException {
    if(peer != null) {
        pdu.port = peer.getDestPort();
        sendTrapPdu(peer.getDestAddr(), pdu);
    }
    else {
        pdu.port = getTrapPort().intValue();
        sendTrapPdu(pdu);
    }
}
项目:infobip-open-jdk-8    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occurred while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:infobip-open-jdk-8    文件:SnmpAdaptorServer.java   
/**
 * Send the specified trap PDU to the passed <CODE>SnmpPeer</CODE>.
 * @param peer The destination peer. The Read community string is used of
 * <CODE>SnmpParameters</CODE> is used as the trap community string.
 * @param pdu The pdu to send.
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit defined
 * by <CODE>bufferSize</CODE>.
 * @since 1.5
 */
@Override
public void snmpPduTrap(SnmpPeer peer,
                        SnmpPduPacket pdu)
    throws IOException, SnmpStatusException {
    if(peer != null) {
        pdu.port = peer.getDestPort();
        sendTrapPdu(peer.getDestAddr(), pdu);
    }
    else {
        pdu.port = getTrapPort().intValue();
        sendTrapPdu(pdu);
    }
}
项目:jdk8u-dev-jdk    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occurred while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:jdk8u-dev-jdk    文件:SnmpAdaptorServer.java   
/**
 * Send the specified trap PDU to the passed <CODE>SnmpPeer</CODE>.
 * @param peer The destination peer. The Read community string is used of
 * <CODE>SnmpParameters</CODE> is used as the trap community string.
 * @param pdu The pdu to send.
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit defined
 * by <CODE>bufferSize</CODE>.
 * @since 1.5
 */
@Override
public void snmpPduTrap(SnmpPeer peer,
                        SnmpPduPacket pdu)
    throws IOException, SnmpStatusException {
    if(peer != null) {
        pdu.port = peer.getDestPort();
        sendTrapPdu(peer.getDestAddr(), pdu);
    }
    else {
        pdu.port = getTrapPort().intValue();
        sendTrapPdu(pdu);
    }
}
项目:jdk7-jdk    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = (NotificationTarget) iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occured while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:jdk7-jdk    文件:SnmpAdaptorServer.java   
/**
 * Send the specified trap PDU to the passed <CODE>SnmpPeer</CODE>.
 * @param peer The destination peer. The Read community string is used of
 * <CODE>SnmpParameters</CODE> is used as the trap community string.
 * @param pdu The pdu to send.
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit defined
 * by <CODE>bufferSize</CODE>.
 * @since 1.5
 */
public void snmpPduTrap(SnmpPeer peer,
                        SnmpPduPacket pdu)
    throws IOException, SnmpStatusException {
    if(peer != null) {
        pdu.port = peer.getDestPort();
        sendTrapPdu(peer.getDestAddr(), pdu);
    }
    else {
        pdu.port = getTrapPort().intValue();
        sendTrapPdu(pdu);
    }
}
项目:openjdk-source-code-learn    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = (NotificationTarget) iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occured while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:openjdk-source-code-learn    文件:SnmpAdaptorServer.java   
/**
 * Send the specified trap PDU to the passed <CODE>SnmpPeer</CODE>.
 * @param peer The destination peer. The Read community string is used of
 * <CODE>SnmpParameters</CODE> is used as the trap community string.
 * @param pdu The pdu to send.
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit defined
 * by <CODE>bufferSize</CODE>.
 * @since 1.5
 */
public void snmpPduTrap(SnmpPeer peer,
                        SnmpPduPacket pdu)
    throws IOException, SnmpStatusException {
    if(peer != null) {
        pdu.port = peer.getDestPort();
        sendTrapPdu(peer.getDestAddr(), pdu);
    }
    else {
        pdu.port = getTrapPort().intValue();
        sendTrapPdu(pdu);
    }
}
项目:OLD-OpenJDK8    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occurred while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:OLD-OpenJDK8    文件:SnmpAdaptorServer.java   
/**
 * Send the specified trap PDU to the passed <CODE>SnmpPeer</CODE>.
 * @param peer The destination peer. The Read community string is used of
 * <CODE>SnmpParameters</CODE> is used as the trap community string.
 * @param pdu The pdu to send.
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit defined
 * by <CODE>bufferSize</CODE>.
 * @since 1.5
 */
@Override
public void snmpPduTrap(SnmpPeer peer,
                        SnmpPduPacket pdu)
    throws IOException, SnmpStatusException {
    if(peer != null) {
        pdu.port = peer.getDestPort();
        sendTrapPdu(peer.getDestAddr(), pdu);
    }
    else {
        pdu.port = getTrapPort().intValue();
        sendTrapPdu(pdu);
    }
}
项目:openjdk-jdk7u-jdk    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = (NotificationTarget) iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occured while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:openjdk-jdk7u-jdk    文件:SnmpAdaptorServer.java   
/**
 * Send the specified trap PDU to the passed <CODE>SnmpPeer</CODE>.
 * @param peer The destination peer. The Read community string is used of
 * <CODE>SnmpParameters</CODE> is used as the trap community string.
 * @param pdu The pdu to send.
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit defined
 * by <CODE>bufferSize</CODE>.
 * @since 1.5
 */
public void snmpPduTrap(SnmpPeer peer,
                        SnmpPduPacket pdu)
    throws IOException, SnmpStatusException {
    if(peer != null) {
        pdu.port = peer.getDestPort();
        sendTrapPdu(peer.getDestAddr(), pdu);
    }
    else {
        pdu.port = getTrapPort().intValue();
        sendTrapPdu(pdu);
    }
}
项目:OpenJSharp    文件:SnmpAdaptorServer.java   
/**
 * Sends a trap using SNMP V2 trap format.
 * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
 * <BR>The community string used is the one located in the
 * <CODE>SnmpPeer</CODE> parameters
 * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
 * <BR>The variable list included in the outgoing trap is composed of
 * the following items:
 * <UL>
 * <LI><CODE>sysUpTime.0</CODE> with the value specified by
 *     <CODE>time</CODE></LI>
 * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
 *     <CODE>trapOid</CODE></LI>
 * <LI><CODE>all the (oid,values)</CODE> from the specified
 *     <CODE>varBindList</CODE></LI>
 * </UL>
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
 * @param trapOid The OID identifying the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 * @param time The time stamp (overwrite the current time).
 *
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit
 * defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public void snmpV2Trap(SnmpPeer peer,
                       SnmpOid trapOid,
                       SnmpVarBindList varBindList,
                       SnmpTimeticks time)
    throws IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    snmpV2Trap(peer.getDestAddr(),
               peer.getDestPort(),
               p.getRdCommunity(),
               trapOid,
               varBindList,
               time);
}
项目:OpenJSharp    文件:SnmpAdaptorServer.java   
/**
 * Sends an inform using SNMP V2 inform request format.
 * <BR>The inform is sent to the specified <CODE>SnmpPeer</CODE>
 *     destination.
 * <BR>The community string used is the one located in the
 *     <CODE>SnmpPeer</CODE> parameters
 *     (<CODE>SnmpParameters.getInformCommunity() </CODE>).
 * <BR>The variable list included in the outgoing inform is composed
 *     of the following items:
 * <UL>
 * <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
 * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
 *     <CODE>trapOid</CODE></LI>
 * <LI><CODE>all the (oid,values)</CODE> from the specified
 *     <CODE>varBindList</CODE></LI>
 * </UL>
 * To send an inform request, the SNMP adaptor server must be active.
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination for this inform
 *             request.
 * @param cb The callback that is invoked when a request is complete.
 * @param trapOid The OID identifying the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 *
 * @return The inform request object.
 *
 * @exception IllegalStateException  This method has been invoked while
 *            the SNMP adaptor server was not active.
 * @exception IOException An I/O error occurred while sending the
 *            inform request.
 * @exception SnmpStatusException If the inform request exceeds the
 *            limit defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public SnmpInformRequest snmpInformRequest(SnmpPeer peer,
                                           SnmpInformHandler cb,
                                           SnmpOid trapOid,
                                           SnmpVarBindList varBindList)
    throws IllegalStateException, IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    return snmpInformRequest(peer.getDestAddr(),
                             peer.getDestPort(),
                             p.getInformCommunity(),
                             cb,
                             trapOid,
                             varBindList);
}
项目:jdk8u-jdk    文件:SnmpAdaptorServer.java   
/**
 * Sends a trap using SNMP V2 trap format.
 * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
 * <BR>The community string used is the one located in the
 * <CODE>SnmpPeer</CODE> parameters
 * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
 * <BR>The variable list included in the outgoing trap is composed of
 * the following items:
 * <UL>
 * <LI><CODE>sysUpTime.0</CODE> with the value specified by
 *     <CODE>time</CODE></LI>
 * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
 *     <CODE>trapOid</CODE></LI>
 * <LI><CODE>all the (oid,values)</CODE> from the specified
 *     <CODE>varBindList</CODE></LI>
 * </UL>
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
 * @param trapOid The OID identifying the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 * @param time The time stamp (overwrite the current time).
 *
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit
 * defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public void snmpV2Trap(SnmpPeer peer,
                       SnmpOid trapOid,
                       SnmpVarBindList varBindList,
                       SnmpTimeticks time)
    throws IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    snmpV2Trap(peer.getDestAddr(),
               peer.getDestPort(),
               p.getRdCommunity(),
               trapOid,
               varBindList,
               time);
}
项目:jdk8u-jdk    文件:SnmpAdaptorServer.java   
/**
 * Sends an inform using SNMP V2 inform request format.
 * <BR>The inform is sent to the specified <CODE>SnmpPeer</CODE>
 *     destination.
 * <BR>The community string used is the one located in the
 *     <CODE>SnmpPeer</CODE> parameters
 *     (<CODE>SnmpParameters.getInformCommunity() </CODE>).
 * <BR>The variable list included in the outgoing inform is composed
 *     of the following items:
 * <UL>
 * <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
 * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
 *     <CODE>trapOid</CODE></LI>
 * <LI><CODE>all the (oid,values)</CODE> from the specified
 *     <CODE>varBindList</CODE></LI>
 * </UL>
 * To send an inform request, the SNMP adaptor server must be active.
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination for this inform
 *             request.
 * @param cb The callback that is invoked when a request is complete.
 * @param trapOid The OID identifying the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 *
 * @return The inform request object.
 *
 * @exception IllegalStateException  This method has been invoked while
 *            the SNMP adaptor server was not active.
 * @exception IOException An I/O error occurred while sending the
 *            inform request.
 * @exception SnmpStatusException If the inform request exceeds the
 *            limit defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public SnmpInformRequest snmpInformRequest(SnmpPeer peer,
                                           SnmpInformHandler cb,
                                           SnmpOid trapOid,
                                           SnmpVarBindList varBindList)
    throws IllegalStateException, IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    return snmpInformRequest(peer.getDestAddr(),
                             peer.getDestPort(),
                             p.getInformCommunity(),
                             cb,
                             trapOid,
                             varBindList);
}
项目:jdk8u_jdk    文件:SnmpAdaptorServer.java   
/**
 * Sends a trap using SNMP V2 trap format.
 * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
 * <BR>The community string used is the one located in the
 * <CODE>SnmpPeer</CODE> parameters
 * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
 * <BR>The variable list included in the outgoing trap is composed of
 * the following items:
 * <UL>
 * <LI><CODE>sysUpTime.0</CODE> with the value specified by
 *     <CODE>time</CODE></LI>
 * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
 *     <CODE>trapOid</CODE></LI>
 * <LI><CODE>all the (oid,values)</CODE> from the specified
 *     <CODE>varBindList</CODE></LI>
 * </UL>
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
 * @param trapOid The OID identifying the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 * @param time The time stamp (overwrite the current time).
 *
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit
 * defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public void snmpV2Trap(SnmpPeer peer,
                       SnmpOid trapOid,
                       SnmpVarBindList varBindList,
                       SnmpTimeticks time)
    throws IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    snmpV2Trap(peer.getDestAddr(),
               peer.getDestPort(),
               p.getRdCommunity(),
               trapOid,
               varBindList,
               time);
}
项目:jdk8u_jdk    文件:SnmpAdaptorServer.java   
/**
 * Sends an inform using SNMP V2 inform request format.
 * <BR>The inform is sent to the specified <CODE>SnmpPeer</CODE>
 *     destination.
 * <BR>The community string used is the one located in the
 *     <CODE>SnmpPeer</CODE> parameters
 *     (<CODE>SnmpParameters.getInformCommunity() </CODE>).
 * <BR>The variable list included in the outgoing inform is composed
 *     of the following items:
 * <UL>
 * <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
 * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
 *     <CODE>trapOid</CODE></LI>
 * <LI><CODE>all the (oid,values)</CODE> from the specified
 *     <CODE>varBindList</CODE></LI>
 * </UL>
 * To send an inform request, the SNMP adaptor server must be active.
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination for this inform
 *             request.
 * @param cb The callback that is invoked when a request is complete.
 * @param trapOid The OID identifying the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 *
 * @return The inform request object.
 *
 * @exception IllegalStateException  This method has been invoked while
 *            the SNMP adaptor server was not active.
 * @exception IOException An I/O error occurred while sending the
 *            inform request.
 * @exception SnmpStatusException If the inform request exceeds the
 *            limit defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public SnmpInformRequest snmpInformRequest(SnmpPeer peer,
                                           SnmpInformHandler cb,
                                           SnmpOid trapOid,
                                           SnmpVarBindList varBindList)
    throws IllegalStateException, IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    return snmpInformRequest(peer.getDestAddr(),
                             peer.getDestPort(),
                             p.getInformCommunity(),
                             cb,
                             trapOid,
                             varBindList);
}
项目:lookaside_java-1.8.0-openjdk    文件:SnmpAdaptorServer.java   
/**
 * Sends a trap using SNMP V2 trap format.
 * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
 * <BR>The community string used is the one located in the
 * <CODE>SnmpPeer</CODE> parameters
 * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
 * <BR>The variable list included in the outgoing trap is composed of
 * the following items:
 * <UL>
 * <LI><CODE>sysUpTime.0</CODE> with the value specified by
 *     <CODE>time</CODE></LI>
 * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
 *     <CODE>trapOid</CODE></LI>
 * <LI><CODE>all the (oid,values)</CODE> from the specified
 *     <CODE>varBindList</CODE></LI>
 * </UL>
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
 * @param trapOid The OID identifying the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 * @param time The time stamp (overwrite the current time).
 *
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit
 * defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public void snmpV2Trap(SnmpPeer peer,
                       SnmpOid trapOid,
                       SnmpVarBindList varBindList,
                       SnmpTimeticks time)
    throws IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    snmpV2Trap(peer.getDestAddr(),
               peer.getDestPort(),
               p.getRdCommunity(),
               trapOid,
               varBindList,
               time);
}
项目:lookaside_java-1.8.0-openjdk    文件:SnmpAdaptorServer.java   
/**
 * Sends an inform using SNMP V2 inform request format.
 * <BR>The inform is sent to the specified <CODE>SnmpPeer</CODE>
 *     destination.
 * <BR>The community string used is the one located in the
 *     <CODE>SnmpPeer</CODE> parameters
 *     (<CODE>SnmpParameters.getInformCommunity() </CODE>).
 * <BR>The variable list included in the outgoing inform is composed
 *     of the following items:
 * <UL>
 * <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
 * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
 *     <CODE>trapOid</CODE></LI>
 * <LI><CODE>all the (oid,values)</CODE> from the specified
 *     <CODE>varBindList</CODE></LI>
 * </UL>
 * To send an inform request, the SNMP adaptor server must be active.
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination for this inform
 *             request.
 * @param cb The callback that is invoked when a request is complete.
 * @param trapOid The OID identifying the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 *
 * @return The inform request object.
 *
 * @exception IllegalStateException  This method has been invoked while
 *            the SNMP adaptor server was not active.
 * @exception IOException An I/O error occurred while sending the
 *            inform request.
 * @exception SnmpStatusException If the inform request exceeds the
 *            limit defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public SnmpInformRequest snmpInformRequest(SnmpPeer peer,
                                           SnmpInformHandler cb,
                                           SnmpOid trapOid,
                                           SnmpVarBindList varBindList)
    throws IllegalStateException, IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    return snmpInformRequest(peer.getDestAddr(),
                             peer.getDestPort(),
                             p.getInformCommunity(),
                             cb,
                             trapOid,
                             varBindList);
}
项目:infobip-open-jdk-8    文件:SnmpAdaptorServer.java   
/**
 * Sends a trap using SNMP V2 trap format.
 * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
 * <BR>The community string used is the one located in the
 * <CODE>SnmpPeer</CODE> parameters
 * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
 * <BR>The variable list included in the outgoing trap is composed of
 * the following items:
 * <UL>
 * <LI><CODE>sysUpTime.0</CODE> with the value specified by
 *     <CODE>time</CODE></LI>
 * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
 *     <CODE>trapOid</CODE></LI>
 * <LI><CODE>all the (oid,values)</CODE> from the specified
 *     <CODE>varBindList</CODE></LI>
 * </UL>
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
 * @param trapOid The OID identifying the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 * @param time The time stamp (overwrite the current time).
 *
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit
 * defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public void snmpV2Trap(SnmpPeer peer,
                       SnmpOid trapOid,
                       SnmpVarBindList varBindList,
                       SnmpTimeticks time)
    throws IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    snmpV2Trap(peer.getDestAddr(),
               peer.getDestPort(),
               p.getRdCommunity(),
               trapOid,
               varBindList,
               time);
}
项目:infobip-open-jdk-8    文件:SnmpAdaptorServer.java   
/**
 * Sends an inform using SNMP V2 inform request format.
 * <BR>The inform is sent to the specified <CODE>SnmpPeer</CODE>
 *     destination.
 * <BR>The community string used is the one located in the
 *     <CODE>SnmpPeer</CODE> parameters
 *     (<CODE>SnmpParameters.getInformCommunity() </CODE>).
 * <BR>The variable list included in the outgoing inform is composed
 *     of the following items:
 * <UL>
 * <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
 * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
 *     <CODE>trapOid</CODE></LI>
 * <LI><CODE>all the (oid,values)</CODE> from the specified
 *     <CODE>varBindList</CODE></LI>
 * </UL>
 * To send an inform request, the SNMP adaptor server must be active.
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination for this inform
 *             request.
 * @param cb The callback that is invoked when a request is complete.
 * @param trapOid The OID identifying the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 *
 * @return The inform request object.
 *
 * @exception IllegalStateException  This method has been invoked while
 *            the SNMP adaptor server was not active.
 * @exception IOException An I/O error occurred while sending the
 *            inform request.
 * @exception SnmpStatusException If the inform request exceeds the
 *            limit defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public SnmpInformRequest snmpInformRequest(SnmpPeer peer,
                                           SnmpInformHandler cb,
                                           SnmpOid trapOid,
                                           SnmpVarBindList varBindList)
    throws IllegalStateException, IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    return snmpInformRequest(peer.getDestAddr(),
                             peer.getDestPort(),
                             p.getInformCommunity(),
                             cb,
                             trapOid,
                             varBindList);
}
项目:jdk8u-dev-jdk    文件:SnmpAdaptorServer.java   
/**
 * Sends a trap using SNMP V2 trap format.
 * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
 * <BR>The community string used is the one located in the
 * <CODE>SnmpPeer</CODE> parameters
 * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
 * <BR>The variable list included in the outgoing trap is composed of
 * the following items:
 * <UL>
 * <LI><CODE>sysUpTime.0</CODE> with the value specified by
 *     <CODE>time</CODE></LI>
 * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
 *     <CODE>trapOid</CODE></LI>
 * <LI><CODE>all the (oid,values)</CODE> from the specified
 *     <CODE>varBindList</CODE></LI>
 * </UL>
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
 * @param trapOid The OID identifying the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 * @param time The time stamp (overwrite the current time).
 *
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit
 * defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public void snmpV2Trap(SnmpPeer peer,
                       SnmpOid trapOid,
                       SnmpVarBindList varBindList,
                       SnmpTimeticks time)
    throws IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    snmpV2Trap(peer.getDestAddr(),
               peer.getDestPort(),
               p.getRdCommunity(),
               trapOid,
               varBindList,
               time);
}
项目:jdk8u-dev-jdk    文件:SnmpAdaptorServer.java   
/**
 * Sends an inform using SNMP V2 inform request format.
 * <BR>The inform is sent to the specified <CODE>SnmpPeer</CODE>
 *     destination.
 * <BR>The community string used is the one located in the
 *     <CODE>SnmpPeer</CODE> parameters
 *     (<CODE>SnmpParameters.getInformCommunity() </CODE>).
 * <BR>The variable list included in the outgoing inform is composed
 *     of the following items:
 * <UL>
 * <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
 * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
 *     <CODE>trapOid</CODE></LI>
 * <LI><CODE>all the (oid,values)</CODE> from the specified
 *     <CODE>varBindList</CODE></LI>
 * </UL>
 * To send an inform request, the SNMP adaptor server must be active.
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination for this inform
 *             request.
 * @param cb The callback that is invoked when a request is complete.
 * @param trapOid The OID identifying the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 *
 * @return The inform request object.
 *
 * @exception IllegalStateException  This method has been invoked while
 *            the SNMP adaptor server was not active.
 * @exception IOException An I/O error occurred while sending the
 *            inform request.
 * @exception SnmpStatusException If the inform request exceeds the
 *            limit defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
@Override
public SnmpInformRequest snmpInformRequest(SnmpPeer peer,
                                           SnmpInformHandler cb,
                                           SnmpOid trapOid,
                                           SnmpVarBindList varBindList)
    throws IllegalStateException, IOException, SnmpStatusException {

    SnmpParameters p = (SnmpParameters) peer.getParams();
    return snmpInformRequest(peer.getDestAddr(),
                             peer.getDestPort(),
                             p.getInformCommunity(),
                             cb,
                             trapOid,
                             varBindList);
}
项目:jdk7-jdk    文件:SnmpAdaptorServer.java   
/**
 * Sends a trap using SNMP V1 trap format.
 * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
 * The community string used is the one located in the
 * <CODE>SnmpPeer</CODE> parameters
 * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
 *
 * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
 * @param agentAddr The agent address to be used for the trap.
 * @param enterpOid The enterprise OID to be used for the trap.
 * @param generic The generic number of the trap.
 * @param specific The specific number of the trap.
 * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
 * @param time The time stamp (overwrite the current time).
 *
 * @exception IOException An I/O error occurred while sending the trap.
 * @exception SnmpStatusException If the trap exceeds the limit
 * defined by <CODE>bufferSize</CODE>.
 *
 * @since 1.5
 */
public void snmpV1Trap(SnmpPeer peer,
                       SnmpIpAddress agentAddr,
                       SnmpOid enterpOid,
                       int generic,
                       int specific,
                       SnmpVarBindList varBindList,
                       SnmpTimeticks time)
    throws IOException, SnmpStatusException {
    SnmpParameters p = (SnmpParameters) peer.getParams();
    snmpV1Trap(peer.getDestAddr(),
               peer.getDestPort(),
               agentAddr,
               p.getRdCommunity(),
               enterpOid,
               generic,
               specific,
               varBindList,
               time);
}