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

io.deepsense.neptune.clientlibrary.models.impl.job.JobBuilderFactory Maven / Gradle / Ivy

There is a newer version: 1.6.1
Show newest version
/**
 * Copyright (c) 2016, CodiLime Inc.
 */

package io.deepsense.neptune.clientlibrary.models.impl.job;

import com.google.common.base.Preconditions;
import io.deepsense.neptune.clientlibrary.services.apimodelconverter.ApiModelConverter;
import io.deepsense.neptune.clientlibrary.services.apiservice.ApiService;
import io.deepsense.neptune.clientlibrary.services.serverconfigurationprovider.ServerConfigurationProvider;

public class JobBuilderFactory {

    private final ApiService apiService;

    private final ApiModelConverter apiModelConverter;

    private final ServerConfigurationProvider serverConfigurationProvider;

    private final io.deepsense.neptune.apiclient.model.Job apiJobModel;

    private final io.deepsense.neptune.apiclient.model.Experiment apiExperimentModel;

    public JobBuilderFactory(
            ApiService apiService,
            ApiModelConverter apiModelConverter,
            ServerConfigurationProvider serverConfigurationProvider,
            io.deepsense.neptune.apiclient.model.Job apiJobModel,
            io.deepsense.neptune.apiclient.model.Experiment apiExperimentModel) {
        this.apiService = Preconditions.checkNotNull(apiService);
        this.apiModelConverter = Preconditions.checkNotNull(apiModelConverter);
        this.serverConfigurationProvider = Preconditions.checkNotNull(serverConfigurationProvider);
        this.apiJobModel = Preconditions.checkNotNull(apiJobModel);
        this.apiExperimentModel = Preconditions.checkNotNull(apiExperimentModel);
    }

    public JobBuilder create() {
        return apiModelConverter.jobBuilderFromApiModel(apiJobModel, apiExperimentModel)
                .withApiService(apiService)
                .withApiModelConverter(apiModelConverter)
                .withMaxChannelValueSize(serverConfigurationProvider.getMaxChannelValueSize());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy