Skip to content

Commit

Permalink
feat: add native protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinten10 committed Jun 7, 2022
1 parent 20f2b55 commit 2324a76
Show file tree
Hide file tree
Showing 38 changed files with 2,019 additions and 562 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ The Multi-Runtime Standard API for Mecha architecture Projects:
+ Publish/Subscribe (Pub/Sub)
+ State Management (State)
+ Secret Management (Secret)
+ Application Log/Metrics/Traces (Telemetry)
+ Binding External System (Binding)
+ File System (File)
+ Distribute Lock (Lock)
+ Database (SQL) -alpha
+ Application Log/Metrics/Traces (Telemetry)
+ Database (DB) -alpha
+ Schedule (Schedule) -alpha
+ Native Redis (Redis) -alpha
+ Native SQL (SQL) -alpha
+ ...

## Getting Started
Expand All @@ -50,7 +53,7 @@ For a Maven project, add the following to your `pom.xml` file:
<dependency>
<groupId>group.rxcloud</groupId>
<artifactId>cloud-runtimes-api</artifactId>
<version>1.12.RELEASE</version>
<version>1.13.RELEASE</version>
</dependency>
...
</dependencies>
Expand All @@ -62,8 +65,8 @@ For a Gradle project, add the following to your `build.gradle` file:

```groovy
dependencies {
...
// ...
// https://mvnrepository.com/artifact/group.rxcloud/cloud-runtimes-api
implementation group: 'group.rxcloud', name: 'cloud-runtimes-api', version: '1.12.RELEASE'
implementation group: 'group.rxcloud', name: 'cloud-runtimes-api', version: '1.13.RELEASE'
}
```
2 changes: 1 addition & 1 deletion cloud-runtimes-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>group.rxcloud</groupId>
<artifactId>cloud-runtimes</artifactId>
<version>1.12.RELEASE</version>
<version>1.13.RELEASE</version>
</parent>

<artifactId>cloud-runtimes-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public interface CloudRuntimesClient extends AutoCloseable,

/**
* Registry Component names.
*
* @return registry name list.
*/
List<String> registryNames();

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,34 @@
import group.rxcloud.cloudruntimes.domain.core.StateRuntimes;
import group.rxcloud.cloudruntimes.domain.core.SecretsRuntimes;
import group.rxcloud.cloudruntimes.domain.core.ConfigurationRuntimes;
import group.rxcloud.cloudruntimes.domain.core.binding.InvokeBindingRequest;
import group.rxcloud.cloudruntimes.domain.core.configuration.ConfigurationItem;
import group.rxcloud.cloudruntimes.domain.core.configuration.ConfigurationRequestItem;
import group.rxcloud.cloudruntimes.domain.core.configuration.SaveConfigurationRequest;
import group.rxcloud.cloudruntimes.domain.core.configuration.SubConfigurationResp;
import group.rxcloud.cloudruntimes.domain.core.invocation.HttpExtension;
import group.rxcloud.cloudruntimes.domain.core.invocation.InvokeMethodRequest;
import group.rxcloud.cloudruntimes.domain.core.invocation.RegisterServerRequest;
import group.rxcloud.cloudruntimes.domain.core.pubsub.PublishEventRequest;
import group.rxcloud.cloudruntimes.domain.core.pubsub.TopicEventRequest;
import group.rxcloud.cloudruntimes.domain.core.pubsub.TopicSubscription;
import group.rxcloud.cloudruntimes.domain.core.secrets.GetBulkSecretRequest;
import group.rxcloud.cloudruntimes.domain.core.secrets.GetSecretRequest;
import group.rxcloud.cloudruntimes.domain.core.state.DeleteStateRequest;
import group.rxcloud.cloudruntimes.domain.core.state.ExecuteStateTransactionRequest;
import group.rxcloud.cloudruntimes.domain.core.state.GetBulkStateRequest;
import group.rxcloud.cloudruntimes.domain.core.state.GetStateRequest;
import group.rxcloud.cloudruntimes.domain.core.state.SaveStateRequest;
import group.rxcloud.cloudruntimes.domain.core.state.State;
import group.rxcloud.cloudruntimes.domain.core.state.StateOptions;
import group.rxcloud.cloudruntimes.domain.core.state.TransactionalStateOperation;
import group.rxcloud.cloudruntimes.utils.TypeRef;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.List;
import java.util.Map;
import java.util.function.Function;

/**
* Core Cloud Runtimes standard API defined.
Expand All @@ -33,4 +61,304 @@ public interface CoreCloudRuntimes extends
StateRuntimes,
SecretsRuntimes,
ConfigurationRuntimes {

@Override
default Mono<Void> invokeBinding(String bindingName, String operation, Object data) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<byte[]> invokeBinding(String bindingName, String operation, byte[] data, Map<String, String> metadata) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<T> invokeBinding(String bindingName, String operation, Object data, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<T> invokeBinding(String bindingName, String operation, Object data, Class<T> clazz) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<T> invokeBinding(String bindingName, String operation, Object data, Map<String, String> metadata, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<T> invokeBinding(String bindingName, String operation, Object data, Map<String, String> metadata, Class<T> clazz) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<T> invokeBinding(InvokeBindingRequest request, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<List<ConfigurationItem<T>>> getConfiguration(String storeName, String appId, List<String> keys, Map<String, String> metadata, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<List<ConfigurationItem<T>>> getConfiguration(String storeName, String appId, List<String> keys, Map<String, String> metadata, String group, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<List<ConfigurationItem<T>>> getConfiguration(String storeName, String appId, List<String> keys, Map<String, String> metadata, String group, String label, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<List<ConfigurationItem<T>>> getConfiguration(ConfigurationRequestItem configurationRequestItem, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Void> saveConfiguration(SaveConfigurationRequest saveConfigurationRequest) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Void> deleteConfiguration(ConfigurationRequestItem configurationRequestItem) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Flux<SubConfigurationResp<T>> subscribeConfiguration(String storeName, String appId, List<String> keys, Map<String, String> metadata, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Flux<SubConfigurationResp<T>> subscribeConfiguration(String storeName, String appId, List<String> keys, Map<String, String> metadata, String group, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Flux<SubConfigurationResp<T>> subscribeConfiguration(String storeName, String appId, List<String> keys, Map<String, String> metadata, String group, String label, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Flux<SubConfigurationResp<T>> subscribeConfiguration(ConfigurationRequestItem configurationRequestItem, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<T> invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, Map<String, String> metadata, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<T> invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, Map<String, String> metadata, Class<T> clazz) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<T> invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<T> invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, Class<T> clazz) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<T> invokeMethod(String appId, String methodName, HttpExtension httpExtension, Map<String, String> metadata, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<T> invokeMethod(String appId, String methodName, HttpExtension httpExtension, Map<String, String> metadata, Class<T> clazz) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Void> invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, Map<String, String> metadata) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Void> invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Void> invokeMethod(String appId, String methodName, HttpExtension httpExtension, Map<String, String> metadata) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<byte[]> invokeMethod(String appId, String methodName, byte[] request, HttpExtension httpExtension, Map<String, String> metadata) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<T> invokeMethod(InvokeMethodRequest invokeMethodRequest, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T, R> Mono<Boolean> registerMethod(String methodName, List<HttpExtension> httpExtensions, Function<T, R> onInvoke, Map<String, String> metadata) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Boolean> registerServer(RegisterServerRequest registerServerRequest) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<String> publishEvent(String pubsubName, String topicName, Object data) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<String> publishEvent(String pubsubName, String topicName, Object data, Map<String, String> metadata) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<String> publishEvent(PublishEventRequest request) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Flux<TopicEventRequest> subscribeEvents(String pubsubName, String topicName, Map<String, String> metadata) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Flux<TopicEventRequest> subscribeEvents(TopicSubscription topicSubscription) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Map<String, String>> getSecret(String storeName, String secretName, Map<String, String> metadata) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Map<String, String>> getSecret(String storeName, String secretName) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Map<String, String>> getSecret(GetSecretRequest request) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Map<String, Map<String, String>>> getBulkSecret(String storeName) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Map<String, Map<String, String>>> getBulkSecret(String storeName, Map<String, String> metadata) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Map<String, Map<String, String>>> getBulkSecret(GetBulkSecretRequest request) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<State<T>> getState(String storeName, State<T> state, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<State<T>> getState(String storeName, State<T> state, Class<T> clazz) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<State<T>> getState(String storeName, String key, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<State<T>> getState(String storeName, String key, Class<T> clazz) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<State<T>> getState(String storeName, String key, StateOptions options, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<State<T>> getState(String storeName, String key, StateOptions options, Class<T> clazz) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<State<T>> getState(GetStateRequest request, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<List<State<T>>> getBulkState(String storeName, List<String> keys, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<List<State<T>>> getBulkState(String storeName, List<String> keys, Class<T> clazz) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default <T> Mono<List<State<T>>> getBulkState(GetBulkStateRequest request, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Void> executeStateTransaction(String storeName, List<TransactionalStateOperation<?>> operations) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Void> executeStateTransaction(ExecuteStateTransactionRequest request) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Void> saveBulkState(String storeName, List<State<?>> states) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Void> saveBulkState(SaveStateRequest request) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Void> saveState(String storeName, String key, Object value) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Void> saveState(String storeName, String key, String etag, Object value, StateOptions options) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Void> deleteState(String storeName, String key) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Void> deleteState(String storeName, String key, String etag, StateOptions options) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<Void> deleteState(DeleteStateRequest request) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}
}
Loading

0 comments on commit 2324a76

Please sign in to comment.