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

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

?? authenticationcredential.java

?? jxta平臺的開發包
?? JAVA
字號:
/* * 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: AuthenticationCredential.java,v 1.20 2006/03/17 17:37:08 bondolo Exp $ */package net.jxta.credential;import java.net.URI;import java.util.Enumeration;import java.net.URISyntaxException;import org.apache.log4j.Logger;import org.apache.log4j.Level;import net.jxta.document.Attributable;import net.jxta.document.Attribute;import net.jxta.document.Element;import net.jxta.document.MimeMediaType;import net.jxta.document.StructuredDocument;import net.jxta.document.StructuredDocumentFactory;import net.jxta.document.StructuredDocumentUtils;import net.jxta.document.TextElement;import net.jxta.id.ID;import net.jxta.id.IDFactory;import net.jxta.peergroup.PeerGroup;import net.jxta.service.Service;/** * Authenication credentials are used by JXTA Membership Services as the * basis for applications for peergroup membership. The AuthenticationCredential * provides two important pieces of inforamtion: * <ul> *   <li>the authetication method being requested</li> *   <li>identity information which will be provided to that authentication *   method.</li> * <ul> * * <p/>Not all authentication methods use the identity nformation. * * @see net.jxta.credential.Credential * @see net.jxta.membership.MembershipService * @see net.jxta.membership.Authenticator **/public final class AuthenticationCredential implements Credential {    /**     *  Log4J Logger     **/    private final static transient Logger LOG = Logger.getLogger(AuthenticationCredential.class.getName());        /**     * the authentication method which will be requested when this credential is     * provided during "apply" to a peergroup membership service.     **/    private String authenticationMethod = null;        /**     * Any optional information which is required by the requested authentication     * method.     **/    private Element identityInfo = null;        /**     * The peergroup of this AuthenticationCredential     **/    private final PeerGroup peergroup;        /**     * Creates new AuthenticationCredential     *     * @param peergroup The peergroup context in which this     * AuthenticationCredential is created.     * @param method The authentication method which will be requested when the     * AuthentiationCredential is provided to the peergroup Membership Service.     * Authentication methods are specific to Membership services. Consult the     * Documentation for the Membership service you will be authenticating     * against in order to determine the valid <tt>method</tt> values. Every     * Membership service should support a default authentication method which     * can be specified as <tt>null</null>.      * @param indentityInfo Optional additional information which is used by the      * authentication method or <tt>null</tt>. This information is passed to the      * authentication method during the apply operation of the Membership      * Service. Consult the documentation for the specific Membership Service     * you are using for details on how this information is used (if at all).     **/    public AuthenticationCredential( PeerGroup peergroup, String method, Element indentityInfo ) {        this.peergroup = peergroup;                authenticationMethod = method;                if( null != indentityInfo ) {            this.identityInfo = StructuredDocumentUtils.copyAsDocument(indentityInfo);        }    }    /**     * Creates new AuthenticationCredential     *     * @param peergroup The peergroup context in which this     * AuthenticationCredential is created.     * @param root the document containing the serialized representation of the     * AuthenticationCredential.     **/    public AuthenticationCredential( PeerGroup peergroup, Element root ) {                this.peergroup = peergroup;                initialize( root );    }        /**     * {@inheritDoc}     *     * <p/>AuthenticationCredentials are created in the context of a PeerGroup     * though they are generally independant of peergroups. The intent is that     * the AuthenticationCredential will be passed to the MembershipService     * service of the same peergroup as the AuthenticationCredenitals.     *     * @return PeerGroupID associated with this AuthenticationCredential.     **/    public ID getPeerGroupID() {        return peergroup.getPeerGroupID();    }    /**     * {@inheritDoc}     **/    public ID getPeerID() {        return peergroup.getPeerID();    }    /**     * {@inheritDoc}     **/    public Service getSourceService() {        return null;    }        /**     * {@inheritDoc}     *     * <p/>AuthenticationCredential are never expired. The Authenticator will     * determine the true validity from the included identity info.     **/    public boolean isExpired() {        return false;        }        /**     * {@inheritDoc}     *     * <p/>AuthenticationCredential are always valid, the Authenticator will     * determine the true validity from the included identity info.     **/    public boolean isValid() {        return true;    }        /**     * {@inheritDoc}     *     * <p/>There is no straightforward mechansim for identifying the subject     * unfortunately.     **/    public Object getSubject() {        return null;    }        /**     * Write credential into a document. as is a mime media-type     * specification and provides the form of the document which is being     * requested. Two standard document forms are defined. "text/text" encodes     * the document in a form nice for printing out and "text/xml" which     * provides an XML format.     *     * @param as The mime media type of the encoding format being requested.     * @throws Exception When errors occur.     * @return the StructuredDocument which represents this credential.     **/    public StructuredDocument getDocument(MimeMediaType as) throws Exception {                    StructuredDocument doc = StructuredDocumentFactory.newStructuredDocument( as, "jxta:Cred" );                if( doc instanceof Attributable ) {            ((Attributable)doc).addAttribute( "xmlns:jxta", "http://jxta.org" );            ((Attributable)doc).addAttribute( "xml:space", "preserve" );            ((Attributable)doc).addAttribute( "type", "AuthenticationCredential" );        }                Element e = doc.createElement( "Method", getMethod() );        doc.appendChild( e );        e = doc.createElement( "PeerGroupID", getPeerGroupID().toString() );        doc.appendChild( e );                e = doc.createElement( "PeerID", getPeerID().toString() );        doc.appendChild( e );        if( null != identityInfo ) {            e = doc.createElement( "IdentityInfo");            doc.appendChild( e );                    StructuredDocumentUtils.copyElements( doc, e, identityInfo );            }        return doc;    }    /**     * Returns the authentication method which this AuthenticationCredential     * will be requesting when it is provided to a Membership Service during the     * "Apply" operation.     *     * @return String containing the authentication method being requested.     **/    public String getMethod() {        return authenticationMethod;    }        protected void setMethod( String authenticationMethod ) {        this.authenticationMethod = authenticationMethod;    }        /**     * Returns the StructuredDocument Element containing the identity information which was     * originally provided when this AuthenticationCredential was created.     *     * @return StructuredDocument Element containing the identity information which was     * originally provided when this AuthenticationCredential was created.     **/    public Element getIdentityInfo() {        return (null == identityInfo) ? null : StructuredDocumentUtils.copyAsDocument(identityInfo);    }    /**     *  Process an individual element from the document.     *     *  @param elem the element to be processed.     *  @return true if the element was recognized, otherwise false.     **/    protected boolean handleElement( TextElement elem ) {        if( elem.getName().equals("PeerGroupID")) {            try {                URI gID = new URI( elem.getTextValue() );                ID pgid = IDFactory.fromURI( gID );                if( !pgid.equals( getPeerGroupID() ) ) {                    throw new IllegalArgumentException( "Operation is from a different group. " + pgid + " != " + getPeerGroupID() );                }            } catch ( URISyntaxException badID ) {                throw new IllegalArgumentException( "Unusable ID in advertisement: " + elem.getTextValue() );            }            return true;        }                if( elem.getName().equals("PeerID")) {            try {                URI pID = new URI( elem.getTextValue() );                ID pid = IDFactory.fromURI( pID );                if( !pid.equals( getPeerID() ) ) {                    throw new IllegalArgumentException( "Operation is from a different group. " + pid + " != " + getPeerID() );                }            } catch ( URISyntaxException badID ) {                throw new IllegalArgumentException( "Bad Peer ID in advertisement: " + elem.getTextValue() );            } catch ( ClassCastException badID ) {                throw new IllegalArgumentException( "Id is not a peer id: " + elem.getTextValue() );            }            return true;        }                if( elem.getName().equals("Method")) {            setMethod( elem.getTextValue() );            return true;        }                if( elem.getName().equals("IdentityInfo")) {            Enumeration firstChild = elem.getChildren( );            if( !firstChild.hasMoreElements() ) {                throw new IllegalArgumentException( "Missing identity info" );            }                            identityInfo = StructuredDocumentUtils.copyAsDocument( (Element) firstChild.nextElement() );                        return true;        }                // element was not handled        return false;    }        /**     *  Intialize from a portion of a structured document.     **/    protected void initialize( Element root ) {                if( !TextElement.class.isInstance( root ) ) {            throw new IllegalArgumentException( getClass().getName() + " only supports TextElement" );        }                TextElement doc = (TextElement) root;                String typedoctype = "";        if( root instanceof Attributable ) {            Attribute itsType = ((Attributable)root).getAttribute( "type" );            if( null != itsType ) {                typedoctype = itsType.getValue();            }        }                String doctype = doc.getName();                if( !"jxta:AuthenticationCredential".equals(doctype) && !"jxta:AuthenticationCredential".equals(typedoctype) ) {            throw new IllegalArgumentException( "Could not construct : "            + getClass().getName() + "from doc containing a " + doctype );        }                Enumeration elements = doc.getChildren();                while (elements.hasMoreElements()) {            TextElement elem = (TextElement) elements.nextElement();                        if( !handleElement( elem ) ) {                if (LOG.isEnabledFor(Level.WARN)) {                    LOG.warn("Unhandleded element '" + elem.getName() + "' in " + doc.getName() );                }            };        }                // sanity check time!                // FIXME bondolo@jxta.org 20030409 check things    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产午夜精品在线观看| 欧美年轻男男videosbes| 精品国产免费人成电影在线观看四季 | 欧美色图在线观看| 午夜日韩在线观看| 91精品国产丝袜白色高跟鞋| 蜜桃一区二区三区四区| 欧美一级国产精品| 国产精品一区二区在线观看不卡 | 精品国产露脸精彩对白| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 国产精品一区二区三区四区| 国产日产欧美一区二区视频| 99这里都是精品| 亚洲一区二区av在线| 日韩一区二区视频在线观看| 国产91在线看| 亚洲在线一区二区三区| 欧美一区欧美二区| 国产成人精品一区二区三区网站观看| 国产欧美一区二区精品忘忧草| 99re在线精品| 午夜免费欧美电影| 国产亚洲午夜高清国产拍精品 | 国产成人午夜视频| 亚洲一区在线播放| 久久夜色精品国产噜噜av| av亚洲精华国产精华| 午夜影视日本亚洲欧洲精品| www国产精品av| 色久优优欧美色久优优| 九九**精品视频免费播放| 国产精品女人毛片| 欧美伦理视频网站| av不卡免费电影| 日韩福利视频网| 国产精品理论片| 欧美成人三级在线| 在线观看日韩av先锋影音电影院| 久草在线在线精品观看| 亚洲自拍偷拍综合| 国产欧美一区二区三区在线看蜜臀| 欧美日韩dvd在线观看| 成人精品国产一区二区4080| 奇米888四色在线精品| 亚洲柠檬福利资源导航| 国产亚洲欧美中文| 欧美成人精品福利| 欧美日韩午夜在线视频| 欧美精品自拍偷拍| 成人性视频免费网站| 美女被吸乳得到大胸91| 中文字幕欧美一| 久久精品日产第一区二区三区高清版| 666欧美在线视频| 97久久超碰国产精品电影| 久久成人精品无人区| 亚洲成a天堂v人片| 亚洲激情网站免费观看| 亚洲国产成人私人影院tom| 久久综合资源网| 欧美一区永久视频免费观看| 欧美色手机在线观看| 色综合色狠狠综合色| 成人av资源在线| 国产黄色91视频| 国产精品一级片| 精品在线观看免费| 老汉av免费一区二区三区| 久久激情综合网| 另类小说色综合网站| 免费人成网站在线观看欧美高清| 亚洲激情欧美激情| 亚洲国产aⅴ天堂久久| 洋洋av久久久久久久一区| 亚洲精选在线视频| 亚洲激情在线激情| 午夜精品久久久| 天天色天天操综合| 日本vs亚洲vs韩国一区三区二区| 日韩不卡一区二区| 久久精品国产99| 精品写真视频在线观看| 国内久久婷婷综合| 国产精品乡下勾搭老头1| 国产精品18久久久久久vr| 国产乱码字幕精品高清av | 国产精品视频麻豆| 国产精品福利影院| 亚洲激情校园春色| 日日夜夜一区二区| 久久成人av少妇免费| 国产精品一级黄| 91网站最新地址| 欧美亚洲国产一区在线观看网站 | 黑人巨大精品欧美黑白配亚洲 | 91美女片黄在线观看91美女| 色婷婷av一区二区| 欧美午夜寂寞影院| 欧美一区二区三区婷婷月色| 欧美xxxx在线观看| 久久久久99精品一区| 亚洲天堂精品视频| 天天av天天翘天天综合网色鬼国产 | 精品粉嫩aⅴ一区二区三区四区| 久久久国产精华| 亚洲免费观看高清完整版在线| 无码av免费一区二区三区试看| 韩国成人精品a∨在线观看| 99久久99久久精品免费观看| 欧美三级韩国三级日本一级| 欧美精品一区视频| 亚洲精品日韩专区silk| 精品一区二区综合| 91在线观看美女| 欧美tickling网站挠脚心| 亚洲日穴在线视频| 美女视频第一区二区三区免费观看网站| 从欧美一区二区三区| 欧美色老头old∨ideo| 久久久综合视频| 亚洲国产日日夜夜| 国产高清精品在线| 26uuu国产一区二区三区| 亚洲人成网站精品片在线观看| 免费不卡在线观看| 91片黄在线观看| 精品福利在线导航| 亚洲第一会所有码转帖| 国产xxx精品视频大全| 欧美丰满少妇xxxxx高潮对白| 欧美国产精品劲爆| 蜜臀av性久久久久av蜜臀妖精| 91女厕偷拍女厕偷拍高清| 亚洲精品在线三区| 午夜视频在线观看一区| 91在线一区二区| 精品国产一区二区三区久久久蜜月 | 337p日本欧洲亚洲大胆精品| 亚洲国产日产av| 99热精品国产| 国产日韩影视精品| 久久精品二区亚洲w码| 欧美亚洲尤物久久| 亚洲日本va午夜在线电影| 国产精品1区2区3区| 欧美一区二区在线看| 亚洲在线视频网站| 色综合天天视频在线观看| 国产农村妇女精品| 国内精品伊人久久久久av一坑| 7878成人国产在线观看| 亚洲综合激情网| 色嗨嗨av一区二区三区| 中文字幕一区二区三区视频| 国产乱子伦一区二区三区国色天香| 欧美一区二区三区视频免费| 香蕉乱码成人久久天堂爱免费| 91麻豆免费观看| 国产精品久久毛片a| 大桥未久av一区二区三区中文| 精品国产百合女同互慰| 日韩欧美在线一区二区三区| 国产精品系列在线观看| 在线观看中文字幕不卡| 国产精品女同一区二区三区| 国产精品正在播放| 国产欧美日韩另类视频免费观看| 国产精品一二三在| 26uuu亚洲综合色欧美| 91麻豆国产福利精品| 国产精品欧美极品| 91香蕉国产在线观看软件| 亚洲精品成人悠悠色影视| 色综合中文字幕国产 | 99久久国产综合精品色伊| 国产精品久久久久桃色tv| 99久久精品久久久久久清纯| 亚洲视频在线一区| 欧美性猛交xxxx乱大交退制版| 亚洲国产成人精品视频| 欧美一区午夜视频在线观看| 精品一区二区影视| 国产精品亲子乱子伦xxxx裸| 99这里都是精品| 亚洲午夜三级在线| 日韩一区二区麻豆国产| 国产原创一区二区三区| 中文字幕精品综合| 在线视频一区二区免费| 婷婷开心激情综合| 久久亚洲一区二区三区四区| www.色精品| 亚洲 欧美综合在线网络| 日韩一区二区免费高清| 成人国产视频在线观看| 亚洲午夜私人影院| 久久婷婷成人综合色| 91在线视频播放| 日本成人在线一区|