jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduTrap.java
changeset 27285 1b4ca1c84d23
parent 27284 98699328cef3
parent 27263 819f5f87d485
child 27288 a3f652a37d1e
child 27503 b75a635f1ff3
equal deleted inserted replaced
27284:98699328cef3 27285:1b4ca1c84d23
     1 /*
       
     2  * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
       
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4  *
       
     5  * This code is free software; you can redistribute it and/or modify it
       
     6  * under the terms of the GNU General Public License version 2 only, as
       
     7  * published by the Free Software Foundation.  Oracle designates this
       
     8  * particular file as subject to the "Classpath" exception as provided
       
     9  * by Oracle in the LICENSE file that accompanied this code.
       
    10  *
       
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
       
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    14  * version 2 for more details (a copy is included in the LICENSE file that
       
    15  * accompanied this code).
       
    16  *
       
    17  * You should have received a copy of the GNU General Public License version
       
    18  * 2 along with this work; if not, write to the Free Software Foundation,
       
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    20  *
       
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    22  * or visit www.oracle.com if you need additional information or have any
       
    23  * questions.
       
    24  */
       
    25 
       
    26 
       
    27 package com.sun.jmx.snmp;
       
    28 
       
    29 
       
    30 
       
    31 /**
       
    32  * Represents an SNMPv1-trap PDU.
       
    33  * <P>
       
    34  * You will not usually need to use this class, except if you
       
    35  * decide to implement your own
       
    36  * {@link com.sun.jmx.snmp.SnmpPduFactory SnmpPduFactory} object.
       
    37  * <P>
       
    38  * The <CODE>SnmpPduTrap</CODE> extends {@link com.sun.jmx.snmp.SnmpPduPacket SnmpPduPacket}
       
    39  * and defines attributes specific to an SNMPv1 trap (see RFC1157).
       
    40  *
       
    41  * <p><b>This API is a Sun Microsystems internal API  and is subject
       
    42  * to change without notice.</b></p>
       
    43  */
       
    44 
       
    45 public class SnmpPduTrap extends SnmpPduPacket {
       
    46     private static final long serialVersionUID = -3670886636491433011L;
       
    47 
       
    48     /**
       
    49      * Enterprise object identifier.
       
    50      * @serial
       
    51      */
       
    52     public SnmpOid        enterprise ;
       
    53 
       
    54     /**
       
    55      * Agent address. If the agent address source was not an IPv4 one (eg : IPv6), this field is null.
       
    56      * @serial
       
    57      */
       
    58     public SnmpIpAddress  agentAddr ;
       
    59 
       
    60     /**
       
    61      * Generic trap number.
       
    62      * <BR>
       
    63      * The possible values are defined in
       
    64      * {@link com.sun.jmx.snmp.SnmpDefinitions#trapColdStart SnmpDefinitions}.
       
    65      * @serial
       
    66      */
       
    67     public int            genericTrap ;
       
    68 
       
    69     /**
       
    70      * Specific trap number.
       
    71      * @serial
       
    72      */
       
    73     public int            specificTrap ;
       
    74 
       
    75     /**
       
    76      * Time-stamp.
       
    77      * @serial
       
    78      */
       
    79     public long            timeStamp ;
       
    80 
       
    81 
       
    82 
       
    83     /**
       
    84      * Builds a new trap PDU.
       
    85      * <BR><CODE>type</CODE> and <CODE>version</CODE> fields are initialized with
       
    86      * {@link com.sun.jmx.snmp.SnmpDefinitions#pduV1TrapPdu pduV1TrapPdu}
       
    87      * and {@link com.sun.jmx.snmp.SnmpDefinitions#snmpVersionOne snmpVersionOne}.
       
    88      */
       
    89     public SnmpPduTrap() {
       
    90         type = pduV1TrapPdu ;
       
    91         version = snmpVersionOne ;
       
    92     }
       
    93 }