Source Code Cross Referenced for CollectionCertStoreParameters.java in  » 6.0-JDK-Core » security » java » security » cert » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » security » java.security.cert 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 2000-2006 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025
026        package java.security.cert;
027
028        import java.io.Serializable;
029        import java.util.Collection;
030        import java.util.Collections;
031
032        /**
033         * Parameters used as input for the Collection <code>CertStore</code>
034         * algorithm.
035         * <p>
036         * This class is used to provide necessary configuration parameters
037         * to implementations of the Collection <code>CertStore</code>
038         * algorithm. The only parameter included in this class is the
039         * <code>Collection</code> from which the <code>CertStore</code> will
040         * retrieve certificates and CRLs.
041         * <p>
042         * <b>Concurrent Access</b>
043         * <p>
044         * Unless otherwise specified, the methods defined in this class are not
045         * thread-safe. Multiple threads that need to access a single
046         * object concurrently should synchronize amongst themselves and
047         * provide the necessary locking. Multiple threads each manipulating
048         * separate objects need not synchronize.
049         *
050         * @version 	1.16 05/05/07
051         * @since	1.4
052         * @author	Steve Hanna
053         * @see         java.util.Collection
054         * @see         CertStore
055         */
056        public class CollectionCertStoreParameters implements 
057                CertStoreParameters {
058
059            private Collection<?> coll;
060
061            /**
062             * Creates an instance of <code>CollectionCertStoreParameters</code>
063             * which will allow certificates and CRLs to be retrieved from the
064             * specified <code>Collection</code>. If the specified
065             * <code>Collection</code> contains an object that is not a
066             * <code>Certificate</code> or <code>CRL</code>, that object will be
067             * ignored by the Collection <code>CertStore</code>.
068             * <p>
069             * The <code>Collection</code> is <b>not</b> copied. Instead, a
070             * reference is used. This allows the caller to subsequently add or
071             * remove <code>Certificates</code> or <code>CRL</code>s from the
072             * <code>Collection</code>, thus changing the set of
073             * <code>Certificates</code> or <code>CRL</code>s available to the
074             * Collection <code>CertStore</code>. The Collection <code>CertStore</code>
075             * will not modify the contents of the <code>Collection</code>.
076             * <p>
077             * If the <code>Collection</code> will be modified by one thread while
078             * another thread is calling a method of a Collection <code>CertStore</code>
079             * that has been initialized with this <code>Collection</code>, the
080             * <code>Collection</code> must have fail-fast iterators.
081             *
082             * @param collection a <code>Collection</code> of
083             *        <code>Certificate</code>s and <code>CRL</code>s
084             * @exception NullPointerException if <code>collection</code> is
085             * <code>null</code>
086             */
087            public CollectionCertStoreParameters(Collection<?> collection) {
088                if (collection == null)
089                    throw new NullPointerException();
090                coll = collection;
091            }
092
093            /**
094             * Creates an instance of <code>CollectionCertStoreParameters</code> with 
095             * the default parameter values (an empty and immutable 
096             * <code>Collection</code>).
097             */
098            public CollectionCertStoreParameters() {
099                coll = Collections.EMPTY_SET;
100            }
101
102            /**
103             * Returns the <code>Collection</code> from which <code>Certificate</code>s
104             * and <code>CRL</code>s are retrieved. This is <b>not</b> a copy of the
105             * <code>Collection</code>, it is a reference. This allows the caller to
106             * subsequently add or remove <code>Certificates</code> or
107             * <code>CRL</code>s from the <code>Collection</code>.
108             *
109             * @return the <code>Collection</code> (never null)
110             */
111            public Collection<?> getCollection() {
112                return coll;
113            }
114
115            /**
116             * Returns a copy of this object. Note that only a reference to the
117             * <code>Collection</code> is copied, and not the contents.
118             *
119             * @return the copy
120             */
121            public Object clone() {
122                try {
123                    return super .clone();
124                } catch (CloneNotSupportedException e) {
125                    /* Cannot happen */
126                    throw new InternalError(e.toString());
127                }
128            }
129
130            /**
131             * Returns a formatted string describing the parameters.
132             *
133             * @return a formatted string describing the parameters
134             */
135            public String toString() {
136                StringBuffer sb = new StringBuffer();
137                sb.append("CollectionCertStoreParameters: [\n");
138                sb.append("  collection: " + coll + "\n");
139                sb.append("]");
140                return sb.toString();
141            }
142        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.