1 /*
2 * Copyright (c) 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
108 private final URI configuration;
109 private final Map<String,ProtectionParameter> protectionParams;
110
111 /**
112 * Constructs a DomainLoadStoreParameter for a keystore domain with
113 * the parameters used to protect keystore data.
114 *
115 * @param configuration identifier for the domain configuration data.
116 * The name of the target domain should be specified in the
117 * {@code java.net.URI} fragment component when it is necessary
118 * to distinguish between several domain configurations at the
119 * same location.
120 *
121 * @param protectionParams the map from keystore name to the parameter
122 * used to protect keystore data.
123 * A {@code java.util.Collections.EMPTY_MAP} should be used
124 * when protection parameters are not required or when they have
125 * been specified by properties in the domain configuration data.
126 * It is cloned to prevent subsequent modification.
127 *
128 * @exception NullPointerException if {@code configuration} or
129 * {@code protectionParams} is {@code null}
130 */
131 public DomainLoadStoreParameter(URI configuration,
132 Map<String,ProtectionParameter> protectionParams) {
133 if (configuration == null || protectionParams == null) {
134 throw new NullPointerException("invalid null input");
135 }
136 this.configuration = configuration;
137 this.protectionParams =
138 Collections.unmodifiableMap(new HashMap<>(protectionParams));
139 }
140
141 /**
142 * Gets the identifier for the domain configuration data.
143 *
144 * @return the identifier for the configuration data
145 */
146 public URI getConfiguration() {
147 return configuration;
148 }
|
1 /*
2 * Copyright (c) 2013, 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
108 private final URI configuration;
109 private final Map<String,ProtectionParameter> protectionParams;
110
111 /**
112 * Constructs a DomainLoadStoreParameter for a keystore domain with
113 * the parameters used to protect keystore data.
114 *
115 * @param configuration identifier for the domain configuration data.
116 * The name of the target domain should be specified in the
117 * {@code java.net.URI} fragment component when it is necessary
118 * to distinguish between several domain configurations at the
119 * same location.
120 *
121 * @param protectionParams the map from keystore name to the parameter
122 * used to protect keystore data.
123 * A {@code java.util.Collections.EMPTY_MAP} should be used
124 * when protection parameters are not required or when they have
125 * been specified by properties in the domain configuration data.
126 * It is cloned to prevent subsequent modification.
127 *
128 * @throws NullPointerException if {@code configuration} or
129 * {@code protectionParams} is {@code null}
130 */
131 public DomainLoadStoreParameter(URI configuration,
132 Map<String,ProtectionParameter> protectionParams) {
133 if (configuration == null || protectionParams == null) {
134 throw new NullPointerException("invalid null input");
135 }
136 this.configuration = configuration;
137 this.protectionParams =
138 Collections.unmodifiableMap(new HashMap<>(protectionParams));
139 }
140
141 /**
142 * Gets the identifier for the domain configuration data.
143 *
144 * @return the identifier for the configuration data
145 */
146 public URI getConfiguration() {
147 return configuration;
148 }
|