-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'eclipse' into feature/connection-log-publishing
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
- Loading branch information
Showing
108 changed files
with
1,932 additions
and
1,493 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
...src/main/java/org/eclipse/ditto/connectivity/service/config/ConnectionConfigProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright (c) 2021 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
|
||
package org.eclipse.ditto.connectivity.service.config; | ||
|
||
import java.util.Optional; | ||
import java.util.concurrent.CompletionStage; | ||
|
||
import org.atteo.classindex.IndexSubclasses; | ||
import org.eclipse.ditto.base.model.signals.events.Event; | ||
import org.eclipse.ditto.connectivity.model.ConnectionId; | ||
|
||
import com.typesafe.config.Config; | ||
|
||
import akka.actor.ActorRef; | ||
|
||
/** | ||
* Provides methods to load {@link ConnectivityConfig} and register for changes to {@link ConnectivityConfig}. | ||
*/ | ||
@IndexSubclasses | ||
public interface ConnectionConfigProvider { | ||
|
||
CompletionStage<Config> getConnectivityConfigOverwrites(ConnectionId connectionId); | ||
|
||
/** | ||
* Loads a {@link ConnectivityConfig} by a connection ID. | ||
* | ||
* @param connectionId the connection id for which to load the {@link ConnectivityConfig} | ||
* @return the future connectivity config | ||
*/ | ||
CompletionStage<ConnectivityConfig> getConnectivityConfig(ConnectionId connectionId); | ||
|
||
/** | ||
* Register the given {@code subscriber} for changes to the {@link ConnectivityConfig} of the given {@code | ||
* connectionId}. The given {@link ActorRef} will receive {@link Event}s to build the modified | ||
* {@link ConnectivityConfig}. | ||
* | ||
* @param connectionId the connection id | ||
* @param subscriber the subscriber that will receive {@link org.eclipse.ditto.base.model.signals.events.Event}s | ||
* @return a future that succeeds or fails depending on whether registration was successful. | ||
*/ | ||
CompletionStage<Void> registerForConnectivityConfigChanges(ConnectionId connectionId, ActorRef subscriber); | ||
|
||
/** | ||
* Returns {@code true} if the implementation can handle the given {@code event} to generate a modified {@link | ||
* ConnectivityConfig} when passed to {@link #handleEvent(Event)}. | ||
* | ||
* @param event the event that may be used to generate modified config | ||
* @return {@code true} if the event is compatible | ||
*/ | ||
boolean canHandle(Event<?> event); | ||
|
||
/** | ||
* Uses the given {@code event} to create a config which should overwrite the default connectivity config. | ||
* | ||
* @param event the event used to create a config which should overwrite the default connectivity config. | ||
* @return Potentially empty config which holds the overwrites for the default connectivity config. | ||
*/ | ||
Optional<Config> handleEvent(Event<?> event); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 0 additions & 111 deletions
111
...rc/main/java/org/eclipse/ditto/connectivity/service/config/ConnectionContextProvider.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.