View Javadoc
1   package fr.ifremer.quadrige3.core.exception;
2   
3   /*-
4    * #%L
5    * Quadrige3 Core :: Quadrige3 Core Shared
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2017 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU Affero General Public License as published by
13   * the Free Software Foundation, either version 3 of the License, or
14   * (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU Affero General Public License
22   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23   * #L%
24   */
25  
26  import java.util.Collection;
27  
28  /**
29   * Created by ludovic.pecquot@e-is.pro on 27/09/17.
30   */
31  public class DeleteForbiddenException extends QuadrigeTechnicalException {
32  
33      private Collection<String> objectIds;
34  
35      /**
36       * <p>Constructor for DeleteForbiddenException.</p>
37       *
38       * @param message a {@link String} object.
39       */
40      public DeleteForbiddenException(String message, Collection<String> objectIds) {
41          super(message);
42          this.objectIds = objectIds;
43      }
44  
45      /**
46       * <p>Constructor for DeleteForbiddenException.</p>
47       *
48       * @param message a {@link String} object.
49       * @param cause a {@link Throwable} object.
50       */
51      public DeleteForbiddenException(String message, Collection<String> objectIds, Throwable cause) {
52          super(message, cause);
53          this.objectIds = objectIds;
54      }
55  
56      /**
57       * <p>Constructor for DeleteForbiddenException.</p>
58       *
59       * @param cause a {@link Throwable} object.
60       */
61      public DeleteForbiddenException(Throwable cause) {
62          super(cause);
63      }
64  
65      public Collection<String> getObjectIds() {
66          return objectIds;
67      }
68  
69      @Override
70      public String getMessage() {
71          return super.getMessage() + (objectIds != null ? " : " + objectIds.toString() : "");
72      }
73  }