| 1 | /* |
|---|
| 2 | * Copyright 2009 NCHOVY |
|---|
| 3 | * |
|---|
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
|---|
| 5 | * you may not use this file except in compliance with the License. |
|---|
| 6 | * You may obtain a copy of the License at |
|---|
| 7 | * |
|---|
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
|---|
| 9 | * |
|---|
| 10 | * Unless required by applicable law or agreed to in writing, software |
|---|
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
|---|
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|---|
| 13 | * See the License for the specific language governing permissions and |
|---|
| 14 | * limitations under the License. |
|---|
| 15 | */ |
|---|
| 16 | package org.krakenapps.filter.exception; |
|---|
| 17 | |
|---|
| 18 | /** |
|---|
| 19 | * Unchecked exception thrown when the filter is already bound to the specified |
|---|
| 20 | * filter. |
|---|
| 21 | * |
|---|
| 22 | * @author xeraph |
|---|
| 23 | * @since 1.0.0 |
|---|
| 24 | */ |
|---|
| 25 | public class AlreadyBoundException extends RuntimeException { |
|---|
| 26 | private static final long serialVersionUID = 1L; |
|---|
| 27 | private String fromFilterId; |
|---|
| 28 | private String toFilterId; |
|---|
| 29 | |
|---|
| 30 | /** |
|---|
| 31 | * Creates an exception with source and destination filter informations. |
|---|
| 32 | * |
|---|
| 33 | * @param fromFilterId |
|---|
| 34 | * the source filter id |
|---|
| 35 | * @param toFilterId |
|---|
| 36 | * the destination filter id |
|---|
| 37 | */ |
|---|
| 38 | public AlreadyBoundException(String fromFilterId, String toFilterId) { |
|---|
| 39 | this.fromFilterId = fromFilterId; |
|---|
| 40 | this.toFilterId = toFilterId; |
|---|
| 41 | } |
|---|
| 42 | |
|---|
| 43 | @Override |
|---|
| 44 | public String getMessage() { |
|---|
| 45 | return toFilterId + " is already bound to " + fromFilterId; |
|---|
| 46 | } |
|---|
| 47 | } |
|---|