亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产精品久久久久国产精品日日| 日韩免费观看高清完整版在线观看| 在线免费亚洲电影| 91麻豆精品国产91| 国产精品久久久久久久久图文区 | 韩国成人在线视频| 成人免费毛片aaaaa**| 一区二区三区在线视频免费| 亚洲国产裸拍裸体视频在线观看乱了 | 久久久久久一级片| 亚洲精品网站在线观看| 国产呦萝稀缺另类资源| 制服丝袜中文字幕亚洲| 亚洲激情第一区| 成人精品视频.| 久久久.com| 蜜桃视频第一区免费观看| 亚洲第一电影网| 91亚洲国产成人精品一区二三| www国产亚洲精品久久麻豆| 视频一区二区三区中文字幕| 色94色欧美sute亚洲线路一久| 国产精品无人区| 国产成人免费视频 | 91精品国产全国免费观看 | 天天综合网 天天综合色| 成人深夜福利app| 久久久欧美精品sm网站| 另类人妖一区二区av| 欧美剧情片在线观看| 亚洲一区二区黄色| 91视频在线观看免费| 国产精品久久影院| www.综合网.com| 最新不卡av在线| gogogo免费视频观看亚洲一| 国产精品毛片无遮挡高清| 国产一区不卡精品| 日韩美女在线视频| 男女男精品网站| 精品久久久久久久久久久久久久久 | 国产精品一二三四五| 久久亚洲一级片| 国产风韵犹存在线视精品| 久久精品人人做人人综合 | 国产精品丝袜久久久久久app| 国产一区二区在线免费观看| 久久蜜桃香蕉精品一区二区三区| 韩国三级中文字幕hd久久精品| 久久影院午夜片一区| 国产成人日日夜夜| 中文字幕一区二区三区乱码在线| 色哟哟一区二区| 天天影视涩香欲综合网| 欧美mv日韩mv国产网站| 国产精品综合视频| 亚洲欧洲无码一区二区三区| 欧美性生活大片视频| 日韩精品亚洲一区| 欧美乱熟臀69xxxxxx| 青青草精品视频| 欧美一级爆毛片| 国产一区二区在线免费观看| 中文字幕日韩一区| 欧美日精品一区视频| 精品一区二区日韩| 国产精品美女一区二区| 欧美日韩一区小说| 国产乱码精品一区二区三区av| 亚洲天堂精品在线观看| 51精品久久久久久久蜜臀| 精品亚洲欧美一区| 最近日韩中文字幕| 精品国产乱码久久久久久1区2区| 懂色中文一区二区在线播放| 一区二区三区免费| 欧美一区二区视频观看视频| 国产乱妇无码大片在线观看| 亚洲综合久久久| 久久久久久久久99精品| 欧美综合天天夜夜久久| 精品一区二区久久久| 亚洲黄色av一区| 久久精品免费在线观看| 精品视频在线免费观看| 成人免费视频国产在线观看| 亚洲va欧美va人人爽| 精品国产凹凸成av人网站| www.亚洲人| 狠狠色狠狠色综合| 亚洲大片在线观看| 国产精品久久久久久久第一福利| 91精品久久久久久久久99蜜臂| 91免费版pro下载短视频| 麻豆成人久久精品二区三区小说| 亚洲人123区| 欧美精品乱人伦久久久久久| 成人精品在线视频观看| 国产乱国产乱300精品| 亚洲va在线va天堂| 亚洲综合在线第一页| 国产精品成人一区二区艾草| 久久久久久久电影| 日韩欧美一区二区视频| 欧美日本在线视频| 欧美性生活久久| 国产**成人网毛片九色| 麻豆91在线看| 久久99久久久久| 日韩高清不卡在线| 亚洲制服丝袜av| 亚洲欧美色综合| 亚洲靠逼com| 亚洲综合免费观看高清完整版在线 | 国产精品88av| 日本免费新一区视频| 亚洲卡通欧美制服中文| 亚洲欧美乱综合| 亚洲美女偷拍久久| 亚洲人成小说网站色在线| 久久精品欧美日韩| 中文字幕制服丝袜成人av| 久久久久久毛片| 中文文精品字幕一区二区| 国产精品亲子乱子伦xxxx裸| 亚洲黄色尤物视频| 一区二区日韩电影| 亚洲免费视频中文字幕| 成人免费一区二区三区在线观看| 丁香另类激情小说| 精品在线播放免费| 欧美高清在线精品一区| 欧美精品精品一区| 日韩精品一区二区三区视频在线观看 | 日韩国产欧美在线观看| 久久99热99| 亚洲天堂网中文字| 一区二区三区免费在线观看| 亚洲精品国产精华液| 亚洲国产精品久久久男人的天堂| 亚洲国产视频a| 蜜臀久久99精品久久久久久9 | 亚洲乱码国产乱码精品精可以看 | 日韩欧美一二三四区| 日韩欧美一二区| 国产人伦精品一区二区| 亚洲欧美成aⅴ人在线观看| 亚洲香肠在线观看| 韩日欧美一区二区三区| 成人国产在线观看| 欧美午夜影院一区| 久久久夜色精品亚洲| 亚洲欧美偷拍卡通变态| 久久99精品久久只有精品| 99国产精品视频免费观看| 欧美精品1区2区| 国产精品免费av| 亚洲va欧美va人人爽| 成人性生交大片免费| 色域天天综合网| 91精品国产色综合久久不卡电影 | 久久奇米777| 成人免费一区二区三区视频| 免费观看日韩电影| 91麻豆swag| 久久青草国产手机看片福利盒子 | 欧美日韩国产综合久久| 国产亚洲一区二区三区在线观看| 亚洲一区二区三区四区中文字幕| 韩国av一区二区| 欧美曰成人黄网| 亚洲国产高清在线| 蜜桃视频一区二区| 欧美日韩一级黄| 中文字幕亚洲精品在线观看| 另类的小说在线视频另类成人小视频在线 | 亚洲一二三四区| 成人免费看的视频| 日韩视频一区在线观看| 亚洲国产你懂的| 91福利国产精品| 国产精品亲子乱子伦xxxx裸| 国产伦精品一区二区三区在线观看 | 成人av小说网| 久久影院电视剧免费观看| 日韩av成人高清| 欧美男男青年gay1069videost | 中文欧美字幕免费| 麻豆精品蜜桃视频网站| 欧美肥胖老妇做爰| 亚洲精品视频在线观看免费| 99久久99久久久精品齐齐| 国产午夜精品在线观看| 国产美女精品人人做人人爽| 精品精品国产高清一毛片一天堂| 婷婷六月综合网| 欧美精品99久久久**| 亚洲成人激情社区| 日本韩国欧美一区| 一区二区三区中文字幕电影|