1 /*
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
63 * specified {@code Collection}. If the specified
64 * {@code Collection} contains an object that is not a
65 * {@code Certificate} or {@code CRL}, that object will be
66 * ignored by the Collection {@code CertStore}.
67 * <p>
68 * The {@code Collection} is <b>not</b> copied. Instead, a
69 * reference is used. This allows the caller to subsequently add or
70 * remove {@code Certificates} or {@code CRL}s from the
71 * {@code Collection}, thus changing the set of
72 * {@code Certificates} or {@code CRL}s available to the
73 * Collection {@code CertStore}. The Collection {@code CertStore}
74 * will not modify the contents of the {@code Collection}.
75 * <p>
76 * If the {@code Collection} will be modified by one thread while
77 * another thread is calling a method of a Collection {@code CertStore}
78 * that has been initialized with this {@code Collection}, the
79 * {@code Collection} must have fail-fast iterators.
80 *
81 * @param collection a {@code Collection} of
82 * {@code Certificate}s and {@code CRL}s
83 * @exception NullPointerException if {@code collection} is
84 * {@code null}
85 */
86 public CollectionCertStoreParameters(Collection<?> collection) {
87 if (collection == null)
88 throw new NullPointerException();
89 coll = collection;
90 }
91
92 /**
93 * Creates an instance of {@code CollectionCertStoreParameters} with
94 * the default parameter values (an empty and immutable
95 * {@code Collection}).
96 */
97 public CollectionCertStoreParameters() {
98 coll = Collections.EMPTY_SET;
99 }
100
101 /**
102 * Returns the {@code Collection} from which {@code Certificate}s
103 * and {@code CRL}s are retrieved. This is <b>not</b> a copy of the
|
1 /*
2 * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
63 * specified {@code Collection}. If the specified
64 * {@code Collection} contains an object that is not a
65 * {@code Certificate} or {@code CRL}, that object will be
66 * ignored by the Collection {@code CertStore}.
67 * <p>
68 * The {@code Collection} is <b>not</b> copied. Instead, a
69 * reference is used. This allows the caller to subsequently add or
70 * remove {@code Certificates} or {@code CRL}s from the
71 * {@code Collection}, thus changing the set of
72 * {@code Certificates} or {@code CRL}s available to the
73 * Collection {@code CertStore}. The Collection {@code CertStore}
74 * will not modify the contents of the {@code Collection}.
75 * <p>
76 * If the {@code Collection} will be modified by one thread while
77 * another thread is calling a method of a Collection {@code CertStore}
78 * that has been initialized with this {@code Collection}, the
79 * {@code Collection} must have fail-fast iterators.
80 *
81 * @param collection a {@code Collection} of
82 * {@code Certificate}s and {@code CRL}s
83 * @throws NullPointerException if {@code collection} is
84 * {@code null}
85 */
86 public CollectionCertStoreParameters(Collection<?> collection) {
87 if (collection == null)
88 throw new NullPointerException();
89 coll = collection;
90 }
91
92 /**
93 * Creates an instance of {@code CollectionCertStoreParameters} with
94 * the default parameter values (an empty and immutable
95 * {@code Collection}).
96 */
97 public CollectionCertStoreParameters() {
98 coll = Collections.EMPTY_SET;
99 }
100
101 /**
102 * Returns the {@code Collection} from which {@code Certificate}s
103 * and {@code CRL}s are retrieved. This is <b>not</b> a copy of the
|