/** * Starts the {@link MessageMappingProcessorActor} responsible for payload transformation/mapping as child actor * behind a (cluster node local) RoundRobin pool and a dynamic resizer from the current mapping context. */ protected Either<DittoRuntimeException, ActorRef> startMessageMappingProcessor() { final MappingContext mappingContext = stateData().getConnection().getMappingContext().orElse(null); return startMessageMappingProcessor(mappingContext); }
/** * Starts the {@link MessageMappingProcessorActor} responsible for payload transformation/mapping as child actor * behind a (cluster node local) RoundRobin pool and a dynamic resizer from the current mapping context. */ protected Either<DittoRuntimeException, ActorRef> startMessageMappingProcessor() { final MappingContext mappingContext = stateData().getConnection().getMappingContext().orElse(null); return startMessageMappingProcessor(mappingContext); }
private State<BaseClientState, BaseClientData> clientConnected(final ClientConnected clientConnected, final BaseClientData data) { return ifEventUpToDate(clientConnected, () -> { LogUtil.enhanceLogWithCustomField(log, BaseClientData.MDC_CONNECTION_ID, connectionId()); startMessageMappingProcessor(data.getConnection().getMappingContext().orElse(null)); allocateResourcesOnConnection(clientConnected); data.getSessionSender().ifPresent(origin -> origin.tell(new Status.Success(CONNECTED), getSelf())); return goTo(CONNECTED).using(data.resetSession() .setConnectionStatus(ConnectionStatus.OPEN) .setConnectionStatusDetails("Connected at " + Instant.now())); }); }
private State<BaseClientState, BaseClientData> clientConnected(final ClientConnected clientConnected, final BaseClientData data) { return ifEventUpToDate(clientConnected, () -> { LogUtil.enhanceLogWithCustomField(log, BaseClientData.MDC_CONNECTION_ID, connectionId()); startMessageMappingProcessor(data.getConnection().getMappingContext().orElse(null)); allocateResourcesOnConnection(clientConnected); data.getSessionSender().ifPresent(origin -> origin.tell(new Status.Success(CONNECTED), getSelf())); return goTo(CONNECTED).using(data.resetSession() .setConnectionStatus(ConnectionStatus.OPEN) .setConnectionStatusDetails("Connected at " + Instant.now())); }); }
final CompletionStage<Status.Status> connectionStatusStage = doTestConnection(connection); final CompletionStage<Status.Status> mappingStatusStage = testMessageMappingProcessor(connection.getMappingContext().orElse(null));
final CompletionStage<Status.Status> connectionStatusStage = doTestConnection(connection); final CompletionStage<Status.Status> mappingStatusStage = testMessageMappingProcessor(connection.getMappingContext().orElse(null));
/** * Returns a new {@code ConnectionBuilder} object. * * @param connection the connection to use for initializing the builder. * @return new instance of {@code ImmutableConnectionBuilder}. * @throws NullPointerException if {@code connection} is {@code null}. */ public static ConnectionBuilder getBuilder(final Connection connection) { checkNotNull(connection, "Connection"); return new Builder(connection.getConnectionType()) .id(connection.getId()) .connectionStatus(connection.getConnectionStatus()) .credentials(connection.getCredentials().orElse(null)) .uri(connection.getUri()) .trustedCertificates(connection.getTrustedCertificates().orElse(null)) .failoverEnabled(connection.isFailoverEnabled()) .validateCertificate(connection.isValidateCertificates()) .processorPoolSize(connection.getProcessorPoolSize()) .sources(connection.getSources()) .targets(connection.getTargets()) .clientCount(connection.getClientCount()) .specificConfig(connection.getSpecificConfig()) .mappingContext(connection.getMappingContext().orElse(null)) .name(connection.getName().orElse(null)) .tags(connection.getTags()); }
/** * Returns a new {@code ConnectionBuilder} object. * * @param connection the connection to use for initializing the builder. * @return new instance of {@code ImmutableConnectionBuilder}. * @throws NullPointerException if {@code connection} is {@code null}. */ public static ConnectionBuilder getBuilder(final Connection connection) { checkNotNull(connection, "Connection"); return new Builder(connection.getConnectionType()) .id(connection.getId()) .connectionStatus(connection.getConnectionStatus()) .credentials(connection.getCredentials().orElse(null)) .uri(connection.getUri()) .trustedCertificates(connection.getTrustedCertificates().orElse(null)) .failoverEnabled(connection.isFailoverEnabled()) .validateCertificate(connection.isValidateCertificates()) .processorPoolSize(connection.getProcessorPoolSize()) .sources(connection.getSources()) .targets(connection.getTargets()) .clientCount(connection.getClientCount()) .specificConfig(connection.getSpecificConfig()) .mappingContext(connection.getMappingContext().orElse(null)) .name(connection.getName().orElse(null)) .tags(connection.getTags()); }