Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Some fixes
  • Loading branch information
bmaidics committed Apr 25, 2024
commit fb1dbfdb7a6fce73a1a24f52ccbf8e8b876d2044
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ public long targetRouteId()
{
return ASYNCAPI_TARGET_ROUTE_ID.getAsLong(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -419,31 +419,4 @@ private void visitAuthority(
authority = authorityRO.wrap(value.buffer(), value.offset(), value.limit());
}
}

static class AsyncapiNamespaceConfig
{
List<String> asyncapiLabels;
List<AsyncapiServerView> servers;
List<Asyncapi> asyncapis;
List<AsyncapiSchemaConfig> configs;

AsyncapiNamespaceConfig()
{
asyncapiLabels = new ArrayList<>();
servers = new ArrayList<>();
asyncapis = new ArrayList<>();
configs = new ArrayList<>();
}

private void addSpecForNamespace(
List<AsyncapiServerView> servers,
AsyncapiSchemaConfig config,
Asyncapi asyncapi)
{
this.asyncapiLabels.add(config.apiLabel);
this.servers.addAll(servers);
this.configs.add(config);
this.asyncapis.add(asyncapi);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class AsyncapiClientNamespaceGenerator extends AsyncapiNamespaceGenerator
{
public NamespaceConfig generate(
BindingConfig binding,
AsyncapiBindingConfig.AsyncapiNamespaceConfig namespaceConfig)
AsyncapiNamespaceConfig namespaceConfig)
{
List<AsyncapiServerView> servers = namespaceConfig.servers;
AsyncapiOptionsConfig options = binding.options != null ? (AsyncapiOptionsConfig) binding.options : EMPTY_OPTION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,6 @@ protected AsyncapiHttpProtocol(
this.authorization = httpOptions != null ? httpOptions.authorization : null;
}

public <C> BindingConfigBuilder<C> injectProtocolServerOptions(
BindingConfigBuilder<C> binding,
List<AsyncapiServerView> servers)
{
return binding
.options(HttpOptionsConfig::builder)
.access()
.policy(CROSS_ORIGIN)
.build()
.inject(this::injectHttpServerOptions)
.inject(this::injectHttpServerRequests)
.build();
}

@Override
public <C> BindingConfigBuilder<C> injectProtocolServerOptions(
BindingConfigBuilder<C> binding)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright 2021-2023 Aklivity Inc
*
* Licensed under the Aklivity Community License (the "License"); you may not use
* this file except in compliance with the License. You may obtain a copy of the
* License at
*
* https://www.aklivity.io/aklivity-community-license/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package io.aklivity.zilla.runtime.binding.asyncapi.internal.config;

import java.util.ArrayList;
import java.util.List;

import io.aklivity.zilla.runtime.binding.asyncapi.config.AsyncapiSchemaConfig;
import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.Asyncapi;
import io.aklivity.zilla.runtime.binding.asyncapi.internal.view.AsyncapiServerView;

class AsyncapiNamespaceConfig
{
List<String> asyncapiLabels;
List<AsyncapiServerView> servers;
List<Asyncapi> asyncapis;
List<AsyncapiSchemaConfig> configs;

AsyncapiNamespaceConfig()
{
asyncapiLabels = new ArrayList<>();
servers = new ArrayList<>();
asyncapis = new ArrayList<>();
configs = new ArrayList<>();
}

public void addSpecForNamespace(
List<AsyncapiServerView> servers,
AsyncapiSchemaConfig config,
Asyncapi asyncapi)
{
this.asyncapiLabels.add(config.apiLabel);
this.servers.addAll(servers);
this.configs.add(config);
this.asyncapis.add(asyncapi);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void init(

public NamespaceConfig generate(
BindingConfig binding,
AsyncapiBindingConfig.AsyncapiNamespaceConfig namespaceConfig)
AsyncapiNamespaceConfig namespaceConfig)
{
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class AsyncapiServerNamespaceGenerator extends AsyncapiNamespaceGenerator
{
public NamespaceConfig generate(
BindingConfig binding,
AsyncapiBindingConfig.AsyncapiNamespaceConfig namespaceConfig)
AsyncapiNamespaceConfig namespaceConfig)
{
List<AsyncapiServerView> servers = namespaceConfig.servers;
AsyncapiOptionsConfig options = binding.options != null ? (AsyncapiOptionsConfig) binding.options : EMPTY_OPTION;
Expand Down