001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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_BYTE_ARRAY = "dataSource.byteArray";
028    
029            public static final String DATA_SOURCE_CHARSET = "dataSource.charset";
030    
031            public static final String DATA_SOURCE_COLUMN_NAMES =
032                    "dataSource.columnNames";
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    }