1package org.apache.archiva.redback.rest.api.services;
2/*3 * Licensed to the Apache Software Foundation (ASF) under one4 * or more contributor license agreements. See the NOTICE file5 * distributed with this work for additional information6 * regarding copyright ownership. The ASF licenses this file7 * to you under the Apache License, Version 2.0 (the8 * "License"); you may not use this file except in compliance9 * with the License. You may obtain a copy of the License at10 *11 * http://www.apache.org/licenses/LICENSE-2.012 *13 * Unless required by applicable law or agreed to in writing,14 * software distributed under the License is distributed on an15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY16 * KIND, either express or implied. See the License for the17 * specific language governing permissions and limitations18 * under the License.19 */2021import org.apache.archiva.redback.rest.api.model.ErrorMessage;
2223import java.util.ArrayList;
24import java.util.List;
2526/**27 * @author Olivier Lamy28 * @since 1.329 */30publicclassRedbackServiceException31extends Exception
32 {
33privateint httpErrorCode = 500;
3435private List<ErrorMessage> errorMessages = new ArrayList<ErrorMessage>(0);
3637publicRedbackServiceException( String s )
38 {
39super( s );
40 }
4142publicRedbackServiceException( String s, int httpErrorCode )
43 {
44super( s );
45this.httpErrorCode = httpErrorCode;
46 }
4748publicRedbackServiceException( ErrorMessage errorMessage )
49 {
50 errorMessages.add( errorMessage );
51 }
5253publicRedbackServiceException( ErrorMessage errorMessage, int httpErrorCode )
54 {
55this.httpErrorCode = httpErrorCode;
56 errorMessages.add( errorMessage );
57 }
5859publicRedbackServiceException( List<ErrorMessage> errorMessage )
60 {
61 errorMessages.addAll( errorMessage );
62 }
6364publicint getHttpErrorCode()
65 {
66return httpErrorCode;
67 }
6869publicvoid setHttpErrorCode( int httpErrorCode )
70 {
71this.httpErrorCode = httpErrorCode;
72 }
7374public List<ErrorMessage> getErrorMessages()
75 {
76if ( errorMessages == null )
77 {
78this.errorMessages = new ArrayList<ErrorMessage>();
79 }
80return errorMessages;
81 }
8283publicvoid setErrorMessages( List<ErrorMessage> errorMessages )
84 {
85this.errorMessages = errorMessages;
86 }
8788publicvoid addErrorMessage( ErrorMessage errorMessage )
89 {
90this.errorMessages.add( errorMessage );
91 }
92 }