src/jdk.sctp/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java
author jlaskey
Thu, 14 Nov 2019 12:39:49 -0400
branchJDK-8193209-branch
changeset 59086 214afc7a1e02
parent 47216 71c04702a3d5
permissions -rw-r--r--
[mq]: refresh
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 20742
diff changeset
     2
 * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     4
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2542
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2542
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    10
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    15
 * accompanied this code).
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    16
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2542
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2542
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2542
diff changeset
    23
 * questions.
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    24
 */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    25
package com.sun.nio.sctp;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    26
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    27
import java.net.SocketAddress;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    28
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    29
/**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    30
 * Notification emitted when a destination address on a multi-homed peer
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    31
 * encounters a change.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    32
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    33
 * @since 1.7
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    34
 */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    35
public abstract class PeerAddressChangeNotification
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    36
    implements Notification
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    37
{
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    38
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    39
     * Defines the type of address change event that occurred to the destination
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    40
     * address on a multi-homed peer when it encounters a change of interface
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    41
     * details.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    42
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    43
     * <P> Some of these events types are only generated when the association
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    44
     * supports dynamic address reconfiguration, e.g. {@code SCTP_ADDR_ADDED},
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    45
     * {@code SCTP_ADDR_REMOVED}, etc.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    46
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    47
     * @since 1.7
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    48
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    49
    public enum AddressChangeEvent {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    50
        /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    51
         * This address is now reachable.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    52
         */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    53
       ADDR_AVAILABLE,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    54
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    55
       /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    56
        * The address specified can no longer be reached. Any data sent to this
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    57
        * address is rerouted to an alternate until this address becomes reachable.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    58
        */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    59
       ADDR_UNREACHABLE,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    60
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    61
       /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    62
        * The address is no longer part of the association.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    63
        */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    64
       ADDR_REMOVED,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    65
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    66
       /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    67
        * The address is now part of the association.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    68
        */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    69
       ADDR_ADDED,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    70
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    71
       /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    72
        * This address has now been made to be the primary destination address.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    73
        */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    74
       ADDR_MADE_PRIMARY,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    75
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    76
       /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    77
        * This address has now been confirmed as a valid address.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    78
        */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    79
       ADDR_CONFIRMED;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    80
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    81
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    82
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    83
     * Initializes a new instance of this class.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    84
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    85
    protected PeerAddressChangeNotification() {}
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    86
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    87
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    88
     * Returns the peer address.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    89
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    90
     * @return  The peer address
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    91
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    92
    public abstract SocketAddress address();
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    93
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    94
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    95
     * Returns the association that this notification is applicable to.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    96
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    97
     * @return  The association whose peer address changed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    98
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    99
    public abstract Association association();
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   100
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   101
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   102
     * Returns the type of change event.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   103
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   104
     * @return  The event
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   105
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   106
    public abstract AddressChangeEvent event();
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   107
}