Advertisement
Guest User

Untitled

a guest
Feb 18th, 2014
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. /**
  2. * The contents of this file are subject to the OpenMRS Public License
  3. * Version 1.0 (the "License"); you may not use this file except in
  4. * compliance with the License. You may obtain a copy of the License at
  5. * http://license.openmrs.org
  6. *
  7. * Software distributed under the License is distributed on an "AS IS"
  8. * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  9. * License for the specific language governing rights and limitations
  10. * under the License.
  11. *
  12. * Copyright (C) OpenMRS, LLC. All Rights Reserved.
  13. */
  14. package org.openmrs.api;
  15.  
  16. import org.openmrs.util.OpenmrsConstants;
  17.  
  18. /**
  19. * This exception is thrown when a user tries to save or delete a form while forms are locked
  20. *
  21. * @see OpenmrsConstants#GLOBAL_PROPERTY_FORMS_LOCKED
  22. * @see FormService#checkIfFormsAreLocked()
  23. */
  24. public class FormsLockedException extends APIException {
  25.  
  26. private static final long serialVersionUID = 12344321L;
  27.  
  28. /**
  29. * Generic constructor that gives a normal reason why the user is not being allowed to save or delete a form
  30. */
  31. public FormsLockedException() {
  32. this("Form.forms.locked");
  33. }
  34.  
  35. /**
  36. * Convenience constructor to give the user a message other than normal default one
  37. *
  38. * @param message the reason to show to the user as to why the forms are locked
  39. */
  40. public FormsLockedException(String message) {
  41. super(message);
  42. }
  43.  
  44. /**
  45. * Convenience constructor to give the user a message other than the normal one and to chain
  46. * this exception with a parent exception.
  47. *
  48. * @param message the reason to show to the user as to why the forms are locked
  49. * @param cause the parent exception
  50. */
  51. public FormsLockedException(String message, Throwable cause) {
  52. super(message, cause);
  53. }
  54.  
  55. /**
  56. * Convenience constructor used to only set the parent exception to chain with. This does not
  57. * set the error message for the user as to why an exception is being thrown. The
  58. * {@link #FormsLockedException(String, Throwable)} constructor is preferred over this one.
  59. *
  60. * @param cause the parent exception
  61. */
  62. public FormsLockedException(Throwable cause) {
  63. super(cause);
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement