1096N/A/*
2362N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
1096N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1096N/A *
1096N/A * This code is free software; you can redistribute it and/or modify it
1096N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
1096N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
1096N/A *
1096N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1096N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1096N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1096N/A * version 2 for more details (a copy is included in the LICENSE file that
1096N/A * accompanied this code).
1096N/A *
1096N/A * You should have received a copy of the GNU General Public License version
1096N/A * 2 along with this work; if not, write to the Free Software Foundation,
1096N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1096N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
1096N/A */
1096N/Apackage com.sun.nio.sctp;
1096N/A
1096N/Aimport java.net.SocketAddress;
1096N/A
1096N/A/**
1096N/A * Notification emitted when a destination address on a multi-homed peer
1096N/A * encounters a change.
1096N/A *
1096N/A * @since 1.7
1096N/A */
1096N/Apublic abstract class PeerAddressChangeNotification
1096N/A implements Notification
1096N/A{
1096N/A /**
1096N/A * Defines the type of address change event that occurred to the destination
1096N/A * address on a multi-homed peer when it encounters a change of interface
1096N/A * details.
1096N/A *
1096N/A * <P> Some of these events types are only generated when the association
1096N/A * supports dynamic address reconfiguration, e.g. {@code SCTP_ADDR_ADDED},
1096N/A * {@code SCTP_ADDR_REMOVED}, etc.
1096N/A *
1096N/A * @since 1.7
1096N/A */
1096N/A public enum AddressChangeEvent {
1096N/A /**
1096N/A * This address is now reachable.
1096N/A */
1096N/A ADDR_AVAILABLE,
1096N/A
1096N/A /**
1096N/A * The address specified can no longer be reached. Any data sent to this
1096N/A * address is rerouted to an alternate until this address becomes reachable.
1096N/A */
1096N/A ADDR_UNREACHABLE,
1096N/A
1096N/A /**
1096N/A * The address is no longer part of the association.
1096N/A */
1096N/A ADDR_REMOVED,
1096N/A
1096N/A /**
1096N/A * The address is now part of the association.
1096N/A */
1096N/A ADDR_ADDED,
1096N/A
1096N/A /**
1096N/A * This address has now been made to be the primary destination address.
1096N/A */
1096N/A ADDR_MADE_PRIMARY,
1096N/A
1096N/A /**
1096N/A * This address has now been confirmed as a valid address.
1096N/A */
1096N/A ADDR_CONFIRMED;
1096N/A }
1096N/A
1096N/A /**
1096N/A * Initializes a new instance of this class.
1096N/A */
1096N/A protected PeerAddressChangeNotification() {}
1096N/A
1096N/A /**
1096N/A * Returns the peer address.
1096N/A *
1096N/A * @return The peer address
1096N/A */
1096N/A public abstract SocketAddress address();
1096N/A
1096N/A /**
1096N/A * Returns the association that this notification is applicable to.
1096N/A *
1096N/A * @return The association whose peer address changed
1096N/A */
1096N/A public abstract Association association();
1096N/A
1096N/A /**
1096N/A * Returns the type of change event.
1096N/A *
1096N/A * @return The event
1096N/A */
1096N/A public abstract AddressChangeEvent event();
1096N/A}