亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? routeadvertisement.java

?? jxta平臺的開發包
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * * $Id: RouteAdvertisement.java,v 1.39 2006/01/13 18:06:14 bondolo Exp $ * * Copyright (c) 2001 Sun Microsystems, Inc.  All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in *    the documentation and/or other materials provided with the *    distribution. * * 3. The end-user documentation included with the redistribution, *    if any, must include the following acknowledgment: *       "This product includes software developed by the *       Sun Microsystems, Inc. for Project JXTA." *    Alternately, this acknowledgment may appear in the software itself, *    if and wherever such third-party acknowledgments normally appear. * * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" *    must not be used to endorse or promote products derived from this *    software without prior written permission. For written *    permission, please contact Project JXTA at http://www.jxta.org. * * 5. Products derived from this software may not be called "JXTA", *    nor may "JXTA" appear in their name, without prior written *    permission of Sun. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED.  IN NO EVENT SHALL SUN MICROSYSTEMS OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of Project JXTA.  For more * information on Project JXTA, please see * <http://www.jxta.org/>. * * This license is based on the BSD license adopted by the Apache Foundation. */package net.jxta.protocol;import java.io.InputStream;import java.io.ByteArrayInputStream;import java.util.Enumeration;import java.util.Iterator;import java.util.Vector;import net.jxta.document.AdvertisementFactory;import net.jxta.document.ExtendableAdvertisement;import net.jxta.id.ID;import net.jxta.id.IDFactory;import net.jxta.peer.PeerID;import net.jxta.peergroup.PeerGroupID;import net.jxta.endpoint.EndpointAddress;/** * This type of advertisement is used to represent a route to a * destination peer in the JXTA virtual network. Routes are * represented in a generic manner as a sequence of hops to reach the * destination. Each hop represent a potential relay peer in the route: * * <pre> Dest *       hop 1 *       hop 2 *       hop 3 *       .... *       hop n *</pre> * * <p/>A route can have as many hops as necessary. Hops are implicitly * ordered starting from the hop with the shortest route to reach the * destination. If a peer cannot reach directly the dest, it should * try to reach in descending order one of the listed hops. Some hops * may have the same physical distance to the destination. Some hops may * define alternative route * * <p/>The destination and hops are defined using an AccessPoint * Advertisement as JXTA PeerIDs with a list of optional endpoint * addresses. The endpoint addresses defined the physical endpoint * addresses that can be used to reach the corresponding * hop.  The PeerID information is required. The endpoint address * information is optional. * * @see net.jxta.protocol.PeerAdvertisement * @see net.jxta.protocol.AccessPointAdvertisement * **/public abstract class RouteAdvertisement extends ExtendableAdvertisement implements Cloneable {        public static final String DEST_PID_TAG = "DstPID";    /**     *  Destination address     **/    private PeerID  destPeer = null;        /**     *  Destination address     **/    private AccessPointAdvertisement dest = null;        /**     *  Semi-ordered list of alternative hops to the destination.     *     *  <p/><ul>     *      <li>Each item is an {@link AccessPointAdvertisement}.</li>     *  </ul>     **/    private Vector hops = new Vector();    private transient ID hashID = null;        /**     *  {@inheritDoc}     */    public Object clone() {        try {            return super.clone();        } catch( CloneNotSupportedException impossible ) {            throw new Error( "Object.clone() threw CloneNotSupportedException", impossible );        }    }        /**     * makes a copy of a route advertisement     * that only contains PID not endpoint addresses     *     * @return object clone route advertisement     **/    public Object cloneOnlyPIDs() {        RouteAdvertisement a;        try {            a = (RouteAdvertisement) super.clone();            a.setDestEndpointAddresses(new Vector());        } catch (CloneNotSupportedException impossible) {            return null;        }                // deep copy of the hops        Vector clonehops = getVectorHops();        int size = clonehops.size();        for (int i = 0; i < size; ++i) {            clonehops.set( i, ((AccessPointAdvertisement) clonehops.get(i)).clone() );        }                a.setHops( clonehops );                return a;    }           /**     * Compare if two routes are equals. Equals means     * the same number of hops and the same endpoint addresses     * for each hop and the destination     *     * @param target  the route to compare against     * @return boolean true if the route is equal to this route otherwise false     */    public boolean equals(Object target) {                if( this == target ) {            return true;        }                if( !(target instanceof RouteAdvertisement)) {            return false;        }                RouteAdvertisement route = (RouteAdvertisement) target;        // check each of the hops        // routes need to have the same size        if (hops.size() != route.size()) {            return false;        }                int index = 0;        for (Enumeration e = route.getHops(); e.hasMoreElements();) {            AccessPointAdvertisement hop = (AccessPointAdvertisement) e.nextElement();            if (!hop.equals((AccessPointAdvertisement) hops.elementAt(index++))) {                return false;            }        }         if (dest == null && route.getDest() == null)            return true;                if (dest == null || route.getDest() == null)            return false;                // chek the destination        return dest.equals(route.getDest());    }        /**     *  Returns the identifying type of this Advertisement.     *     * @return String the type of advertisement     **/    public final static String getAdvertisementType() {        return "jxta:RA" ;    }        /**     * {@inheritDoc}     **/    public final String getBaseAdvType() {        return getAdvertisementType();    }        /**     * {@inheritDoc}     */    public synchronized ID getID() {        if (hashID == null) {            try {                // We have not yet built it. Do it now                // The group id is somewhat redundant since it is already                // part of the peer ID, but that's the way CodatID want it.                PeerID pid = dest.getPeerID();                byte[] seed = getAdvertisementType().getBytes();                InputStream in = new ByteArrayInputStream(pid.toString().getBytes());                                hashID = IDFactory.newCodatID((PeerGroupID) pid.getPeerGroupID(), seed, in);            } catch (Exception ez) {                return ID.nullID;            }        }        return hashID;    }        /**     * Returns the destination access point     *     * @return AccessPointAdvertisement     */    public AccessPointAdvertisement getDest() {        return dest;    }        /**     * Sets the access point of the destination     *     * @param ap AccessPointAdvertisement of the destination peer     */    public void setDest(AccessPointAdvertisement ap) {        this.dest = ap;                if((null != dest) && (null != dest.getPeerID()) ) {            setDestPeerID( dest.getPeerID() );        }    }        /**     * returns the list of hops     *     * @return Enumeration list of hops as AccessPointAdvertisement     */    public Enumeration getHops() {        return hops.elements();    }        /**     * returns the list of hops     *     * @return Vectorlist of hops as AccessPointAdvertisement     */    public Vector getVectorHops() {        return hops;    }           /**     * sets the list of hops associated with this route     *     * @param hopsAccess Enumeration of hops as AccessPointAdvertisement     * The vector of hops is specified as a vector of AccessPoint     * advertisement.     */    public void setHops(Vector hopsAccess) {        // It is legal to set it to null but it is automatically converted        // to an empty vector. The member hops is NEVER null.        hops = hopsAccess != null ? hopsAccess : new Vector();    }        /**      * add a new list of EndpointAddresses to the Route Destination access     * point     *     * @deprecated Use {@link #getDest()} and modify AccessPointAdvertisement directly.     *      *@param addresses vector of endpoint addresses to add to the     * destination access point. Warning: The vector of endpoint addresses     * is specified as a vector of String. Each string representing     * one endpoint address.     */    public void addDestEndpointAddresses(Vector addresses) {        dest.addEndpointAddresses(addresses);    }        /**     * remove a list of EndpointAddresses from the Route Destination     * access point     *     * @deprecated Use {@link #getDest()} and modify AccessPointAdvertisement directly.     *     * @param addresses vector of endpoint addresses to remove from the     * destination access point. Warning: The vector of endpoint addresses is     * specified as a vector of String. Each string representing one     * endpoint address.     */    public void removeDestEndpointAddresses(Vector addresses) {        dest.removeEndpointAddresses(addresses);    }            /**     * Returns the access point for the first hop     *     * @return AccessPointAdvertisement first hop     */    public AccessPointAdvertisement getFirstHop() {        if (hops == null || hops.isEmpty())            return null;        else            return (AccessPointAdvertisement) hops.firstElement();    }        /**     * Sets the access point for the first hop     *     * @param ap AccessPointAdvertisement of the first hop     *     */    public void setFirstHop(AccessPointAdvertisement ap) {        hops.add(0, ap);    }        /**     * Returns the access point for the last hop     *     * @return AccessPointAdvertisement last hop     */    public AccessPointAdvertisement getLastHop() {        if (hops == null || hops.isEmpty())            return null;        else            return (AccessPointAdvertisement) hops.lastElement();    }        /**     * Sets the access point for the last hop     *     * @param ap AccessPointAdvertisement of the last hop     *     */    public void setLastHop(AccessPointAdvertisement ap) {        hops.addElement(ap);    }        /**     * Returns the route destination Peer ID     *     * @return peerID of the destination of the route     */    public PeerID getDestPeerID() {        return destPeer;    }            /**     * Sets the route destination peer id     *     * @param pid route destination peerID     *     */    public void setDestPeerID(PeerID pid) {        destPeer = pid;                if( null != dest )            dest.setPeerID( pid );    }        /**     * Set the route destination endpoint addresses     *     * @deprecated Use {@link #getDest()} and modify AccessPointAdvertisement directly.     *     * @param ea vector of endpoint addresses. Warning: The vector of endpoint     * addresses is specified as a vector of String. Each string     * representing one endpoint address.     *     */    public void setDestEndpointAddresses(Vector ea) {        dest.setEndpointAddresses(ea);    }        /**     * Return the endpoint addresses of the destination     *     * @deprecated Use {@link #getDest()} and modify AccessPointAdvertisement directly.     *     * @return vector of endpoint addresses as String. <b>This is live data.</b>     */    public Vector getDestEndpointAddresses() {        return dest.getVectorEndpointAddresses();    }        /**     * Check if the route contains the following hop     *     * @param pid peer id of the hop     * @return boolean true or false if the hop is found in the route     */    public boolean containsHop(PeerID pid) {        for (Enumeration e = hops.elements(); e.hasMoreElements();) {            AccessPointAdvertisement hop = (AccessPointAdvertisement)            e.nextElement();            PeerID hid = hop.getPeerID();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区的| 欧美一级欧美三级| 日本系列欧美系列| 成人欧美一区二区三区1314| 欧美日韩成人一区二区| 成人动漫av在线| 日本少妇一区二区| 亚洲欧美日韩国产中文在线| 久久久久国产精品人| 制服丝袜一区二区三区| 不卡一区在线观看| 黑人巨大精品欧美一区| 亚洲国产精品久久久久婷婷884 | 欧美不卡123| 欧美婷婷六月丁香综合色| 成人污视频在线观看| 久久国产剧场电影| 日韩有码一区二区三区| 国产精品私人影院| 欧美精品一区二区三区蜜臀| 欧美日韩国产高清一区二区| 91社区在线播放| 国产999精品久久久久久| 奇米色一区二区| 亚洲一区二区高清| 亚洲精品国产高清久久伦理二区| 久久亚洲春色中文字幕久久久| 欧美日韩成人一区二区| gogogo免费视频观看亚洲一| 国产成a人亚洲| 国产一区久久久| 麻豆精品一区二区| 免费不卡在线视频| 日本成人在线电影网| 日韩激情一区二区| 三级久久三级久久久| 亚洲高清视频的网址| 亚洲二区在线视频| 亚洲图片一区二区| 亚洲bt欧美bt精品| 日韩精品免费专区| 久久精品久久99精品久久| 日韩中文字幕一区二区三区| 三级久久三级久久| 人人狠狠综合久久亚洲| 免费成人av在线| 国产麻豆精品视频| 国产xxx精品视频大全| av成人免费在线观看| 94-欧美-setu| 欧美久久免费观看| 日韩欧美国产高清| 国产亚洲欧洲一区高清在线观看| 久久久久高清精品| √…a在线天堂一区| 亚洲成人av电影在线| 亚洲 欧美综合在线网络| 日韩电影在线免费| 精品亚洲porn| 国产精品一区专区| www.亚洲人| 成人美女视频在线观看| 色爱区综合激月婷婷| 欧美日韩免费视频| 欧美一区二区视频在线观看| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 亚洲欧美精品午睡沙发| 亚洲国产精品久久久久秋霞影院| 日本不卡的三区四区五区| 狠狠色2019综合网| 91丝袜呻吟高潮美腿白嫩在线观看| 色乱码一区二区三区88| 欧美成人r级一区二区三区| 国产精品视频线看| 偷拍与自拍一区| 国产精品 欧美精品| 日本韩国精品一区二区在线观看| 欧美久久久久久蜜桃| 久久久夜色精品亚洲| 亚洲码国产岛国毛片在线| 亚洲一区二区三区中文字幕| 奇米色777欧美一区二区| 成人午夜大片免费观看| 欧美日韩一区 二区 三区 久久精品| 日韩视频国产视频| 中文字幕在线播放不卡一区| 日韩综合小视频| 成人爱爱电影网址| 欧美精品视频www在线观看 | 午夜激情综合网| 风间由美性色一区二区三区| 91福利资源站| 国产嫩草影院久久久久| 婷婷久久综合九色综合绿巨人 | 中文字幕一区二区三区四区不卡 | 亚洲高清一区二区三区| 高清beeg欧美| 欧美精品日韩精品| 亚洲日本成人在线观看| 国产一区二区三区电影在线观看| 欧美伊人久久大香线蕉综合69| 欧美r级在线观看| 亚洲成av人在线观看| 99精品黄色片免费大全| 欧美va亚洲va在线观看蝴蝶网| 亚洲一区二区影院| 91猫先生在线| 中文字幕成人网| 精品一区二区久久久| 色狠狠色狠狠综合| 日本一二三不卡| 国产一区二区三区精品欧美日韩一区二区三区| 日本乱码高清不卡字幕| 久久久噜噜噜久久中文字幕色伊伊 | 国产亚洲一本大道中文在线| 日韩制服丝袜av| 在线观看日韩高清av| 国产精品传媒在线| 成人免费视频免费观看| 精品国产污网站| 美腿丝袜亚洲色图| 欧美日韩成人一区| 午夜精品久久久久久久| 欧美午夜精品一区二区三区| 亚洲四区在线观看| 成人av在线看| 国产精品久久久久aaaa| 成人动漫中文字幕| 亚洲欧洲另类国产综合| 丁香天五香天堂综合| 国产欧美精品一区二区色综合朱莉| 麻豆精品一区二区综合av| 欧美一级搡bbbb搡bbbb| 日韩成人精品在线观看| 欧美一区二区三区四区高清| 天堂成人免费av电影一区| 欧美日韩色综合| 日韩国产精品久久| 69av一区二区三区| 视频一区在线播放| 日韩视频在线永久播放| 青青草97国产精品免费观看无弹窗版 | 久久精品男人的天堂| 国产美女av一区二区三区| 国产日韩精品一区二区三区| 国产福利91精品一区| 欧美激情资源网| 国产99精品在线观看| 中文字幕中文字幕一区二区 | www.欧美精品一二区| 国产精品电影院| 色狠狠桃花综合| 亚洲国产欧美另类丝袜| 欧美精品vⅰdeose4hd| 久久99精品久久久久| 久久精品欧美一区二区三区不卡| 国产成人三级在线观看| 亚洲天堂成人在线观看| 欧洲视频一区二区| 日韩电影在线观看电影| 久久精品亚洲一区二区三区浴池| 成人av片在线观看| 午夜在线成人av| 精品奇米国产一区二区三区| 国产一级精品在线| 亚洲蜜臀av乱码久久精品 | 日本一区二区三区高清不卡| 91久久一区二区| 久久国产精品无码网站| 亚洲国产高清aⅴ视频| 在线视频国内自拍亚洲视频| 亚洲成人精品一区| 久久久久久久久免费| 91丨九色丨蝌蚪丨老版| 日本中文一区二区三区| 国产精品视频你懂的| 欧美伦理视频网站| 国产精品18久久久久久vr| 一区二区三区四区中文字幕| 欧美一区二区观看视频| 91女人视频在线观看| 老司机免费视频一区二区三区| 中文字幕一区二区三中文字幕| 欧美一区二区三区视频在线 | 国产综合色视频| 亚洲欧美成aⅴ人在线观看| 日韩欧美的一区二区| 色综合色综合色综合| 精品影院一区二区久久久| 一区二区三区高清不卡| 久久综合九色欧美综合狠狠| 欧美影视一区在线| xf在线a精品一区二区视频网站| 久久久精品国产免大香伊| 欧美图区在线视频| 成人黄色一级视频| 麻豆成人久久精品二区三区红| 亚洲另类在线一区| 国产天堂亚洲国产碰碰| 91麻豆精品国产91|