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 specified by a property key and value.
23   */
24  public class DataSourcePropertyMessageBean extends
25      DataSourcePropertyKeyMessageBean
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 value the property should have been set to.
43     *
44     * @serial
45     */
46    @MessageParam
47    private final String propertyValue; // NOPMD
48  
49    // ****************************** Initializer *******************************
50  
51    // ****************************** Constructors ******************************
52  
53    /**
54     * Constructor without cause.
55     *
56     * @param code the error or exception code of the exception.
57     * @param dataSourceId the identifier of the data source.
58     * @param path the path to the table that contains the property.
59     * @param propertyKey the identifier of the property key that caused problems.
60     * @param propertyValue the value the property should have been set to.
61     */
62    public DataSourcePropertyMessageBean(final DataSourceCode code,
63        final String dataSourceId, final String path, final String propertyKey,
64        final String propertyValue)
65    {
66      this(code, null, dataSourceId, path, propertyKey, propertyValue);
67    }
68  
69    // CHECKSTYLE:OFF
70    /**
71     * Default constructor.
72     *
73     * @param code the error or exception code of the exception.
74     * @param cause the cause to the problem.
75     * @param dataSourceId the identifier of the data source.
76     * @param path the path to the table that contains the property.
77     * @param propertyKey the identifier of the property key that caused problems.
78     * @param propertyValue the value the property should have been set to.
79     */
80    public DataSourcePropertyMessageBean(final DataSourceCode code,
81        final Throwable cause, final String dataSourceId, final String path,
82        final String propertyKey, final String propertyValue)
83    {
84      super(code, cause, dataSourceId, path, propertyKey);
85      this.propertyValue = propertyValue;
86    }
87    // CHECKSTYLE:ON
88  
89    // ****************************** Inner Classes *****************************
90  
91    // ********************************* Methods ********************************
92  
93    // --- init -----------------------------------------------------------------
94  
95    // --- factory --------------------------------------------------------------
96  
97    // --- get&set --------------------------------------------------------------
98  
99    // --- business -------------------------------------------------------------
100 
101   // --- object basics --------------------------------------------------------
102 
103 }