@@ -34,76 +34,101 @@ public interface IdentityService {
3434 /**
3535 * Creates a new identity with the given name.
3636 *
37- * @param identityName the name of the identity to be created.
37+ * @param identityName
38+ * the name of the identity to be created.
3839 * @return {@code true} if the identity with the given name has been created as
3940 * part of the method call or {@code false} if the identity already
40- * exist.
41- * @throws KuraException if a failure occurs in creating the identity.
41+ * exists.
42+ * @throws KuraException
43+ * if a failure occurs in creating the identity.
4244 */
4345 public boolean createIdentity (final String identityName ) throws KuraException ;
4446
47+ /**
48+ * Creates a new identity using the provided configuration.
49+ *
50+ * @param identityConfiguration
51+ * the identity configuration including identity
52+ * name and optional configuration components.
53+ * @return {@code true} if the identity with the given name has been created as
54+ * part of the method call or {@code false} if the identity already
55+ * exists.
56+ * @throws KuraException
57+ * if a failure occurs in creating the identity.
58+ * @since 2.8.0
59+ */
60+ public boolean createIdentity (final IdentityConfiguration identityConfiguration ) throws KuraException ;
61+
4562 /**
4663 * Deletes the identity with the given name, including temporary identities.
4764 *
48- * @param identityName the name of the identity to be deleted.
65+ * @param identityName
66+ * the name of the identity to be deleted.
4967 * @return {@code true} if the identity with the given name has been deleted as
5068 * part of the method call or {@code false} if the identity does not
5169 * exist.
52- * @throws KuraException if a failure occurs in deleting the identity.
70+ * @throws KuraException
71+ * if a failure occurs in deleting the identity.
5372 */
5473 public boolean deleteIdentity (final String identityName ) throws KuraException ;
5574
5675 /**
5776 * Returns the configuration of all existing identities.
5877 *
59- * @param componentsToReturn the set of {@link IdentityConfigurationComponent}
60- * types to be returned. If the set is empty a
61- * {@link IdentityConfiguration} will be returned for
62- * each defined identity with an empty component list.
63- * This can be used to get the name for all defined
64- * identities.
78+ * @param componentsToReturn
79+ * the set of {@link IdentityConfigurationComponent}
80+ * types to be returned. If the set is empty a
81+ * {@link IdentityConfiguration} will be returned for
82+ * each defined identity with an empty component list.
83+ * This can be used to get the name for all defined
84+ * identities.
6585 *
6686 * @return the list of {@link IdentityConfiguration}s. An empty list will be
6787 * returned if no identities are defined.
68- * @throws KuraException if a failure occurs in retrieving identity
69- * configurations.
88+ * @throws KuraException
89+ * if a failure occurs in retrieving identity
90+ * configurations.
7091 */
7192 public List <IdentityConfiguration > getIdentitiesConfiguration (
72- Set <Class <? extends IdentityConfigurationComponent >> componentsToReturn )
73- throws KuraException ;
93+ Set <Class <? extends IdentityConfigurationComponent >> componentsToReturn ) throws KuraException ;
7494
7595 /**
7696 * Returns the configuration of the identity with the given name.
7797 *
78- * @param identityName the identity name.
79- * @param componentsToReturn the set of {@link IdentityConfigurationComponent}
80- * types to be returned.
98+ * @param identityName
99+ * the identity name.
100+ * @param componentsToReturn
101+ * the set of {@link IdentityConfigurationComponent}
102+ * types to be returned.
81103 * @return the configuration of the requested identity or an empty optional if
82104 * the identity does not exist.
83- * @throws KuraException if a failure occurs in retrieving identity
84- * configuration.
105+ * @throws KuraException
106+ * if a failure occurs in retrieving identity
107+ * configuration.
85108 */
86109 public Optional <IdentityConfiguration > getIdentityConfiguration (final String identityName ,
87- Set <Class <? extends IdentityConfigurationComponent >> componentsToReturn )
88- throws KuraException ;
110+ Set <Class <? extends IdentityConfigurationComponent >> componentsToReturn ) throws KuraException ;
89111
90112 /**
91113 * Returns the default configuration for the identity with the given name, this
92114 * method should succeed even if the identity does not exist. The result should
93115 * be the same configuration returned by the
94- * {@link IdentityService#getIdentityConfiguration(String, List )}
116+ * {@link IdentityService#getIdentityConfiguration(String, Set )}
95117 * method for an identity that has just been created with the
96118 * {@link IdentityService#createIdentity(String)} method.
97119 *
98120 * This method can be useful for example to allow a user interface to show the
99121 * initial identity configuration to the user before creating it.
100122 *
101- * @param identityName the identity name.
102- * @param componentsToReturn the set of {@link IdentityConfigurationComponent}
103- * types to be returned.
123+ * @param identityName
124+ * the identity name.
125+ * @param componentsToReturn
126+ * the set of {@link IdentityConfigurationComponent}
127+ * types to be returned.
104128 * @return the default configuration for the requested identity
105- * @throws KuraException if a failure occurs in retrieving identity
106- * configuration.
129+ * @throws KuraException
130+ * if a failure occurs in retrieving identity
131+ * configuration.
107132 */
108133 public IdentityConfiguration getIdentityDefaultConfiguration (final String identityName ,
109134 Set <Class <? extends IdentityConfigurationComponent >> componentsToReturn ) throws KuraException ;
@@ -112,48 +137,54 @@ public IdentityConfiguration getIdentityDefaultConfiguration(final String identi
112137 * Validates the provided identity configuration without performing any
113138 * change to the system.
114139 *
115- * @param identityConfiguration the identity configuration that should be
116- * validated.
117- * @throws KuraException if the provided identity configuration is not
118- * valid.
140+ * @param identityConfiguration
141+ * the identity configuration that should be
142+ * validated.
143+ * @throws KuraException
144+ * if the provided identity configuration is not
145+ * valid.
119146 */
120- public void validateIdentityConfiguration (final IdentityConfiguration identityConfiguration )
121- throws KuraException ;
147+ public void validateIdentityConfiguration (final IdentityConfiguration identityConfiguration ) throws KuraException ;
122148
123149 /**
124150 * Updates the configuration of the given identity for the provided
125151 * {@link IdentityConfigurationComponent} types.
126152 * The configuration of the identities or identity
127153 * components that have not been provided will not be modified.
128154 *
129- * @param identityConfiguration the identity configuration that should be
130- * updated.
131- * @throws KuraException if a failure occurs updating identity
132- * configuration.
155+ * @param identityConfiguration
156+ * the identity configuration that should be
157+ * updated.
158+ * @throws KuraException
159+ * if a failure occurs updating identity
160+ * configuration.
133161 */
134- public void updateIdentityConfiguration (final IdentityConfiguration identityConfiguration )
135- throws KuraException ;
162+ public void updateIdentityConfiguration (final IdentityConfiguration identityConfiguration ) throws KuraException ;
136163
137164 /**
138165 * Defines a new permission.
139166 *
140- * @param permission the permission to be created.
167+ * @param permission
168+ * the permission to be created.
141169 * @return {@code true} if the permission has been created as
142170 * part of the method call or {@code false} if the permission already
143171 * exist.
144- * @throws KuraException if a failure occurs creating the permission.
172+ * @throws KuraException
173+ * if a failure occurs creating the permission.
145174 */
146175 public boolean createPermission (final Permission permission ) throws KuraException ;
147176
148177 /**
149178 * Removes an existing permission. The permission will also be removed from all
150179 * identities assigned to it.
151180 *
152- * @param permission the permission to be deleted.
181+ * @param permission
182+ * the permission to be deleted.
153183 * @return {@code true} if the permission has been deleted as
154184 * part of the method call or {@code false} if the permission does not
155185 * exist.
156- * @throws KuraException if a failure occurs deleting the permission.
186+ * @throws KuraException
187+ * if a failure occurs deleting the permission.
157188 */
158189 public boolean deletePermission (final Permission permission ) throws KuraException ;
159190
@@ -163,17 +194,20 @@ public void updateIdentityConfiguration(final IdentityConfiguration identityConf
163194 *
164195 * @return the set of permissions that are currently defined within the
165196 * framework.
166- * @throws KuraException if a failure occurs retrieving the permission set.
197+ * @throws KuraException
198+ * if a failure occurs retrieving the permission set.
167199 */
168200 public Set <Permission > getPermissions () throws KuraException ;
169201
170202 /**
171203 * Computes a {@link PasswordHash} for the given plaintext password. The
172204 * password array will be overwritten at the end of the operation.
173205 *
174- * @param password the plaintext password.
206+ * @param password
207+ * the plaintext password.
175208 * @return the computed password hash.
176- * @throws KuraException if a failure occurs computing the password hash
209+ * @throws KuraException
210+ * if a failure occurs computing the password hash
177211 */
178212 public PasswordHash computePasswordHash (final char [] password ) throws KuraException ;
179213
@@ -183,9 +217,10 @@ public void updateIdentityConfiguration(final IdentityConfiguration identityConf
183217 *
184218 * @param identityName
185219 * @param password
186- * @throws KuraException if the passwords do not match of if a failure occurs
187- * while
188- * performing the check.
220+ * @throws KuraException
221+ * if the passwords do not match of if a failure occurs
222+ * while
223+ * performing the check.
189224 */
190225 public void checkPassword (final String identityName , final char [] password ) throws KuraException ;
191226
@@ -195,30 +230,31 @@ public void updateIdentityConfiguration(final IdentityConfiguration identityConf
195230 *
196231 * @param identityName
197232 * @param permission
198- * @throws KuraException if the provided permissio is not currently assigned to
199- * the given identity or if occurs while performing the
200- * check.
233+ * @throws KuraException
234+ * if the provided permissio is not currently assigned to
235+ * the given identity or if occurs while performing the
236+ * check.
201237 *
202238 */
203239 public void checkPermission (final String identityName , final Permission permission ) throws KuraException ;
204240
205241 /**
206- * Creates a temporary identity that is not persisted and has automatic expiration.
207- * Temporary identities behave like regular identities but are stored in-memory only
208- * and will be automatically removed after the specified lifetime period.
209- * The identity name is extracted from {@link IdentityConfiguration#getName()}.
210- * If a {@link PasswordConfiguration} with a new password is provided, the password
211- * will be validated and hashed before storage.
242+ * Creates a temporary identity that is not persisted and has automatic
243+ * expiration. Temporary identities behave like regular identities but are
244+ * stored in-memory only and are automatically removed after the specified
245+ * lifetime period.
212246 *
213- * @param configuration the identity configuration including the identity name, passwords,
214- * certificates, tokens, permissions, etc.
215- * @param lifetime the duration before automatic expiration. The identity will be automatically
216- * removed after this period.
217- * @throws KuraException if a failure occurs in creating the temporary identity or if an identity
218- * with the given name already exists (either regular or temporary).
247+ * @param identityName
248+ * the name of the temporary identity to create.
249+ * @param lifetime
250+ * the duration before automatic expiration. The identity
251+ * will be automatically removed after this period.
252+ * @throws KuraException
253+ * if a failure occurs in creating the temporary identity
254+ * or if an identity with the given name already exists
255+ * (either regular or temporary).
219256 * @since 2.8.0
220257 */
221- public void createTemporaryIdentity (final IdentityConfiguration configuration ,
222- final Duration lifetime ) throws KuraException ;
258+ public void createTemporaryIdentity (final String identityName , final Duration lifetime ) throws KuraException ;
223259
224260}
0 commit comments