@@ -0,0 +1,2079 @@
+/*%0A * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.%0A *%0A * WSO2 Inc. licenses this file to you under the Apache License,%0A * Version 2.0 (the %22License%22); you may not use this file except%0A * in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A */%0A%0Apackage org.wso2.carbon.dashboards.core.internal.database;%0A%0Aimport org.wso2.carbon.config.provider.ConfigProvider;%0Aimport org.wso2.carbon.dashboards.core.exception.DashboardException;%0Aimport org.wso2.carbon.datasource.core.api.DataSourceService;%0Aimport org.wso2.carbon.datasource.core.exception.DataSourceException;%0A%0Aimport javax.sql.DataSource;%0A%0A/**%0A * Factory for %7B@link DashboardMetadataDAO%7D class.%0A *%0A * @since 4.0.0%0A */%0Apublic class DashboardMetadataDaoFactory %7B%0A%0A    private static final String DATA_SOURCE_NAME_DASHBOARD = %22WSO2_DASHBOARD_DB%22;%0A%0A    /**%0A     * Creates a new DAO.%0A     *%0A     * @param dataSourceService data sources service%0A     * @param configProvider    config provider%0A     * @return DAO%0A     * @throws DashboardException if cannot find required data source%0A     */%0A    public static DashboardMetadataDAO createDao(DataSourceService dataSourceService, ConfigProvider configProvider)%0A            throws DashboardException %7B%0A        DataSource dataSource;%0A        try %7B%0A            dataSource = (DataSource) dataSourceService.getDataSource(DATA_SOURCE_NAME_DASHBOARD);%0A        %7D catch (DataSourceException e) %7B%0A            throw new DashboardException(%22Cannot find data source named '%22 + DATA_SOURCE_NAME_DASHBOARD + %22'.%22, e);%0A        %7D%0A        QueryManager queryManager = new QueryManager(configProvider);%0A        return new DashboardMetadataDAO(dataSource, queryManager);%0A    %7D%0A%7D%0A

add DashboardMetadataDaoFactory class