Search in sources :

Example 1 with ConnectorPermission

use of com.hazelcast.security.permission.ConnectorPermission in project hazelcast by hazelcast.

the class SourceProcessors method streamJmsTopicP.

/**
 * Returns a supplier of processors for {@link Sources#jmsTopicBuilder}.
 *
 * @param isSharedConsumer true, if {@code createSharedConsumer()} or
 *      {@code createSharedDurableConsumer()} was used to create the
 *      consumer in the {@code consumerFn}
 * @param maxGuarantee maximum processing guarantee for the source. You can
 *      use it to disable acknowledging in transactions to save transaction
 *      overhead
 */
@Nonnull
public static <T> ProcessorMetaSupplier streamJmsTopicP(@Nullable String destination, boolean isSharedConsumer, @Nonnull ProcessingGuarantee maxGuarantee, @Nonnull EventTimePolicy<? super T> eventTimePolicy, @Nonnull SupplierEx<? extends Connection> newConnectionFn, @Nonnull FunctionEx<? super Session, ? extends MessageConsumer> consumerFn, @Nonnull FunctionEx<? super Message, ?> messageIdFn, @Nonnull FunctionEx<? super Message, ? extends T> projectionFn) {
    ProcessorSupplier pSupplier = new StreamJmsP.Supplier<>(destination, maxGuarantee, eventTimePolicy, newConnectionFn, consumerFn, messageIdFn, projectionFn);
    ConnectorPermission permission = ConnectorPermission.jms(destination, ACTION_READ);
    return isSharedConsumer ? ProcessorMetaSupplier.preferLocalParallelismOne(permission, pSupplier) : ProcessorMetaSupplier.forceTotalParallelismOne(pSupplier, newUnsecureUuidString(), permission);
}
Also used : ConnectorPermission(com.hazelcast.security.permission.ConnectorPermission) ProcessorSupplier(com.hazelcast.jet.core.ProcessorSupplier) ProcessorMetaSupplier(com.hazelcast.jet.core.ProcessorMetaSupplier) StreamEventJournalP.streamRemoteCacheSupplier(com.hazelcast.jet.impl.connector.StreamEventJournalP.streamRemoteCacheSupplier) ProcessorSupplier(com.hazelcast.jet.core.ProcessorSupplier) Nonnull(javax.annotation.Nonnull)

Aggregations

ProcessorMetaSupplier (com.hazelcast.jet.core.ProcessorMetaSupplier)1 ProcessorSupplier (com.hazelcast.jet.core.ProcessorSupplier)1 StreamEventJournalP.streamRemoteCacheSupplier (com.hazelcast.jet.impl.connector.StreamEventJournalP.streamRemoteCacheSupplier)1 ConnectorPermission (com.hazelcast.security.permission.ConnectorPermission)1 Nonnull (javax.annotation.Nonnull)1