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

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

?? piperesolvermsg.java

?? jxta平臺的開發包
?? JAVA
字號:
/* * Copyright (c) 2002 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. * * $Id: PipeResolverMsg.java,v 1.11 2004/10/09 23:35:38 bondolo Exp $ */package net.jxta.impl.protocol;import java.io.InputStream;import java.io.StringWriter;import java.io.StringReader;import java.io.Writer;import java.net.URI;import java.util.Enumeration;import java.util.Hashtable;import java.util.Iterator;import java.util.Set;import java.io.IOException;import java.net.URISyntaxException;import org.apache.log4j.Logger;import org.apache.log4j.Level;import net.jxta.document.AdvertisementFactory;import net.jxta.document.Attribute;import net.jxta.document.Attributable;import net.jxta.document.Element;import net.jxta.document.TextElement;import net.jxta.document.MimeMediaType;import net.jxta.document.Document;import net.jxta.document.StructuredTextDocument;import net.jxta.document.StructuredDocumentFactory;import net.jxta.document.StructuredDocumentUtils;import net.jxta.id.ID;import net.jxta.id.IDFactory;import net.jxta.peer.PeerID;import net.jxta.pipe.PipeID;import net.jxta.protocol.PeerAdvertisement;import net.jxta.protocol.PipeResolverMessage;/** * This class implements {@link net.jxta.protocol.PipeResolverMessage} by * providing {@link #initialize(Element)} and {@link #getDocument(MimeMediaType)} * implementations. * * <p/>It implements the PipeResolver message for the standard Pipe   Binding Protocol (PBP) with the following schema: * * <pre><code> * &lt;xs:element name="jxta:PipeResolver" type="jxta:PipeResolver"/> * * &lt;xs:simpleType name="PipeResolverMsgType"> *   &lt;xs:restriction base="xs:string"> *     &lt;!-- QUERY --> *     &lt;xs:enumeration value="Query"/> *     &lt;!-- ANSWER --> *     &lt;xs:enumeration value="Answer"/> *   &lt;/xs:restriction> * &lt;/xs:simpleType> * * &lt;xs:complexType name="PipeResolver"> *   &lt;xs:sequence> *     &lt;xs:element name="MsgType" type="jxta:PipeResolverMsgType"/> *     &lt;xs:element name="PipeId" type="jxta:JXTAID"/> * &lt;xs:element name="Type" type="xs:string"/> * *     &lt;!-- used in the query --> * &lt;xs:element name="Cached" type="xs:boolean" default="true" minOccurs="0"/> *     &lt;xs:element name="Peer" type="jxta:JXTAID" minOccurs="0"/> * *     &lt;!-- used in the answer --> *     &lt;xs:element name="Found" type="xs:boolean"/> * &lt;!-- This should refer to a peer adv, but is instead a whole doc --> * &lt;xs:element name="PeerAdv" type="xs:string" minOccurs="0"/> *   &lt;/xs:sequence> * &lt;/xs:complexType> * </code></pre> * * @see net.jxta.pipe.PipeService * @see net.jxta.impl.pipe.PipeServiceImpl * @see <a href="http://spec.jxta.org/nonav/v1.0/docbook/JXTAProtocols.html#proto-pbp" target="_blank">JXTA Protocols Specification : Pipe Binding Protocol</a> **/public class PipeResolverMsg extends PipeResolverMessage {        /**     *  Log4J Logger     **/    private final static transient Logger LOG = Logger.getLogger( PipeResolverMsg.class.getName());        private final static String MsgTypeTag       = "MsgType";    private final static String PipeIdTag        = "PipeId";    private final static String PipeTypeTag      = "Type";    private final static String PeerIdTag        = "Peer";    private final static String PeerAdvTag       = "PeerAdv";    private final static String FoundTag         = "Found";        private final static String QueryMsgType     = "Query";    private final static String AnswerMsgType    = "Answer";        public PipeResolverMsg() {        super();    }        public PipeResolverMsg(Element root) {        this();        initialize( root );    }        /**     *  Initializes the message from a document.     **/    protected void initialize(Element root) {        if( !TextElement.class.isInstance( root ) )            throw new IllegalArgumentException( getClass().getName() + " only supports TextElement" );                TextElement doc = (TextElement) root;                String docName = doc.getName();                if( !docName.equals(getMessageType()) )            throw new IllegalArgumentException( "Could not construct : "            + getClass().getName()            + "from doc containing a "            + docName );                Enumeration each = doc.getChildren();                while (each.hasMoreElements()) {            TextElement elem = (TextElement) each.nextElement();                        if (elem.getName().equals(MsgTypeTag)) {                String msgtype = elem.getTextValue();                if( msgtype.equals( QueryMsgType ) )                    setMsgType( PipeResolverMessage.MessageType.QUERY );                else if ( msgtype.equals( AnswerMsgType ) )                    setMsgType( PipeResolverMessage.MessageType.ANSWER );                else                    throw new IllegalArgumentException( "Unexpected Message Type in parsing." );                continue;            }                        if (elem.getName().equals(PipeIdTag)) {                try {                    URI pipeID =  new URI( elem.getTextValue() );                    setPipeID( IDFactory.fromURI( pipeID ) );                } catch ( URISyntaxException badID ) {                    throw new IllegalArgumentException( "Bad pipe ID in message" );                }                continue;            }                        if (elem.getName().equals(PipeTypeTag)) {                setPipeType( elem.getTextValue() );                continue;            }                        if (elem.getName().equals(PeerIdTag)) {                try {                    URI peerID =  new URI( elem.getTextValue() );                    addPeerID( IDFactory.fromURI( peerID ) );                } catch ( URISyntaxException badID ) {                    throw new IllegalArgumentException( "Bad peer ID in message" );                }                continue;            }                        if (elem.getName().equals(FoundTag)) {                setFound( Boolean.valueOf(elem.getTextValue()).booleanValue() );                continue;            }                        // let's check whether the responder sent us a adv            if (elem.getName().equals(PeerAdvTag)) {                String peerAdv = elem.getTextValue();                try {                    setInputPeerAdv( (PeerAdvertisement) AdvertisementFactory.newAdvertisement(                    MimeMediaType.XMLUTF8,                    new StringReader(peerAdv)) );                } catch ( IOException caught ) {                    if (LOG.isEnabledFor(Level.DEBUG))                        LOG.debug( "Malformed peer adv in message", caught );                    throw new IllegalArgumentException( "Malformed peer adv in message : " + caught.getMessage() );                }                continue;            }        }                // Begin checking sanity!        PipeResolverMessage.MessageType msgType = getMsgType();        if ( null == msgType )            throw new IllegalArgumentException( "Message type was never set!" );                ID pipeID = getPipeID();        if( (null == pipeID) || ID.nullID.equals(pipeID) || !(pipeID instanceof PipeID) )            throw new IllegalArgumentException( "Input Pipe ID not set or invalid" );                if ( null == getPipeType() )            throw new IllegalArgumentException( "Pipe type was never set!" );                //Query extra checks                //Response extra checks        if (  PipeResolverMessage.MessageType.ANSWER.equals( msgType ) ) {            if( getPeerIDs().isEmpty() ) {                throw new IllegalArgumentException( "An answer without responses is invalid" );            }        }    }        /**     *  Creates a document out of the message.     *     *  @param  encodeAs  The document representation format requested.     *  @return the message as a document.     **/    public Document getDocument(MimeMediaType encodeAs) {        StructuredTextDocument doc = (StructuredTextDocument)        StructuredDocumentFactory.newStructuredDocument(encodeAs, getMessageType() );                if( doc instanceof Attributable ) {            ((Attributable)doc).addAttribute( "xmlns:jxta", "http://jxta.org" );        }                PipeResolverMessage.MessageType msgType = getMsgType();        if ( null == msgType ) {            throw new IllegalStateException( "Message type was never set!" );        }                ID pipeID = getPipeID();        if( (null == pipeID) || ID.nullID.equals(pipeID) || !(pipeID instanceof PipeID) ) {            throw new IllegalStateException( "Pipe ID not set or invalid." );        }                String pipeType = getPipeType();        if ( (null == pipeType) || (0 == pipeType.trim().length()) ) {            throw new IllegalStateException( "Pipe type was never set or is invalid." );        }                Element e = null;        if(  PipeResolverMessage.MessageType.QUERY.equals( msgType ) ) {            e = doc.createElement(MsgTypeTag, QueryMsgType);        } else if (  PipeResolverMessage.MessageType.ANSWER.equals( msgType ) ) {            e = doc.createElement(MsgTypeTag, AnswerMsgType);        } else {            throw new IllegalStateException( "Unknown message type :" + msgType.toString() );        }        doc.appendChild(e);                e = doc.createElement(PipeIdTag, pipeID.toString() );        doc.appendChild(e);                if( (null != pipeType) && (0 != pipeType.length()) ) {            e = doc.createElement( PipeTypeTag, pipeType );            doc.appendChild(e);        }                // Write the peer ids.        Set peers = getPeerIDs();                if ( PipeResolverMessage.MessageType.ANSWER.equals( msgType ) && peers.isEmpty() ) {            throw new IllegalStateException( "An ANSWER message must contain at least one peer as part of the response." );        }                Iterator eachPeer = peers.iterator();                while( eachPeer.hasNext() ) {            ID aPeer = (ID) eachPeer.next();                            e = doc.createElement(PeerIdTag, aPeer.toString() );                doc.appendChild(e);        }                if(  PipeResolverMessage.MessageType.QUERY.equals( msgType ) ) {            // nothing for now...        } else if (  PipeResolverMessage.MessageType.ANSWER.equals( msgType ) ) {            e = doc.createElement(FoundTag, (isFound() ? Boolean.TRUE : Boolean.FALSE).toString() );            doc.appendChild(e);                        PeerAdvertisement peerAdv = getInputPeerAdv();            if (peerAdv != null) {                if( !peers.contains( peerAdv.getPeerID() ) ) {                    throw new IllegalStateException( "Provided Peer Advertisement does not refer to one of the peers in the response list." );                }                		    StructuredTextDocument asDoc = (StructuredTextDocument)			peerAdv.getDocument( MimeMediaType.XMLUTF8 );                                e = doc.createElement( PeerAdvTag, asDoc.toString() );		    doc.appendChild(e);	    }        } else {            throw new IllegalStateException( "Unknown message type :" + msgType.toString() );        }                return doc;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区伦理片| 一区二区三区加勒比av| 欧美专区在线观看一区| 国产一区二区中文字幕| 亚洲图片欧美色图| 国产精品白丝在线| 久久色.com| 精品国产一区二区三区忘忧草 | 亚洲精品中文在线观看| 精品国产电影一区二区| 884aa四虎影成人精品一区| 色8久久人人97超碰香蕉987| 国产成人亚洲综合a∨猫咪| 久久国产尿小便嘘嘘| 日本不卡视频在线| 日本少妇一区二区| 看电视剧不卡顿的网站| 欧美bbbbb| 国内精品第一页| www.激情成人| 欧美日本高清视频在线观看| 久久综合999| 国产精品视频在线看| 有码一区二区三区| 日韩黄色在线观看| 成人免费高清在线| 欧美日韩激情一区| 久久九九99视频| 亚洲免费资源在线播放| 久久99国产精品久久| 不卡一二三区首页| 欧美一级一级性生活免费录像| 久久久国产综合精品女国产盗摄| 日韩欧美成人午夜| 国产精品国产精品国产专区不片| 国产精品超碰97尤物18| 日韩av午夜在线观看| 成人午夜免费电影| 欧美男女性生活在线直播观看| 精品国一区二区三区| 亚洲综合精品自拍| 成人综合婷婷国产精品久久蜜臀| 欧美在线观看18| 国产精品毛片a∨一区二区三区| 午夜精品视频一区| 国产超碰在线一区| 日韩女同互慰一区二区| 亚洲第一综合色| 99综合电影在线视频| 久久综合成人精品亚洲另类欧美| 伊人色综合久久天天人手人婷| 国产盗摄女厕一区二区三区| 日韩一级视频免费观看在线| 午夜久久久影院| 欧美日韩精品是欧美日韩精品| 亚洲欧洲99久久| 91亚洲午夜精品久久久久久| 中文字幕av资源一区| 国产在线不卡一区| 久久久夜色精品亚洲| 国内成人精品2018免费看| 精品国产乱子伦一区| 久久99国产精品麻豆| 久久综合国产精品| 国产剧情一区二区| 国产婷婷色一区二区三区在线| 国产一区欧美一区| 国产日韩三级在线| 成人一级黄色片| 国产精品第13页| 色婷婷亚洲综合| 亚洲成人在线网站| 欧美tk丨vk视频| 风间由美一区二区三区在线观看 | 首页亚洲欧美制服丝腿| 日韩精品一区二区三区视频| 国产精品456露脸| 1024成人网| 欧美精品九九99久久| 国产一区高清在线| 综合自拍亚洲综合图不卡区| www.亚洲精品| 日韩av在线播放中文字幕| 国产日韩精品视频一区| 99视频一区二区| 美腿丝袜亚洲三区| 亚洲天堂av一区| 日韩一区二区在线免费观看| 极品少妇一区二区三区精品视频| 久久电影国产免费久久电影| 国产精品电影一区二区三区| 欧美日韩久久一区二区| 国产成人av自拍| 亚洲aaa精品| 中文字幕一区日韩精品欧美| 在线不卡一区二区| www.性欧美| 美国一区二区三区在线播放| 亚洲色图制服诱惑 | 久久机这里只有精品| 亚洲欧美区自拍先锋| 亚洲精品一线二线三线| 精品视频一区二区三区免费| 99re66热这里只有精品3直播 | 3atv一区二区三区| 欧美丝袜第三区| 99精品欧美一区二区三区综合在线| 久久国产综合精品| 日韩电影在线观看电影| 亚洲欧美日韩国产另类专区| 欧美激情在线免费观看| 久久久欧美精品sm网站| 精品电影一区二区| 日韩一二三四区| 91精品国产一区二区三区| 欧美日韩国产高清一区二区三区 | 亚洲精品第一国产综合野| 国产精品女同一区二区三区| 久久久青草青青国产亚洲免观| 亚洲精品一区二区三区影院| 精品三级在线看| 精品少妇一区二区三区视频免付费 | 91.麻豆视频| 精品噜噜噜噜久久久久久久久试看 | 一区二区三区在线播放| 亚洲欧美国产毛片在线| 亚洲一区免费视频| 视频一区视频二区中文字幕| 美国十次综合导航| 国产精品亚洲视频| 国产成人亚洲综合a∨婷婷图片 | 亚洲成人免费影院| 日本不卡一二三区黄网| 国产91丝袜在线播放九色| 色女孩综合影院| 欧美哺乳videos| 中文字幕视频一区二区三区久| 一区二区三区日韩精品视频| 日韩中文字幕麻豆| 国产一区二区福利| 欧美天堂亚洲电影院在线播放| 欧美第一区第二区| 亚洲欧美偷拍三级| 国产一区二区三区四区五区美女| 91小视频免费观看| 精品对白一区国产伦| 亚洲最新在线观看| 国产乱码精品一品二品| 欧美日韩一级视频| 国产欧美视频一区二区三区| 亚洲人吸女人奶水| 国产成人午夜视频| 日韩一级二级三级| 亚洲在线视频一区| 成人免费黄色大片| 久久免费午夜影院| 裸体健美xxxx欧美裸体表演| 91在线观看视频| 国产欧美精品国产国产专区 | 蜜臀av性久久久久蜜臀aⅴ| av成人免费在线| 日韩欧美www| 亚洲成人综合视频| 欧美午夜在线观看| 亚洲自拍都市欧美小说| 成人av电影免费在线播放| 久久精品亚洲麻豆av一区二区| 日本伊人色综合网| 日韩情涩欧美日韩视频| 日本不卡视频在线| 日韩你懂的在线观看| 男女激情视频一区| 欧美一级黄色大片| 国产一区二区三区四区在线观看| 日韩欧美的一区二区| 美国av一区二区| 欧美极品少妇xxxxⅹ高跟鞋| caoporn国产一区二区| 亚洲精品国产a| 欧美精品九九99久久| 蜜桃一区二区三区四区| 久久综合99re88久久爱| 风间由美性色一区二区三区| 中文字幕在线观看一区| 色婷婷精品大在线视频| 亚洲一区二区成人在线观看| 日韩欧美一级精品久久| 国产成人在线网站| 一区二区三区在线播| 日韩三级电影网址| 国产精品一二一区| 亚洲香肠在线观看| 精品国产一区二区在线观看| 成人美女在线观看| 天天色天天爱天天射综合| 久久综合久久综合九色| 欧美在线观看视频一区二区| 国产乱一区二区| 丝袜美腿一区二区三区| 国产精品国产成人国产三级|