View Javadoc

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  
20  /**
21   * Provides context information for problems accessing a data source containing
22   * properties identified by a property key.
23   */
24  public class DataSourcePropertyKeyMessageBean extends DataSourceMessageBean
25  {
26    // ********************************* Fields *********************************
27  
28    // --- constants ------------------------------------------------------------
29  
30    /**
31     * The class version identifier.
32     * <p>
33     * The value of this constant is {@value}.
34     * </p>
35     */
36    private static final long serialVersionUID = 1L;
37  
38    // --- members --------------------------------------------------------------
39  
40    /**
41     * The path to the table that contains the property. This contains the name of
42     * the table and the configuration key of the table.
43     *
44     * @serial
45     */
46    @MessageParam
47    private final String path; // NOPMD
48  
49    /**
50     * The identifier of the property key that caused problems.
51     *
52     * @serial
53     */
54    @MessageParam
55    private final String propertyKey; // NOPMD
56  
57    // ****************************** Initializer *******************************
58  
59    // ****************************** Constructors ******************************
60  
61    /**
62     * Constructor without cause.
63     *
64     * @param code the error or exception code of the exception.
65     * @param dataSourceId the identifier of the data source.
66     * @param path the path to the table that contains the property.
67     * @param propertyKey the identifier of the property key that caused problems.
68     */
69    public DataSourcePropertyKeyMessageBean(final DataSourceCode code,
70        final String dataSourceId, final String path, final String propertyKey)
71    {
72      this(code, null, dataSourceId, path, propertyKey);
73    }
74  
75    /**
76     * Default constructor.
77     *
78     * @param code the error or exception code of the exception.
79     * @param cause the cause to the problem.
80     * @param dataSourceId the identifier of the data source.
81     * @param path the path to the table that contains the property.
82     * @param propertyKey the identifier of the property key that caused problems.
83     */
84    public DataSourcePropertyKeyMessageBean(final DataSourceCode code,
85        final Throwable cause, final String dataSourceId, final String path,
86        final String propertyKey)
87    {
88      super(code, cause, dataSourceId);
89      this.path = path;
90      this.propertyKey = propertyKey;
91    }
92    // ****************************** Inner Classes *****************************
93  
94    // ********************************* Methods ********************************
95  
96    // --- init -----------------------------------------------------------------
97  
98    // --- factory --------------------------------------------------------------
99  
100   // --- get&set --------------------------------------------------------------
101 
102   // --- business -------------------------------------------------------------
103 
104   // --- object basics --------------------------------------------------------
105 
106 }