View Javadoc
1   /*
2    * The contents of this file are subject to the terms of the Common Development and
3    * Distribution License (the License). You may not use this file except in compliance with the
4    * License.
5    *
6    * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
7    * specific language governing permission and limitations under the License.
8    *
9    * When distributing Covered Software, include this CDDL Header Notice in each file and include
10   * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
11   * Header, with the fields enclosed by brackets [] replaced by your own identifying
12   * information: "Portions Copyrighted [year] [name of copyright owner]".
13   *
14   * Copyright 2011-2015 ForgeRock AS.
15   */
16  
17  package org.forgerock.json.resource;
18  
19  /**
20   * An exception that is thrown during an operation on a resource when the server
21   * is temporarily unable to handle the request.
22   */
23  public class ServiceUnavailableException extends RetryableException {
24  
25      private static final long serialVersionUID = 1L;
26  
27      /**
28       * Constructs a new exception with {@code null} as its detail message.
29       */
30      public ServiceUnavailableException() {
31          super(ResourceException.UNAVAILABLE, null, null);
32      }
33  
34      /**
35       * Constructs a new exception with the specified detail message.
36       *
37       * @param message
38       *            The detail message.
39       */
40      public ServiceUnavailableException(final String message) {
41          super(ResourceException.UNAVAILABLE, message, null);
42      }
43  
44      /**
45       * Constructs a new exception with the specified detail message and cause.
46       *
47       * @param message
48       *            The detail message.
49       * @param cause
50       *            The exception which caused this exception to be thrown.
51       */
52      public ServiceUnavailableException(final String message, final Throwable cause) {
53          super(ResourceException.UNAVAILABLE, message, cause);
54      }
55  
56      /**
57       * Constructs a new exception with the specified cause.
58       *
59       * @param cause
60       *            The exception which caused this exception to be thrown.
61       */
62      public ServiceUnavailableException(final Throwable cause) {
63          super(ResourceException.UNAVAILABLE, null, cause);
64      }
65  }