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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? srdimessageimpl.java

?? jxta平臺(tái)的開發(fā)包
?? JAVA
字號(hào):
/* *  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. * *  $Id: SrdiMessageImpl.java,v 1.16 2005/03/15 20:44:21 bondolo Exp $ */package net.jxta.impl.protocol;import java.io.InputStream;import java.io.StringWriter;import java.util.Iterator;import java.net.URI;import java.util.Enumeration;import java.util.List;import java.io.IOException;import java.net.URISyntaxException;import net.jxta.document.*;import net.jxta.id.IDFactory;import net.jxta.peer.PeerID;import net.jxta.protocol.SrdiMessage;import org.apache.log4j.Logger;import org.apache.log4j.Level;/** * SrdiMessageImpl provides the SRDI message binding */public class SrdiMessageImpl extends SrdiMessage {    /**     * The Log4J debugging category.     */    private final static Logger LOG = Logger.getLogger(SrdiMessageImpl.class.getName());    /**     *  PeerID element name     */    public final static String pidTag = "PID";    /**     *  ttl element name     */    public final static String ttlTag = "ttl";    /**     *  Entry element name     */    public final static String entryTag = "Entry";    /**     *  Primary Key element name     */    public final static String pKeyTag = "PKey";    /**     *  Secondary Key element name     */    public final static String sKeyTag = "SKey";    /**     *  Value element name     */    public final static String valTag = "Value";    /**     *  Expiration element name     */    public final static String expirationTag = "Expiration";    /**     * Construct an empty doc     */    public SrdiMessageImpl() {        setTTL(0);    }    /**     * Construct a doc from InputStream     *     *  @deprecated It's better to generate the document yourself. This method     *  cannot deduce the mime type of the content.     *     * @param  stream           the underlying input stream.     * @exception  IOException  if an I/O error occurs.     */    public SrdiMessageImpl(InputStream stream) throws IOException {        // We are asked to assume that the message from which this response        // is constructed is an XML document.        XMLDocument doc = (XMLDocument) StructuredDocumentFactory.newStructuredDocument(MimeMediaType.XMLUTF8, stream);        readIt(doc);    }    /**     * Construct from a StructuredDocument     *     * @param  root  the underlying document     */    public SrdiMessageImpl(Element root) {        if (!XMLElement.class.isInstance(root)) {            throw new IllegalArgumentException(getClass().getName() + " only supports XLMElement");        }                XMLElement doc = (XMLElement) root;                String doctype = doc.getName();                String typedoctype = "";        Attribute itsType = doc.getAttribute("type");        if (null != itsType) {            typedoctype = itsType.getValue();        }                if (!doctype.equals(getMessageType()) && !getMessageType().equals(typedoctype)) {            throw new IllegalArgumentException("Could not construct : " + getClass().getName() + "from doc containing a " + doc.getName());        }                readIt(doc);    }    /**     * Construct a msg from entries     *     * @param  peerid       PeerID associated with this message     * @param  ttl          TTL     * @param  pKey         primary key     * @param  entries      the entries for this message     */    public SrdiMessageImpl(PeerID peerid,            int ttl,            String pKey,            List entries) {        setPeerID(peerid);        setTTL(ttl);        setPrimaryKey(pKey);        setEntries(entries);    }    /**     * Construct a msg consisting of a single entry     *     * @param  peerid       PeerID associated with this message     * @param  ttl          TTL     * @param  pKey         primary key     * @param  key          the secondary key     * @param  value        value for the key     * @param  expiration   expirations for this entry     */    public SrdiMessageImpl(PeerID peerid,            int ttl,            String pKey,            String key,            String value,            long expiration) {        setPeerID(peerid);        setTTL(ttl);        setPrimaryKey(pKey);        addEntry(key, value, expiration);    }    /**     * Construct a doc from vectors of strings     *     * @param  peerid       PeerID associated with this message     * @param  ttl          TTL     * @param  pKey         primary key     * @param  entries      the entries for this message     */    public SrdiMessageImpl(String peerid,            int ttl,            String pKey,            List entries) {        PeerID pid;        try {            pid = (PeerID) IDFactory.fromURI(new URI(peerid));        } catch (URISyntaxException badID) {            throw new IllegalArgumentException("Invalid PeerID ID in message");        }        setPeerID(pid);        setTTL(ttl);        setPrimaryKey(pKey);        setEntries(entries);    }    /**     * @param  doc     */    public void readIt(XMLElement doc) {        String key = null;        String value = null;        long expiration = 0;        Enumeration elements = doc.getChildren();        while (elements.hasMoreElements()) {            XMLElement elem = (XMLElement) elements.nextElement();            if (elem.getName().equals(pidTag)) {                try {                    URI pID = new URI(elem.getTextValue());                    setPeerID((PeerID) IDFactory.fromURI(pID));                } catch (URISyntaxException badID) {                    throw new IllegalArgumentException("Invalid PeerID ID in message");                }                continue;            }            if (elem.getName().equals(pKeyTag)) {                setPrimaryKey(elem.getTextValue());            }            if (elem.getName().equals(ttlTag)) {                setTTL(Integer.parseInt(elem.getTextValue()));            }            if (elem.getName().equals(entryTag)) {                Attribute keyEl = ((Attributable) elem).getAttribute(sKeyTag);                if (keyEl == null) {                    key = "NA";                } else {                    key = keyEl.getValue();                }                value = elem.getTextValue();                if (null != value) {                  Attribute expAttr = elem.getAttribute(expirationTag);                  if (expAttr != null) {                      String expstr = expAttr.getValue();                      expiration = Long.parseLong(expstr);                  } else {                      expiration = -1;                  }                                    SrdiMessage.Entry entry = new SrdiMessage.Entry(key, value, expiration);                  addEntry(entry);                } else {                  if (LOG.isEnabledFor(Level.DEBUG)) {                     LOG.debug("SrdiMessage Entry with a Null value");                  }                                }            }        }    }    /**     * return a Document representation of this object     *     * @param  encodeAs     * @return           document represtation of this object     */    public Document getDocument(MimeMediaType encodeAs) {        StructuredTextDocument adv = (StructuredTextDocument)                StructuredDocumentFactory.newStructuredDocument(encodeAs, getMessageType());        if (adv instanceof Attributable) {            ((Attributable) adv).addAttribute("xmlns:jxta", "http://jxta.org");        }        Element e;        Iterator eachEntry = getEntries().iterator();        PeerID peerid = getPeerID();        if (peerid != null) {            e = adv.createElement(pidTag, peerid.toString());            adv.appendChild(e);        }        if (getPrimaryKey() != null) {            e = adv.createElement(pKeyTag, getPrimaryKey());            adv.appendChild(e);        }        if (getTTL() > 0) {            e = adv.createElement(ttlTag, Integer.toString(getTTL()));            adv.appendChild(e);        }        while (eachEntry.hasNext()) {            SrdiMessage.Entry entry = (SrdiMessage.Entry) eachEntry.next();            if (entry.key == null && entry.value == null) {                // skip bad entries                continue;            }            e = adv.createElement(entryTag, entry.value);            adv.appendChild(e);            ((Attributable) e).addAttribute(expirationTag, Long.toString(entry.expiration));            ((Attributable) e).addAttribute(sKeyTag, entry.key);        }        return adv;    }    /**     * returns the document string representation of this object     *     * @return    String representation of the of this message type     */    public String toString() {                StructuredTextDocument doc = (StructuredTextDocument) getDocument(MimeMediaType.XMLUTF8);                    return doc.toString();    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩无一区二区| 欧洲视频一区二区| 亚洲另类中文字| 色欧美日韩亚洲| 久久99热狠狠色一区二区| 国产欧美精品一区二区色综合| 色综合久久久久久久| 亚洲第一二三四区| 中文字幕av在线一区二区三区| 在线视频国内一区二区| 国内久久精品视频| 国产欧美一区二区三区在线老狼| 色又黄又爽网站www久久| 日韩精品成人一区二区三区| 国产精品成人免费| 精品国产精品一区二区夜夜嗨 | 91影院在线免费观看| 亚洲一区在线观看网站| 555www色欧美视频| 不卡的看片网站| 久久99精品久久久久久久久久久久 | 亚洲欧洲www| 91蜜桃网址入口| 狠狠色狠狠色综合日日91app| 亚洲精品ww久久久久久p站| 亚洲精品在线三区| 欧美午夜片在线看| 91香蕉视频mp4| 国产成人精品1024| 精品一区二区免费看| 亚洲一区二区三区在线| 国产精品第13页| 久久久国际精品| 日韩欧美另类在线| 欧美日韩二区三区| 欧美综合天天夜夜久久| 99这里只有久久精品视频| 国产白丝网站精品污在线入口| 奇米精品一区二区三区在线观看 | 成人精品视频.| 精品亚洲国产成人av制服丝袜 | 国产成人精品亚洲777人妖| 美女免费视频一区二区| 日韩黄色一级片| 亚洲国产精品综合小说图片区| 国产精品日韩成人| 337p粉嫩大胆噜噜噜噜噜91av| 欧美一级在线视频| 91麻豆精品国产91久久久久| 欧美色网站导航| 精品国产人成亚洲区| 91精品黄色片免费大全| 在线成人免费观看| 91精品午夜视频| 91久久国产综合久久| 色综合久久综合中文综合网| 色网站国产精品| 在线观看视频一区二区欧美日韩| 色综合一区二区| 91电影在线观看| 欧美美女一区二区在线观看| 欧美人伦禁忌dvd放荡欲情| 欧美三级日本三级少妇99| 在线看不卡av| 91精品国产乱码久久蜜臀| 91精品国产91久久综合桃花| 欧美一区二区三区在线观看视频 | 亚洲免费观看视频| 亚洲精品国产成人久久av盗摄 | 欧洲精品一区二区| 日本韩国一区二区| 欧美老女人第四色| 日韩午夜精品电影| 国产色产综合色产在线视频| 国产精品视频一二| 亚洲免费毛片网站| 一区二区三区在线高清| 亚洲福利国产精品| 免费在线欧美视频| 国产成人亚洲综合色影视| 91视频在线观看| 欧美日韩日日骚| 精品久久久影院| 国产欧美日韩精品一区| 一区二区三区av电影| 青青草97国产精品免费观看| 国产原创一区二区三区| 色综合天天在线| 欧美一区二区三区免费| 中文字幕 久热精品 视频在线| 日本成人中文字幕在线视频| 精品在线播放午夜| 色综合天天综合给合国产| 91精品国产免费| 欧美激情一区不卡| 丝袜亚洲另类丝袜在线| 国产九九视频一区二区三区| 91蜜桃免费观看视频| 日韩免费在线观看| 国产亚洲欧美激情| 五月天久久比比资源色| 国产不卡在线一区| 69堂亚洲精品首页| 亚洲蜜桃精久久久久久久| 国产99久久久精品| 亚洲精品一区二区三区蜜桃下载| 亚洲大片在线观看| 99精品热视频| 国产婷婷色一区二区三区在线| 日本aⅴ亚洲精品中文乱码| 欧美三级三级三级爽爽爽| 亚洲色图视频网站| 9色porny自拍视频一区二区| 精品国产成人系列| 麻豆精品在线视频| 91麻豆精品91久久久久同性| 亚洲综合色婷婷| 一本大道久久精品懂色aⅴ| 国产日韩精品一区二区三区| 理论电影国产精品| 91精选在线观看| 日韩精品亚洲专区| 91麻豆精品国产91久久久久 | 91精品国产免费| 天天色综合天天| 欧美日韩国产中文| 亚洲成a人片在线观看中文| 在线亚洲精品福利网址导航| 亚洲欧洲制服丝袜| 色网综合在线观看| 亚洲一二三四在线观看| 精品1区2区3区| 日日嗨av一区二区三区四区| 欧美福利一区二区| 日本色综合中文字幕| 日韩午夜电影av| 国产一区91精品张津瑜| 久久新电视剧免费观看| 国产精品99久久久久久有的能看| 久久蜜桃av一区精品变态类天堂| 国产毛片精品视频| 国产精品狼人久久影院观看方式| 成人免费观看男女羞羞视频| 中文字幕亚洲一区二区av在线 | 亚洲最新在线观看| 欧美做爰猛烈大尺度电影无法无天| 亚洲精品一二三| 欧美日韩精品是欧美日韩精品| 日韩和的一区二区| 欧美成人高清电影在线| 国产精品亚洲第一| 亚洲欧美激情视频在线观看一区二区三区 | 久久国产尿小便嘘嘘| 久久久青草青青国产亚洲免观| www.成人在线| 午夜精品福利一区二区三区av| 日韩一区二区精品| 成人黄色国产精品网站大全在线免费观看| 国产精品美女视频| 欧洲中文字幕精品| 久久国产人妖系列| 国产精品短视频| 欧美理论电影在线| 国产91在线|亚洲| 亚洲一区二区视频| 久久久久久综合| 在线免费一区三区| 久草这里只有精品视频| 亚洲私人黄色宅男| 日韩一区二区麻豆国产| av成人老司机| 日本大胆欧美人术艺术动态| 国产精品久久久久影院老司| 欧美日本国产视频| 成人伦理片在线| 免费xxxx性欧美18vr| 亚洲欧洲成人精品av97| 日韩三级在线观看| 色综合亚洲欧洲| 韩国三级在线一区| 亚洲影视资源网| 国产三级精品在线| 欧美丰满一区二区免费视频| 国产一区福利在线| 亚洲aⅴ怡春院| 国产精品入口麻豆九色| 日韩欧美中文字幕制服| 91丝袜国产在线播放| 久久机这里只有精品| 亚洲综合一区二区三区| 久久婷婷成人综合色| 欧美电影影音先锋| 一本色道久久综合精品竹菊| 精品一区二区三区视频在线观看 | 中文字幕一区二区三区乱码在线| 在线91免费看| 色综合久久综合| 国产成人亚洲综合a∨婷婷图片| 日韩成人精品在线| 亚洲免费在线观看视频|