All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.stratio.deep.cassandra.config.CassandraConfigFactory Maven / Gradle / Ivy

/*
 * Copyright 2014, Stratio.
 *
 * 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.
 */

package com.stratio.deep.cassandra.config;

import java.io.Serializable;

import org.apache.log4j.Logger;

import com.stratio.deep.commons.entity.Cells;
import com.stratio.deep.commons.entity.IDeepType;

/**
 * Factory class for deep configuration objects.
 *
 * @author Luca Rosellini 
 */
public final class CassandraConfigFactory implements Serializable {

    private static final long serialVersionUID = -4559130919203819088L;

    private static final Logger LOG = Logger.getLogger(CassandraConfigFactory.class);

    /**
     * private constructor
     */
    private CassandraConfigFactory() {
    }

    /**
     * Creates a new cell-based job configuration object.
     *
     * @return a new cell-based job configuration object.
     */
    public static CassandraDeepJobConfig create() {
        return new CellDeepJobConfig();
    }

    /**
     * Creates a new cell-based write suitable job configuration object.
     *
     * @return a new cell-based write suitable job configuration object.
     */
    public static CassandraDeepJobConfig createWriteConfig() {
        return new CellDeepJobConfig(true);
    }

    /**
     * Creates an entity-based configuration object.
     *
     * @param entityClass the class instance of the entity class that will be used to map db objects to Java objects.
     * @param          the generic type of the entity object implementing IDeepType.
     * @return a new an entity-based configuration object.
     */
    public static  CassandraDeepJobConfig create(Class entityClass) {
        return new EntityDeepJobConfig<>(entityClass);
    }

    /**
     * Creates an entity-based write configuration object.
     *
     * @return an entity-based write configuration object.
     */
    public static  CassandraDeepJobConfig createWriteConfig(Class entityClass) {
        return new EntityDeepJobConfig<>(entityClass, true);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy