1 /* 2 * Copyright 2012-2013 smartics, Kronseder & Reiner GmbH 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 de.smartics.properties.spi.config.ds; 17 18 import de.smartics.exceptions.i18n.message.MessageParam; 19 import de.smartics.properties.api.core.app.AbstractBaseMessageBean; 20 21 /** 22 * Provides context information for problems accessing a data source containing 23 * properties. 24 */ 25 public class DataSourceMessageBean extends AbstractBaseMessageBean 26 { 27 // ********************************* Fields ********************************* 28 29 // --- constants ------------------------------------------------------------ 30 31 /** 32 * The class version identifier. 33 * <p> 34 * The value of this constant is {@value}. 35 * </p> 36 */ 37 private static final long serialVersionUID = 1L; 38 39 // --- members -------------------------------------------------------------- 40 41 /** 42 * The identifier of the data source. Usually this is the connection URL plus 43 * any other identifying information. 44 * 45 * @serial 46 */ 47 @MessageParam 48 private final String dataSourceId; // NOPMD 49 50 // ****************************** Initializer ******************************* 51 52 // ****************************** Constructors ****************************** 53 54 /** 55 * Constructor without cause. 56 * 57 * @param code the error or exception code of the exception. 58 * @param dataSourceId the identifier of the data source. 59 */ 60 public DataSourceMessageBean(final DataSourceCode code, 61 final String dataSourceId) 62 { 63 this(code, null, dataSourceId); 64 } 65 66 /** 67 * Default constructor. 68 * 69 * @param code the error or exception code of the exception. 70 * @param cause the cause to the problem. 71 * @param dataSourceId the identifier of the data source. 72 */ 73 public DataSourceMessageBean(final DataSourceCode code, 74 final Throwable cause, final String dataSourceId) 75 { 76 super(code, cause); 77 this.dataSourceId = dataSourceId; 78 } 79 80 // ****************************** Inner Classes ***************************** 81 82 // ********************************* Methods ******************************** 83 84 // --- init ----------------------------------------------------------------- 85 86 // --- factory -------------------------------------------------------------- 87 88 // --- get&set -------------------------------------------------------------- 89 90 // --- business ------------------------------------------------------------- 91 92 // --- object basics -------------------------------------------------------- 93 94 }