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

com.hazelcast.jet.impl.connector.RemoteMapSourceConfiguration Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2008-2024, Hazelcast, Inc. 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.
 */

package com.hazelcast.jet.impl.connector;

import com.hazelcast.client.config.ClientConfig;
import com.hazelcast.jet.pipeline.DataConnectionRef;
import com.hazelcast.projection.Projection;
import com.hazelcast.query.Predicate;

import java.util.Map;

import static java.util.Objects.requireNonNull;

/**
 * Configuration for a remote map source
 *
 * @param  specifies key type
 * @param  specifies value type
 * @param  specifies emitted type
 */
public class RemoteMapSourceConfiguration {

    private final String name;
    private final DataConnectionRef dataConnectionRef;
    private final ClientConfig clientConfig;
    private final Predicate predicate;
    private final Projection, ? extends T> projection;

    public RemoteMapSourceConfiguration(String name,
                                        DataConnectionRef dataConnectionRef,
                                        ClientConfig clientConfig,
                                        Predicate predicate,
                                        Projection, ? extends T> projection) {
        this.name = requireNonNull(name);
        this.dataConnectionRef = dataConnectionRef;
        this.clientConfig = clientConfig;
        this.predicate = predicate;
        this.projection = projection;
    }

    public boolean hasPredicate() {
        return predicate != null;
    }

    public String getName() {
        return name;
    }

    public DataConnectionRef getDataConnectionRef() {
        return dataConnectionRef;
    }

    public String getDataConnectionName() {
        return dataConnectionRef == null ? null : dataConnectionRef.getName();
    }


    public ClientConfig getClientConfig() {
        return clientConfig;
    }

    public Predicate getPredicate() {
        return predicate;
    }

    public Projection, ? extends T> getProjection() {
        return projection;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy