ElasticSearchDAOService.java 1.6 KB
Newer Older
P
peng-yongsheng 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/*
 * Copyright 2017, OpenSkywalking Organization All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Project repository: https://github.com/OpenSkywalking/skywalking
 */

package org.skywalking.apm.collector.storage.es.service;

21
import org.skywalking.apm.collector.storage.base.dao.DAO;
P
peng-yongsheng 已提交
22
import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
23
import org.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
P
peng-yongsheng 已提交
24 25 26 27 28 29 30 31 32 33 34 35 36
import org.skywalking.apm.collector.storage.service.DAOService;

/**
 * @author peng-yongsheng
 */
public class ElasticSearchDAOService implements DAOService {

    private final DAOContainer daoContainer;

    public ElasticSearchDAOService(DAOContainer daoContainer) {
        this.daoContainer = daoContainer;
    }

37
    @Override public DAO get(Class<? extends DAO> daoInterfaceClass) {
P
peng-yongsheng 已提交
38 39
        return daoContainer.get(daoInterfaceClass.getName());
    }
40 41 42 43

    @Override public IPersistenceDAO getPersistenceDAO(Class<? extends IPersistenceDAO> daoInterfaceClass) {
        return daoContainer.getPersistenceDAO(daoInterfaceClass.getName());
    }
P
peng-yongsheng 已提交
44
}