001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.bi.reporting;
016    
017    import java.io.Serializable;
018    
019    import java.util.HashMap;
020    import java.util.Map;
021    
022    /**
023     * @author Michael C. Han
024     */
025    public class ReportRequestContext implements Serializable {
026    
027            public static final String DATA_SOURCE_CHARSET = "dataSource.charset";
028    
029            public static final String DATA_SOURCE_COLUMN_NAMES =
030                    "dataSource.columnNames";
031    
032            public static final String DATA_SOURCE_FILE = "dataSource.file";
033    
034            public static final String JDBC_DRIVER_CLASS = "jdbc.driverClassName";
035    
036            public static final String JDBC_PASSWORD = "jdbc.password";
037    
038            public static final String JDBC_URL = "jdbc.url";
039    
040            public static final String JDBC_USER_NAME = "jdbc.userName";
041    
042            public ReportRequestContext(ReportDataSourceType reportDataSourceType) {
043                    _reportDataSourceType = reportDataSourceType;
044            }
045    
046            public Serializable getAttribute(String key) {
047                    return _attributes.get(key);
048            }
049    
050            public ReportDataSourceType getReportDataSourceType() {
051                    return _reportDataSourceType;
052            }
053    
054            public void setAttribute(String key, Serializable value) {
055                    _attributes.put(key, value);
056            }
057    
058            private Map<String, Serializable> _attributes =
059                    new HashMap<String, Serializable>();
060            private ReportDataSourceType _reportDataSourceType;
061    
062    }