1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.kernel.bi.reporting;
16  
17  import java.io.Serializable;
18  
19  import java.util.HashMap;
20  import java.util.Map;
21  
22  /**
23   * <a href="ReportRequestContext.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Michael C. Han
26   */
27  public class ReportRequestContext implements Serializable {
28  
29      public static final String DATA_SOURCE_CHARSET = "dataSource.charset";
30  
31      public static final String DATA_SOURCE_COLUMN_NAMES =
32          "dataSource.columnNames";
33  
34      public static final String DATA_SOURCE_FILE = "dataSource.file";
35  
36      public static final String JDBC_DRIVER_CLASS = "jdbc.driverClassName";
37  
38      public static final String JDBC_PASSWORD = "jdbc.password";
39  
40      public static final String JDBC_URL = "jdbc.url";
41  
42      public static final String JDBC_USER_NAME = "jdbc.userName";
43  
44      public ReportRequestContext(ReportDataSourceType reportDataSourceType) {
45          _reportDataSourceType = reportDataSourceType;
46      }
47  
48      public Serializable getAttribute(String key) {
49          return _attributes.get(key);
50      }
51  
52      public ReportDataSourceType getReportDataSourceType() {
53          return _reportDataSourceType;
54      }
55  
56      public void setAttribute(String key, Serializable value) {
57          _attributes.put(key, value);
58      }
59  
60      private Map<String, Serializable> _attributes =
61          new HashMap<String, Serializable>();
62      private ReportDataSourceType _reportDataSourceType;
63  
64  }