1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.chemistry.opencmis.commons.exceptions;
20
21 import java.math.BigInteger;
22 import java.util.Map;
23
24 /**
25 * CMIS Constraint Exception.
26 * <p>
27 * Intent: The operation violates a repository- or object-level constraint
28 * defined in the CMIS domain model.
29 */
30 public class CmisConstraintException extends CmisBaseException {
31
32 private static final long serialVersionUID = 1L;
33 public static final String EXCEPTION_NAME = "constraint";
34
35 /**
36 * Default constructor.
37 */
38 public CmisConstraintException() {
39 super();
40 }
41
42 /**
43 * Constructor.
44 *
45 * @param message
46 * error message
47 * @param code
48 * error code
49 * @param cause
50 * the cause
51 */
52 public CmisConstraintException(String message, BigInteger code, Throwable cause) {
53 super(message, code, cause);
54 }
55
56 /**
57 * Constructor.
58 *
59 * @param message
60 * error message
61 * @param errorContent
62 * error page content
63 */
64 public CmisConstraintException(String message, String errorContent) {
65 super(message, errorContent);
66 }
67
68 /**
69 * Constructor.
70 *
71 * @param message
72 * error message
73 * @param code
74 * error code
75 */
76 public CmisConstraintException(String message, BigInteger code) {
77 super(message, code);
78 }
79
80 /**
81 * Constructor.
82 *
83 * @param message
84 * error message
85 * @param code
86 * error code
87 * @param errorContent
88 * error page content
89 */
90 public CmisConstraintException(String message, BigInteger code, String errorContent) {
91 super(message, code, errorContent);
92 }
93
94 /**
95 * Constructor.
96 *
97 * @param message
98 * error message
99 * @param code
100 * error code
101 * @param errorContent
102 * error page content
103 * @param additionalData
104 * additional data
105 */
106 public CmisConstraintException(String message, BigInteger code, String errorContent,
107 Map<String, String> additionalData) {
108 super(message, code, errorContent, additionalData);
109 }
110
111 /**
112 * Constructor.
113 *
114 * @param message
115 * error message
116 * @param errorContent
117 * error page content
118 * @param additionalData
119 * additional data
120 * @param cause
121 * the cause
122 */
123 public CmisConstraintException(String message, String errorContent, Map<String, String> additionalData,
124 Throwable cause) {
125 super(message, errorContent, additionalData, cause);
126 }
127
128 /**
129 * Constructor.
130 *
131 * @param message
132 * error message
133 * @param errorContent
134 * error page content
135 * @param cause
136 * the cause
137 */
138 public CmisConstraintException(String message, String errorContent, Throwable cause) {
139 super(message, errorContent, cause);
140 }
141
142 /**
143 * Constructor.
144 *
145 * @param message
146 * error message
147 * @param cause
148 * the cause
149 */
150 public CmisConstraintException(String message, Throwable cause) {
151 super(message, BigInteger.ZERO, cause);
152 }
153
154 /**
155 * Constructor.
156 *
157 * @param message
158 * error message
159 */
160 public CmisConstraintException(String message) {
161 super(message, BigInteger.ZERO);
162 }
163
164 @Override
165 public final String getExceptionName() {
166 return EXCEPTION_NAME;
167 }
168 }