PageRenderTime 61ms CodeModel.GetById 30ms RepoModel.GetById 1ms app.codeStats 0ms

/domain-management/src/main/java/org/jboss/as/domain/management/logging/DomainManagementLogger.java

https://github.com/ehsavoie/wildfly-core
Java | 1590 lines | 385 code | 218 blank | 987 comment | 0 complexity | 10ee64d91815443e69823a64551fff71 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. /*
  2. * JBoss, Home of Professional Open Source.
  3. * Copyright 2011, Red Hat, Inc., and individual contributors
  4. * as indicated by the @author tags. See the copyright.txt file in the
  5. * distribution for a full listing of individual contributors.
  6. *
  7. * This is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation; either version 2.1 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This software is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this software; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21. */
  22. package org.jboss.as.domain.management.logging;
  23. import static org.jboss.logging.Logger.Level.ERROR;
  24. import static org.jboss.logging.Logger.Level.WARN;
  25. import java.io.IOException;
  26. import java.security.GeneralSecurityException;
  27. import java.util.Collection;
  28. import java.util.Set;
  29. import javax.naming.NamingException;
  30. import javax.security.auth.callback.Callback;
  31. import javax.security.auth.callback.UnsupportedCallbackException;
  32. import javax.security.auth.login.LoginException;
  33. import javax.xml.stream.Location;
  34. import javax.xml.stream.XMLStreamException;
  35. import org.jboss.as.controller.OperationFailedException;
  36. import org.jboss.as.controller.PathAddress;
  37. import org.jboss.as.controller.PathElement;
  38. import org.jboss.as.domain.management.security.password.PasswordValidationException;
  39. import org.jboss.logging.BasicLogger;
  40. import org.jboss.logging.Logger;
  41. import org.jboss.logging.annotations.Cause;
  42. import org.jboss.logging.annotations.LogMessage;
  43. import org.jboss.logging.annotations.Message;
  44. import org.jboss.logging.annotations.MessageLogger;
  45. import org.jboss.logging.annotations.Param;
  46. import org.jboss.msc.service.StartException;
  47. /**
  48. * Date: 05.11.2011
  49. *
  50. * @author <a href="mailto:jperkins@redhat.com">James R. Perkins</a>
  51. * @author <a href="mailto:darran.lofthouse@jboss.com">Darran Lofthouse</a>
  52. * @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
  53. * @author <a href="mailto:bgaisford@punagroup.com">Brandon Gaisford</a>
  54. */
  55. @MessageLogger(projectCode = "WFLYDM", length = 4)
  56. public interface DomainManagementLogger extends BasicLogger {
  57. /**
  58. * A logger with a category of the package name.
  59. */
  60. DomainManagementLogger ROOT_LOGGER = Logger.getMessageLogger(DomainManagementLogger.class, "org.jboss.as.domain.management");
  61. /**
  62. * A logger with category specifically for logging per request security related messages.
  63. */
  64. DomainManagementLogger SECURITY_LOGGER = Logger.getMessageLogger(DomainManagementLogger.class, "org.jboss.as.domain.management.security");
  65. /**
  66. * Logs a warning message indicating the user and password were found in the properties file.
  67. */
  68. @LogMessage(level = WARN)
  69. @Message(id = 1, value = "Properties file defined with default user and password, this will be easy to guess.")
  70. void userAndPasswordWarning();
  71. /**
  72. * Logs a warning message indicating that whitespace has been trimmed from the password when it was
  73. * decoded from Base64.
  74. */
  75. @LogMessage(level = WARN)
  76. @Message(id = 2, value = "Whitespace has been trimmed from the Base64 representation of the secret identity.")
  77. void whitespaceTrimmed();
  78. /**
  79. * Logs a warning message indicating that the password attribute is deprecated that that keystore-password
  80. * should be used instead.
  81. */
  82. @LogMessage(level = WARN)
  83. @Message(id = 3, value = "The attribute 'password' is deprecated, 'keystore-password' should be used instead.")
  84. void passwordAttributeDeprecated();
  85. /**
  86. * Logs a message indicating that the name of the realm does not match the name used in the properties file.
  87. */
  88. @LogMessage(level = WARN)
  89. @Message(id = 4, value = "The realm name of the defined security realm '%s' does not match the realm name within the properties file '%s'.")
  90. void realmMisMatch(final String realmRealmName, final String fileRealmName);
  91. // /**
  92. // * Logs a warning message indicating it failed to retrieving groups from the LDAP provider
  93. // */
  94. // @LogMessage(level = WARN)
  95. // @Message(id = 5, value = "Failed to retrieving groups from the LDAP provider.")
  96. // void failedRetrieveLdapGroups(@Cause Throwable cause);
  97. // /**
  98. // * log warning message it was not able to retrieving matching groups from the pattern
  99. // */
  100. // @LogMessage(level = WARN)
  101. // @Message(id = 6, value = "Failed to retrieving matching groups from the pattern, check the regular expression for pattern attribute.")
  102. // void failedRetrieveMatchingLdapGroups(@Cause Throwable cause);
  103. // /**
  104. // * log warning message it was not able to retriev matching groups from the pattern
  105. // */
  106. // @LogMessage(level = WARN)
  107. // @Message(id = 7, value = "Failed to retrieve matching groups from the groups, check the regular expression for groups attribute.")
  108. // void failedRetrieveMatchingGroups();
  109. // /**
  110. // * log warning message it was not able to retrieve matching groups from the pattern
  111. // */
  112. // @LogMessage(level = WARN)
  113. // @Message(id = 8, value = "Failed to retrieve attribute %s from search result.")
  114. // void failedRetrieveLdapAttribute(String attribute);
  115. /**
  116. * Creates an exception indicating the verification could not be performed.
  117. *
  118. * @param cause the cause of the error.
  119. *
  120. * @return an {@link IOException} for the error.
  121. */
  122. @Message(id = 9, value = "Unable to perform verification")
  123. IOException cannotPerformVerification(@Cause Throwable cause);
  124. /**
  125. * Creates an exception indicating the realm was invalid.
  126. *
  127. * @param realm the invalid realm.
  128. * @param expectedRealm the expected realm.
  129. *
  130. * @return an {@link IllegalStateException} for the error.
  131. */
  132. @Message(id = 10, value = "Invalid Realm '%s' expected '%s'")
  133. IllegalStateException invalidRealm(String realm, String expectedRealm);
  134. /**
  135. * Creates an exception indicating the referral for authentication could not be followed.
  136. *
  137. * @param name the invalid name.
  138. *
  139. * @return a {@link NamingException} for the error.
  140. */
  141. @Message(id = 11, value = "Can't follow referral for authentication: %s")
  142. NamingException nameNotFound(String name);
  143. // /**
  144. // * Creates an exception indicating no authentication mechanism was defined in the security realm.
  145. // *
  146. // * @return an {@link IllegalStateException} for the error.
  147. // */
  148. //@Message(id = 12, value = "No authentication mechanism defined in security realm.")
  149. //IllegalStateException noAuthenticationDefined();
  150. /**
  151. * Creates an exception indicating no username was provided.
  152. *
  153. * @return an {@link IOException} for the error.
  154. */
  155. @Message(id = 13, value = "No username provided.")
  156. IOException noUsername();
  157. /**
  158. * Creates an exception indicating no password was provided.
  159. *
  160. * @return an {@link IOException} for the error.
  161. */
  162. @Message(id = 14, value = "No password to verify.")
  163. IOException noPassword();
  164. // /**
  165. // * Creates an exception indicating that one of {@code attr1} or {@code attr2} is required.
  166. // *
  167. // * @param attr1 the first attribute.
  168. // * @param attr2 the second attribute.
  169. // *
  170. // * @return an {@link IllegalArgumentException} for the error.
  171. // */
  172. // @Message(id = 15, value = "One of '%s' or '%s' required.")
  173. // IllegalArgumentException oneOfRequired(String attr1, String attr2);
  174. /**
  175. * Creates an exception indicating the realm is not supported.
  176. *
  177. * @param callback the callback used to create the exception.
  178. *
  179. * @return an {@link UnsupportedCallbackException} for the error.
  180. */
  181. @Message(id = 16, value = "Realm choice not currently supported.")
  182. UnsupportedCallbackException realmNotSupported(@Param Callback callback);
  183. /**
  184. * Creates an exception indicating the properties could not be loaded.
  185. *
  186. * @param cause the cause of the error.
  187. *
  188. * @return a {@link StartException} for the error.
  189. */
  190. @Message(id = 17, value = "Unable to load properties")
  191. StartException unableToLoadProperties(@Cause Throwable cause);
  192. /**
  193. * Creates an exception indicating the inability to start the service.
  194. *
  195. * @param cause the cause of the error.
  196. *
  197. * @return a {@link StartException} for the error.
  198. */
  199. @Message(id = 18, value = "Unable to start service")
  200. StartException unableToStart(@Cause Throwable cause);
  201. /**
  202. * A message indicating the user, represented by the {@code username} parameter, was not found.
  203. *
  204. * @param username the username not found.
  205. *
  206. * @return the message.
  207. */
  208. @Message(id = 19, value = "User '%s' not found.")
  209. String userNotFound(String username);
  210. /**
  211. * Creates an exception indicating the user, represented by the {@code username} parameter, was not found in the
  212. * directory.
  213. *
  214. * @param username the username not found.
  215. *
  216. * @return an {@link IOException} for the error.
  217. */
  218. @Message(id = 20, value = "User '%s' not found in directory.")
  219. NamingException userNotFoundInDirectory(String username);
  220. /**
  221. * Creates an exception indicating that no java.io.Console is available.
  222. *
  223. * @return a {@link IllegalStateException} for the error.
  224. */
  225. @Message(id = 21, value = "No java.io.Console available to interact with user.")
  226. IllegalStateException noConsoleAvailable();
  227. // /**
  228. // * A message indicating JBOSS_HOME not set.
  229. // *
  230. // * @return a {@link String} for the message.
  231. // */
  232. //@Message(id = 22, value = "JBOSS_HOME environment variable not set.")
  233. //String jbossHomeNotSet();
  234. /**
  235. * A message indicating no mgmt-users.properties have been found.
  236. *
  237. * @return a {@link String} for the message.
  238. */
  239. @Message(id = 23, value = "No %s files found.")
  240. String propertiesFileNotFound(String file);
  241. /**
  242. * A message prompting the user to enter the details of the user being added.
  243. *
  244. * @return a {@link String} for the message.
  245. */
  246. @Message(id = Message.NONE, value = "Enter the details of the new user to add.")
  247. String enterNewUserDetails();
  248. /**
  249. * The prompt to obtain the realm from the user.
  250. *
  251. * @param realm - the default realm.
  252. *
  253. * @return a {@link String} for the message.
  254. */
  255. @Message(id = Message.NONE, value = "Realm (%s)")
  256. String realmPrompt(String realm);
  257. /**
  258. * The prompt to obtain the new username from the user.
  259. *
  260. * @return a {@link String} for the message.
  261. */
  262. @Message(id = Message.NONE, value = "Username")
  263. String usernamePrompt();
  264. /**
  265. * The prompt to obtain the new username from the user.
  266. *
  267. * @param defaultUsername - The default username if no value is entered.
  268. *
  269. * @return a {@link String} for the message.
  270. */
  271. @Message(id = Message.NONE, value = "Username (%s)")
  272. String usernamePrompt(String defaultUsername);
  273. /**
  274. * The error message if no username is entered.
  275. *
  276. * @return a {@link String} for the message.
  277. */
  278. @Message(id = 24, value = "No Username entered, exiting.")
  279. String noUsernameExiting();
  280. /**
  281. * The prompt to obtain the password from the user.
  282. *
  283. * @return a {@link String} for the message.
  284. */
  285. @Message(id = Message.NONE, value = "Password")
  286. String passwordPrompt();
  287. /**
  288. * The error message if no password is entered.
  289. *
  290. * @return a {@link String} for the message.
  291. */
  292. @Message(id = 25, value = "No Password entered, exiting.")
  293. String noPasswordExiting();
  294. /**
  295. * The prompt to obtain the password confirmation from the user.
  296. *
  297. * @return a {@link String} for the message.
  298. */
  299. @Message(id = Message.NONE, value = "Re-enter Password")
  300. String passwordConfirmationPrompt();
  301. /**
  302. * The error message if the passwords do not match.
  303. *
  304. * @return a {@link String} for the message.
  305. */
  306. @Message(id = 26, value = "The passwords do not match.")
  307. String passwordMisMatch();
  308. /**
  309. * The error message if the username is not alpha numeric
  310. *
  311. * @return a {@link String} for the message.
  312. */
  313. @Message(id = 28, value = "Username must be alphanumeric with the exception of the following accepted symbols (%s)")
  314. String usernameNotAlphaNumeric(String symbols);
  315. /**
  316. * Confirmation of the user being added.
  317. *
  318. * @param username - The new username.
  319. * @param realm - The realm the user is being added for.
  320. *
  321. * @return a {@link String} for the message.
  322. */
  323. @Message(id = Message.NONE, value = "About to add user '%s' for realm '%s'")
  324. String aboutToAddUser(String username, String realm);
  325. /**
  326. * Prompt to ask user to confirm the previous statement is correct.
  327. *
  328. * Do not include the translation specific yes/no
  329. *
  330. * @return a {@link String} for the message.
  331. */
  332. @Message(id = Message.NONE, value = "Is this correct")
  333. String isCorrectPrompt();
  334. /**
  335. * Warning that the username is easy to guess.
  336. *
  337. * @param username - The new username.
  338. *
  339. * @return a {@link String} for the message.
  340. */
  341. @Message(id = Message.NONE, value = "The username '%s' is easy to guess")
  342. String usernameEasyToGuess(String username);
  343. /**
  344. * A prompt to double check the user is really sure they want to add this user.
  345. *
  346. * @param username - The new username.
  347. *
  348. * @return a {@link String} for the message.
  349. */
  350. @Message(id = Message.NONE, value = "Are you sure you want to add user '%s' yes/no?")
  351. String sureToAddUser(String username);
  352. /**
  353. * The error message if the confirmation response is invalid.
  354. *
  355. * @return a {@link String} for the message.
  356. */
  357. @Message(id = 29, value = "Invalid response. (Valid responses are %s and %s)")
  358. String invalidConfirmationResponse(String firstValues, String secondValues);
  359. /**
  360. * Message to inform user that the new user has been added to the file identified.
  361. *
  362. * @param username - The new username.
  363. * @param fileName - The file the user has been added to.
  364. *
  365. * @return a {@link String} for the message.
  366. */
  367. @Message(id = Message.NONE, value = "Added user '%s' to file '%s'")
  368. String addedUser(String username, String fileName);
  369. /**
  370. * The error message if adding the user to the file fails.
  371. *
  372. * @param file - The name of the file the add failed for.
  373. * @param error - The failure message.
  374. *
  375. * @return a {@link String} for the message.
  376. */
  377. @Message(id = 30, value = "Unable to add user to %s due to error %s")
  378. String unableToAddUser(String file, String error);
  379. /**
  380. * The error message if loading the known users from file fails.
  381. *
  382. * @param file - The name of the file the load failed for.
  383. * @param error - The failure message.
  384. *
  385. * @return a {@link String} for the message.
  386. */
  387. @Message(id = 31, value = "Unable to add load users from %s due to error %s")
  388. String unableToLoadUsers(String file, String error);
  389. /**
  390. * The error message header.
  391. *
  392. * @return a {@link String} for the message.
  393. */
  394. @Message(id = Message.NONE, value = "Error")
  395. String errorHeader();
  396. /**
  397. * A message to check if this user is going to be used by a host controller to connect to the master domain controller.
  398. *
  399. * @return a {@link String} for the message.
  400. */
  401. @Message(id = Message.NONE, value = "Is this new user going to be used for one AS process to connect to another AS process? %ne.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.")
  402. String serverUser();
  403. /**
  404. * Simple yes/no prompt.
  405. *
  406. * @return a {@link String} for the message.
  407. */
  408. @Message(id = Message.NONE, value = "yes/no?")
  409. String yesNo();
  410. /**
  411. * To represent this user use the following secret entry in the server-identities.
  412. *
  413. * @return a {@link String} for the message.
  414. */
  415. @Message(id = Message.NONE, value = "To represent the user add the following to the server-identities definition <secret value=\"%s\" />")
  416. String secretElement(String base64);
  417. /**
  418. * Error message if more than one username/password authentication mechanism is defined.
  419. *
  420. * @param realmName the name of the security realm
  421. * @param mechanisms the set of mechanisms .
  422. *
  423. * @return an {@link OperationFailedException} for the error.
  424. */
  425. @Message(id = 33, value = "Configuration for security realm '%s' includes multiple username/password based authentication mechanisms (%s). Only one is allowed")
  426. OperationFailedException multipleAuthenticationMechanismsDefined(String realmName, Set<String> mechanisms);
  427. /**
  428. * Creates an exception indicating that one of {@code attr1} or {@code attr2} is required.
  429. *
  430. * @param attr1 the first attribute.
  431. * @param attr2 the second attribute.
  432. *
  433. * @return an {@link OperationFailedException} for the error.
  434. */
  435. @Message(id = 34, value = "One of '%s' or '%s' required.")
  436. OperationFailedException operationFailedOneOfRequired(String attr1, String attr2);
  437. /**
  438. * Creates an exception indicating that only one of {@code attr1} or {@code attr2} is required.
  439. *
  440. * @param attr1 the first attribute.
  441. * @param attr2 the second attribute.
  442. *
  443. * @return an {@link OperationFailedException} for the error.
  444. */
  445. @Message(id = 35, value = "Only one of '%s' or '%s' is required.")
  446. OperationFailedException operationFailedOnlyOneOfRequired(String attr1, String attr2);
  447. // id = 36; redundant parameter null check message
  448. /**
  449. * Creates a String for use in an OperationFailedException to indicate that no security context has been established for a
  450. * call that requires one.
  451. */
  452. @Message(id = 37, value = "No security context has been established.")
  453. String noSecurityContextEstablished();
  454. // /**
  455. // * Creates a String for use in an OperationFailedException to indicate that an unexpected number of RealmUser instances have
  456. // * been found.
  457. // *
  458. // * @param count - The number of RealmUser instances found.
  459. // */
  460. //@Message(id = 38, value = "An unexpected number (%d) of RealmUsers are associated with the SecurityContext.")
  461. //String unexpectedNumberOfRealmUsers(int count);
  462. /**
  463. * Prompt for the file to update in add-users
  464. */
  465. @Message(id = Message.NONE, value = "What type of user do you wish to add? %n a) Management User (mgmt-users.properties) %n b) Application User (application-users.properties)")
  466. String filePrompt();
  467. /**
  468. * Prompt the user for the groups to add the user to
  469. * @return the prompt
  470. */
  471. @Message(id = Message.NONE, value = "What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)")
  472. String groupsPrompt();
  473. /**
  474. * Message to inform user that the new user has been added to the groups file identified.
  475. *
  476. * @param username - The new username.
  477. * @param groups - The new groups.
  478. * @param fileName - The file the user has been added to.
  479. *
  480. * @return a {@link String} for the message.
  481. */
  482. @Message(id = Message.NONE, value = "Added user '%s' with groups %s to file '%s'")
  483. String addedGroups(String username, String groups, String fileName);
  484. /**
  485. * The error message if the choice response is invalid.
  486. *
  487. * TODO - On translation we will need support for checking the possible responses.
  488. *
  489. * @return a {@link String} for the message.
  490. */
  491. @Message(id = 39, value = "Invalid response. (Valid responses are A, a, B, or b)")
  492. String invalidChoiceResponse();
  493. /**
  494. * Confirmation if the current user (enabled) is about to be updated.
  495. *
  496. * @param user - The name of the user.
  497. *
  498. * @return a {@link String} for the message.
  499. */
  500. @Message(id = Message.NONE, value = "User '%s' already exists and is enabled, would you like to... %n a) Update the existing user password and roles %n b) Disable the existing user %n c) Type a new username")
  501. String aboutToUpdateEnabledUser(String user);
  502. /**
  503. * Confirmation if the current user (disabled) is about to be updated.
  504. *
  505. * @param user - The name of the user.
  506. *
  507. * @return a {@link String} for the message.
  508. */
  509. @Message(id = Message.NONE, value = "User '%s' already exists and is disabled, would you like to... %n a) Update the existing user password and roles %n b) Enable the existing user %n c) Type a new username")
  510. String aboutToUpdateDisabledUser(String user);
  511. /**
  512. * Message to inform user that the user has been updated to the file identified.
  513. *
  514. * @param userName - The new username.
  515. * @param canonicalPath - The file the user has been added to.
  516. *
  517. * @return a {@link String} for the message.
  518. */
  519. @Message(id = Message.NONE, value = "Updated user '%s' to file '%s'")
  520. String updateUser(String userName, String canonicalPath);
  521. /**
  522. * The error message if updating user to the file fails.
  523. *
  524. * @param absolutePath - The name of the file the add failed for.
  525. * @param message - The failure message.
  526. *
  527. * @return a {@link String} for the message.
  528. */
  529. @Message(id = 40, value = "Unable to update user to %s due to error %s")
  530. String unableToUpdateUser(String absolutePath, String message);
  531. /**
  532. * Message to inform user that the user has been updated to the groups file identified.
  533. *
  534. * @param username - The new username.
  535. * @param groups - The new groups.
  536. * @param fileName - The file the user has been added to.
  537. *
  538. * @return a {@link String} for the message.
  539. */
  540. @Message(id = Message.NONE, value = "Updated user '%s' with groups %s to file '%s'")
  541. String updatedGroups(String username, String groups, String fileName);
  542. /**
  543. * IOException to indicate the user attempting to use local authentication has been rejected.
  544. *
  545. * @param userName - The user attempting local authentication.
  546. * @return an {@link IOException} for the failure.
  547. */
  548. @Message(id = 41, value = "The user '%s' is not allowed in a local authentication.")
  549. IOException invalidLocalUser(final String userName);
  550. /**
  551. * StartException to indicate that multiple CallbackHandlerServices are associated for the same mechanism.
  552. *
  553. * @param mechanismName - the name of the mechanism being registered.
  554. * @return an {@link StartException} for the failure.
  555. */
  556. @Message(id = 42, value = "Multiple CallbackHandlerServices for the same mechanism (%s)")
  557. StartException multipleCallbackHandlerForMechanism(final String mechanismName);
  558. /**
  559. * IllegalStateException to indicate a CallbackHandler has been requested for an unsupported mechanism.
  560. *
  561. * @param mechanism - The name of the mechanism requested.
  562. * @param realmName - The name of the realm the mechanism was requested from.
  563. * @return an {@link IllegalStateException} for the failure.
  564. */
  565. @Message(id = 43, value = "No CallbackHandler available for mechanism %s in realm %s")
  566. IllegalStateException noCallbackHandlerForMechanism(final String mechanism, final String realmName);
  567. /**
  568. * IllegalStateException to indicate no plug in providers were loaded for the specified name.
  569. *
  570. * @param name The name of the module loaded.
  571. * @return an {@link IllegalStateException} for the failure.
  572. */
  573. @Message(id = 44, value = "No plug in providers found for module name %s")
  574. IllegalArgumentException noPlugInProvidersLoaded(final String name);
  575. /**
  576. * IllegalStateException to indicate a failure loading the PlugIn.
  577. *
  578. * @param name - The name of the plug-in being loaded.
  579. * @param error - The error that occurred.
  580. * @return an {@link IllegalArgumentException} for the failure.
  581. */
  582. @Message(id = 45, value = "Unable to load plug-in for module %s due to error (%s)")
  583. IllegalArgumentException unableToLoadPlugInProviders(final String name, final String error);
  584. /**
  585. * IllegalArgumentException to indicate that an AuthenticationPlugIn was not loaded.
  586. *
  587. * @param name - The name specified.
  588. * @return an {@link IllegalArgumentException} for the failure.
  589. */
  590. @Message(id = 46, value = "No authentication plug-in found for name %s")
  591. IllegalArgumentException noAuthenticationPlugInFound(final String name);
  592. /**
  593. * IllegalStateException to indicate that a plug-in could not be initialised.
  594. *
  595. * @param name - The name specified.
  596. * @return an {@link IllegalArgumentException} for the failure.
  597. */
  598. @Message(id = 47, value = "Unable to initialise plug-in %s due to error %s")
  599. IllegalStateException unableToInitialisePlugIn(final String name, final String message);
  600. /**
  601. * The error message for password which does not met strength requirement.
  602. *
  603. * @param currentStrength - strength value which has been computed from password.
  604. * @param desiredStrength - Minimum strength value which should be met.
  605. *
  606. * @return a {@link String} for the message.
  607. */
  608. @Message(id = 48, value = "Password is not strong enough, it is '%s'. It should be at least '%s'.")
  609. String passwordNotStrongEnough(String currentStrength, String desiredStrength);
  610. /**
  611. * The error message for password which has forbidden value.
  612. *
  613. * @param password - password value.
  614. *
  615. * @return a {@link PasswordValidationException} for the message.
  616. */
  617. @Message(id = 49, value = "Password must not be equal to '%s', this value is restricted.")
  618. PasswordValidationException passwordMustNotBeEqual(String password);
  619. /**
  620. * The error message for password which has not enough digit.
  621. * @param minDigit - minimum digit values.
  622. * @return a {@link String} for the message.
  623. */
  624. @Message(id = 50, value = "Password must have at least %d digit.")
  625. String passwordMustHaveDigit(int minDigit);
  626. /**
  627. * The error message for password which has not enough symbol.
  628. * @param minSymbol - minimum symbol values.
  629. * @return a {@link String} for the message.
  630. */
  631. @Message(id = 51, value = "Password must have at least %s non-alphanumeric symbol.")
  632. String passwordMustHaveSymbol(int minSymbol);
  633. /**
  634. * The error message for password which has not enough alpha numerical values.
  635. * @param minAlpha - minimum alpha numerical values.
  636. * @return a {@link String} for the message.
  637. */
  638. @Message(id = 52, value = "Password must have at least %d alphanumeric character.")
  639. String passwordMustHaveAlpha(int minAlpha);
  640. /**
  641. * The error message for password which is not long enough.
  642. * @param desiredLength - desired length of password.
  643. * @return a {@link PasswordValidationException} for the message.
  644. */
  645. @Message(id = 53, value = "Password must have at least %s characters!")
  646. PasswordValidationException passwordNotLongEnough(int desiredLength);
  647. @Message(id = 54, value = "Unable to load key trust file.")
  648. IllegalStateException unableToLoadKeyTrustFile(@Cause Throwable t);
  649. @Message(id = 55, value = "Unable to operate on trust store.")
  650. IllegalStateException unableToOperateOnTrustStore(@Cause GeneralSecurityException gse);
  651. @Message(id = 56, value = "Unable to create delegate trust manager.")
  652. IllegalStateException unableToCreateDelegateTrustManager();
  653. @Message(id = 57, value = "The syslog-handler can only contain one protocol %s")
  654. XMLStreamException onlyOneSyslogHandlerProtocol(Location location);
  655. @Message(id = 58, value = "There is no handler called '%s'")
  656. IllegalStateException noHandlerCalled(String name);
  657. @Message(id = 59, value = "There is already a protocol configured for the syslog handler at %s")
  658. OperationFailedException sysLogProtocolAlreadyConfigured(PathAddress append);
  659. @Message(id = 60, value = "No syslog protocol was given")
  660. OperationFailedException noSyslogProtocol();
  661. @Message(id = 61, value = "There is no formatter called '%s'")
  662. OperationFailedException noFormatterCalled(String formatterName);
  663. @Message(id = 62, value = "Can not remove formatter, it is still referenced by the handler '%s'")
  664. OperationFailedException cannotRemoveReferencedFormatter(PathElement pathElement);
  665. @Message(id = 63, value = "Handler names must be unique. There is already a handler called '%s' at %s")
  666. OperationFailedException handlerAlreadyExists(String name, PathAddress append);
  667. /**
  668. * Parsing the user property file different realm names have been detected, the add-user utility requires the same realm
  669. * name to be used across all property files a user is being added to.
  670. */
  671. @Message(id = 64, value = "Different realm names detected '%s', '%s' reading user property files, all realms must be equal.")
  672. String multipleRealmsDetected(final String realmOne, final String realmTwo);
  673. /**
  674. * The user has supplied a realm name but the supplied name does not match the name discovered from the property files.
  675. */
  676. @Message(id = 65, value = "The user supplied realm name '%s' does not match the realm name discovered from the property file(s) '%s'.")
  677. String userRealmNotMatchDiscovered(final String supplied, final String discovered);
  678. /**
  679. * The user has supplied a group properties file name but no user properties file name.
  680. */
  681. @Message(id = 66, value = "A group properties file '%s' has been specified, however no user properties has been specified.")
  682. String groupPropertiesButNoUserProperties(final String groupProperties);
  683. /**
  684. * There is no default realm name and the user has not specified one either.
  685. */
  686. @Message(id = 67, value = "A realm name must be specified.")
  687. String realmMustBeSpecified();
  688. /**
  689. * Creates an exception indicating that RBAC has been enabled but it is not possible for users to be mapped to roles.
  690. *
  691. * @return an {@link OperationFailedException} for the error.
  692. */
  693. @Message(id = 68, value = "The current operation(s) would result in role based access control being enabled but leave it impossible for authenticated users to be assigned roles.")
  694. OperationFailedException inconsistentRbacConfiguration();
  695. /**
  696. * Creates an exception indicating that the runtime role mapping state is inconsistent.
  697. *
  698. * @return an {@link OperationFailedException} for the error.
  699. */
  700. @Message(id = 69, value = "The runtime role mapping configuration is inconsistent, the server must be restarted.")
  701. OperationFailedException inconsistentRbacRuntimeState();
  702. /**
  703. * The error message if the choice response is invalid to the update user state.
  704. *
  705. * @return a {@link String} for the message.
  706. */
  707. @Message(id = 70, value = "Invalid response. (Valid responses are A, a, B, b, C or c)")
  708. String invalidChoiceUpdateUserResponse();
  709. @Message(id = 71, value = "Role '%s' already contains an %s for type=%s, name=%s, realm=%s.")
  710. OperationFailedException duplicateIncludeExclude(String roleName, String incExcl, String type, String name, String realm);
  711. /**
  712. * Error message if more than one authorization configuration is defined.
  713. *
  714. * @param realmName the name of the security realm
  715. * @param configurations the set of configurations .
  716. *
  717. * @return an {@link OperationFailedException} for the error.
  718. */
  719. @Message(id = 72, value = "Configuration for security realm '%s' includes multiple authorization configurations (%s). Only one is allowed")
  720. OperationFailedException multipleAuthorizationConfigurationsDefined(String realmName, Set<String> configurations);
  721. /**
  722. * Error message if more than one username-to-dn resource is defined.
  723. *
  724. * @param realmName the name of the security realm
  725. * @param configurations the set of configurations .
  726. *
  727. * @return an {@link OperationFailedException} for the error.
  728. */
  729. @Message(id = 73, value = "Configuration for security realm '%s' includes multiple username-to-dn resources within the authorization=ldap resource (%s). Only one is allowed")
  730. OperationFailedException multipleUsernameToDnConfigurationsDefined(String realmName, Set<String> configurations);
  731. /**
  732. * Error message if no group-search resource is defined.
  733. *
  734. * @param realmName the name of the security realm
  735. *
  736. * @return an {@link OperationFailedException} for the error.
  737. */
  738. @Message(id = 74, value = "Configuration for security realm '%s' does not contain any group-search resource within the authorization=ldap resource.")
  739. OperationFailedException noGroupSearchDefined(String realmName);
  740. /**
  741. * Error message if more than one group-search resource is defined.
  742. *
  743. * @param realmName the name of the security realm
  744. * @param configurations the set of configurations .
  745. *
  746. * @return an {@link OperationFailedException} for the error.
  747. */
  748. @Message(id = 75, value = "Configuration for security realm '%s' includes multiple group-search resources within the authorization=ldap resource (%s). Only one is allowed")
  749. OperationFailedException multipleGroupSearchConfigurationsDefined(String realmName, Set<String> configurations);
  750. /**
  751. * Error message if the name of a role mapping being added is invalid.
  752. *
  753. * @param roleName - The name of the role.
  754. *
  755. * @return an {@link OperationFailedException} for the error.
  756. */
  757. @Message(id = 76, value = "The role name '%s' is not a valid standard role.")
  758. OperationFailedException invalidRoleName(String roleName);
  759. /**
  760. * Error message if the name of a role mapping being added is invalid.
  761. *
  762. * @param roleName - The name of the role.
  763. *
  764. * @return an {@link OperationFailedException} for the error.
  765. */
  766. @Message(id = 77, value = "The role name '%s' is not a valid standard role and is not a host scoped role or a server group scoped role.")
  767. OperationFailedException invalidRoleNameDomain(String roleName);
  768. /**
  769. * Error message if the name of a scoped role can not be removed as the role mapping remains.
  770. *
  771. * @param roleName - The name of the role.
  772. *
  773. * @return an {@link OperationFailedException} for the error.
  774. */
  775. @Message(id = 78, value = "The scoped role '%s' can not be removed as a role mapping still exists.")
  776. OperationFailedException roleMappingRemaining(String roleName);
  777. /**
  778. * Error message if a scoped role already exists with the same name.
  779. *
  780. * @param scopeType - The type of scoped role.
  781. * @param roleName - The name of the role.
  782. *
  783. * @return an {@link OperationFailedException} for the error.
  784. */
  785. @Message(id = 79, value = "A %s already exists with name '%s'")
  786. OperationFailedException duplicateScopedRole(String scopeType, String roleName);
  787. /**
  788. * Error message if a scoped role name matches a standard role.
  789. *
  790. * @param scopedRole - The name of the scoped role.
  791. * @param standardRole - The name of the standard role.
  792. *
  793. * @return an {@link OperationFailedException} for the error.
  794. */
  795. @Message(id = 80, value = "The name '%s' conflicts with the standard role name of '%s' - comparison is case insensitive.")
  796. OperationFailedException scopedRoleStandardName(String scopedRole, String standardRole);
  797. /**
  798. * Error message if the base-role is not one of the standard roles.
  799. *
  800. * @param baseRole - The base-role supplied.
  801. *
  802. * @return an {@link OperationFailedException} for the error.
  803. */
  804. @Message(id = 81, value = "The base-role '%s' is not one of the standard roles for the current authorization provider.")
  805. OperationFailedException badBaseRole(String baseRole);
  806. /**
  807. * Error message if the password and username match.
  808. *
  809. * @return an {@link PasswordValidationException} for the error.
  810. */
  811. @Message(id = 82, value = "The password must be different from the username")
  812. PasswordValidationException passwordUsernameMatchError();
  813. /**
  814. * Create an exception indicating that there are no keys in the keystore.
  815. *
  816. * @return a {@link StartException} for the error.
  817. */
  818. @Message(id = 83, value = "The KeyStore %s does not contain any keys.")
  819. StartException noKey(String path);
  820. /**
  821. * Create an exception indicating that the alias specified is not a key.
  822. *
  823. * @return a {@link StartException} for the error.
  824. */
  825. @Message(id = 84, value = "The alias specified '%s' is not a Key, valid aliases are %s")
  826. StartException aliasNotKey(String alias, String validList);
  827. /**
  828. * Create an exception indicating that the alias specified was not found.
  829. *
  830. * @return a {@link StartException} for the error.
  831. */
  832. @Message(id = 85, value = "The alias specified '%s' does not exist in the KeyStore, valid aliases are %s")
  833. StartException aliasNotFound(String alias, String validList);
  834. /**
  835. * Create an exception indicating that the keystore was not found.
  836. *
  837. * @return a {@link StartException} for the error.
  838. */
  839. @Message(id = 86, value = "The KeyStore can not be found at %s")
  840. StartException keyStoreNotFound(String path);
  841. /**
  842. * Error message if more than one cache is defined.
  843. *
  844. * @param realmName the name of the security realm
  845. *
  846. * @return an {@link OperationFailedException} for the error.
  847. */
  848. @Message(id = 87, value = "Configuration for security realm '%s' includes multiple cache definitions at the same position in the hierarchy. Only one is allowed")
  849. OperationFailedException multipleCacheConfigurationsDefined(String realmName);
  850. /**
  851. * Creates an exception indicating that is was not possible to load a username for the supplied username.
  852. *
  853. * @param name the supplied username.
  854. *
  855. * @return a {@link NamingException} for the error.
  856. */
  857. @Message(id = 88, value = "Unable to load username for supplied username '%s'")
  858. NamingException usernameNotLoaded(String name);
  859. @Message(id = 89, value = "No operation was found that has been holding the operation execution write lock for long than [%d] seconds")
  860. OperationFailedException noNonProgressingOperationFound(long timeout);
  861. /**
  862. * Create an exception indicating an error parsing the Keytab location.
  863. *
  864. * @return a {@link StartException} for the error.
  865. */
  866. @Message(id = 90, value = "Invalid Keytab path")
  867. StartException invalidKeytab(@Cause Exception cause);
  868. /**
  869. * Create an exception to indicate that logout has already been called on the SubjectIdentity.
  870. *
  871. * @return a {@link IllegalStateException} for the error.
  872. */
  873. @Message(id = 91, value = "logout has already been called on this SubjectIdentity.")
  874. IllegalStateException subjectIdentityLoggedOut();
  875. /**
  876. * Create an exception indicating an error obtaining a Kerberos TGT.
  877. *
  878. * @return a {@link OperationFailedException} for the error.
  879. */
  880. @Message(id = 92, value = "Unable to obtain Kerberos TGT")
  881. OperationFailedException unableToObtainTGT(@Cause Exception cause);
  882. /**
  883. * Logs a message indicating that attempting to login using a specific keytab failed.
  884. */
  885. @LogMessage(level = ERROR)
  886. @Message(id = 93, value = "Login failed using Keytab for principal '%s' to handle request for host '%s'")
  887. void keytabLoginFailed(String principal, String host, @Cause LoginException e);
  888. /**
  889. * Create an {@link OperationFailedException} where a security realm has Kerberos enabled for authentication but no Keytab in the server-identities.
  890. *
  891. * @param realm The name of the security realm.
  892. * @return a {@link OperationFailedException} for the error.
  893. */
  894. @Message(id = 94, value = "Kerberos is enabled for authentication on security realm '%s' but no Keytab has been added to the server-identity.")
  895. OperationFailedException kerberosWithoutKeytab(String realm);
  896. /**
  897. * Create an {@link StartException} where the requested cipher suites do not match any of the supported cipher suites.
  898. *
  899. * @param supported the supported cipher suites
  900. * @param requested the requested cipher suites
  901. * @return a {@link StartException} for the error.
  902. */
  903. @Message(id = 95, value = "No cipher suites in common, supported=(%s), requested=(%s)")
  904. StartException noCipherSuitesInCommon(String supported, String requested);
  905. /**
  906. * Create an {@link StartException} where the requested protocols do not match any of the supported protocols.
  907. *
  908. * @param supported the supported protocols
  909. * @param requested the requested protocols
  910. * @return a {@link StartException} for the error.
  911. */
  912. @Message(id = 96, value = "No protocols in common, supported=(%s), requested=(%s)")
  913. StartException noProtocolsInCommon(String supported, String requested);
  914. /**
  915. * The error message for password which has forbidden value.
  916. *
  917. * @param password - password value.
  918. *
  919. * @return a {@link PasswordValidationException} for the message.
  920. */
  921. @Message(id = 97, value = "Password should not be equal to '%s', this value is restricted.")
  922. PasswordValidationException passwordShouldNotBeEqual(String password);
  923. /**
  924. * Error message if the password and username match.
  925. *
  926. * @return an {@link PasswordValidationException} for the error.
  927. */
  928. @Message(id = 98, value = "The password should be different from the username")
  929. PasswordValidationException passwordUsernameShouldNotMatch();
  930. /**
  931. * The error message for password which is not long enough.
  932. * @param desiredLength - desired length of password.
  933. * @return a {@link PasswordValidationException} for the message.
  934. */
  935. @Message(id = 99, value = "Password should have at least %s characters!")
  936. PasswordValidationException passwordShouldHaveXCharacters(int desiredLength);
  937. /**
  938. * The error message for password which has not enough alpha numerical values.
  939. * @param minAlpha - minimum alpha numerical values.
  940. * @return a {@link String} for the message.
  941. */
  942. @Message(id = 100, value = "Password should have at least %d alphanumeric character.")
  943. String passwordShouldHaveAlpha(int minAlpha);
  944. /**
  945. * The error message for password which has not enough digit.
  946. * @param minDigit - minimum digit values.
  947. * @return a {@link String} for the message.
  948. */
  949. @Message(id = 101, value = "Password should have at least %d digit.")
  950. String passwordShouldHaveDigit(int minDigit);
  951. /**
  952. * The error message for password which has not enough symbol.
  953. * @param minSymbol - minimum symbol values.
  954. * @return a {@link String} for the message.
  955. */
  956. @Message(id = 102, value = "Password should have at least %s non-alphanumeric symbol.")
  957. String passwordShouldHaveSymbol(int minSymbol);
  958. /**
  959. * The error message for invalid rotate size value.
  960. * @param size the rotate size value.
  961. * @return a {@link OperationFailedException} for the error.
  962. */
  963. @Message(id = 103, value = "Invalid size %s")
  964. OperationFailedException invalidSize(String size);
  965. /**
  966. * The error message indicating a suffix contains seconds or milliseconds and the handler does not allow it.
  967. * @param suffix the suffix value.
  968. * @return a {@link OperationFailedException} for the error.
  969. */
  970. @Message(id = 104, value = "The suffix (%s) can not contain seconds or milliseconds.")
  971. OperationFailedException suffixContainsMillis(String suffix);
  972. /**
  973. * The error message indicating a suffix is invalid.
  974. * @param suffix the suffix value.
  975. * @return a {@link OperationFailedException} for the error.
  976. */
  977. @Message(id = 105, value = "The suffix (%s) is invalid. A suffix must be a valid date format.")
  978. OperationFailedException invalidSuffix(String suffix);
  979. /**
  980. * A message indicating file permissions problems found with mgmt-users.properties.
  981. *
  982. * @return a {@link String} for the message.
  983. */
  984. @Message(id = 106, value = "File permissions problems found while attempting to update %s file.")
  985. String filePermissionsProblemsFound(String file);
  986. @Message(id = 107, value = "Operation '%s' has been holding the operation execution write lock for longer than [%d] seconds, " +
  987. "but it is part of the rollout of a domain-wide operation with domain-uuid '%s' that has other operations that are also" +
  988. "not progressing. Their ids are: %s. Cancellation of the operation on the master host controller is recommended.")
  989. OperationFailedException domainRolloutNotProgressing(String exclusiveLock, long timeout, String domainUUID, Collection relatedOps);
  990. /**
  991. * A message indicating an unsupported resource in the model during marshalling.
  992. *
  993. * @param name the name of the resource.
  994. * @return The exception for the error.
  995. */
  996. @Message(id = 108, value = "Unsupported resource '%s'")
  997. IllegalStateException unsupportedResource(String name);
  998. /**
  999. * The error to indicate that a specified KeyTab can not be found.
  1000. *
  1001. * @param fileName the full path to the KeyTab.
  1002. * @return The exception for the error.
  1003. */
  1004. @Message(id = 109, value = "The Keytab file '%s' does not exist.")
  1005. StartException keyTabFileNotFound(String fileName);
  1006. /**
  1007. * The error to indicate where it has not been possible to load a distinguished name for a group.
  1008. *
  1009. * @param distinguishedName the distinguished name of the group that failed to load.
  1010. * @return The exception for the error.
  1011. */
  1012. @Message(id = 110, value = "Unable to load a simple name for group '%s'")
  1013. NamingException unableToLoadSimpleNameForGroup(String distinguishedName);
  1014. @Message(id = 111, value = "Keystore %s not found, it will be auto generated on first use with a self signed certificate for host %s")
  1015. @LogMessage(level = WARN)
  1016. void keystoreWillBeCreated(String file, String host);
  1017. @Message(id = 112, value = "Failed to generate self signed certificate")
  1018. RuntimeException failedToGenerateSelfSignedCertificate(@Cause Exception e);
  1019. @Message(id = 113, value = "Generated self signed certificate at %s. Please note that self signed certificates are not secure, and should only be used for testing purposes. Do not use this self signed certificate in production.%nSHA-1 fingerprint of the generated key is %s%nSHA-256 fingerprint of the generated key is %s")
  1020. @LogMessage(level = WARN)
  1021. void keystoreHasBeenCreated(String file, String sha1, String sha256);
  1022. @Message(id = 114, value = "Failed to lazily initialize SSL context")
  1023. RuntimeException failedToCreateLazyInitSSLContext(@Cause Exception e);
  1024. /* X.500 exceptions, to be removed once Elytron certificate generation is in use */
  1025. // @Message(id = 115, value = "No signature algorithm name given")
  1026. // IllegalArgumentException noSignatureAlgorithmNameGiven();
  1027. // @Message(id = 116, value = "Signature algorithm name \"%s\" is not recognized")
  1028. // IllegalArgumentException unknownSignatureAlgorithmName(String signatureAlgorithmName);
  1029. // @Message(id = 117, value = "No signing key given")
  1030. // IllegalArgumentException noSigningKeyGiven();
  1031. // @Message(id = 118, value = "Signing key algorithm name \"%s\" is not compatible with signature algorithm name \"%s\"")
  1032. // IllegalArgumentException signingKeyNotCompatWithSig(String signingKeyAlgorithm, String signatureAlgorithmName);
  1033. // @Message(id = 119, value = "Not-valid-before date of %s is after not-valid-after date of %s")
  1034. // IllegalArgumentException validAfterBeforeValidBefore(ZonedDateTime notValidBefore, ZonedDateTime notValidAfter);
  1035. // @Message(id = 120, value = "No issuer DN given")
  1036. // IllegalArgumentException noIssuerDnGiven();
  1037. // @Message(id = 121, value = "No public key given")
  1038. // IllegalArgumentException noPublicKeyGiven();
  1039. // @Message(id = 122, value = "Issuer and subject unique ID are only allowed in certificates with version 2 or higher")
  1040. // IllegalArgumentException uniqueIdNotAllowed();
  1041. // @Message(id = 123, value = "X.509 encoding of public key with algorithm \"%s\" failed")
  1042. // IllegalArgumentException invalidKeyForCert(String publicKeyAlgorithm, @Cause Exception cause);
  1043. // @Message(id = 124, value = "Failed to sign certificate")
  1044. // IllegalArgumentException certSigningFailed(@Cause Exception cause);
  1045. // @Message(id = 125, value = "Certificate serial number must be positive")
  1046. // IllegalArgumentException serialNumberTooSmall();
  1047. // @Message(id = 126, value = "Certificate serial number too large (cannot exceed 20 octets)")
  1048. // IllegalArgumentException serialNumberTooLarge();
  1049. // @Message(id = 127, value = "No sequence to end")
  1050. // IllegalStateException noSequenceToEnd();
  1051. // @Message(id = 128, value = "N…

Large files files are truncated, but you can click here to view the full file