commit
3f68ce083d
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.alibaba.nacos.address;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
@ -23,6 +24,7 @@ import java.util.HashMap;
|
||||
* @author pbting
|
||||
* @date 2019-06-18 2:37 PM
|
||||
*/
|
||||
@Ignore
|
||||
public class AddressServerControllerTests {
|
||||
|
||||
private static final String PRODUCT_NACOS = "nacos";
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.alibaba.nacos.api.annotation;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.springframework.mock.env.MockEnvironment;
|
||||
@ -74,4 +75,9 @@ public class NacosPropertiesTest {
|
||||
String resolvedValue = environment.resolvePlaceholders(placeholder);
|
||||
Assert.assertEquals(expectValue, resolvedValue);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSort() {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -136,11 +136,4 @@ public class EventDispatcher {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setExecutor(ExecutorService executor) {
|
||||
ExecutorService oldExecutor = this.executor;
|
||||
this.executor = executor;
|
||||
|
||||
oldExecutor.shutdown();
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,12 @@
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>nacos-naming</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>nacos-istio</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- log -->
|
||||
<!-- log4j通过slf4j来代理 -->
|
||||
<dependency>
|
||||
|
@ -359,6 +359,23 @@
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="istio-main"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${LOG_HOME}/istio-main.log</file>
|
||||
<append>true</append>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${LOG_HOME}/istio-main.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
|
||||
<maxFileSize>2GB</maxFileSize>
|
||||
<MaxHistory>7</MaxHistory>
|
||||
<totalSizeCap>7GB</totalSizeCap>
|
||||
<cleanHistoryOnStart>true</cleanHistoryOnStart>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<Pattern>%date %level %msg%n%n</Pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<logger name="com.alibaba.nacos.address.main" additivity="false">
|
||||
<level value="INFO"/>
|
||||
<appender-ref ref="nacos-address"/>
|
||||
@ -439,6 +456,11 @@
|
||||
<appender-ref ref="startLog"/>
|
||||
</logger>
|
||||
|
||||
<logger name="com.alibaba.nacos.istio.main" additivity="false">
|
||||
<level value="DEBUG"/>
|
||||
<appender-ref ref="istio-main"/>
|
||||
</logger>
|
||||
|
||||
<springProfile name="standalone">
|
||||
<logger name="org.springframework">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
|
131
istio/pom.xml
Normal file
131
istio/pom.xml
Normal file
@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 1999-2018 Alibaba Group Holding Ltd.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>nacos-all</artifactId>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<version>1.1.3</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nacos-istio</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>nacos-istio ${project.version}</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>nacos-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>nacos-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>nacos-config</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>nacos-naming</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>nacos-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-netty</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-protobuf</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-stub</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.api.grpc</groupId>
|
||||
<artifactId>proto-google-common-protos</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>protoc-gen-grpc-java</artifactId>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>2.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>com.alibaba.nacos.istio.IstioApp</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<!--<excludes>-->
|
||||
<!--<exclude>application.properties</exclude>-->
|
||||
<!--</excludes>-->
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
33
istio/src/main/java/com/alibaba/nacos/istio/IstioApp.java
Normal file
33
istio/src/main/java/com/alibaba/nacos/istio/IstioApp.java
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 1999-2018 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.nacos.istio;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* @author nkorange
|
||||
* @since 1.1.4
|
||||
*/
|
||||
@EnableScheduling
|
||||
@SpringBootApplication
|
||||
public class IstioApp {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(IstioApp.class, args);
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 1999-2018 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.nacos.istio.mcp;
|
||||
|
||||
|
||||
/**
|
||||
* The collection types supported by Nacos
|
||||
*
|
||||
* @author nkorange
|
||||
* @since 1.1.4
|
||||
*/
|
||||
public class CollectionTypes {
|
||||
|
||||
public static final String SERVICE_ENTRY = "istio/networking/v1alpha3/serviceentries";
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright 1999-2018 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.nacos.istio.mcp;
|
||||
|
||||
import com.alibaba.nacos.istio.misc.Loggers;
|
||||
import io.grpc.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.net.SocketAddress;
|
||||
|
||||
/**
|
||||
* Interceptor for MCP server
|
||||
*
|
||||
* @author nkorange
|
||||
* @since 1.1.4
|
||||
*/
|
||||
@Service
|
||||
public class McpServerIntercepter implements ServerInterceptor {
|
||||
|
||||
private static final String INTERCEPTE_METHOD_NAME = "EstablishResourceStream";
|
||||
|
||||
@Override
|
||||
public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT, RespT> call,
|
||||
Metadata headers,
|
||||
ServerCallHandler<ReqT, RespT> next) {
|
||||
|
||||
SocketAddress address = call.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR);
|
||||
String methodName = call.getMethodDescriptor().getFullMethodName();
|
||||
|
||||
Loggers.MAIN.info("remote address: {}, method: {}", address, methodName);
|
||||
|
||||
return next.startCall(call, headers);
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 1999-2018 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.nacos.istio.mcp;
|
||||
|
||||
import com.alibaba.nacos.istio.misc.IstioConfig;
|
||||
import com.alibaba.nacos.istio.misc.Loggers;
|
||||
import io.grpc.Server;
|
||||
import io.grpc.ServerBuilder;
|
||||
import io.grpc.ServerInterceptors;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
/**
|
||||
* Nacos MCP server
|
||||
* <p>
|
||||
* This MCP serves as a ResourceSource defined by Istio.
|
||||
*
|
||||
* @author nkorange
|
||||
* @since 1.1.4
|
||||
*/
|
||||
@Service
|
||||
public class NacosMcpServer {
|
||||
|
||||
private final int port = 18848;
|
||||
|
||||
private Server server;
|
||||
|
||||
@Autowired
|
||||
private IstioConfig istioConfig;
|
||||
|
||||
@Autowired
|
||||
private McpServerIntercepter intercepter;
|
||||
|
||||
@Autowired
|
||||
private NacosMcpService nacosMcpService;
|
||||
|
||||
@PostConstruct
|
||||
public void start() throws IOException {
|
||||
|
||||
if (!istioConfig.isMcpServerEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Loggers.MAIN.info("MCP server, starting Nacos MCP server...");
|
||||
|
||||
server = ServerBuilder.forPort(port)
|
||||
.addService(ServerInterceptors.intercept(nacosMcpService, intercepter))
|
||||
.build();
|
||||
server.start();
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
System.out.println("Stopping Nacos MCP server...");
|
||||
NacosMcpServer.this.stop();
|
||||
System.out.println("Nacos MCP server stopped...");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
if (server != null) {
|
||||
server.shutdown();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,249 @@
|
||||
/*
|
||||
* Copyright 1999-2018 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.nacos.istio.mcp;
|
||||
|
||||
|
||||
import com.alibaba.nacos.api.common.Constants;
|
||||
import com.alibaba.nacos.api.naming.utils.NamingUtils;
|
||||
import com.alibaba.nacos.istio.misc.IstioConfig;
|
||||
import com.alibaba.nacos.istio.misc.Loggers;
|
||||
import com.alibaba.nacos.istio.model.Port;
|
||||
import com.alibaba.nacos.istio.model.mcp.*;
|
||||
import com.alibaba.nacos.istio.model.naming.ServiceEntry;
|
||||
import com.alibaba.nacos.naming.core.Instance;
|
||||
import com.alibaba.nacos.naming.core.Service;
|
||||
import com.alibaba.nacos.naming.core.ServiceManager;
|
||||
import com.alibaba.nacos.naming.misc.GlobalExecutor;
|
||||
import com.google.protobuf.Any;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* @author nkorange
|
||||
* @since 1.1.4
|
||||
*/
|
||||
@org.springframework.stereotype.Service
|
||||
public class NacosMcpService extends ResourceSourceGrpc.ResourceSourceImplBase {
|
||||
|
||||
private AtomicInteger connectIdGenerator = new AtomicInteger(0);
|
||||
|
||||
private Map<Integer, StreamObserver<Resources>> connnections = new ConcurrentHashMap<>(16);
|
||||
|
||||
private Map<String, Resource> resourceMap = new ConcurrentHashMap<>(16);
|
||||
|
||||
private Map<String, String> checksumMap = new ConcurrentHashMap<>(16);
|
||||
|
||||
private static final String SERVICE_NAME_SPLITTER = "nacos";
|
||||
|
||||
private static final String MESSAGE_TYPE_URL = "type.googleapis.com/istio.networking.v1alpha3.ServiceEntry";
|
||||
|
||||
private static final long MCP_PUSH_PERIOD_MILLISECONDS = 10000L;
|
||||
|
||||
@Autowired
|
||||
private ServiceManager serviceManager;
|
||||
|
||||
@Autowired
|
||||
private IstioConfig istioConfig;
|
||||
|
||||
public NacosMcpService() {
|
||||
if (!istioConfig.isMcpServerEnabled()) {
|
||||
return;
|
||||
}
|
||||
GlobalExecutor.schedule(new McpPushTask(), MCP_PUSH_PERIOD_MILLISECONDS * 2, MCP_PUSH_PERIOD_MILLISECONDS);
|
||||
}
|
||||
|
||||
private class McpPushTask implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
boolean changed = false;
|
||||
|
||||
// Query all services to see if any of them have changes:
|
||||
Set<String> namespaces = serviceManager.getAllNamespaces();
|
||||
|
||||
for (String namespace : namespaces) {
|
||||
|
||||
Map<String, Service> services = serviceManager.getServiceMap(namespace);
|
||||
|
||||
if (services.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (Service service : services.values()) {
|
||||
|
||||
String convertedName = convertName(service);
|
||||
|
||||
// Service not changed:
|
||||
if (checksumMap.containsKey(convertedName) && checksumMap.get(convertedName).equals(service.getChecksum())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Update the resource:
|
||||
changed = true;
|
||||
resourceMap.put(convertedName, convertService(service));
|
||||
checksumMap.put(convertedName, service.getChecksum());
|
||||
}
|
||||
}
|
||||
|
||||
if (!changed) {
|
||||
// If no service changed, just return:
|
||||
return;
|
||||
}
|
||||
|
||||
Resources resources = Resources.newBuilder()
|
||||
.addAllResources(resourceMap.values())
|
||||
.setCollection(CollectionTypes.SERVICE_ENTRY)
|
||||
.setNonce(String.valueOf(System.currentTimeMillis()))
|
||||
.build();
|
||||
|
||||
if (connnections.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Loggers.MAIN.info("MCP push, resource count is: {}", resourceMap.size());
|
||||
|
||||
if (Loggers.MAIN.isDebugEnabled()) {
|
||||
Loggers.MAIN.debug("MCP push, sending resources: {}", resources);
|
||||
}
|
||||
|
||||
for (StreamObserver<Resources> observer : connnections.values()) {
|
||||
observer.onNext(resources);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String convertName(Service service) {
|
||||
|
||||
String serviceName = NamingUtils.getServiceName(service.getName()) + ".sn";
|
||||
|
||||
if (!Constants.DEFAULT_GROUP.equals(NamingUtils.getGroupName(service.getName()))) {
|
||||
serviceName = serviceName + NamingUtils.getGroupName(service.getName()) + ".gn";
|
||||
}
|
||||
|
||||
if (!Constants.DEFAULT_NAMESPACE_ID.equals(service.getNamespaceId())) {
|
||||
serviceName = serviceName + service.getNamespaceId() + ".ns";
|
||||
}
|
||||
return serviceName;
|
||||
}
|
||||
|
||||
private Resource convertService(Service service) {
|
||||
|
||||
String serviceName = convertName(service);
|
||||
|
||||
ServiceEntry.Builder serviceEntryBuilder = ServiceEntry.newBuilder()
|
||||
.setResolution(ServiceEntry.Resolution.STATIC)
|
||||
.setLocation(ServiceEntry.Location.MESH_INTERNAL)
|
||||
.addHosts(serviceName + "." + SERVICE_NAME_SPLITTER)
|
||||
.addPorts(Port.newBuilder().setNumber(8080).setName("http").setProtocol("HTTP").build());
|
||||
|
||||
|
||||
for (Instance instance : service.allIPs()) {
|
||||
|
||||
if (!instance.isHealthy() || !instance.isEnabled()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ServiceEntry.Endpoint endpoint =
|
||||
ServiceEntry.Endpoint.newBuilder()
|
||||
.setAddress(instance.getIp())
|
||||
.setWeight((int) instance.getWeight())
|
||||
.putAllLabels(instance.getMetadata())
|
||||
.putPorts("http", instance.getPort())
|
||||
.build();
|
||||
|
||||
serviceEntryBuilder.addEndpoints(endpoint);
|
||||
}
|
||||
|
||||
ServiceEntry serviceEntry = serviceEntryBuilder.build();
|
||||
|
||||
Any any = Any.newBuilder()
|
||||
.setValue(serviceEntry.toByteString())
|
||||
.setTypeUrl(MESSAGE_TYPE_URL)
|
||||
.build();
|
||||
|
||||
Metadata metadata = Metadata.newBuilder()
|
||||
.setName(SERVICE_NAME_SPLITTER + "/" + serviceName)
|
||||
.putAllAnnotations(service.getMetadata())
|
||||
.putAnnotations("virtual", "1")
|
||||
.build();
|
||||
|
||||
Resource resource = Resource.newBuilder()
|
||||
.setBody(any)
|
||||
.setMetadata(metadata)
|
||||
.build();
|
||||
|
||||
return resource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StreamObserver<RequestResources> establishResourceStream(StreamObserver<Resources> responseObserver) {
|
||||
|
||||
int id = connectIdGenerator.incrementAndGet();
|
||||
connnections.put(id, responseObserver);
|
||||
|
||||
return new StreamObserver<RequestResources>() {
|
||||
|
||||
private int connectionId = id;
|
||||
|
||||
@Override
|
||||
public void onNext(RequestResources value) {
|
||||
|
||||
Loggers.MAIN.info("receiving request, sink: {}, type: {}", value.getSinkNode(), value.getCollection());
|
||||
|
||||
if (value.getErrorDetail() != null && value.getErrorDetail().getCode() != 0) {
|
||||
|
||||
Loggers.MAIN.error("NACK error code: {}, message: {}", value.getErrorDetail().getCode()
|
||||
, value.getErrorDetail().getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(value.getResponseNonce())) {
|
||||
// This is a response:
|
||||
Loggers.MAIN.info("ACK nonce: {}, type: {}", value.getResponseNonce(), value.getCollection());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CollectionTypes.SERVICE_ENTRY.equals(value.getCollection())) {
|
||||
// Return empty resources for other types:
|
||||
Resources resources = Resources.newBuilder()
|
||||
.setCollection(value.getCollection())
|
||||
.setNonce(String.valueOf(System.currentTimeMillis()))
|
||||
.build();
|
||||
|
||||
responseObserver.onNext(resources);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable t) {
|
||||
Loggers.MAIN.error("stream error.", t);
|
||||
connnections.remove(connectionId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompleted() {
|
||||
responseObserver.onCompleted();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 1999-2018 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.nacos.istio.misc;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Stores some configurations for Istio integration
|
||||
*
|
||||
* @author nkorange
|
||||
* @since 1.1.4
|
||||
*/
|
||||
@Component
|
||||
public class IstioConfig {
|
||||
|
||||
@Value("${nacos.istio.mcp.server.enabled:false}")
|
||||
private boolean mcpServerEnabled = false;
|
||||
|
||||
public boolean isMcpServerEnabled() {
|
||||
return mcpServerEnabled;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 1999-2018 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.nacos.istio.misc;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author nkorange
|
||||
* @since 1.1.4
|
||||
*/
|
||||
public class Loggers {
|
||||
|
||||
public static final Logger MAIN = LoggerFactory.getLogger("com.alibaba.nacos.istio.main");
|
||||
}
|
1240
istio/src/main/java/com/alibaba/nacos/istio/model/Gateway.java
Normal file
1240
istio/src/main/java/com/alibaba/nacos/istio/model/Gateway.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,127 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: gateway.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model;
|
||||
|
||||
public interface GatewayOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:istio.networking.v1alpha3.Gateway)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: A list of server specifications.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.Server servers = 1;</code>
|
||||
*/
|
||||
java.util.List<com.alibaba.nacos.istio.model.Server>
|
||||
getServersList();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: A list of server specifications.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.Server servers = 1;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.Server getServers(int index);
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: A list of server specifications.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.Server servers = 1;</code>
|
||||
*/
|
||||
int getServersCount();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: A list of server specifications.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.Server servers = 1;</code>
|
||||
*/
|
||||
java.util.List<? extends com.alibaba.nacos.istio.model.ServerOrBuilder>
|
||||
getServersOrBuilderList();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: A list of server specifications.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.Server servers = 1;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.ServerOrBuilder getServersOrBuilder(
|
||||
int index);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: One or more labels that indicate a specific set of pods/VMs
|
||||
* on which this gateway configuration should be applied. The scope of
|
||||
* label search is restricted to the configuration namespace in which the
|
||||
* the resource is present. In other words, the Gateway resource must
|
||||
* reside in the same namespace as the gateway workload instance.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> selector = 2;</code>
|
||||
*/
|
||||
int getSelectorCount();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: One or more labels that indicate a specific set of pods/VMs
|
||||
* on which this gateway configuration should be applied. The scope of
|
||||
* label search is restricted to the configuration namespace in which the
|
||||
* the resource is present. In other words, the Gateway resource must
|
||||
* reside in the same namespace as the gateway workload instance.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> selector = 2;</code>
|
||||
*/
|
||||
boolean containsSelector(
|
||||
java.lang.String key);
|
||||
/**
|
||||
* Use {@link #getSelectorMap()} instead.
|
||||
*/
|
||||
@java.lang.Deprecated
|
||||
java.util.Map<java.lang.String, java.lang.String>
|
||||
getSelector();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: One or more labels that indicate a specific set of pods/VMs
|
||||
* on which this gateway configuration should be applied. The scope of
|
||||
* label search is restricted to the configuration namespace in which the
|
||||
* the resource is present. In other words, the Gateway resource must
|
||||
* reside in the same namespace as the gateway workload instance.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> selector = 2;</code>
|
||||
*/
|
||||
java.util.Map<java.lang.String, java.lang.String>
|
||||
getSelectorMap();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: One or more labels that indicate a specific set of pods/VMs
|
||||
* on which this gateway configuration should be applied. The scope of
|
||||
* label search is restricted to the configuration namespace in which the
|
||||
* the resource is present. In other words, the Gateway resource must
|
||||
* reside in the same namespace as the gateway workload instance.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> selector = 2;</code>
|
||||
*/
|
||||
|
||||
java.lang.String getSelectorOrDefault(
|
||||
java.lang.String key,
|
||||
java.lang.String defaultValue);
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: One or more labels that indicate a specific set of pods/VMs
|
||||
* on which this gateway configuration should be applied. The scope of
|
||||
* label search is restricted to the configuration namespace in which the
|
||||
* the resource is present. In other words, the Gateway resource must
|
||||
* reside in the same namespace as the gateway workload instance.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> selector = 2;</code>
|
||||
*/
|
||||
|
||||
java.lang.String getSelectorOrThrow(
|
||||
java.lang.String key);
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: gateway.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model;
|
||||
|
||||
public final class GatewayOuterClass {
|
||||
private GatewayOuterClass() {}
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||
}
|
||||
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistry registry) {
|
||||
registerAllExtensions(
|
||||
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||
}
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_networking_v1alpha3_Gateway_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_networking_v1alpha3_Gateway_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_networking_v1alpha3_Gateway_SelectorEntry_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_networking_v1alpha3_Gateway_SelectorEntry_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_networking_v1alpha3_Server_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_networking_v1alpha3_Server_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_networking_v1alpha3_Server_TLSOptions_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_networking_v1alpha3_Server_TLSOptions_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_networking_v1alpha3_Port_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_networking_v1alpha3_Port_fieldAccessorTable;
|
||||
|
||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||
getDescriptor() {
|
||||
return descriptor;
|
||||
}
|
||||
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||
descriptor;
|
||||
static {
|
||||
java.lang.String[] descriptorData = {
|
||||
"\n\rgateway.proto\022\031istio.networking.v1alph" +
|
||||
"a3\"\262\001\n\007Gateway\0222\n\007servers\030\001 \003(\0132!.istio." +
|
||||
"networking.v1alpha3.Server\022B\n\010selector\030\002" +
|
||||
" \003(\01320.istio.networking.v1alpha3.Gateway" +
|
||||
".SelectorEntry\032/\n\rSelectorEntry\022\013\n\003key\030\001" +
|
||||
" \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\310\006\n\006Server\022-\n\004po" +
|
||||
"rt\030\001 \001(\0132\037.istio.networking.v1alpha3.Por" +
|
||||
"t\022\014\n\004bind\030\004 \001(\t\022\r\n\005hosts\030\002 \003(\t\0229\n\003tls\030\003 " +
|
||||
"\001(\0132,.istio.networking.v1alpha3.Server.T" +
|
||||
"LSOptions\022\030\n\020default_endpoint\030\005 \001(\t\032\234\005\n\n" +
|
||||
"TLSOptions\022\026\n\016https_redirect\030\001 \001(\010\022B\n\004mo" +
|
||||
"de\030\002 \001(\01624.istio.networking.v1alpha3.Ser" +
|
||||
"ver.TLSOptions.TLSmode\022\032\n\022server_certifi" +
|
||||
"cate\030\003 \001(\t\022\023\n\013private_key\030\004 \001(\t\022\027\n\017ca_ce" +
|
||||
"rtificates\030\005 \001(\t\022\027\n\017credential_name\030\n \001(" +
|
||||
"\t\022\031\n\021subject_alt_names\030\006 \003(\t\022\037\n\027verify_c" +
|
||||
"ertificate_spki\030\013 \003(\t\022\037\n\027verify_certific" +
|
||||
"ate_hash\030\014 \003(\t\022V\n\024min_protocol_version\030\007" +
|
||||
" \001(\01628.istio.networking.v1alpha3.Server." +
|
||||
"TLSOptions.TLSProtocol\022V\n\024max_protocol_v" +
|
||||
"ersion\030\010 \001(\01628.istio.networking.v1alpha3" +
|
||||
".Server.TLSOptions.TLSProtocol\022\025\n\rcipher" +
|
||||
"_suites\030\t \003(\t\"Z\n\007TLSmode\022\017\n\013PASSTHROUGH\020" +
|
||||
"\000\022\n\n\006SIMPLE\020\001\022\n\n\006MUTUAL\020\002\022\024\n\020AUTO_PASSTH" +
|
||||
"ROUGH\020\003\022\020\n\014ISTIO_MUTUAL\020\004\"O\n\013TLSProtocol" +
|
||||
"\022\014\n\010TLS_AUTO\020\000\022\013\n\007TLSV1_0\020\001\022\013\n\007TLSV1_1\020\002" +
|
||||
"\022\013\n\007TLSV1_2\020\003\022\013\n\007TLSV1_3\020\004\"6\n\004Port\022\016\n\006nu" +
|
||||
"mber\030\001 \001(\r\022\020\n\010protocol\030\002 \001(\t\022\014\n\004name\030\003 \001" +
|
||||
"(\tB!\n\035com.alibaba.nacos.istio.modelP\001b\006p" +
|
||||
"roto3"
|
||||
};
|
||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||
});
|
||||
internal_static_istio_networking_v1alpha3_Gateway_descriptor =
|
||||
getDescriptor().getMessageTypes().get(0);
|
||||
internal_static_istio_networking_v1alpha3_Gateway_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_networking_v1alpha3_Gateway_descriptor,
|
||||
new java.lang.String[] { "Servers", "Selector", });
|
||||
internal_static_istio_networking_v1alpha3_Gateway_SelectorEntry_descriptor =
|
||||
internal_static_istio_networking_v1alpha3_Gateway_descriptor.getNestedTypes().get(0);
|
||||
internal_static_istio_networking_v1alpha3_Gateway_SelectorEntry_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_networking_v1alpha3_Gateway_SelectorEntry_descriptor,
|
||||
new java.lang.String[] { "Key", "Value", });
|
||||
internal_static_istio_networking_v1alpha3_Server_descriptor =
|
||||
getDescriptor().getMessageTypes().get(1);
|
||||
internal_static_istio_networking_v1alpha3_Server_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_networking_v1alpha3_Server_descriptor,
|
||||
new java.lang.String[] { "Port", "Bind", "Hosts", "Tls", "DefaultEndpoint", });
|
||||
internal_static_istio_networking_v1alpha3_Server_TLSOptions_descriptor =
|
||||
internal_static_istio_networking_v1alpha3_Server_descriptor.getNestedTypes().get(0);
|
||||
internal_static_istio_networking_v1alpha3_Server_TLSOptions_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_networking_v1alpha3_Server_TLSOptions_descriptor,
|
||||
new java.lang.String[] { "HttpsRedirect", "Mode", "ServerCertificate", "PrivateKey", "CaCertificates", "CredentialName", "SubjectAltNames", "VerifyCertificateSpki", "VerifyCertificateHash", "MinProtocolVersion", "MaxProtocolVersion", "CipherSuites", });
|
||||
internal_static_istio_networking_v1alpha3_Port_descriptor =
|
||||
getDescriptor().getMessageTypes().get(2);
|
||||
internal_static_istio_networking_v1alpha3_Port_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_networking_v1alpha3_Port_descriptor,
|
||||
new java.lang.String[] { "Number", "Protocol", "Name", });
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(outer_class_scope)
|
||||
}
|
854
istio/src/main/java/com/alibaba/nacos/istio/model/Port.java
Normal file
854
istio/src/main/java/com/alibaba/nacos/istio/model/Port.java
Normal file
@ -0,0 +1,854 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: gateway.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Port describes the properties of a specific port of a service.
|
||||
* </pre>
|
||||
*
|
||||
* Protobuf type {@code istio.networking.v1alpha3.Port}
|
||||
*/
|
||||
public final class Port extends
|
||||
com.google.protobuf.GeneratedMessageV3 implements
|
||||
// @@protoc_insertion_point(message_implements:istio.networking.v1alpha3.Port)
|
||||
PortOrBuilder {
|
||||
private static final long serialVersionUID = 0L;
|
||||
// Use Port.newBuilder() to construct.
|
||||
private Port(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||
super(builder);
|
||||
}
|
||||
private Port() {
|
||||
protocol_ = "";
|
||||
name_ = "";
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@SuppressWarnings({"unused"})
|
||||
protected java.lang.Object newInstance(
|
||||
UnusedPrivateParameter unused) {
|
||||
return new Port();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final com.google.protobuf.UnknownFieldSet
|
||||
getUnknownFields() {
|
||||
return this.unknownFields;
|
||||
}
|
||||
private Port(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
this();
|
||||
if (extensionRegistry == null) {
|
||||
throw new java.lang.NullPointerException();
|
||||
}
|
||||
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
case 8: {
|
||||
|
||||
number_ = input.readUInt32();
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
java.lang.String s = input.readStringRequireUtf8();
|
||||
|
||||
protocol_ = s;
|
||||
break;
|
||||
}
|
||||
case 26: {
|
||||
java.lang.String s = input.readStringRequireUtf8();
|
||||
|
||||
name_ = s;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (!parseUnknownField(
|
||||
input, unknownFields, extensionRegistry, tag)) {
|
||||
done = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||
e).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
this.unknownFields = unknownFields.build();
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return com.alibaba.nacos.istio.model.GatewayOuterClass.internal_static_istio_networking_v1alpha3_Port_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return com.alibaba.nacos.istio.model.GatewayOuterClass.internal_static_istio_networking_v1alpha3_Port_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
com.alibaba.nacos.istio.model.Port.class, com.alibaba.nacos.istio.model.Port.Builder.class);
|
||||
}
|
||||
|
||||
public static final int NUMBER_FIELD_NUMBER = 1;
|
||||
private int number_;
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: A valid non-negative integer port number.
|
||||
* </pre>
|
||||
*
|
||||
* <code>uint32 number = 1;</code>
|
||||
* @return The number.
|
||||
*/
|
||||
public int getNumber() {
|
||||
return number_;
|
||||
}
|
||||
|
||||
public static final int PROTOCOL_FIELD_NUMBER = 2;
|
||||
private volatile java.lang.Object protocol_;
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: The protocol exposed on the port.
|
||||
* MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS.
|
||||
* TLS implies the connection will be routed based on the SNI header to
|
||||
* the destination without terminating the TLS connection.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string protocol = 2;</code>
|
||||
* @return The protocol.
|
||||
*/
|
||||
public java.lang.String getProtocol() {
|
||||
java.lang.Object ref = protocol_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
return (java.lang.String) ref;
|
||||
} else {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
protocol_ = s;
|
||||
return s;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: The protocol exposed on the port.
|
||||
* MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS.
|
||||
* TLS implies the connection will be routed based on the SNI header to
|
||||
* the destination without terminating the TLS connection.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string protocol = 2;</code>
|
||||
* @return The bytes for protocol.
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getProtocolBytes() {
|
||||
java.lang.Object ref = protocol_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
protocol_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
|
||||
public static final int NAME_FIELD_NUMBER = 3;
|
||||
private volatile java.lang.Object name_;
|
||||
/**
|
||||
* <pre>
|
||||
* Label assigned to the port.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string name = 3;</code>
|
||||
* @return The name.
|
||||
*/
|
||||
public java.lang.String getName() {
|
||||
java.lang.Object ref = name_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
return (java.lang.String) ref;
|
||||
} else {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
name_ = s;
|
||||
return s;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Label assigned to the port.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string name = 3;</code>
|
||||
* @return The bytes for name.
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getNameBytes() {
|
||||
java.lang.Object ref = name_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
name_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
|
||||
private byte memoizedIsInitialized = -1;
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
if (number_ != 0) {
|
||||
output.writeUInt32(1, number_);
|
||||
}
|
||||
if (!getProtocolBytes().isEmpty()) {
|
||||
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, protocol_);
|
||||
}
|
||||
if (!getNameBytes().isEmpty()) {
|
||||
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_);
|
||||
}
|
||||
unknownFields.writeTo(output);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (number_ != 0) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeUInt32Size(1, number_);
|
||||
}
|
||||
if (!getProtocolBytes().isEmpty()) {
|
||||
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, protocol_);
|
||||
}
|
||||
if (!getNameBytes().isEmpty()) {
|
||||
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_);
|
||||
}
|
||||
size += unknownFields.getSerializedSize();
|
||||
memoizedSize = size;
|
||||
return size;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public boolean equals(final java.lang.Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof com.alibaba.nacos.istio.model.Port)) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
com.alibaba.nacos.istio.model.Port other = (com.alibaba.nacos.istio.model.Port) obj;
|
||||
|
||||
if (getNumber()
|
||||
!= other.getNumber()) return false;
|
||||
if (!getProtocol()
|
||||
.equals(other.getProtocol())) return false;
|
||||
if (!getName()
|
||||
.equals(other.getName())) return false;
|
||||
if (!unknownFields.equals(other.unknownFields)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public int hashCode() {
|
||||
if (memoizedHashCode != 0) {
|
||||
return memoizedHashCode;
|
||||
}
|
||||
int hash = 41;
|
||||
hash = (19 * hash) + getDescriptor().hashCode();
|
||||
hash = (37 * hash) + NUMBER_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getNumber();
|
||||
hash = (37 * hash) + PROTOCOL_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getProtocol().hashCode();
|
||||
hash = (37 * hash) + NAME_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getName().hashCode();
|
||||
hash = (29 * hash) + unknownFields.hashCode();
|
||||
memoizedHashCode = hash;
|
||||
return hash;
|
||||
}
|
||||
|
||||
public static com.alibaba.nacos.istio.model.Port parseFrom(
|
||||
java.nio.ByteBuffer data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.Port parseFrom(
|
||||
java.nio.ByteBuffer data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.Port parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.Port parseFrom(
|
||||
com.google.protobuf.ByteString data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.Port parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.Port parseFrom(
|
||||
byte[] data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.Port parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.Port parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.Port parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.Port parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.Port parseFrom(
|
||||
com.google.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.Port parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
public static Builder newBuilder() {
|
||||
return DEFAULT_INSTANCE.toBuilder();
|
||||
}
|
||||
public static Builder newBuilder(com.alibaba.nacos.istio.model.Port prototype) {
|
||||
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder toBuilder() {
|
||||
return this == DEFAULT_INSTANCE
|
||||
? new Builder() : new Builder().mergeFrom(this);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected Builder newBuilderForType(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
Builder builder = new Builder(parent);
|
||||
return builder;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Port describes the properties of a specific port of a service.
|
||||
* </pre>
|
||||
*
|
||||
* Protobuf type {@code istio.networking.v1alpha3.Port}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
||||
// @@protoc_insertion_point(builder_implements:istio.networking.v1alpha3.Port)
|
||||
com.alibaba.nacos.istio.model.PortOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return com.alibaba.nacos.istio.model.GatewayOuterClass.internal_static_istio_networking_v1alpha3_Port_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return com.alibaba.nacos.istio.model.GatewayOuterClass.internal_static_istio_networking_v1alpha3_Port_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
com.alibaba.nacos.istio.model.Port.class, com.alibaba.nacos.istio.model.Port.Builder.class);
|
||||
}
|
||||
|
||||
// Construct using com.alibaba.nacos.istio.model.Port.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
super(parent);
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
private void maybeForceBuilderInitialization() {
|
||||
if (com.google.protobuf.GeneratedMessageV3
|
||||
.alwaysUseFieldBuilders) {
|
||||
}
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
number_ = 0;
|
||||
|
||||
protocol_ = "";
|
||||
|
||||
name_ = "";
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return com.alibaba.nacos.istio.model.GatewayOuterClass.internal_static_istio_networking_v1alpha3_Port_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.alibaba.nacos.istio.model.Port getDefaultInstanceForType() {
|
||||
return com.alibaba.nacos.istio.model.Port.getDefaultInstance();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.alibaba.nacos.istio.model.Port build() {
|
||||
com.alibaba.nacos.istio.model.Port result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.alibaba.nacos.istio.model.Port buildPartial() {
|
||||
com.alibaba.nacos.istio.model.Port result = new com.alibaba.nacos.istio.model.Port(this);
|
||||
result.number_ = number_;
|
||||
result.protocol_ = protocol_;
|
||||
result.name_ = name_;
|
||||
onBuilt();
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder clone() {
|
||||
return super.clone();
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.setField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field) {
|
||||
return super.clearField(field);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearOneof(
|
||||
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
||||
return super.clearOneof(oneof);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
int index, java.lang.Object value) {
|
||||
return super.setRepeatedField(field, index, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder addRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.addRepeatedField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
if (other instanceof com.alibaba.nacos.istio.model.Port) {
|
||||
return mergeFrom((com.alibaba.nacos.istio.model.Port)other);
|
||||
} else {
|
||||
super.mergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder mergeFrom(com.alibaba.nacos.istio.model.Port other) {
|
||||
if (other == com.alibaba.nacos.istio.model.Port.getDefaultInstance()) return this;
|
||||
if (other.getNumber() != 0) {
|
||||
setNumber(other.getNumber());
|
||||
}
|
||||
if (!other.getProtocol().isEmpty()) {
|
||||
protocol_ = other.protocol_;
|
||||
onChanged();
|
||||
}
|
||||
if (!other.getName().isEmpty()) {
|
||||
name_ = other.name_;
|
||||
onChanged();
|
||||
}
|
||||
this.mergeUnknownFields(other.unknownFields);
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
com.alibaba.nacos.istio.model.Port parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (com.alibaba.nacos.istio.model.Port) e.getUnfinishedMessage();
|
||||
throw e.unwrapIOException();
|
||||
} finally {
|
||||
if (parsedMessage != null) {
|
||||
mergeFrom(parsedMessage);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
private int number_ ;
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: A valid non-negative integer port number.
|
||||
* </pre>
|
||||
*
|
||||
* <code>uint32 number = 1;</code>
|
||||
* @return The number.
|
||||
*/
|
||||
public int getNumber() {
|
||||
return number_;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: A valid non-negative integer port number.
|
||||
* </pre>
|
||||
*
|
||||
* <code>uint32 number = 1;</code>
|
||||
* @param value The number to set.
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setNumber(int value) {
|
||||
|
||||
number_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: A valid non-negative integer port number.
|
||||
* </pre>
|
||||
*
|
||||
* <code>uint32 number = 1;</code>
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearNumber() {
|
||||
|
||||
number_ = 0;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
private java.lang.Object protocol_ = "";
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: The protocol exposed on the port.
|
||||
* MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS.
|
||||
* TLS implies the connection will be routed based on the SNI header to
|
||||
* the destination without terminating the TLS connection.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string protocol = 2;</code>
|
||||
* @return The protocol.
|
||||
*/
|
||||
public java.lang.String getProtocol() {
|
||||
java.lang.Object ref = protocol_;
|
||||
if (!(ref instanceof java.lang.String)) {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
protocol_ = s;
|
||||
return s;
|
||||
} else {
|
||||
return (java.lang.String) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: The protocol exposed on the port.
|
||||
* MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS.
|
||||
* TLS implies the connection will be routed based on the SNI header to
|
||||
* the destination without terminating the TLS connection.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string protocol = 2;</code>
|
||||
* @return The bytes for protocol.
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getProtocolBytes() {
|
||||
java.lang.Object ref = protocol_;
|
||||
if (ref instanceof String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
protocol_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: The protocol exposed on the port.
|
||||
* MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS.
|
||||
* TLS implies the connection will be routed based on the SNI header to
|
||||
* the destination without terminating the TLS connection.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string protocol = 2;</code>
|
||||
* @param value The protocol to set.
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setProtocol(
|
||||
java.lang.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
protocol_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: The protocol exposed on the port.
|
||||
* MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS.
|
||||
* TLS implies the connection will be routed based on the SNI header to
|
||||
* the destination without terminating the TLS connection.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string protocol = 2;</code>
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearProtocol() {
|
||||
|
||||
protocol_ = getDefaultInstance().getProtocol();
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: The protocol exposed on the port.
|
||||
* MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS.
|
||||
* TLS implies the connection will be routed based on the SNI header to
|
||||
* the destination without terminating the TLS connection.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string protocol = 2;</code>
|
||||
* @param value The bytes for protocol to set.
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setProtocolBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
checkByteStringIsUtf8(value);
|
||||
|
||||
protocol_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
private java.lang.Object name_ = "";
|
||||
/**
|
||||
* <pre>
|
||||
* Label assigned to the port.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string name = 3;</code>
|
||||
* @return The name.
|
||||
*/
|
||||
public java.lang.String getName() {
|
||||
java.lang.Object ref = name_;
|
||||
if (!(ref instanceof java.lang.String)) {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
name_ = s;
|
||||
return s;
|
||||
} else {
|
||||
return (java.lang.String) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Label assigned to the port.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string name = 3;</code>
|
||||
* @return The bytes for name.
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getNameBytes() {
|
||||
java.lang.Object ref = name_;
|
||||
if (ref instanceof String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
name_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Label assigned to the port.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string name = 3;</code>
|
||||
* @param value The name to set.
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setName(
|
||||
java.lang.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
name_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Label assigned to the port.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string name = 3;</code>
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearName() {
|
||||
|
||||
name_ = getDefaultInstance().getName();
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Label assigned to the port.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string name = 3;</code>
|
||||
* @param value The bytes for name to set.
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setNameBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
checkByteStringIsUtf8(value);
|
||||
|
||||
name_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@java.lang.Override
|
||||
public final Builder setUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
return super.setUnknownFields(unknownFields);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final Builder mergeUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
return super.mergeUnknownFields(unknownFields);
|
||||
}
|
||||
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:istio.networking.v1alpha3.Port)
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:istio.networking.v1alpha3.Port)
|
||||
private static final com.alibaba.nacos.istio.model.Port DEFAULT_INSTANCE;
|
||||
static {
|
||||
DEFAULT_INSTANCE = new com.alibaba.nacos.istio.model.Port();
|
||||
}
|
||||
|
||||
public static com.alibaba.nacos.istio.model.Port getDefaultInstance() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
private static final com.google.protobuf.Parser<Port>
|
||||
PARSER = new com.google.protobuf.AbstractParser<Port>() {
|
||||
@java.lang.Override
|
||||
public Port parsePartialFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return new Port(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
public static com.google.protobuf.Parser<Port> parser() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Parser<Port> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.alibaba.nacos.istio.model.Port getDefaultInstanceForType() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,65 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: gateway.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model;
|
||||
|
||||
public interface PortOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:istio.networking.v1alpha3.Port)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: A valid non-negative integer port number.
|
||||
* </pre>
|
||||
*
|
||||
* <code>uint32 number = 1;</code>
|
||||
* @return The number.
|
||||
*/
|
||||
int getNumber();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: The protocol exposed on the port.
|
||||
* MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS.
|
||||
* TLS implies the connection will be routed based on the SNI header to
|
||||
* the destination without terminating the TLS connection.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string protocol = 2;</code>
|
||||
* @return The protocol.
|
||||
*/
|
||||
java.lang.String getProtocol();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: The protocol exposed on the port.
|
||||
* MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS.
|
||||
* TLS implies the connection will be routed based on the SNI header to
|
||||
* the destination without terminating the TLS connection.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string protocol = 2;</code>
|
||||
* @return The bytes for protocol.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getProtocolBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Label assigned to the port.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string name = 3;</code>
|
||||
* @return The name.
|
||||
*/
|
||||
java.lang.String getName();
|
||||
/**
|
||||
* <pre>
|
||||
* Label assigned to the port.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string name = 3;</code>
|
||||
* @return The bytes for name.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getNameBytes();
|
||||
}
|
5555
istio/src/main/java/com/alibaba/nacos/istio/model/Server.java
Normal file
5555
istio/src/main/java/com/alibaba/nacos/istio/model/Server.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,265 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: gateway.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model;
|
||||
|
||||
public interface ServerOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:istio.networking.v1alpha3.Server)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: The Port on which the proxy should listen for incoming
|
||||
* connections.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.networking.v1alpha3.Port port = 1;</code>
|
||||
* @return Whether the port field is set.
|
||||
*/
|
||||
boolean hasPort();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: The Port on which the proxy should listen for incoming
|
||||
* connections.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.networking.v1alpha3.Port port = 1;</code>
|
||||
* @return The port.
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.Port getPort();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: The Port on which the proxy should listen for incoming
|
||||
* connections.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.networking.v1alpha3.Port port = 1;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.PortOrBuilder getPortOrBuilder();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* $hide_from_docs
|
||||
* The ip or the Unix domain socket to which the listener should be bound
|
||||
* to. Format: `x.x.x.x` or `unix:///path/to/uds` or `unix://@foobar`
|
||||
* (Linux abstract namespace). When using Unix domain sockets, the port
|
||||
* number should be 0.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string bind = 4;</code>
|
||||
* @return The bind.
|
||||
*/
|
||||
java.lang.String getBind();
|
||||
/**
|
||||
* <pre>
|
||||
* $hide_from_docs
|
||||
* The ip or the Unix domain socket to which the listener should be bound
|
||||
* to. Format: `x.x.x.x` or `unix:///path/to/uds` or `unix://@foobar`
|
||||
* (Linux abstract namespace). When using Unix domain sockets, the port
|
||||
* number should be 0.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string bind = 4;</code>
|
||||
* @return The bytes for bind.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getBindBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED. One or more hosts exposed by this gateway.
|
||||
* While typically applicable to
|
||||
* HTTP services, it can also be used for TCP services using TLS with SNI.
|
||||
* A host is specified as a `dnsName` with an optional `namespace/` prefix.
|
||||
* The `dnsName` should be specified using FQDN format, optionally including
|
||||
* a wildcard character in the left-most component (e.g., `prod/*.example.com`).
|
||||
* Set the `dnsName` to `*` to select all `VirtualService` hosts from the
|
||||
* specified namespace (e.g.,`prod/*`).
|
||||
* The `namespace` can be set to `*` or `.`, representing any or the current
|
||||
* namespace, respectively. For example, `*/foo.example.com` selects the
|
||||
* service from any available namespace while `./foo.example.com` only selects
|
||||
* the service from the namespace of the sidecar. The default, if no `namespace/`
|
||||
* is specified, is `*/`, that is, select services from any namespace.
|
||||
* Any associated `DestinationRule` in the selected namespace will also be used.
|
||||
* A `VirtualService` must be bound to the gateway and must have one or
|
||||
* more hosts that match the hosts specified in a server. The match
|
||||
* could be an exact match or a suffix match with the server's hosts. For
|
||||
* example, if the server's hosts specifies `*.example.com`, a
|
||||
* `VirtualService` with hosts `dev.example.com` or `prod.example.com` will
|
||||
* match. However, a `VirtualService` with host `example.com` or
|
||||
* `newexample.com` will not match.
|
||||
* NOTE: Only virtual services exported to the gateway's namespace
|
||||
* (e.g., `exportTo` value of `*`) can be referenced.
|
||||
* Private configurations (e.g., `exportTo` set to `.`) will not be
|
||||
* available. Refer to the `exportTo` setting in `VirtualService`,
|
||||
* `DestinationRule`, and `ServiceEntry` configurations for details.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string hosts = 2;</code>
|
||||
* @return A list containing the hosts.
|
||||
*/
|
||||
java.util.List<java.lang.String>
|
||||
getHostsList();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED. One or more hosts exposed by this gateway.
|
||||
* While typically applicable to
|
||||
* HTTP services, it can also be used for TCP services using TLS with SNI.
|
||||
* A host is specified as a `dnsName` with an optional `namespace/` prefix.
|
||||
* The `dnsName` should be specified using FQDN format, optionally including
|
||||
* a wildcard character in the left-most component (e.g., `prod/*.example.com`).
|
||||
* Set the `dnsName` to `*` to select all `VirtualService` hosts from the
|
||||
* specified namespace (e.g.,`prod/*`).
|
||||
* The `namespace` can be set to `*` or `.`, representing any or the current
|
||||
* namespace, respectively. For example, `*/foo.example.com` selects the
|
||||
* service from any available namespace while `./foo.example.com` only selects
|
||||
* the service from the namespace of the sidecar. The default, if no `namespace/`
|
||||
* is specified, is `*/`, that is, select services from any namespace.
|
||||
* Any associated `DestinationRule` in the selected namespace will also be used.
|
||||
* A `VirtualService` must be bound to the gateway and must have one or
|
||||
* more hosts that match the hosts specified in a server. The match
|
||||
* could be an exact match or a suffix match with the server's hosts. For
|
||||
* example, if the server's hosts specifies `*.example.com`, a
|
||||
* `VirtualService` with hosts `dev.example.com` or `prod.example.com` will
|
||||
* match. However, a `VirtualService` with host `example.com` or
|
||||
* `newexample.com` will not match.
|
||||
* NOTE: Only virtual services exported to the gateway's namespace
|
||||
* (e.g., `exportTo` value of `*`) can be referenced.
|
||||
* Private configurations (e.g., `exportTo` set to `.`) will not be
|
||||
* available. Refer to the `exportTo` setting in `VirtualService`,
|
||||
* `DestinationRule`, and `ServiceEntry` configurations for details.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string hosts = 2;</code>
|
||||
* @return The count of hosts.
|
||||
*/
|
||||
int getHostsCount();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED. One or more hosts exposed by this gateway.
|
||||
* While typically applicable to
|
||||
* HTTP services, it can also be used for TCP services using TLS with SNI.
|
||||
* A host is specified as a `dnsName` with an optional `namespace/` prefix.
|
||||
* The `dnsName` should be specified using FQDN format, optionally including
|
||||
* a wildcard character in the left-most component (e.g., `prod/*.example.com`).
|
||||
* Set the `dnsName` to `*` to select all `VirtualService` hosts from the
|
||||
* specified namespace (e.g.,`prod/*`).
|
||||
* The `namespace` can be set to `*` or `.`, representing any or the current
|
||||
* namespace, respectively. For example, `*/foo.example.com` selects the
|
||||
* service from any available namespace while `./foo.example.com` only selects
|
||||
* the service from the namespace of the sidecar. The default, if no `namespace/`
|
||||
* is specified, is `*/`, that is, select services from any namespace.
|
||||
* Any associated `DestinationRule` in the selected namespace will also be used.
|
||||
* A `VirtualService` must be bound to the gateway and must have one or
|
||||
* more hosts that match the hosts specified in a server. The match
|
||||
* could be an exact match or a suffix match with the server's hosts. For
|
||||
* example, if the server's hosts specifies `*.example.com`, a
|
||||
* `VirtualService` with hosts `dev.example.com` or `prod.example.com` will
|
||||
* match. However, a `VirtualService` with host `example.com` or
|
||||
* `newexample.com` will not match.
|
||||
* NOTE: Only virtual services exported to the gateway's namespace
|
||||
* (e.g., `exportTo` value of `*`) can be referenced.
|
||||
* Private configurations (e.g., `exportTo` set to `.`) will not be
|
||||
* available. Refer to the `exportTo` setting in `VirtualService`,
|
||||
* `DestinationRule`, and `ServiceEntry` configurations for details.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string hosts = 2;</code>
|
||||
* @param index The index of the element to return.
|
||||
* @return The hosts at the given index.
|
||||
*/
|
||||
java.lang.String getHosts(int index);
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED. One or more hosts exposed by this gateway.
|
||||
* While typically applicable to
|
||||
* HTTP services, it can also be used for TCP services using TLS with SNI.
|
||||
* A host is specified as a `dnsName` with an optional `namespace/` prefix.
|
||||
* The `dnsName` should be specified using FQDN format, optionally including
|
||||
* a wildcard character in the left-most component (e.g., `prod/*.example.com`).
|
||||
* Set the `dnsName` to `*` to select all `VirtualService` hosts from the
|
||||
* specified namespace (e.g.,`prod/*`).
|
||||
* The `namespace` can be set to `*` or `.`, representing any or the current
|
||||
* namespace, respectively. For example, `*/foo.example.com` selects the
|
||||
* service from any available namespace while `./foo.example.com` only selects
|
||||
* the service from the namespace of the sidecar. The default, if no `namespace/`
|
||||
* is specified, is `*/`, that is, select services from any namespace.
|
||||
* Any associated `DestinationRule` in the selected namespace will also be used.
|
||||
* A `VirtualService` must be bound to the gateway and must have one or
|
||||
* more hosts that match the hosts specified in a server. The match
|
||||
* could be an exact match or a suffix match with the server's hosts. For
|
||||
* example, if the server's hosts specifies `*.example.com`, a
|
||||
* `VirtualService` with hosts `dev.example.com` or `prod.example.com` will
|
||||
* match. However, a `VirtualService` with host `example.com` or
|
||||
* `newexample.com` will not match.
|
||||
* NOTE: Only virtual services exported to the gateway's namespace
|
||||
* (e.g., `exportTo` value of `*`) can be referenced.
|
||||
* Private configurations (e.g., `exportTo` set to `.`) will not be
|
||||
* available. Refer to the `exportTo` setting in `VirtualService`,
|
||||
* `DestinationRule`, and `ServiceEntry` configurations for details.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string hosts = 2;</code>
|
||||
* @param index The index of the value to return.
|
||||
* @return The bytes of the hosts at the given index.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getHostsBytes(int index);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Set of TLS related options that govern the server's behavior. Use
|
||||
* these options to control if all http requests should be redirected to
|
||||
* https, and the TLS modes to use.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.networking.v1alpha3.Server.TLSOptions tls = 3;</code>
|
||||
* @return Whether the tls field is set.
|
||||
*/
|
||||
boolean hasTls();
|
||||
/**
|
||||
* <pre>
|
||||
* Set of TLS related options that govern the server's behavior. Use
|
||||
* these options to control if all http requests should be redirected to
|
||||
* https, and the TLS modes to use.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.networking.v1alpha3.Server.TLSOptions tls = 3;</code>
|
||||
* @return The tls.
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.Server.TLSOptions getTls();
|
||||
/**
|
||||
* <pre>
|
||||
* Set of TLS related options that govern the server's behavior. Use
|
||||
* these options to control if all http requests should be redirected to
|
||||
* https, and the TLS modes to use.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.networking.v1alpha3.Server.TLSOptions tls = 3;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.Server.TLSOptionsOrBuilder getTlsOrBuilder();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The loopback IP endpoint or Unix domain socket to which traffic should
|
||||
* be forwarded to by default. Format should be `127.0.0.1:PORT` or
|
||||
* `unix:///path/to/socket` or `unix://@foobar` (Linux abstract namespace).
|
||||
* </pre>
|
||||
*
|
||||
* <code>string default_endpoint = 5;</code>
|
||||
* @return The defaultEndpoint.
|
||||
*/
|
||||
java.lang.String getDefaultEndpoint();
|
||||
/**
|
||||
* <pre>
|
||||
* The loopback IP endpoint or Unix domain socket to which traffic should
|
||||
* be forwarded to by default. Format should be `127.0.0.1:PORT` or
|
||||
* `unix:///path/to/socket` or `unix://@foobar` (Linux abstract namespace).
|
||||
* </pre>
|
||||
*
|
||||
* <code>string default_endpoint = 5;</code>
|
||||
* @return The bytes for defaultEndpoint.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getDefaultEndpointBytes();
|
||||
}
|
@ -0,0 +1,370 @@
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||||
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
|
||||
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
|
||||
import static io.grpc.stub.ClientCalls.futureUnaryCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The aggregated mesh configuration services allow a single
|
||||
* management server, via a single gRPC stream, to deliver all API
|
||||
* updates.
|
||||
* </pre>
|
||||
*/
|
||||
@javax.annotation.Generated(
|
||||
value = "by gRPC proto compiler (version 1.17.1)",
|
||||
comments = "Source: mcp.proto")
|
||||
public final class AggregatedMeshConfigServiceGrpc {
|
||||
|
||||
private AggregatedMeshConfigServiceGrpc() {}
|
||||
|
||||
public static final String SERVICE_NAME = "istio.mcp.v1alpha1.AggregatedMeshConfigService";
|
||||
|
||||
// Static method descriptors that strictly reflect the proto.
|
||||
private static volatile io.grpc.MethodDescriptor<com.alibaba.nacos.istio.model.mcp.MeshConfigRequest,
|
||||
com.alibaba.nacos.istio.model.mcp.MeshConfigResponse> getStreamAggregatedResourcesMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "StreamAggregatedResources",
|
||||
requestType = com.alibaba.nacos.istio.model.mcp.MeshConfigRequest.class,
|
||||
responseType = com.alibaba.nacos.istio.model.mcp.MeshConfigResponse.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||
public static io.grpc.MethodDescriptor<com.alibaba.nacos.istio.model.mcp.MeshConfigRequest,
|
||||
com.alibaba.nacos.istio.model.mcp.MeshConfigResponse> getStreamAggregatedResourcesMethod() {
|
||||
io.grpc.MethodDescriptor<com.alibaba.nacos.istio.model.mcp.MeshConfigRequest, com.alibaba.nacos.istio.model.mcp.MeshConfigResponse> getStreamAggregatedResourcesMethod;
|
||||
if ((getStreamAggregatedResourcesMethod = AggregatedMeshConfigServiceGrpc.getStreamAggregatedResourcesMethod) == null) {
|
||||
synchronized (AggregatedMeshConfigServiceGrpc.class) {
|
||||
if ((getStreamAggregatedResourcesMethod = AggregatedMeshConfigServiceGrpc.getStreamAggregatedResourcesMethod) == null) {
|
||||
AggregatedMeshConfigServiceGrpc.getStreamAggregatedResourcesMethod = getStreamAggregatedResourcesMethod =
|
||||
io.grpc.MethodDescriptor.<com.alibaba.nacos.istio.model.mcp.MeshConfigRequest, com.alibaba.nacos.istio.model.mcp.MeshConfigResponse>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||
.setFullMethodName(generateFullMethodName(
|
||||
"istio.mcp.v1alpha1.AggregatedMeshConfigService", "StreamAggregatedResources"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.alibaba.nacos.istio.model.mcp.MeshConfigRequest.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.alibaba.nacos.istio.model.mcp.MeshConfigResponse.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new AggregatedMeshConfigServiceMethodDescriptorSupplier("StreamAggregatedResources"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getStreamAggregatedResourcesMethod;
|
||||
}
|
||||
|
||||
private static volatile io.grpc.MethodDescriptor<com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigRequest,
|
||||
com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigResponse> getIncrementalAggregatedResourcesMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "IncrementalAggregatedResources",
|
||||
requestType = com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigRequest.class,
|
||||
responseType = com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigResponse.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||
public static io.grpc.MethodDescriptor<com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigRequest,
|
||||
com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigResponse> getIncrementalAggregatedResourcesMethod() {
|
||||
io.grpc.MethodDescriptor<com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigRequest, com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigResponse> getIncrementalAggregatedResourcesMethod;
|
||||
if ((getIncrementalAggregatedResourcesMethod = AggregatedMeshConfigServiceGrpc.getIncrementalAggregatedResourcesMethod) == null) {
|
||||
synchronized (AggregatedMeshConfigServiceGrpc.class) {
|
||||
if ((getIncrementalAggregatedResourcesMethod = AggregatedMeshConfigServiceGrpc.getIncrementalAggregatedResourcesMethod) == null) {
|
||||
AggregatedMeshConfigServiceGrpc.getIncrementalAggregatedResourcesMethod = getIncrementalAggregatedResourcesMethod =
|
||||
io.grpc.MethodDescriptor.<com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigRequest, com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigResponse>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||
.setFullMethodName(generateFullMethodName(
|
||||
"istio.mcp.v1alpha1.AggregatedMeshConfigService", "IncrementalAggregatedResources"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigRequest.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigResponse.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new AggregatedMeshConfigServiceMethodDescriptorSupplier("IncrementalAggregatedResources"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getIncrementalAggregatedResourcesMethod;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new async stub that supports all call types for the service
|
||||
*/
|
||||
public static AggregatedMeshConfigServiceStub newStub(io.grpc.Channel channel) {
|
||||
return new AggregatedMeshConfigServiceStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||||
*/
|
||||
public static AggregatedMeshConfigServiceBlockingStub newBlockingStub(
|
||||
io.grpc.Channel channel) {
|
||||
return new AggregatedMeshConfigServiceBlockingStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||||
*/
|
||||
public static AggregatedMeshConfigServiceFutureStub newFutureStub(
|
||||
io.grpc.Channel channel) {
|
||||
return new AggregatedMeshConfigServiceFutureStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The aggregated mesh configuration services allow a single
|
||||
* management server, via a single gRPC stream, to deliver all API
|
||||
* updates.
|
||||
* </pre>
|
||||
*/
|
||||
public static abstract class AggregatedMeshConfigServiceImplBase implements io.grpc.BindableService {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* StreamAggregatedResources provides the ability to carefully
|
||||
* sequence updates across multiple resource types. A single stream
|
||||
* is used with multiple independent MeshConfigRequest /
|
||||
* MeshConfigResponses sequences multiplexed via the type URL.
|
||||
* </pre>
|
||||
*/
|
||||
public io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.MeshConfigRequest> streamAggregatedResources(
|
||||
io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.MeshConfigResponse> responseObserver) {
|
||||
return asyncUnimplementedStreamingCall(getStreamAggregatedResourcesMethod(), responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* IncrementalAggregatedResources provides the ability to incrementally
|
||||
* update the resources on the client. This supports the goal of
|
||||
* scalability of MCP resources.
|
||||
* </pre>
|
||||
*/
|
||||
public io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigRequest> incrementalAggregatedResources(
|
||||
io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigResponse> responseObserver) {
|
||||
return asyncUnimplementedStreamingCall(getIncrementalAggregatedResourcesMethod(), responseObserver);
|
||||
}
|
||||
|
||||
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||
.addMethod(
|
||||
getStreamAggregatedResourcesMethod(),
|
||||
asyncBidiStreamingCall(
|
||||
new MethodHandlers<
|
||||
com.alibaba.nacos.istio.model.mcp.MeshConfigRequest,
|
||||
com.alibaba.nacos.istio.model.mcp.MeshConfigResponse>(
|
||||
this, METHODID_STREAM_AGGREGATED_RESOURCES)))
|
||||
.addMethod(
|
||||
getIncrementalAggregatedResourcesMethod(),
|
||||
asyncBidiStreamingCall(
|
||||
new MethodHandlers<
|
||||
com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigRequest,
|
||||
com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigResponse>(
|
||||
this, METHODID_INCREMENTAL_AGGREGATED_RESOURCES)))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The aggregated mesh configuration services allow a single
|
||||
* management server, via a single gRPC stream, to deliver all API
|
||||
* updates.
|
||||
* </pre>
|
||||
*/
|
||||
public static final class AggregatedMeshConfigServiceStub extends io.grpc.stub.AbstractStub<AggregatedMeshConfigServiceStub> {
|
||||
private AggregatedMeshConfigServiceStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private AggregatedMeshConfigServiceStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected AggregatedMeshConfigServiceStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new AggregatedMeshConfigServiceStub(channel, callOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* StreamAggregatedResources provides the ability to carefully
|
||||
* sequence updates across multiple resource types. A single stream
|
||||
* is used with multiple independent MeshConfigRequest /
|
||||
* MeshConfigResponses sequences multiplexed via the type URL.
|
||||
* </pre>
|
||||
*/
|
||||
public io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.MeshConfigRequest> streamAggregatedResources(
|
||||
io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.MeshConfigResponse> responseObserver) {
|
||||
return asyncBidiStreamingCall(
|
||||
getChannel().newCall(getStreamAggregatedResourcesMethod(), getCallOptions()), responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* IncrementalAggregatedResources provides the ability to incrementally
|
||||
* update the resources on the client. This supports the goal of
|
||||
* scalability of MCP resources.
|
||||
* </pre>
|
||||
*/
|
||||
public io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigRequest> incrementalAggregatedResources(
|
||||
io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigResponse> responseObserver) {
|
||||
return asyncBidiStreamingCall(
|
||||
getChannel().newCall(getIncrementalAggregatedResourcesMethod(), getCallOptions()), responseObserver);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The aggregated mesh configuration services allow a single
|
||||
* management server, via a single gRPC stream, to deliver all API
|
||||
* updates.
|
||||
* </pre>
|
||||
*/
|
||||
public static final class AggregatedMeshConfigServiceBlockingStub extends io.grpc.stub.AbstractStub<AggregatedMeshConfigServiceBlockingStub> {
|
||||
private AggregatedMeshConfigServiceBlockingStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private AggregatedMeshConfigServiceBlockingStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected AggregatedMeshConfigServiceBlockingStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new AggregatedMeshConfigServiceBlockingStub(channel, callOptions);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The aggregated mesh configuration services allow a single
|
||||
* management server, via a single gRPC stream, to deliver all API
|
||||
* updates.
|
||||
* </pre>
|
||||
*/
|
||||
public static final class AggregatedMeshConfigServiceFutureStub extends io.grpc.stub.AbstractStub<AggregatedMeshConfigServiceFutureStub> {
|
||||
private AggregatedMeshConfigServiceFutureStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private AggregatedMeshConfigServiceFutureStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected AggregatedMeshConfigServiceFutureStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new AggregatedMeshConfigServiceFutureStub(channel, callOptions);
|
||||
}
|
||||
}
|
||||
|
||||
private static final int METHODID_STREAM_AGGREGATED_RESOURCES = 0;
|
||||
private static final int METHODID_INCREMENTAL_AGGREGATED_RESOURCES = 1;
|
||||
|
||||
private static final class MethodHandlers<Req, Resp> implements
|
||||
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
||||
private final AggregatedMeshConfigServiceImplBase serviceImpl;
|
||||
private final int methodId;
|
||||
|
||||
MethodHandlers(AggregatedMeshConfigServiceImplBase serviceImpl, int methodId) {
|
||||
this.serviceImpl = serviceImpl;
|
||||
this.methodId = methodId;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("unchecked")
|
||||
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||
switch (methodId) {
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("unchecked")
|
||||
public io.grpc.stub.StreamObserver<Req> invoke(
|
||||
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||
switch (methodId) {
|
||||
case METHODID_STREAM_AGGREGATED_RESOURCES:
|
||||
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.streamAggregatedResources(
|
||||
(io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.MeshConfigResponse>) responseObserver);
|
||||
case METHODID_INCREMENTAL_AGGREGATED_RESOURCES:
|
||||
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.incrementalAggregatedResources(
|
||||
(io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.IncrementalMeshConfigResponse>) responseObserver);
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static abstract class AggregatedMeshConfigServiceBaseDescriptorSupplier
|
||||
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
|
||||
AggregatedMeshConfigServiceBaseDescriptorSupplier() {}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
|
||||
return com.alibaba.nacos.istio.model.mcp.Mcp.getDescriptor();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
|
||||
return getFileDescriptor().findServiceByName("AggregatedMeshConfigService");
|
||||
}
|
||||
}
|
||||
|
||||
private static final class AggregatedMeshConfigServiceFileDescriptorSupplier
|
||||
extends AggregatedMeshConfigServiceBaseDescriptorSupplier {
|
||||
AggregatedMeshConfigServiceFileDescriptorSupplier() {}
|
||||
}
|
||||
|
||||
private static final class AggregatedMeshConfigServiceMethodDescriptorSupplier
|
||||
extends AggregatedMeshConfigServiceBaseDescriptorSupplier
|
||||
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
|
||||
private final String methodName;
|
||||
|
||||
AggregatedMeshConfigServiceMethodDescriptorSupplier(String methodName) {
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
|
||||
return getServiceDescriptor().findMethodByName(methodName);
|
||||
}
|
||||
}
|
||||
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (AggregatedMeshConfigServiceGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||||
.setSchemaDescriptor(new AggregatedMeshConfigServiceFileDescriptorSupplier())
|
||||
.addMethod(getStreamAggregatedResourcesMethod())
|
||||
.addMethod(getIncrementalAggregatedResourcesMethod())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,191 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: mcp.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
public interface IncrementalMeshConfigRequestOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:istio.mcp.v1alpha1.IncrementalMeshConfigRequest)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The sink node making the request.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
|
||||
* @return Whether the sinkNode field is set.
|
||||
*/
|
||||
boolean hasSinkNode();
|
||||
/**
|
||||
* <pre>
|
||||
* The sink node making the request.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
|
||||
* @return The sinkNode.
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.mcp.SinkNode getSinkNode();
|
||||
/**
|
||||
* <pre>
|
||||
* The sink node making the request.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.mcp.SinkNodeOrBuilder getSinkNodeOrBuilder();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Type of the resource that is being requested, e.g.
|
||||
* "type.googleapis.com/istio.io.networking.v1alpha3.VirtualService".
|
||||
* </pre>
|
||||
*
|
||||
* <code>string type_url = 2;</code>
|
||||
* @return The typeUrl.
|
||||
*/
|
||||
java.lang.String getTypeUrl();
|
||||
/**
|
||||
* <pre>
|
||||
* Type of the resource that is being requested, e.g.
|
||||
* "type.googleapis.com/istio.io.networking.v1alpha3.VirtualService".
|
||||
* </pre>
|
||||
*
|
||||
* <code>string type_url = 2;</code>
|
||||
* @return The bytes for typeUrl.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getTypeUrlBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* When the IncrementalMeshConfigRequest is the first in a stream,
|
||||
* the initial_resource_versions must be populated. Otherwise,
|
||||
* initial_resource_versions must be omitted. The keys are the
|
||||
* resources names of the MCP resources known to the MCP client. The
|
||||
* values in the map are the associated resource level version info.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> initial_resource_versions = 3;</code>
|
||||
*/
|
||||
int getInitialResourceVersionsCount();
|
||||
/**
|
||||
* <pre>
|
||||
* When the IncrementalMeshConfigRequest is the first in a stream,
|
||||
* the initial_resource_versions must be populated. Otherwise,
|
||||
* initial_resource_versions must be omitted. The keys are the
|
||||
* resources names of the MCP resources known to the MCP client. The
|
||||
* values in the map are the associated resource level version info.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> initial_resource_versions = 3;</code>
|
||||
*/
|
||||
boolean containsInitialResourceVersions(
|
||||
java.lang.String key);
|
||||
/**
|
||||
* Use {@link #getInitialResourceVersionsMap()} instead.
|
||||
*/
|
||||
@java.lang.Deprecated
|
||||
java.util.Map<java.lang.String, java.lang.String>
|
||||
getInitialResourceVersions();
|
||||
/**
|
||||
* <pre>
|
||||
* When the IncrementalMeshConfigRequest is the first in a stream,
|
||||
* the initial_resource_versions must be populated. Otherwise,
|
||||
* initial_resource_versions must be omitted. The keys are the
|
||||
* resources names of the MCP resources known to the MCP client. The
|
||||
* values in the map are the associated resource level version info.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> initial_resource_versions = 3;</code>
|
||||
*/
|
||||
java.util.Map<java.lang.String, java.lang.String>
|
||||
getInitialResourceVersionsMap();
|
||||
/**
|
||||
* <pre>
|
||||
* When the IncrementalMeshConfigRequest is the first in a stream,
|
||||
* the initial_resource_versions must be populated. Otherwise,
|
||||
* initial_resource_versions must be omitted. The keys are the
|
||||
* resources names of the MCP resources known to the MCP client. The
|
||||
* values in the map are the associated resource level version info.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> initial_resource_versions = 3;</code>
|
||||
*/
|
||||
|
||||
java.lang.String getInitialResourceVersionsOrDefault(
|
||||
java.lang.String key,
|
||||
java.lang.String defaultValue);
|
||||
/**
|
||||
* <pre>
|
||||
* When the IncrementalMeshConfigRequest is the first in a stream,
|
||||
* the initial_resource_versions must be populated. Otherwise,
|
||||
* initial_resource_versions must be omitted. The keys are the
|
||||
* resources names of the MCP resources known to the MCP client. The
|
||||
* values in the map are the associated resource level version info.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> initial_resource_versions = 3;</code>
|
||||
*/
|
||||
|
||||
java.lang.String getInitialResourceVersionsOrThrow(
|
||||
java.lang.String key);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* When the IncrementalMeshConfigRequest is a ACK or NACK message in response
|
||||
* to a previous IncrementalMeshConfigResponse, the response_nonce must be the
|
||||
* nonce in the IncrementalMeshConfigResponse.
|
||||
* Otherwise response_nonce must be omitted.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string response_nonce = 4;</code>
|
||||
* @return The responseNonce.
|
||||
*/
|
||||
java.lang.String getResponseNonce();
|
||||
/**
|
||||
* <pre>
|
||||
* When the IncrementalMeshConfigRequest is a ACK or NACK message in response
|
||||
* to a previous IncrementalMeshConfigResponse, the response_nonce must be the
|
||||
* nonce in the IncrementalMeshConfigResponse.
|
||||
* Otherwise response_nonce must be omitted.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string response_nonce = 4;</code>
|
||||
* @return The bytes for responseNonce.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getResponseNonceBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* This is populated when the previous IncrementalMeshConfigResponses
|
||||
* failed to update configuration. The *message* field in *error_details*
|
||||
* provides the client internal exception related to the failure.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.rpc.Status error_detail = 5;</code>
|
||||
* @return Whether the errorDetail field is set.
|
||||
*/
|
||||
boolean hasErrorDetail();
|
||||
/**
|
||||
* <pre>
|
||||
* This is populated when the previous IncrementalMeshConfigResponses
|
||||
* failed to update configuration. The *message* field in *error_details*
|
||||
* provides the client internal exception related to the failure.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.rpc.Status error_detail = 5;</code>
|
||||
* @return The errorDetail.
|
||||
*/
|
||||
com.google.rpc.Status getErrorDetail();
|
||||
/**
|
||||
* <pre>
|
||||
* This is populated when the previous IncrementalMeshConfigResponses
|
||||
* failed to update configuration. The *message* field in *error_details*
|
||||
* provides the client internal exception related to the failure.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.rpc.Status error_detail = 5;</code>
|
||||
*/
|
||||
com.google.rpc.StatusOrBuilder getErrorDetailOrBuilder();
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,156 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: mcp.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
public interface IncrementalMeshConfigResponseOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:istio.mcp.v1alpha1.IncrementalMeshConfigResponse)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The version of the response data (used for debugging).
|
||||
* </pre>
|
||||
*
|
||||
* <code>string system_version_info = 1;</code>
|
||||
* @return The systemVersionInfo.
|
||||
*/
|
||||
java.lang.String getSystemVersionInfo();
|
||||
/**
|
||||
* <pre>
|
||||
* The version of the response data (used for debugging).
|
||||
* </pre>
|
||||
*
|
||||
* <code>string system_version_info = 1;</code>
|
||||
* @return The bytes for systemVersionInfo.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getSystemVersionInfoBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource*
|
||||
* message. These are typed resources that match the type url in the
|
||||
* IncrementalMeshConfigRequest.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 2;</code>
|
||||
*/
|
||||
java.util.List<com.alibaba.nacos.istio.model.mcp.Resource>
|
||||
getResourcesList();
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource*
|
||||
* message. These are typed resources that match the type url in the
|
||||
* IncrementalMeshConfigRequest.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 2;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.mcp.Resource getResources(int index);
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource*
|
||||
* message. These are typed resources that match the type url in the
|
||||
* IncrementalMeshConfigRequest.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 2;</code>
|
||||
*/
|
||||
int getResourcesCount();
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource*
|
||||
* message. These are typed resources that match the type url in the
|
||||
* IncrementalMeshConfigRequest.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 2;</code>
|
||||
*/
|
||||
java.util.List<? extends com.alibaba.nacos.istio.model.mcp.ResourceOrBuilder>
|
||||
getResourcesOrBuilderList();
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource*
|
||||
* message. These are typed resources that match the type url in the
|
||||
* IncrementalMeshConfigRequest.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 2;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.mcp.ResourceOrBuilder getResourcesOrBuilder(
|
||||
int index);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Resources names of resources that have be deleted and to be
|
||||
* removed from the MCP Client. Removed resources for missing
|
||||
* resources can be ignored.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string removed_resources = 3;</code>
|
||||
* @return A list containing the removedResources.
|
||||
*/
|
||||
java.util.List<java.lang.String>
|
||||
getRemovedResourcesList();
|
||||
/**
|
||||
* <pre>
|
||||
* Resources names of resources that have be deleted and to be
|
||||
* removed from the MCP Client. Removed resources for missing
|
||||
* resources can be ignored.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string removed_resources = 3;</code>
|
||||
* @return The count of removedResources.
|
||||
*/
|
||||
int getRemovedResourcesCount();
|
||||
/**
|
||||
* <pre>
|
||||
* Resources names of resources that have be deleted and to be
|
||||
* removed from the MCP Client. Removed resources for missing
|
||||
* resources can be ignored.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string removed_resources = 3;</code>
|
||||
* @param index The index of the element to return.
|
||||
* @return The removedResources at the given index.
|
||||
*/
|
||||
java.lang.String getRemovedResources(int index);
|
||||
/**
|
||||
* <pre>
|
||||
* Resources names of resources that have be deleted and to be
|
||||
* removed from the MCP Client. Removed resources for missing
|
||||
* resources can be ignored.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string removed_resources = 3;</code>
|
||||
* @param index The index of the value to return.
|
||||
* @return The bytes of the removedResources at the given index.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getRemovedResourcesBytes(int index);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The nonce provides a way for IncrementalMeshConfigRequests to
|
||||
* uniquely reference an IncrementalMeshConfigResponse. The nonce is
|
||||
* required.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string nonce = 4;</code>
|
||||
* @return The nonce.
|
||||
*/
|
||||
java.lang.String getNonce();
|
||||
/**
|
||||
* <pre>
|
||||
* The nonce provides a way for IncrementalMeshConfigRequests to
|
||||
* uniquely reference an IncrementalMeshConfigResponse. The nonce is
|
||||
* required.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string nonce = 4;</code>
|
||||
* @return The bytes for nonce.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getNonceBytes();
|
||||
}
|
201
istio/src/main/java/com/alibaba/nacos/istio/model/mcp/Mcp.java
Normal file
201
istio/src/main/java/com/alibaba/nacos/istio/model/mcp/Mcp.java
Normal file
@ -0,0 +1,201 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: mcp.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
public final class Mcp {
|
||||
private Mcp() {}
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||
}
|
||||
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistry registry) {
|
||||
registerAllExtensions(
|
||||
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||
}
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_mcp_v1alpha1_SinkNode_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_mcp_v1alpha1_SinkNode_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_mcp_v1alpha1_SinkNode_AnnotationsEntry_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_mcp_v1alpha1_SinkNode_AnnotationsEntry_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_mcp_v1alpha1_MeshConfigRequest_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_mcp_v1alpha1_MeshConfigRequest_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_mcp_v1alpha1_MeshConfigResponse_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_mcp_v1alpha1_MeshConfigResponse_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigRequest_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigRequest_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigRequest_InitialResourceVersionsEntry_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigRequest_InitialResourceVersionsEntry_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigResponse_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigResponse_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_mcp_v1alpha1_RequestResources_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_mcp_v1alpha1_RequestResources_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_mcp_v1alpha1_RequestResources_InitialResourceVersionsEntry_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_mcp_v1alpha1_RequestResources_InitialResourceVersionsEntry_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_mcp_v1alpha1_Resources_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_mcp_v1alpha1_Resources_fieldAccessorTable;
|
||||
|
||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||
getDescriptor() {
|
||||
return descriptor;
|
||||
}
|
||||
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||
descriptor;
|
||||
static {
|
||||
java.lang.String[] descriptorData = {
|
||||
"\n\tmcp.proto\022\022istio.mcp.v1alpha1\032\014status." +
|
||||
"proto\032\016resource.proto\"\216\001\n\010SinkNode\022\n\n\002id" +
|
||||
"\030\001 \001(\t\022B\n\013annotations\030\002 \003(\0132-.istio.mcp." +
|
||||
"v1alpha1.SinkNode.AnnotationsEntry\0322\n\020An" +
|
||||
"notationsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" +
|
||||
"(\t:\0028\001\"\256\001\n\021MeshConfigRequest\022\024\n\014version_" +
|
||||
"info\030\001 \001(\t\022/\n\tsink_node\030\002 \001(\0132\034.istio.mc" +
|
||||
"p.v1alpha1.SinkNode\022\020\n\010type_url\030\003 \001(\t\022\026\n" +
|
||||
"\016response_nonce\030\004 \001(\t\022(\n\014error_detail\030\005 " +
|
||||
"\001(\0132\022.google.rpc.Status\"|\n\022MeshConfigRes" +
|
||||
"ponse\022\024\n\014version_info\030\001 \001(\t\022/\n\tresources" +
|
||||
"\030\002 \003(\0132\034.istio.mcp.v1alpha1.Resource\022\020\n\010" +
|
||||
"type_url\030\003 \001(\t\022\r\n\005nonce\030\004 \001(\t\"\325\002\n\034Increm" +
|
||||
"entalMeshConfigRequest\022/\n\tsink_node\030\001 \001(" +
|
||||
"\0132\034.istio.mcp.v1alpha1.SinkNode\022\020\n\010type_" +
|
||||
"url\030\002 \001(\t\022p\n\031initial_resource_versions\030\003" +
|
||||
" \003(\0132M.istio.mcp.v1alpha1.IncrementalMes" +
|
||||
"hConfigRequest.InitialResourceVersionsEn" +
|
||||
"try\022\026\n\016response_nonce\030\004 \001(\t\022(\n\014error_det" +
|
||||
"ail\030\005 \001(\0132\022.google.rpc.Status\032>\n\034Initial" +
|
||||
"ResourceVersionsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" +
|
||||
"lue\030\002 \001(\t:\0028\001\"\227\001\n\035IncrementalMeshConfigR" +
|
||||
"esponse\022\033\n\023system_version_info\030\001 \001(\t\022/\n\t" +
|
||||
"resources\030\002 \003(\0132\034.istio.mcp.v1alpha1.Res" +
|
||||
"ource\022\031\n\021removed_resources\030\003 \003(\t\022\r\n\005nonc" +
|
||||
"e\030\004 \001(\t\"\324\002\n\020RequestResources\022/\n\tsink_nod" +
|
||||
"e\030\001 \001(\0132\034.istio.mcp.v1alpha1.SinkNode\022\022\n" +
|
||||
"\ncollection\030\002 \001(\t\022d\n\031initial_resource_ve" +
|
||||
"rsions\030\003 \003(\0132A.istio.mcp.v1alpha1.Reques" +
|
||||
"tResources.InitialResourceVersionsEntry\022" +
|
||||
"\026\n\016response_nonce\030\004 \001(\t\022(\n\014error_detail\030" +
|
||||
"\005 \001(\0132\022.google.rpc.Status\022\023\n\013incremental" +
|
||||
"\030\006 \001(\010\032>\n\034InitialResourceVersionsEntry\022\013" +
|
||||
"\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\254\001\n\tResou" +
|
||||
"rces\022\033\n\023system_version_info\030\001 \001(\t\022\022\n\ncol" +
|
||||
"lection\030\002 \001(\t\022/\n\tresources\030\003 \003(\0132\034.istio" +
|
||||
".mcp.v1alpha1.Resource\022\031\n\021removed_resour" +
|
||||
"ces\030\004 \003(\t\022\r\n\005nonce\030\005 \001(\t\022\023\n\013incremental\030" +
|
||||
"\006 \001(\0102\235\002\n\033AggregatedMeshConfigService\022p\n" +
|
||||
"\031StreamAggregatedResources\022%.istio.mcp.v" +
|
||||
"1alpha1.MeshConfigRequest\032&.istio.mcp.v1" +
|
||||
"alpha1.MeshConfigResponse\"\000(\0010\001\022\213\001\n\036Incr" +
|
||||
"ementalAggregatedResources\0220.istio.mcp.v" +
|
||||
"1alpha1.IncrementalMeshConfigRequest\0321.i" +
|
||||
"stio.mcp.v1alpha1.IncrementalMeshConfigR" +
|
||||
"esponse\"\000(\0010\0012v\n\016ResourceSource\022d\n\027Estab" +
|
||||
"lishResourceStream\022$.istio.mcp.v1alpha1." +
|
||||
"RequestResources\032\035.istio.mcp.v1alpha1.Re" +
|
||||
"sources\"\000(\0010\0012t\n\014ResourceSink\022d\n\027Establi" +
|
||||
"shResourceStream\022\035.istio.mcp.v1alpha1.Re" +
|
||||
"sources\032$.istio.mcp.v1alpha1.RequestReso" +
|
||||
"urces\"\000(\0010\001B%\n!com.alibaba.nacos.istio.m" +
|
||||
"odel.mcpP\001b\006proto3"
|
||||
};
|
||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||
com.google.rpc.StatusProto.getDescriptor(),
|
||||
com.alibaba.nacos.istio.model.mcp.ResourceOuterClass.getDescriptor(),
|
||||
});
|
||||
internal_static_istio_mcp_v1alpha1_SinkNode_descriptor =
|
||||
getDescriptor().getMessageTypes().get(0);
|
||||
internal_static_istio_mcp_v1alpha1_SinkNode_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_mcp_v1alpha1_SinkNode_descriptor,
|
||||
new java.lang.String[] { "Id", "Annotations", });
|
||||
internal_static_istio_mcp_v1alpha1_SinkNode_AnnotationsEntry_descriptor =
|
||||
internal_static_istio_mcp_v1alpha1_SinkNode_descriptor.getNestedTypes().get(0);
|
||||
internal_static_istio_mcp_v1alpha1_SinkNode_AnnotationsEntry_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_mcp_v1alpha1_SinkNode_AnnotationsEntry_descriptor,
|
||||
new java.lang.String[] { "Key", "Value", });
|
||||
internal_static_istio_mcp_v1alpha1_MeshConfigRequest_descriptor =
|
||||
getDescriptor().getMessageTypes().get(1);
|
||||
internal_static_istio_mcp_v1alpha1_MeshConfigRequest_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_mcp_v1alpha1_MeshConfigRequest_descriptor,
|
||||
new java.lang.String[] { "VersionInfo", "SinkNode", "TypeUrl", "ResponseNonce", "ErrorDetail", });
|
||||
internal_static_istio_mcp_v1alpha1_MeshConfigResponse_descriptor =
|
||||
getDescriptor().getMessageTypes().get(2);
|
||||
internal_static_istio_mcp_v1alpha1_MeshConfigResponse_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_mcp_v1alpha1_MeshConfigResponse_descriptor,
|
||||
new java.lang.String[] { "VersionInfo", "Resources", "TypeUrl", "Nonce", });
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigRequest_descriptor =
|
||||
getDescriptor().getMessageTypes().get(3);
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigRequest_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigRequest_descriptor,
|
||||
new java.lang.String[] { "SinkNode", "TypeUrl", "InitialResourceVersions", "ResponseNonce", "ErrorDetail", });
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigRequest_InitialResourceVersionsEntry_descriptor =
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigRequest_descriptor.getNestedTypes().get(0);
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigRequest_InitialResourceVersionsEntry_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigRequest_InitialResourceVersionsEntry_descriptor,
|
||||
new java.lang.String[] { "Key", "Value", });
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigResponse_descriptor =
|
||||
getDescriptor().getMessageTypes().get(4);
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigResponse_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_mcp_v1alpha1_IncrementalMeshConfigResponse_descriptor,
|
||||
new java.lang.String[] { "SystemVersionInfo", "Resources", "RemovedResources", "Nonce", });
|
||||
internal_static_istio_mcp_v1alpha1_RequestResources_descriptor =
|
||||
getDescriptor().getMessageTypes().get(5);
|
||||
internal_static_istio_mcp_v1alpha1_RequestResources_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_mcp_v1alpha1_RequestResources_descriptor,
|
||||
new java.lang.String[] { "SinkNode", "Collection", "InitialResourceVersions", "ResponseNonce", "ErrorDetail", "Incremental", });
|
||||
internal_static_istio_mcp_v1alpha1_RequestResources_InitialResourceVersionsEntry_descriptor =
|
||||
internal_static_istio_mcp_v1alpha1_RequestResources_descriptor.getNestedTypes().get(0);
|
||||
internal_static_istio_mcp_v1alpha1_RequestResources_InitialResourceVersionsEntry_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_mcp_v1alpha1_RequestResources_InitialResourceVersionsEntry_descriptor,
|
||||
new java.lang.String[] { "Key", "Value", });
|
||||
internal_static_istio_mcp_v1alpha1_Resources_descriptor =
|
||||
getDescriptor().getMessageTypes().get(6);
|
||||
internal_static_istio_mcp_v1alpha1_Resources_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_mcp_v1alpha1_Resources_descriptor,
|
||||
new java.lang.String[] { "SystemVersionInfo", "Collection", "Resources", "RemovedResources", "Nonce", "Incremental", });
|
||||
com.google.rpc.StatusProto.getDescriptor();
|
||||
com.alibaba.nacos.istio.model.mcp.ResourceOuterClass.getDescriptor();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(outer_class_scope)
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,160 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: mcp.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
public interface MeshConfigRequestOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:istio.mcp.v1alpha1.MeshConfigRequest)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The version_info provided in the request messages will be the
|
||||
* version_info received with the most recent successfully processed
|
||||
* response or empty on the first request. It is expected that no
|
||||
* new request is sent after a response is received until the client
|
||||
* instance is ready to ACK/NACK the new configuration. ACK/NACK
|
||||
* takes place by returning the new API config version as applied or
|
||||
* the previous API config version respectively. Each type_url (see
|
||||
* below) has an independent version associated with it.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string version_info = 1;</code>
|
||||
* @return The versionInfo.
|
||||
*/
|
||||
java.lang.String getVersionInfo();
|
||||
/**
|
||||
* <pre>
|
||||
* The version_info provided in the request messages will be the
|
||||
* version_info received with the most recent successfully processed
|
||||
* response or empty on the first request. It is expected that no
|
||||
* new request is sent after a response is received until the client
|
||||
* instance is ready to ACK/NACK the new configuration. ACK/NACK
|
||||
* takes place by returning the new API config version as applied or
|
||||
* the previous API config version respectively. Each type_url (see
|
||||
* below) has an independent version associated with it.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string version_info = 1;</code>
|
||||
* @return The bytes for versionInfo.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getVersionInfoBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The sink node making the request.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.SinkNode sink_node = 2;</code>
|
||||
* @return Whether the sinkNode field is set.
|
||||
*/
|
||||
boolean hasSinkNode();
|
||||
/**
|
||||
* <pre>
|
||||
* The sink node making the request.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.SinkNode sink_node = 2;</code>
|
||||
* @return The sinkNode.
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.mcp.SinkNode getSinkNode();
|
||||
/**
|
||||
* <pre>
|
||||
* The sink node making the request.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.SinkNode sink_node = 2;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.mcp.SinkNodeOrBuilder getSinkNodeOrBuilder();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Type of the resource that is being requested, e.g.
|
||||
* "type.googleapis.com/istio.io.networking.v1alpha3.VirtualService".
|
||||
* </pre>
|
||||
*
|
||||
* <code>string type_url = 3;</code>
|
||||
* @return The typeUrl.
|
||||
*/
|
||||
java.lang.String getTypeUrl();
|
||||
/**
|
||||
* <pre>
|
||||
* Type of the resource that is being requested, e.g.
|
||||
* "type.googleapis.com/istio.io.networking.v1alpha3.VirtualService".
|
||||
* </pre>
|
||||
*
|
||||
* <code>string type_url = 3;</code>
|
||||
* @return The bytes for typeUrl.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getTypeUrlBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The nonce corresponding to MeshConfigResponse being
|
||||
* ACK/NACKed. See above discussion on version_info and the
|
||||
* MeshConfigResponse nonce comment. This may be empty if no nonce is
|
||||
* available, e.g. at startup.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string response_nonce = 4;</code>
|
||||
* @return The responseNonce.
|
||||
*/
|
||||
java.lang.String getResponseNonce();
|
||||
/**
|
||||
* <pre>
|
||||
* The nonce corresponding to MeshConfigResponse being
|
||||
* ACK/NACKed. See above discussion on version_info and the
|
||||
* MeshConfigResponse nonce comment. This may be empty if no nonce is
|
||||
* available, e.g. at startup.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string response_nonce = 4;</code>
|
||||
* @return The bytes for responseNonce.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getResponseNonceBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* This is populated when the previous MeshConfigResponse failed to
|
||||
* update configuration. The *message* field in *error_details*
|
||||
* provides the client internal exception related to the failure. It
|
||||
* is only intended for consumption during manual debugging, the
|
||||
* string provided is not guaranteed to be stable across client
|
||||
* versions.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.rpc.Status error_detail = 5;</code>
|
||||
* @return Whether the errorDetail field is set.
|
||||
*/
|
||||
boolean hasErrorDetail();
|
||||
/**
|
||||
* <pre>
|
||||
* This is populated when the previous MeshConfigResponse failed to
|
||||
* update configuration. The *message* field in *error_details*
|
||||
* provides the client internal exception related to the failure. It
|
||||
* is only intended for consumption during manual debugging, the
|
||||
* string provided is not guaranteed to be stable across client
|
||||
* versions.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.rpc.Status error_detail = 5;</code>
|
||||
* @return The errorDetail.
|
||||
*/
|
||||
com.google.rpc.Status getErrorDetail();
|
||||
/**
|
||||
* <pre>
|
||||
* This is populated when the previous MeshConfigResponse failed to
|
||||
* update configuration. The *message* field in *error_details*
|
||||
* provides the client internal exception related to the failure. It
|
||||
* is only intended for consumption during manual debugging, the
|
||||
* string provided is not guaranteed to be stable across client
|
||||
* versions.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.rpc.Status error_detail = 5;</code>
|
||||
*/
|
||||
com.google.rpc.StatusOrBuilder getErrorDetailOrBuilder();
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,136 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: mcp.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
public interface MeshConfigResponseOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:istio.mcp.v1alpha1.MeshConfigResponse)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The version of the response data.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string version_info = 1;</code>
|
||||
* @return The versionInfo.
|
||||
*/
|
||||
java.lang.String getVersionInfo();
|
||||
/**
|
||||
* <pre>
|
||||
* The version of the response data.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string version_info = 1;</code>
|
||||
* @return The bytes for versionInfo.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getVersionInfoBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource*
|
||||
* message.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 2;</code>
|
||||
*/
|
||||
java.util.List<com.alibaba.nacos.istio.model.mcp.Resource>
|
||||
getResourcesList();
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource*
|
||||
* message.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 2;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.mcp.Resource getResources(int index);
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource*
|
||||
* message.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 2;</code>
|
||||
*/
|
||||
int getResourcesCount();
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource*
|
||||
* message.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 2;</code>
|
||||
*/
|
||||
java.util.List<? extends com.alibaba.nacos.istio.model.mcp.ResourceOrBuilder>
|
||||
getResourcesOrBuilderList();
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource*
|
||||
* message.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 2;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.mcp.ResourceOrBuilder getResourcesOrBuilder(
|
||||
int index);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Type URL for resources wrapped in the provided resources(s). This
|
||||
* must be consistent with the type_url in the wrapper messages if
|
||||
* resources is non-empty.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string type_url = 3;</code>
|
||||
* @return The typeUrl.
|
||||
*/
|
||||
java.lang.String getTypeUrl();
|
||||
/**
|
||||
* <pre>
|
||||
* Type URL for resources wrapped in the provided resources(s). This
|
||||
* must be consistent with the type_url in the wrapper messages if
|
||||
* resources is non-empty.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string type_url = 3;</code>
|
||||
* @return The bytes for typeUrl.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getTypeUrlBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The nonce provides a way to explicitly ack a specific
|
||||
* MeshConfigResponse in a following MeshConfigRequest. Additional
|
||||
* messages may have been sent by client to the management server for
|
||||
* the previous version on the stream prior to this
|
||||
* MeshConfigResponse, that were unprocessed at response send
|
||||
* time. The nonce allows the management server to ignore any
|
||||
* further MeshConfigRequests for the previous version until a
|
||||
* MeshConfigRequest bearing the nonce.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string nonce = 4;</code>
|
||||
* @return The nonce.
|
||||
*/
|
||||
java.lang.String getNonce();
|
||||
/**
|
||||
* <pre>
|
||||
* The nonce provides a way to explicitly ack a specific
|
||||
* MeshConfigResponse in a following MeshConfigRequest. Additional
|
||||
* messages may have been sent by client to the management server for
|
||||
* the previous version on the stream prior to this
|
||||
* MeshConfigResponse, that were unprocessed at response send
|
||||
* time. The nonce allows the management server to ignore any
|
||||
* further MeshConfigRequests for the previous version until a
|
||||
* MeshConfigRequest bearing the nonce.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string nonce = 4;</code>
|
||||
* @return The bytes for nonce.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getNonceBytes();
|
||||
}
|
1766
istio/src/main/java/com/alibaba/nacos/istio/model/mcp/Metadata.java
Normal file
1766
istio/src/main/java/com/alibaba/nacos/istio/model/mcp/Metadata.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,236 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: metadata.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
public interface MetadataOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:istio.mcp.v1alpha1.Metadata)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Fully qualified name of the resource. Unique in context of a collection.
|
||||
* The fully qualified name consists of a directory and basename. The directory identifies
|
||||
* the resources location in a resource hierarchy. The basename identifies the specific
|
||||
* resource name within the context of that directory.
|
||||
* The directory and basename are composed of one or more segments. Segments must be
|
||||
* valid [DNS labels](https://tools.ietf.org/html/rfc1123). "/" is the delimiter between
|
||||
* segments
|
||||
* The rightmost segment is the basename. All segments to the
|
||||
* left of the basename form the directory. Segments moving towards the left
|
||||
* represent higher positions in the resource hierarchy, similar to reverse
|
||||
* DNS notation. e.g.
|
||||
* /<org>/<team>/<subteam>/<resource basename>
|
||||
* An empty directory indicates a resource that is located at the root of the
|
||||
* hierarchy, e.g.
|
||||
* /<globally scoped resource>
|
||||
* On Kubernetes the resource hierarchy is two-levels: namespaces and
|
||||
* cluster-scoped (i.e. global).
|
||||
* Namespace resources fully qualified name is of the form:
|
||||
* "<k8s namespace>/<k8s resource name>"
|
||||
* Cluster scoped resources are located at the root of the hierarchy and are of the form:
|
||||
* "/<k8s resource name>"
|
||||
* </pre>
|
||||
*
|
||||
* <code>string name = 1;</code>
|
||||
* @return The name.
|
||||
*/
|
||||
java.lang.String getName();
|
||||
/**
|
||||
* <pre>
|
||||
* Fully qualified name of the resource. Unique in context of a collection.
|
||||
* The fully qualified name consists of a directory and basename. The directory identifies
|
||||
* the resources location in a resource hierarchy. The basename identifies the specific
|
||||
* resource name within the context of that directory.
|
||||
* The directory and basename are composed of one or more segments. Segments must be
|
||||
* valid [DNS labels](https://tools.ietf.org/html/rfc1123). "/" is the delimiter between
|
||||
* segments
|
||||
* The rightmost segment is the basename. All segments to the
|
||||
* left of the basename form the directory. Segments moving towards the left
|
||||
* represent higher positions in the resource hierarchy, similar to reverse
|
||||
* DNS notation. e.g.
|
||||
* /<org>/<team>/<subteam>/<resource basename>
|
||||
* An empty directory indicates a resource that is located at the root of the
|
||||
* hierarchy, e.g.
|
||||
* /<globally scoped resource>
|
||||
* On Kubernetes the resource hierarchy is two-levels: namespaces and
|
||||
* cluster-scoped (i.e. global).
|
||||
* Namespace resources fully qualified name is of the form:
|
||||
* "<k8s namespace>/<k8s resource name>"
|
||||
* Cluster scoped resources are located at the root of the hierarchy and are of the form:
|
||||
* "/<k8s resource name>"
|
||||
* </pre>
|
||||
*
|
||||
* <code>string name = 1;</code>
|
||||
* @return The bytes for name.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getNameBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The creation timestamp of the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Timestamp create_time = 2;</code>
|
||||
* @return Whether the createTime field is set.
|
||||
*/
|
||||
boolean hasCreateTime();
|
||||
/**
|
||||
* <pre>
|
||||
* The creation timestamp of the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Timestamp create_time = 2;</code>
|
||||
* @return The createTime.
|
||||
*/
|
||||
com.google.protobuf.Timestamp getCreateTime();
|
||||
/**
|
||||
* <pre>
|
||||
* The creation timestamp of the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Timestamp create_time = 2;</code>
|
||||
*/
|
||||
com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Resource version. This is used to determine when resources change across
|
||||
* resource updates. It should be treated as opaque by consumers/sinks.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string version = 3;</code>
|
||||
* @return The version.
|
||||
*/
|
||||
java.lang.String getVersion();
|
||||
/**
|
||||
* <pre>
|
||||
* Resource version. This is used to determine when resources change across
|
||||
* resource updates. It should be treated as opaque by consumers/sinks.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string version = 3;</code>
|
||||
* @return The bytes for version.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getVersionBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Map of string keys and values that can be used to organize and categorize
|
||||
* resources within a collection.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> labels = 4;</code>
|
||||
*/
|
||||
int getLabelsCount();
|
||||
/**
|
||||
* <pre>
|
||||
* Map of string keys and values that can be used to organize and categorize
|
||||
* resources within a collection.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> labels = 4;</code>
|
||||
*/
|
||||
boolean containsLabels(
|
||||
java.lang.String key);
|
||||
/**
|
||||
* Use {@link #getLabelsMap()} instead.
|
||||
*/
|
||||
@java.lang.Deprecated
|
||||
java.util.Map<java.lang.String, java.lang.String>
|
||||
getLabels();
|
||||
/**
|
||||
* <pre>
|
||||
* Map of string keys and values that can be used to organize and categorize
|
||||
* resources within a collection.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> labels = 4;</code>
|
||||
*/
|
||||
java.util.Map<java.lang.String, java.lang.String>
|
||||
getLabelsMap();
|
||||
/**
|
||||
* <pre>
|
||||
* Map of string keys and values that can be used to organize and categorize
|
||||
* resources within a collection.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> labels = 4;</code>
|
||||
*/
|
||||
|
||||
java.lang.String getLabelsOrDefault(
|
||||
java.lang.String key,
|
||||
java.lang.String defaultValue);
|
||||
/**
|
||||
* <pre>
|
||||
* Map of string keys and values that can be used to organize and categorize
|
||||
* resources within a collection.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> labels = 4;</code>
|
||||
*/
|
||||
|
||||
java.lang.String getLabelsOrThrow(
|
||||
java.lang.String key);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Map of string keys and values that can be used by source and sink to communicate
|
||||
* arbitrary metadata about this resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 5;</code>
|
||||
*/
|
||||
int getAnnotationsCount();
|
||||
/**
|
||||
* <pre>
|
||||
* Map of string keys and values that can be used by source and sink to communicate
|
||||
* arbitrary metadata about this resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 5;</code>
|
||||
*/
|
||||
boolean containsAnnotations(
|
||||
java.lang.String key);
|
||||
/**
|
||||
* Use {@link #getAnnotationsMap()} instead.
|
||||
*/
|
||||
@java.lang.Deprecated
|
||||
java.util.Map<java.lang.String, java.lang.String>
|
||||
getAnnotations();
|
||||
/**
|
||||
* <pre>
|
||||
* Map of string keys and values that can be used by source and sink to communicate
|
||||
* arbitrary metadata about this resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 5;</code>
|
||||
*/
|
||||
java.util.Map<java.lang.String, java.lang.String>
|
||||
getAnnotationsMap();
|
||||
/**
|
||||
* <pre>
|
||||
* Map of string keys and values that can be used by source and sink to communicate
|
||||
* arbitrary metadata about this resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 5;</code>
|
||||
*/
|
||||
|
||||
java.lang.String getAnnotationsOrDefault(
|
||||
java.lang.String key,
|
||||
java.lang.String defaultValue);
|
||||
/**
|
||||
* <pre>
|
||||
* Map of string keys and values that can be used by source and sink to communicate
|
||||
* arbitrary metadata about this resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 5;</code>
|
||||
*/
|
||||
|
||||
java.lang.String getAnnotationsOrThrow(
|
||||
java.lang.String key);
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: metadata.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
public final class MetadataOuterClass {
|
||||
private MetadataOuterClass() {}
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||
}
|
||||
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistry registry) {
|
||||
registerAllExtensions(
|
||||
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||
}
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_LabelsEntry_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_LabelsEntry_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_AnnotationsEntry_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_AnnotationsEntry_fieldAccessorTable;
|
||||
|
||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||
getDescriptor() {
|
||||
return descriptor;
|
||||
}
|
||||
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||
descriptor;
|
||||
static {
|
||||
java.lang.String[] descriptorData = {
|
||||
"\n\016metadata.proto\022\022istio.mcp.v1alpha1\032\037go" +
|
||||
"ogle/protobuf/timestamp.proto\"\273\002\n\010Metada" +
|
||||
"ta\022\014\n\004name\030\001 \001(\t\022/\n\013create_time\030\002 \001(\0132\032." +
|
||||
"google.protobuf.Timestamp\022\017\n\007version\030\003 \001" +
|
||||
"(\t\0228\n\006labels\030\004 \003(\0132(.istio.mcp.v1alpha1." +
|
||||
"Metadata.LabelsEntry\022B\n\013annotations\030\005 \003(" +
|
||||
"\0132-.istio.mcp.v1alpha1.Metadata.Annotati" +
|
||||
"onsEntry\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" +
|
||||
"value\030\002 \001(\t:\0028\001\0322\n\020AnnotationsEntry\022\013\n\003k" +
|
||||
"ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B%\n!com.aliba" +
|
||||
"ba.nacos.istio.model.mcpP\001b\006proto3"
|
||||
};
|
||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||
com.google.protobuf.TimestampProto.getDescriptor(),
|
||||
});
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_descriptor =
|
||||
getDescriptor().getMessageTypes().get(0);
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_descriptor,
|
||||
new java.lang.String[] { "Name", "CreateTime", "Version", "Labels", "Annotations", });
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_LabelsEntry_descriptor =
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_descriptor.getNestedTypes().get(0);
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_LabelsEntry_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_LabelsEntry_descriptor,
|
||||
new java.lang.String[] { "Key", "Value", });
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_AnnotationsEntry_descriptor =
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_descriptor.getNestedTypes().get(1);
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_AnnotationsEntry_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_mcp_v1alpha1_Metadata_AnnotationsEntry_descriptor,
|
||||
new java.lang.String[] { "Key", "Value", });
|
||||
com.google.protobuf.TimestampProto.getDescriptor();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(outer_class_scope)
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,198 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: mcp.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
public interface RequestResourcesOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:istio.mcp.v1alpha1.RequestResources)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The sink node making the request.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
|
||||
* @return Whether the sinkNode field is set.
|
||||
*/
|
||||
boolean hasSinkNode();
|
||||
/**
|
||||
* <pre>
|
||||
* The sink node making the request.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
|
||||
* @return The sinkNode.
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.mcp.SinkNode getSinkNode();
|
||||
/**
|
||||
* <pre>
|
||||
* The sink node making the request.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.mcp.SinkNodeOrBuilder getSinkNodeOrBuilder();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Type of resource collection that is being requested, e.g.
|
||||
* istio/networking/v1alpha3/VirtualService
|
||||
* k8s/<apiVersion>/<kind>
|
||||
* </pre>
|
||||
*
|
||||
* <code>string collection = 2;</code>
|
||||
* @return The collection.
|
||||
*/
|
||||
java.lang.String getCollection();
|
||||
/**
|
||||
* <pre>
|
||||
* Type of resource collection that is being requested, e.g.
|
||||
* istio/networking/v1alpha3/VirtualService
|
||||
* k8s/<apiVersion>/<kind>
|
||||
* </pre>
|
||||
*
|
||||
* <code>string collection = 2;</code>
|
||||
* @return The bytes for collection.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getCollectionBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* When the RequestResources is the first in a stream, the initial_resource_versions must
|
||||
* be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
|
||||
* resources names of the MCP resources known to the MCP client. The values in the map
|
||||
* are the associated resource level version info.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> initial_resource_versions = 3;</code>
|
||||
*/
|
||||
int getInitialResourceVersionsCount();
|
||||
/**
|
||||
* <pre>
|
||||
* When the RequestResources is the first in a stream, the initial_resource_versions must
|
||||
* be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
|
||||
* resources names of the MCP resources known to the MCP client. The values in the map
|
||||
* are the associated resource level version info.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> initial_resource_versions = 3;</code>
|
||||
*/
|
||||
boolean containsInitialResourceVersions(
|
||||
java.lang.String key);
|
||||
/**
|
||||
* Use {@link #getInitialResourceVersionsMap()} instead.
|
||||
*/
|
||||
@java.lang.Deprecated
|
||||
java.util.Map<java.lang.String, java.lang.String>
|
||||
getInitialResourceVersions();
|
||||
/**
|
||||
* <pre>
|
||||
* When the RequestResources is the first in a stream, the initial_resource_versions must
|
||||
* be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
|
||||
* resources names of the MCP resources known to the MCP client. The values in the map
|
||||
* are the associated resource level version info.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> initial_resource_versions = 3;</code>
|
||||
*/
|
||||
java.util.Map<java.lang.String, java.lang.String>
|
||||
getInitialResourceVersionsMap();
|
||||
/**
|
||||
* <pre>
|
||||
* When the RequestResources is the first in a stream, the initial_resource_versions must
|
||||
* be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
|
||||
* resources names of the MCP resources known to the MCP client. The values in the map
|
||||
* are the associated resource level version info.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> initial_resource_versions = 3;</code>
|
||||
*/
|
||||
|
||||
java.lang.String getInitialResourceVersionsOrDefault(
|
||||
java.lang.String key,
|
||||
java.lang.String defaultValue);
|
||||
/**
|
||||
* <pre>
|
||||
* When the RequestResources is the first in a stream, the initial_resource_versions must
|
||||
* be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
|
||||
* resources names of the MCP resources known to the MCP client. The values in the map
|
||||
* are the associated resource level version info.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> initial_resource_versions = 3;</code>
|
||||
*/
|
||||
|
||||
java.lang.String getInitialResourceVersionsOrThrow(
|
||||
java.lang.String key);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* When the RequestResources is an ACK or NACK message in response to a previous RequestResources,
|
||||
* the response_nonce must be the nonce in the RequestResources. Otherwise response_nonce must
|
||||
* be omitted.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string response_nonce = 4;</code>
|
||||
* @return The responseNonce.
|
||||
*/
|
||||
java.lang.String getResponseNonce();
|
||||
/**
|
||||
* <pre>
|
||||
* When the RequestResources is an ACK or NACK message in response to a previous RequestResources,
|
||||
* the response_nonce must be the nonce in the RequestResources. Otherwise response_nonce must
|
||||
* be omitted.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string response_nonce = 4;</code>
|
||||
* @return The bytes for responseNonce.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getResponseNonceBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* This is populated when the previously received resources could not be applied
|
||||
* The *message* field in *error_details* provides the source internal error
|
||||
* related to the failure.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.rpc.Status error_detail = 5;</code>
|
||||
* @return Whether the errorDetail field is set.
|
||||
*/
|
||||
boolean hasErrorDetail();
|
||||
/**
|
||||
* <pre>
|
||||
* This is populated when the previously received resources could not be applied
|
||||
* The *message* field in *error_details* provides the source internal error
|
||||
* related to the failure.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.rpc.Status error_detail = 5;</code>
|
||||
* @return The errorDetail.
|
||||
*/
|
||||
com.google.rpc.Status getErrorDetail();
|
||||
/**
|
||||
* <pre>
|
||||
* This is populated when the previously received resources could not be applied
|
||||
* The *message* field in *error_details* provides the source internal error
|
||||
* related to the failure.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.rpc.Status error_detail = 5;</code>
|
||||
*/
|
||||
com.google.rpc.StatusOrBuilder getErrorDetailOrBuilder();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Request an incremental update for the specified collection. The source may choose to
|
||||
* honor this request or ignore and and provide a full-state update in the corresponding
|
||||
* `Resource` response.
|
||||
* </pre>
|
||||
*
|
||||
* <code>bool incremental = 6;</code>
|
||||
* @return The incremental.
|
||||
*/
|
||||
boolean getIncremental();
|
||||
}
|
@ -0,0 +1,895 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: resource.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Resource as transferred via the Mesh Configuration Protocol. Each
|
||||
* resource is made up of common metadata, and a type-specific resource payload.
|
||||
* </pre>
|
||||
*
|
||||
* Protobuf type {@code istio.mcp.v1alpha1.Resource}
|
||||
*/
|
||||
public final class Resource extends
|
||||
com.google.protobuf.GeneratedMessageV3 implements
|
||||
// @@protoc_insertion_point(message_implements:istio.mcp.v1alpha1.Resource)
|
||||
ResourceOrBuilder {
|
||||
private static final long serialVersionUID = 0L;
|
||||
// Use Resource.newBuilder() to construct.
|
||||
private Resource(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||
super(builder);
|
||||
}
|
||||
private Resource() {
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@SuppressWarnings({"unused"})
|
||||
protected java.lang.Object newInstance(
|
||||
UnusedPrivateParameter unused) {
|
||||
return new Resource();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final com.google.protobuf.UnknownFieldSet
|
||||
getUnknownFields() {
|
||||
return this.unknownFields;
|
||||
}
|
||||
private Resource(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
this();
|
||||
if (extensionRegistry == null) {
|
||||
throw new java.lang.NullPointerException();
|
||||
}
|
||||
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
case 10: {
|
||||
com.alibaba.nacos.istio.model.mcp.Metadata.Builder subBuilder = null;
|
||||
if (metadata_ != null) {
|
||||
subBuilder = metadata_.toBuilder();
|
||||
}
|
||||
metadata_ = input.readMessage(com.alibaba.nacos.istio.model.mcp.Metadata.parser(), extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom(metadata_);
|
||||
metadata_ = subBuilder.buildPartial();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
com.google.protobuf.Any.Builder subBuilder = null;
|
||||
if (body_ != null) {
|
||||
subBuilder = body_.toBuilder();
|
||||
}
|
||||
body_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom(body_);
|
||||
body_ = subBuilder.buildPartial();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (!parseUnknownField(
|
||||
input, unknownFields, extensionRegistry, tag)) {
|
||||
done = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||
e).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
this.unknownFields = unknownFields.build();
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return com.alibaba.nacos.istio.model.mcp.ResourceOuterClass.internal_static_istio_mcp_v1alpha1_Resource_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return com.alibaba.nacos.istio.model.mcp.ResourceOuterClass.internal_static_istio_mcp_v1alpha1_Resource_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
com.alibaba.nacos.istio.model.mcp.Resource.class, com.alibaba.nacos.istio.model.mcp.Resource.Builder.class);
|
||||
}
|
||||
|
||||
public static final int METADATA_FIELD_NUMBER = 1;
|
||||
private com.alibaba.nacos.istio.model.mcp.Metadata metadata_;
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
* @return Whether the metadata field is set.
|
||||
*/
|
||||
public boolean hasMetadata() {
|
||||
return metadata_ != null;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
* @return The metadata.
|
||||
*/
|
||||
public com.alibaba.nacos.istio.model.mcp.Metadata getMetadata() {
|
||||
return metadata_ == null ? com.alibaba.nacos.istio.model.mcp.Metadata.getDefaultInstance() : metadata_;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
*/
|
||||
public com.alibaba.nacos.istio.model.mcp.MetadataOrBuilder getMetadataOrBuilder() {
|
||||
return getMetadata();
|
||||
}
|
||||
|
||||
public static final int BODY_FIELD_NUMBER = 2;
|
||||
private com.google.protobuf.Any body_;
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
* @return Whether the body field is set.
|
||||
*/
|
||||
public boolean hasBody() {
|
||||
return body_ != null;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
* @return The body.
|
||||
*/
|
||||
public com.google.protobuf.Any getBody() {
|
||||
return body_ == null ? com.google.protobuf.Any.getDefaultInstance() : body_;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
*/
|
||||
public com.google.protobuf.AnyOrBuilder getBodyOrBuilder() {
|
||||
return getBody();
|
||||
}
|
||||
|
||||
private byte memoizedIsInitialized = -1;
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
if (metadata_ != null) {
|
||||
output.writeMessage(1, getMetadata());
|
||||
}
|
||||
if (body_ != null) {
|
||||
output.writeMessage(2, getBody());
|
||||
}
|
||||
unknownFields.writeTo(output);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (metadata_ != null) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeMessageSize(1, getMetadata());
|
||||
}
|
||||
if (body_ != null) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeMessageSize(2, getBody());
|
||||
}
|
||||
size += unknownFields.getSerializedSize();
|
||||
memoizedSize = size;
|
||||
return size;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public boolean equals(final java.lang.Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof com.alibaba.nacos.istio.model.mcp.Resource)) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
com.alibaba.nacos.istio.model.mcp.Resource other = (com.alibaba.nacos.istio.model.mcp.Resource) obj;
|
||||
|
||||
if (hasMetadata() != other.hasMetadata()) return false;
|
||||
if (hasMetadata()) {
|
||||
if (!getMetadata()
|
||||
.equals(other.getMetadata())) return false;
|
||||
}
|
||||
if (hasBody() != other.hasBody()) return false;
|
||||
if (hasBody()) {
|
||||
if (!getBody()
|
||||
.equals(other.getBody())) return false;
|
||||
}
|
||||
if (!unknownFields.equals(other.unknownFields)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public int hashCode() {
|
||||
if (memoizedHashCode != 0) {
|
||||
return memoizedHashCode;
|
||||
}
|
||||
int hash = 41;
|
||||
hash = (19 * hash) + getDescriptor().hashCode();
|
||||
if (hasMetadata()) {
|
||||
hash = (37 * hash) + METADATA_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getMetadata().hashCode();
|
||||
}
|
||||
if (hasBody()) {
|
||||
hash = (37 * hash) + BODY_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getBody().hashCode();
|
||||
}
|
||||
hash = (29 * hash) + unknownFields.hashCode();
|
||||
memoizedHashCode = hash;
|
||||
return hash;
|
||||
}
|
||||
|
||||
public static com.alibaba.nacos.istio.model.mcp.Resource parseFrom(
|
||||
java.nio.ByteBuffer data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.Resource parseFrom(
|
||||
java.nio.ByteBuffer data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.Resource parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.Resource parseFrom(
|
||||
com.google.protobuf.ByteString data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.Resource parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.Resource parseFrom(
|
||||
byte[] data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.Resource parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.Resource parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.Resource parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.Resource parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.Resource parseFrom(
|
||||
com.google.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.Resource parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
public static Builder newBuilder() {
|
||||
return DEFAULT_INSTANCE.toBuilder();
|
||||
}
|
||||
public static Builder newBuilder(com.alibaba.nacos.istio.model.mcp.Resource prototype) {
|
||||
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder toBuilder() {
|
||||
return this == DEFAULT_INSTANCE
|
||||
? new Builder() : new Builder().mergeFrom(this);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected Builder newBuilderForType(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
Builder builder = new Builder(parent);
|
||||
return builder;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Resource as transferred via the Mesh Configuration Protocol. Each
|
||||
* resource is made up of common metadata, and a type-specific resource payload.
|
||||
* </pre>
|
||||
*
|
||||
* Protobuf type {@code istio.mcp.v1alpha1.Resource}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
||||
// @@protoc_insertion_point(builder_implements:istio.mcp.v1alpha1.Resource)
|
||||
com.alibaba.nacos.istio.model.mcp.ResourceOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return com.alibaba.nacos.istio.model.mcp.ResourceOuterClass.internal_static_istio_mcp_v1alpha1_Resource_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return com.alibaba.nacos.istio.model.mcp.ResourceOuterClass.internal_static_istio_mcp_v1alpha1_Resource_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
com.alibaba.nacos.istio.model.mcp.Resource.class, com.alibaba.nacos.istio.model.mcp.Resource.Builder.class);
|
||||
}
|
||||
|
||||
// Construct using com.alibaba.nacos.istio.model.mcp.Resource.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
super(parent);
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
private void maybeForceBuilderInitialization() {
|
||||
if (com.google.protobuf.GeneratedMessageV3
|
||||
.alwaysUseFieldBuilders) {
|
||||
}
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
if (metadataBuilder_ == null) {
|
||||
metadata_ = null;
|
||||
} else {
|
||||
metadata_ = null;
|
||||
metadataBuilder_ = null;
|
||||
}
|
||||
if (bodyBuilder_ == null) {
|
||||
body_ = null;
|
||||
} else {
|
||||
body_ = null;
|
||||
bodyBuilder_ = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return com.alibaba.nacos.istio.model.mcp.ResourceOuterClass.internal_static_istio_mcp_v1alpha1_Resource_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.alibaba.nacos.istio.model.mcp.Resource getDefaultInstanceForType() {
|
||||
return com.alibaba.nacos.istio.model.mcp.Resource.getDefaultInstance();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.alibaba.nacos.istio.model.mcp.Resource build() {
|
||||
com.alibaba.nacos.istio.model.mcp.Resource result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.alibaba.nacos.istio.model.mcp.Resource buildPartial() {
|
||||
com.alibaba.nacos.istio.model.mcp.Resource result = new com.alibaba.nacos.istio.model.mcp.Resource(this);
|
||||
if (metadataBuilder_ == null) {
|
||||
result.metadata_ = metadata_;
|
||||
} else {
|
||||
result.metadata_ = metadataBuilder_.build();
|
||||
}
|
||||
if (bodyBuilder_ == null) {
|
||||
result.body_ = body_;
|
||||
} else {
|
||||
result.body_ = bodyBuilder_.build();
|
||||
}
|
||||
onBuilt();
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder clone() {
|
||||
return super.clone();
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.setField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field) {
|
||||
return super.clearField(field);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearOneof(
|
||||
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
||||
return super.clearOneof(oneof);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
int index, java.lang.Object value) {
|
||||
return super.setRepeatedField(field, index, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder addRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.addRepeatedField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
if (other instanceof com.alibaba.nacos.istio.model.mcp.Resource) {
|
||||
return mergeFrom((com.alibaba.nacos.istio.model.mcp.Resource)other);
|
||||
} else {
|
||||
super.mergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder mergeFrom(com.alibaba.nacos.istio.model.mcp.Resource other) {
|
||||
if (other == com.alibaba.nacos.istio.model.mcp.Resource.getDefaultInstance()) return this;
|
||||
if (other.hasMetadata()) {
|
||||
mergeMetadata(other.getMetadata());
|
||||
}
|
||||
if (other.hasBody()) {
|
||||
mergeBody(other.getBody());
|
||||
}
|
||||
this.mergeUnknownFields(other.unknownFields);
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
com.alibaba.nacos.istio.model.mcp.Resource parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (com.alibaba.nacos.istio.model.mcp.Resource) e.getUnfinishedMessage();
|
||||
throw e.unwrapIOException();
|
||||
} finally {
|
||||
if (parsedMessage != null) {
|
||||
mergeFrom(parsedMessage);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
private com.alibaba.nacos.istio.model.mcp.Metadata metadata_;
|
||||
private com.google.protobuf.SingleFieldBuilderV3<
|
||||
com.alibaba.nacos.istio.model.mcp.Metadata, com.alibaba.nacos.istio.model.mcp.Metadata.Builder, com.alibaba.nacos.istio.model.mcp.MetadataOrBuilder> metadataBuilder_;
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
* @return Whether the metadata field is set.
|
||||
*/
|
||||
public boolean hasMetadata() {
|
||||
return metadataBuilder_ != null || metadata_ != null;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
* @return The metadata.
|
||||
*/
|
||||
public com.alibaba.nacos.istio.model.mcp.Metadata getMetadata() {
|
||||
if (metadataBuilder_ == null) {
|
||||
return metadata_ == null ? com.alibaba.nacos.istio.model.mcp.Metadata.getDefaultInstance() : metadata_;
|
||||
} else {
|
||||
return metadataBuilder_.getMessage();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
*/
|
||||
public Builder setMetadata(com.alibaba.nacos.istio.model.mcp.Metadata value) {
|
||||
if (metadataBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
metadata_ = value;
|
||||
onChanged();
|
||||
} else {
|
||||
metadataBuilder_.setMessage(value);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
*/
|
||||
public Builder setMetadata(
|
||||
com.alibaba.nacos.istio.model.mcp.Metadata.Builder builderForValue) {
|
||||
if (metadataBuilder_ == null) {
|
||||
metadata_ = builderForValue.build();
|
||||
onChanged();
|
||||
} else {
|
||||
metadataBuilder_.setMessage(builderForValue.build());
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
*/
|
||||
public Builder mergeMetadata(com.alibaba.nacos.istio.model.mcp.Metadata value) {
|
||||
if (metadataBuilder_ == null) {
|
||||
if (metadata_ != null) {
|
||||
metadata_ =
|
||||
com.alibaba.nacos.istio.model.mcp.Metadata.newBuilder(metadata_).mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
metadata_ = value;
|
||||
}
|
||||
onChanged();
|
||||
} else {
|
||||
metadataBuilder_.mergeFrom(value);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
*/
|
||||
public Builder clearMetadata() {
|
||||
if (metadataBuilder_ == null) {
|
||||
metadata_ = null;
|
||||
onChanged();
|
||||
} else {
|
||||
metadata_ = null;
|
||||
metadataBuilder_ = null;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
*/
|
||||
public com.alibaba.nacos.istio.model.mcp.Metadata.Builder getMetadataBuilder() {
|
||||
|
||||
onChanged();
|
||||
return getMetadataFieldBuilder().getBuilder();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
*/
|
||||
public com.alibaba.nacos.istio.model.mcp.MetadataOrBuilder getMetadataOrBuilder() {
|
||||
if (metadataBuilder_ != null) {
|
||||
return metadataBuilder_.getMessageOrBuilder();
|
||||
} else {
|
||||
return metadata_ == null ?
|
||||
com.alibaba.nacos.istio.model.mcp.Metadata.getDefaultInstance() : metadata_;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
*/
|
||||
private com.google.protobuf.SingleFieldBuilderV3<
|
||||
com.alibaba.nacos.istio.model.mcp.Metadata, com.alibaba.nacos.istio.model.mcp.Metadata.Builder, com.alibaba.nacos.istio.model.mcp.MetadataOrBuilder>
|
||||
getMetadataFieldBuilder() {
|
||||
if (metadataBuilder_ == null) {
|
||||
metadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
|
||||
com.alibaba.nacos.istio.model.mcp.Metadata, com.alibaba.nacos.istio.model.mcp.Metadata.Builder, com.alibaba.nacos.istio.model.mcp.MetadataOrBuilder>(
|
||||
getMetadata(),
|
||||
getParentForChildren(),
|
||||
isClean());
|
||||
metadata_ = null;
|
||||
}
|
||||
return metadataBuilder_;
|
||||
}
|
||||
|
||||
private com.google.protobuf.Any body_;
|
||||
private com.google.protobuf.SingleFieldBuilderV3<
|
||||
com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> bodyBuilder_;
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
* @return Whether the body field is set.
|
||||
*/
|
||||
public boolean hasBody() {
|
||||
return bodyBuilder_ != null || body_ != null;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
* @return The body.
|
||||
*/
|
||||
public com.google.protobuf.Any getBody() {
|
||||
if (bodyBuilder_ == null) {
|
||||
return body_ == null ? com.google.protobuf.Any.getDefaultInstance() : body_;
|
||||
} else {
|
||||
return bodyBuilder_.getMessage();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
*/
|
||||
public Builder setBody(com.google.protobuf.Any value) {
|
||||
if (bodyBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
body_ = value;
|
||||
onChanged();
|
||||
} else {
|
||||
bodyBuilder_.setMessage(value);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
*/
|
||||
public Builder setBody(
|
||||
com.google.protobuf.Any.Builder builderForValue) {
|
||||
if (bodyBuilder_ == null) {
|
||||
body_ = builderForValue.build();
|
||||
onChanged();
|
||||
} else {
|
||||
bodyBuilder_.setMessage(builderForValue.build());
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
*/
|
||||
public Builder mergeBody(com.google.protobuf.Any value) {
|
||||
if (bodyBuilder_ == null) {
|
||||
if (body_ != null) {
|
||||
body_ =
|
||||
com.google.protobuf.Any.newBuilder(body_).mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
body_ = value;
|
||||
}
|
||||
onChanged();
|
||||
} else {
|
||||
bodyBuilder_.mergeFrom(value);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
*/
|
||||
public Builder clearBody() {
|
||||
if (bodyBuilder_ == null) {
|
||||
body_ = null;
|
||||
onChanged();
|
||||
} else {
|
||||
body_ = null;
|
||||
bodyBuilder_ = null;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
*/
|
||||
public com.google.protobuf.Any.Builder getBodyBuilder() {
|
||||
|
||||
onChanged();
|
||||
return getBodyFieldBuilder().getBuilder();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
*/
|
||||
public com.google.protobuf.AnyOrBuilder getBodyOrBuilder() {
|
||||
if (bodyBuilder_ != null) {
|
||||
return bodyBuilder_.getMessageOrBuilder();
|
||||
} else {
|
||||
return body_ == null ?
|
||||
com.google.protobuf.Any.getDefaultInstance() : body_;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
*/
|
||||
private com.google.protobuf.SingleFieldBuilderV3<
|
||||
com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>
|
||||
getBodyFieldBuilder() {
|
||||
if (bodyBuilder_ == null) {
|
||||
bodyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
|
||||
com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>(
|
||||
getBody(),
|
||||
getParentForChildren(),
|
||||
isClean());
|
||||
body_ = null;
|
||||
}
|
||||
return bodyBuilder_;
|
||||
}
|
||||
@java.lang.Override
|
||||
public final Builder setUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
return super.setUnknownFields(unknownFields);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final Builder mergeUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
return super.mergeUnknownFields(unknownFields);
|
||||
}
|
||||
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:istio.mcp.v1alpha1.Resource)
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:istio.mcp.v1alpha1.Resource)
|
||||
private static final com.alibaba.nacos.istio.model.mcp.Resource DEFAULT_INSTANCE;
|
||||
static {
|
||||
DEFAULT_INSTANCE = new com.alibaba.nacos.istio.model.mcp.Resource();
|
||||
}
|
||||
|
||||
public static com.alibaba.nacos.istio.model.mcp.Resource getDefaultInstance() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
private static final com.google.protobuf.Parser<Resource>
|
||||
PARSER = new com.google.protobuf.AbstractParser<Resource>() {
|
||||
@java.lang.Override
|
||||
public Resource parsePartialFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return new Resource(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
public static com.google.protobuf.Parser<Resource> parser() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Parser<Resource> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.alibaba.nacos.istio.model.mcp.Resource getDefaultInstanceForType() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,63 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: resource.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
public interface ResourceOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:istio.mcp.v1alpha1.Resource)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
* @return Whether the metadata field is set.
|
||||
*/
|
||||
boolean hasMetadata();
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
* @return The metadata.
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.mcp.Metadata getMetadata();
|
||||
/**
|
||||
* <pre>
|
||||
* Common metadata describing the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.mcp.v1alpha1.Metadata metadata = 1;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.mcp.MetadataOrBuilder getMetadataOrBuilder();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
* @return Whether the body field is set.
|
||||
*/
|
||||
boolean hasBody();
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
* @return The body.
|
||||
*/
|
||||
com.google.protobuf.Any getBody();
|
||||
/**
|
||||
* <pre>
|
||||
* The primary payload for the resource.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.google.protobuf.Any body = 2;</code>
|
||||
*/
|
||||
com.google.protobuf.AnyOrBuilder getBodyOrBuilder();
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: resource.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
public final class ResourceOuterClass {
|
||||
private ResourceOuterClass() {}
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||
}
|
||||
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistry registry) {
|
||||
registerAllExtensions(
|
||||
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||
}
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_mcp_v1alpha1_Resource_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_mcp_v1alpha1_Resource_fieldAccessorTable;
|
||||
|
||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||
getDescriptor() {
|
||||
return descriptor;
|
||||
}
|
||||
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||
descriptor;
|
||||
static {
|
||||
java.lang.String[] descriptorData = {
|
||||
"\n\016resource.proto\022\022istio.mcp.v1alpha1\032\031go" +
|
||||
"ogle/protobuf/any.proto\032\016metadata.proto\"" +
|
||||
"^\n\010Resource\022.\n\010metadata\030\001 \001(\0132\034.istio.mc" +
|
||||
"p.v1alpha1.Metadata\022\"\n\004body\030\002 \001(\0132\024.goog" +
|
||||
"le.protobuf.AnyB%\n!com.alibaba.nacos.ist" +
|
||||
"io.model.mcpP\001b\006proto3"
|
||||
};
|
||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||
com.google.protobuf.AnyProto.getDescriptor(),
|
||||
com.alibaba.nacos.istio.model.mcp.MetadataOuterClass.getDescriptor(),
|
||||
});
|
||||
internal_static_istio_mcp_v1alpha1_Resource_descriptor =
|
||||
getDescriptor().getMessageTypes().get(0);
|
||||
internal_static_istio_mcp_v1alpha1_Resource_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_mcp_v1alpha1_Resource_descriptor,
|
||||
new java.lang.String[] { "Metadata", "Body", });
|
||||
com.google.protobuf.AnyProto.getDescriptor();
|
||||
com.alibaba.nacos.istio.model.mcp.MetadataOuterClass.getDescriptor();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(outer_class_scope)
|
||||
}
|
@ -0,0 +1,294 @@
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||||
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
|
||||
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
|
||||
import static io.grpc.stub.ClientCalls.futureUnaryCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Service where the source is the gRPC client. The source is responsible for
|
||||
* initiating connections and opening streams.
|
||||
* </pre>
|
||||
*/
|
||||
@javax.annotation.Generated(
|
||||
value = "by gRPC proto compiler (version 1.17.1)",
|
||||
comments = "Source: mcp.proto")
|
||||
public final class ResourceSinkGrpc {
|
||||
|
||||
private ResourceSinkGrpc() {}
|
||||
|
||||
public static final String SERVICE_NAME = "istio.mcp.v1alpha1.ResourceSink";
|
||||
|
||||
// Static method descriptors that strictly reflect the proto.
|
||||
private static volatile io.grpc.MethodDescriptor<com.alibaba.nacos.istio.model.mcp.Resources,
|
||||
com.alibaba.nacos.istio.model.mcp.RequestResources> getEstablishResourceStreamMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "EstablishResourceStream",
|
||||
requestType = com.alibaba.nacos.istio.model.mcp.Resources.class,
|
||||
responseType = com.alibaba.nacos.istio.model.mcp.RequestResources.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||
public static io.grpc.MethodDescriptor<com.alibaba.nacos.istio.model.mcp.Resources,
|
||||
com.alibaba.nacos.istio.model.mcp.RequestResources> getEstablishResourceStreamMethod() {
|
||||
io.grpc.MethodDescriptor<com.alibaba.nacos.istio.model.mcp.Resources, com.alibaba.nacos.istio.model.mcp.RequestResources> getEstablishResourceStreamMethod;
|
||||
if ((getEstablishResourceStreamMethod = ResourceSinkGrpc.getEstablishResourceStreamMethod) == null) {
|
||||
synchronized (ResourceSinkGrpc.class) {
|
||||
if ((getEstablishResourceStreamMethod = ResourceSinkGrpc.getEstablishResourceStreamMethod) == null) {
|
||||
ResourceSinkGrpc.getEstablishResourceStreamMethod = getEstablishResourceStreamMethod =
|
||||
io.grpc.MethodDescriptor.<com.alibaba.nacos.istio.model.mcp.Resources, com.alibaba.nacos.istio.model.mcp.RequestResources>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||
.setFullMethodName(generateFullMethodName(
|
||||
"istio.mcp.v1alpha1.ResourceSink", "EstablishResourceStream"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.alibaba.nacos.istio.model.mcp.Resources.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.alibaba.nacos.istio.model.mcp.RequestResources.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new ResourceSinkMethodDescriptorSupplier("EstablishResourceStream"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getEstablishResourceStreamMethod;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new async stub that supports all call types for the service
|
||||
*/
|
||||
public static ResourceSinkStub newStub(io.grpc.Channel channel) {
|
||||
return new ResourceSinkStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||||
*/
|
||||
public static ResourceSinkBlockingStub newBlockingStub(
|
||||
io.grpc.Channel channel) {
|
||||
return new ResourceSinkBlockingStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||||
*/
|
||||
public static ResourceSinkFutureStub newFutureStub(
|
||||
io.grpc.Channel channel) {
|
||||
return new ResourceSinkFutureStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Service where the source is the gRPC client. The source is responsible for
|
||||
* initiating connections and opening streams.
|
||||
* </pre>
|
||||
*/
|
||||
public static abstract class ResourceSinkImplBase implements io.grpc.BindableService {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The source, acting as gRPC client, establishes a new resource stream
|
||||
* with the sink. The sink sends RequestResources message to and
|
||||
* receives Resources messages from the source.
|
||||
* </pre>
|
||||
*/
|
||||
public io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.Resources> establishResourceStream(
|
||||
io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.RequestResources> responseObserver) {
|
||||
return asyncUnimplementedStreamingCall(getEstablishResourceStreamMethod(), responseObserver);
|
||||
}
|
||||
|
||||
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||
.addMethod(
|
||||
getEstablishResourceStreamMethod(),
|
||||
asyncBidiStreamingCall(
|
||||
new MethodHandlers<
|
||||
com.alibaba.nacos.istio.model.mcp.Resources,
|
||||
com.alibaba.nacos.istio.model.mcp.RequestResources>(
|
||||
this, METHODID_ESTABLISH_RESOURCE_STREAM)))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Service where the source is the gRPC client. The source is responsible for
|
||||
* initiating connections and opening streams.
|
||||
* </pre>
|
||||
*/
|
||||
public static final class ResourceSinkStub extends io.grpc.stub.AbstractStub<ResourceSinkStub> {
|
||||
private ResourceSinkStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private ResourceSinkStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected ResourceSinkStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new ResourceSinkStub(channel, callOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The source, acting as gRPC client, establishes a new resource stream
|
||||
* with the sink. The sink sends RequestResources message to and
|
||||
* receives Resources messages from the source.
|
||||
* </pre>
|
||||
*/
|
||||
public io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.Resources> establishResourceStream(
|
||||
io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.RequestResources> responseObserver) {
|
||||
return asyncBidiStreamingCall(
|
||||
getChannel().newCall(getEstablishResourceStreamMethod(), getCallOptions()), responseObserver);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Service where the source is the gRPC client. The source is responsible for
|
||||
* initiating connections and opening streams.
|
||||
* </pre>
|
||||
*/
|
||||
public static final class ResourceSinkBlockingStub extends io.grpc.stub.AbstractStub<ResourceSinkBlockingStub> {
|
||||
private ResourceSinkBlockingStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private ResourceSinkBlockingStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected ResourceSinkBlockingStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new ResourceSinkBlockingStub(channel, callOptions);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Service where the source is the gRPC client. The source is responsible for
|
||||
* initiating connections and opening streams.
|
||||
* </pre>
|
||||
*/
|
||||
public static final class ResourceSinkFutureStub extends io.grpc.stub.AbstractStub<ResourceSinkFutureStub> {
|
||||
private ResourceSinkFutureStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private ResourceSinkFutureStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected ResourceSinkFutureStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new ResourceSinkFutureStub(channel, callOptions);
|
||||
}
|
||||
}
|
||||
|
||||
private static final int METHODID_ESTABLISH_RESOURCE_STREAM = 0;
|
||||
|
||||
private static final class MethodHandlers<Req, Resp> implements
|
||||
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
||||
private final ResourceSinkImplBase serviceImpl;
|
||||
private final int methodId;
|
||||
|
||||
MethodHandlers(ResourceSinkImplBase serviceImpl, int methodId) {
|
||||
this.serviceImpl = serviceImpl;
|
||||
this.methodId = methodId;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("unchecked")
|
||||
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||
switch (methodId) {
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("unchecked")
|
||||
public io.grpc.stub.StreamObserver<Req> invoke(
|
||||
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||
switch (methodId) {
|
||||
case METHODID_ESTABLISH_RESOURCE_STREAM:
|
||||
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.establishResourceStream(
|
||||
(io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.RequestResources>) responseObserver);
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static abstract class ResourceSinkBaseDescriptorSupplier
|
||||
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
|
||||
ResourceSinkBaseDescriptorSupplier() {}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
|
||||
return com.alibaba.nacos.istio.model.mcp.Mcp.getDescriptor();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
|
||||
return getFileDescriptor().findServiceByName("ResourceSink");
|
||||
}
|
||||
}
|
||||
|
||||
private static final class ResourceSinkFileDescriptorSupplier
|
||||
extends ResourceSinkBaseDescriptorSupplier {
|
||||
ResourceSinkFileDescriptorSupplier() {}
|
||||
}
|
||||
|
||||
private static final class ResourceSinkMethodDescriptorSupplier
|
||||
extends ResourceSinkBaseDescriptorSupplier
|
||||
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
|
||||
private final String methodName;
|
||||
|
||||
ResourceSinkMethodDescriptorSupplier(String methodName) {
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
|
||||
return getServiceDescriptor().findMethodByName(methodName);
|
||||
}
|
||||
}
|
||||
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (ResourceSinkGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||||
.setSchemaDescriptor(new ResourceSinkFileDescriptorSupplier())
|
||||
.addMethod(getEstablishResourceStreamMethod())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1,294 @@
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||||
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
|
||||
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
|
||||
import static io.grpc.stub.ClientCalls.futureUnaryCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Service where the sink is the gRPC client. The sink is responsible for
|
||||
* initiating connections and opening streams.
|
||||
* </pre>
|
||||
*/
|
||||
@javax.annotation.Generated(
|
||||
value = "by gRPC proto compiler (version 1.17.1)",
|
||||
comments = "Source: mcp.proto")
|
||||
public final class ResourceSourceGrpc {
|
||||
|
||||
private ResourceSourceGrpc() {}
|
||||
|
||||
public static final String SERVICE_NAME = "istio.mcp.v1alpha1.ResourceSource";
|
||||
|
||||
// Static method descriptors that strictly reflect the proto.
|
||||
private static volatile io.grpc.MethodDescriptor<com.alibaba.nacos.istio.model.mcp.RequestResources,
|
||||
com.alibaba.nacos.istio.model.mcp.Resources> getEstablishResourceStreamMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "EstablishResourceStream",
|
||||
requestType = com.alibaba.nacos.istio.model.mcp.RequestResources.class,
|
||||
responseType = com.alibaba.nacos.istio.model.mcp.Resources.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||
public static io.grpc.MethodDescriptor<com.alibaba.nacos.istio.model.mcp.RequestResources,
|
||||
com.alibaba.nacos.istio.model.mcp.Resources> getEstablishResourceStreamMethod() {
|
||||
io.grpc.MethodDescriptor<com.alibaba.nacos.istio.model.mcp.RequestResources, com.alibaba.nacos.istio.model.mcp.Resources> getEstablishResourceStreamMethod;
|
||||
if ((getEstablishResourceStreamMethod = ResourceSourceGrpc.getEstablishResourceStreamMethod) == null) {
|
||||
synchronized (ResourceSourceGrpc.class) {
|
||||
if ((getEstablishResourceStreamMethod = ResourceSourceGrpc.getEstablishResourceStreamMethod) == null) {
|
||||
ResourceSourceGrpc.getEstablishResourceStreamMethod = getEstablishResourceStreamMethod =
|
||||
io.grpc.MethodDescriptor.<com.alibaba.nacos.istio.model.mcp.RequestResources, com.alibaba.nacos.istio.model.mcp.Resources>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||
.setFullMethodName(generateFullMethodName(
|
||||
"istio.mcp.v1alpha1.ResourceSource", "EstablishResourceStream"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.alibaba.nacos.istio.model.mcp.RequestResources.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.alibaba.nacos.istio.model.mcp.Resources.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new ResourceSourceMethodDescriptorSupplier("EstablishResourceStream"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getEstablishResourceStreamMethod;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new async stub that supports all call types for the service
|
||||
*/
|
||||
public static ResourceSourceStub newStub(io.grpc.Channel channel) {
|
||||
return new ResourceSourceStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||||
*/
|
||||
public static ResourceSourceBlockingStub newBlockingStub(
|
||||
io.grpc.Channel channel) {
|
||||
return new ResourceSourceBlockingStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||||
*/
|
||||
public static ResourceSourceFutureStub newFutureStub(
|
||||
io.grpc.Channel channel) {
|
||||
return new ResourceSourceFutureStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Service where the sink is the gRPC client. The sink is responsible for
|
||||
* initiating connections and opening streams.
|
||||
* </pre>
|
||||
*/
|
||||
public static abstract class ResourceSourceImplBase implements io.grpc.BindableService {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The sink, acting as gRPC client, establishes a new resource stream
|
||||
* with the source. The sink sends RequestResources message to
|
||||
* and receives Resources messages from the source.
|
||||
* </pre>
|
||||
*/
|
||||
public io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.RequestResources> establishResourceStream(
|
||||
io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.Resources> responseObserver) {
|
||||
return asyncUnimplementedStreamingCall(getEstablishResourceStreamMethod(), responseObserver);
|
||||
}
|
||||
|
||||
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||
.addMethod(
|
||||
getEstablishResourceStreamMethod(),
|
||||
asyncBidiStreamingCall(
|
||||
new MethodHandlers<
|
||||
com.alibaba.nacos.istio.model.mcp.RequestResources,
|
||||
com.alibaba.nacos.istio.model.mcp.Resources>(
|
||||
this, METHODID_ESTABLISH_RESOURCE_STREAM)))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Service where the sink is the gRPC client. The sink is responsible for
|
||||
* initiating connections and opening streams.
|
||||
* </pre>
|
||||
*/
|
||||
public static final class ResourceSourceStub extends io.grpc.stub.AbstractStub<ResourceSourceStub> {
|
||||
private ResourceSourceStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private ResourceSourceStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected ResourceSourceStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new ResourceSourceStub(channel, callOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The sink, acting as gRPC client, establishes a new resource stream
|
||||
* with the source. The sink sends RequestResources message to
|
||||
* and receives Resources messages from the source.
|
||||
* </pre>
|
||||
*/
|
||||
public io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.RequestResources> establishResourceStream(
|
||||
io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.Resources> responseObserver) {
|
||||
return asyncBidiStreamingCall(
|
||||
getChannel().newCall(getEstablishResourceStreamMethod(), getCallOptions()), responseObserver);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Service where the sink is the gRPC client. The sink is responsible for
|
||||
* initiating connections and opening streams.
|
||||
* </pre>
|
||||
*/
|
||||
public static final class ResourceSourceBlockingStub extends io.grpc.stub.AbstractStub<ResourceSourceBlockingStub> {
|
||||
private ResourceSourceBlockingStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private ResourceSourceBlockingStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected ResourceSourceBlockingStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new ResourceSourceBlockingStub(channel, callOptions);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Service where the sink is the gRPC client. The sink is responsible for
|
||||
* initiating connections and opening streams.
|
||||
* </pre>
|
||||
*/
|
||||
public static final class ResourceSourceFutureStub extends io.grpc.stub.AbstractStub<ResourceSourceFutureStub> {
|
||||
private ResourceSourceFutureStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private ResourceSourceFutureStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected ResourceSourceFutureStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new ResourceSourceFutureStub(channel, callOptions);
|
||||
}
|
||||
}
|
||||
|
||||
private static final int METHODID_ESTABLISH_RESOURCE_STREAM = 0;
|
||||
|
||||
private static final class MethodHandlers<Req, Resp> implements
|
||||
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
||||
private final ResourceSourceImplBase serviceImpl;
|
||||
private final int methodId;
|
||||
|
||||
MethodHandlers(ResourceSourceImplBase serviceImpl, int methodId) {
|
||||
this.serviceImpl = serviceImpl;
|
||||
this.methodId = methodId;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("unchecked")
|
||||
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||
switch (methodId) {
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("unchecked")
|
||||
public io.grpc.stub.StreamObserver<Req> invoke(
|
||||
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||
switch (methodId) {
|
||||
case METHODID_ESTABLISH_RESOURCE_STREAM:
|
||||
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.establishResourceStream(
|
||||
(io.grpc.stub.StreamObserver<com.alibaba.nacos.istio.model.mcp.Resources>) responseObserver);
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static abstract class ResourceSourceBaseDescriptorSupplier
|
||||
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
|
||||
ResourceSourceBaseDescriptorSupplier() {}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
|
||||
return com.alibaba.nacos.istio.model.mcp.Mcp.getDescriptor();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
|
||||
return getFileDescriptor().findServiceByName("ResourceSource");
|
||||
}
|
||||
}
|
||||
|
||||
private static final class ResourceSourceFileDescriptorSupplier
|
||||
extends ResourceSourceBaseDescriptorSupplier {
|
||||
ResourceSourceFileDescriptorSupplier() {}
|
||||
}
|
||||
|
||||
private static final class ResourceSourceMethodDescriptorSupplier
|
||||
extends ResourceSourceBaseDescriptorSupplier
|
||||
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
|
||||
private final String methodName;
|
||||
|
||||
ResourceSourceMethodDescriptorSupplier(String methodName) {
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
|
||||
return getServiceDescriptor().findMethodByName(methodName);
|
||||
}
|
||||
}
|
||||
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (ResourceSourceGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||||
.setSchemaDescriptor(new ResourceSourceFileDescriptorSupplier())
|
||||
.addMethod(getEstablishResourceStreamMethod())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
1937
istio/src/main/java/com/alibaba/nacos/istio/model/mcp/Resources.java
Normal file
1937
istio/src/main/java/com/alibaba/nacos/istio/model/mcp/Resources.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,225 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: mcp.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
public interface ResourcesOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:istio.mcp.v1alpha1.Resources)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The version of the response data (used for debugging).
|
||||
* </pre>
|
||||
*
|
||||
* <code>string system_version_info = 1;</code>
|
||||
* @return The systemVersionInfo.
|
||||
*/
|
||||
java.lang.String getSystemVersionInfo();
|
||||
/**
|
||||
* <pre>
|
||||
* The version of the response data (used for debugging).
|
||||
* </pre>
|
||||
*
|
||||
* <code>string system_version_info = 1;</code>
|
||||
* @return The bytes for systemVersionInfo.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getSystemVersionInfoBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Type of resource collection that is being requested, e.g.
|
||||
* istio/networking/v1alpha3/VirtualService
|
||||
* k8s/<apiVersion>/<kind>
|
||||
* </pre>
|
||||
*
|
||||
* <code>string collection = 2;</code>
|
||||
* @return The collection.
|
||||
*/
|
||||
java.lang.String getCollection();
|
||||
/**
|
||||
* <pre>
|
||||
* Type of resource collection that is being requested, e.g.
|
||||
* istio/networking/v1alpha3/VirtualService
|
||||
* k8s/<apiVersion>/<kind>
|
||||
* </pre>
|
||||
*
|
||||
* <code>string collection = 2;</code>
|
||||
* @return The bytes for collection.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getCollectionBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource* message.
|
||||
* These are typed resources that match the type url in the
|
||||
* RequestResources message.
|
||||
* When `incremental` is true, this contains an array of resources to add/update
|
||||
* for the specified collection. This modifies the existing collection at the sink
|
||||
* When `incremental` is false, this contains the full set of resources for the
|
||||
* specified collection. This replaces any previously delivered resources.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 3;</code>
|
||||
*/
|
||||
java.util.List<com.alibaba.nacos.istio.model.mcp.Resource>
|
||||
getResourcesList();
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource* message.
|
||||
* These are typed resources that match the type url in the
|
||||
* RequestResources message.
|
||||
* When `incremental` is true, this contains an array of resources to add/update
|
||||
* for the specified collection. This modifies the existing collection at the sink
|
||||
* When `incremental` is false, this contains the full set of resources for the
|
||||
* specified collection. This replaces any previously delivered resources.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 3;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.mcp.Resource getResources(int index);
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource* message.
|
||||
* These are typed resources that match the type url in the
|
||||
* RequestResources message.
|
||||
* When `incremental` is true, this contains an array of resources to add/update
|
||||
* for the specified collection. This modifies the existing collection at the sink
|
||||
* When `incremental` is false, this contains the full set of resources for the
|
||||
* specified collection. This replaces any previously delivered resources.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 3;</code>
|
||||
*/
|
||||
int getResourcesCount();
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource* message.
|
||||
* These are typed resources that match the type url in the
|
||||
* RequestResources message.
|
||||
* When `incremental` is true, this contains an array of resources to add/update
|
||||
* for the specified collection. This modifies the existing collection at the sink
|
||||
* When `incremental` is false, this contains the full set of resources for the
|
||||
* specified collection. This replaces any previously delivered resources.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 3;</code>
|
||||
*/
|
||||
java.util.List<? extends com.alibaba.nacos.istio.model.mcp.ResourceOrBuilder>
|
||||
getResourcesOrBuilderList();
|
||||
/**
|
||||
* <pre>
|
||||
* The response resources wrapped in the common MCP *Resource* message.
|
||||
* These are typed resources that match the type url in the
|
||||
* RequestResources message.
|
||||
* When `incremental` is true, this contains an array of resources to add/update
|
||||
* for the specified collection. This modifies the existing collection at the sink
|
||||
* When `incremental` is false, this contains the full set of resources for the
|
||||
* specified collection. This replaces any previously delivered resources.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.mcp.v1alpha1.Resource resources = 3;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.mcp.ResourceOrBuilder getResourcesOrBuilder(
|
||||
int index);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Names of resources that have been deleted and to be
|
||||
* removed from the MCP sink node. Removed resources for missing
|
||||
* resources can be ignored.
|
||||
* When `incremental` is true, this contains an array of resource names to remove
|
||||
* for the specified collection. This modifies the existing resource collection at
|
||||
* the sink.
|
||||
* When `incremental` is false, this field should be ignored.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string removed_resources = 4;</code>
|
||||
* @return A list containing the removedResources.
|
||||
*/
|
||||
java.util.List<java.lang.String>
|
||||
getRemovedResourcesList();
|
||||
/**
|
||||
* <pre>
|
||||
* Names of resources that have been deleted and to be
|
||||
* removed from the MCP sink node. Removed resources for missing
|
||||
* resources can be ignored.
|
||||
* When `incremental` is true, this contains an array of resource names to remove
|
||||
* for the specified collection. This modifies the existing resource collection at
|
||||
* the sink.
|
||||
* When `incremental` is false, this field should be ignored.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string removed_resources = 4;</code>
|
||||
* @return The count of removedResources.
|
||||
*/
|
||||
int getRemovedResourcesCount();
|
||||
/**
|
||||
* <pre>
|
||||
* Names of resources that have been deleted and to be
|
||||
* removed from the MCP sink node. Removed resources for missing
|
||||
* resources can be ignored.
|
||||
* When `incremental` is true, this contains an array of resource names to remove
|
||||
* for the specified collection. This modifies the existing resource collection at
|
||||
* the sink.
|
||||
* When `incremental` is false, this field should be ignored.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string removed_resources = 4;</code>
|
||||
* @param index The index of the element to return.
|
||||
* @return The removedResources at the given index.
|
||||
*/
|
||||
java.lang.String getRemovedResources(int index);
|
||||
/**
|
||||
* <pre>
|
||||
* Names of resources that have been deleted and to be
|
||||
* removed from the MCP sink node. Removed resources for missing
|
||||
* resources can be ignored.
|
||||
* When `incremental` is true, this contains an array of resource names to remove
|
||||
* for the specified collection. This modifies the existing resource collection at
|
||||
* the sink.
|
||||
* When `incremental` is false, this field should be ignored.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string removed_resources = 4;</code>
|
||||
* @param index The index of the value to return.
|
||||
* @return The bytes of the removedResources at the given index.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getRemovedResourcesBytes(int index);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Required. The nonce provides a way for RequestChange to uniquely
|
||||
* reference a RequestResources.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string nonce = 5;</code>
|
||||
* @return The nonce.
|
||||
*/
|
||||
java.lang.String getNonce();
|
||||
/**
|
||||
* <pre>
|
||||
* Required. The nonce provides a way for RequestChange to uniquely
|
||||
* reference a RequestResources.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string nonce = 5;</code>
|
||||
* @return The bytes for nonce.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getNonceBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* This resource response is an incremental update. The source should only send
|
||||
* incremental updates if the sink requested them.
|
||||
* </pre>
|
||||
*
|
||||
* <code>bool incremental = 6;</code>
|
||||
* @return The incremental.
|
||||
*/
|
||||
boolean getIncremental();
|
||||
}
|
@ -0,0 +1,919 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: mcp.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Identifies a specific MCP sink node instance. The node identifier is
|
||||
* presented to the resource source, which may use this identifier
|
||||
* to distinguish per sink configuration for serving. This
|
||||
* information is not authoritative. Authoritative identity should come
|
||||
* from the underlying transport layer (e.g. rpc credentials).
|
||||
* </pre>
|
||||
*
|
||||
* Protobuf type {@code istio.mcp.v1alpha1.SinkNode}
|
||||
*/
|
||||
public final class SinkNode extends
|
||||
com.google.protobuf.GeneratedMessageV3 implements
|
||||
// @@protoc_insertion_point(message_implements:istio.mcp.v1alpha1.SinkNode)
|
||||
SinkNodeOrBuilder {
|
||||
private static final long serialVersionUID = 0L;
|
||||
// Use SinkNode.newBuilder() to construct.
|
||||
private SinkNode(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||
super(builder);
|
||||
}
|
||||
private SinkNode() {
|
||||
id_ = "";
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@SuppressWarnings({"unused"})
|
||||
protected java.lang.Object newInstance(
|
||||
UnusedPrivateParameter unused) {
|
||||
return new SinkNode();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final com.google.protobuf.UnknownFieldSet
|
||||
getUnknownFields() {
|
||||
return this.unknownFields;
|
||||
}
|
||||
private SinkNode(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
this();
|
||||
if (extensionRegistry == null) {
|
||||
throw new java.lang.NullPointerException();
|
||||
}
|
||||
int mutable_bitField0_ = 0;
|
||||
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
case 10: {
|
||||
java.lang.String s = input.readStringRequireUtf8();
|
||||
|
||||
id_ = s;
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
|
||||
annotations_ = com.google.protobuf.MapField.newMapField(
|
||||
AnnotationsDefaultEntryHolder.defaultEntry);
|
||||
mutable_bitField0_ |= 0x00000001;
|
||||
}
|
||||
com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
|
||||
annotations__ = input.readMessage(
|
||||
AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
|
||||
annotations_.getMutableMap().put(
|
||||
annotations__.getKey(), annotations__.getValue());
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (!parseUnknownField(
|
||||
input, unknownFields, extensionRegistry, tag)) {
|
||||
done = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||
e).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
this.unknownFields = unknownFields.build();
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return com.alibaba.nacos.istio.model.mcp.Mcp.internal_static_istio_mcp_v1alpha1_SinkNode_descriptor;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.MapField internalGetMapField(
|
||||
int number) {
|
||||
switch (number) {
|
||||
case 2:
|
||||
return internalGetAnnotations();
|
||||
default:
|
||||
throw new RuntimeException(
|
||||
"Invalid map field number: " + number);
|
||||
}
|
||||
}
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return com.alibaba.nacos.istio.model.mcp.Mcp.internal_static_istio_mcp_v1alpha1_SinkNode_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
com.alibaba.nacos.istio.model.mcp.SinkNode.class, com.alibaba.nacos.istio.model.mcp.SinkNode.Builder.class);
|
||||
}
|
||||
|
||||
public static final int ID_FIELD_NUMBER = 1;
|
||||
private volatile java.lang.Object id_;
|
||||
/**
|
||||
* <pre>
|
||||
* An opaque identifier for the MCP node.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string id = 1;</code>
|
||||
* @return The id.
|
||||
*/
|
||||
public java.lang.String getId() {
|
||||
java.lang.Object ref = id_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
return (java.lang.String) ref;
|
||||
} else {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
id_ = s;
|
||||
return s;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* An opaque identifier for the MCP node.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string id = 1;</code>
|
||||
* @return The bytes for id.
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getIdBytes() {
|
||||
java.lang.Object ref = id_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
id_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
|
||||
public static final int ANNOTATIONS_FIELD_NUMBER = 2;
|
||||
private static final class AnnotationsDefaultEntryHolder {
|
||||
static final com.google.protobuf.MapEntry<
|
||||
java.lang.String, java.lang.String> defaultEntry =
|
||||
com.google.protobuf.MapEntry
|
||||
.<java.lang.String, java.lang.String>newDefaultInstance(
|
||||
com.alibaba.nacos.istio.model.mcp.Mcp.internal_static_istio_mcp_v1alpha1_SinkNode_AnnotationsEntry_descriptor,
|
||||
com.google.protobuf.WireFormat.FieldType.STRING,
|
||||
"",
|
||||
com.google.protobuf.WireFormat.FieldType.STRING,
|
||||
"");
|
||||
}
|
||||
private com.google.protobuf.MapField<
|
||||
java.lang.String, java.lang.String> annotations_;
|
||||
private com.google.protobuf.MapField<java.lang.String, java.lang.String>
|
||||
internalGetAnnotations() {
|
||||
if (annotations_ == null) {
|
||||
return com.google.protobuf.MapField.emptyMapField(
|
||||
AnnotationsDefaultEntryHolder.defaultEntry);
|
||||
}
|
||||
return annotations_;
|
||||
}
|
||||
|
||||
public int getAnnotationsCount() {
|
||||
return internalGetAnnotations().getMap().size();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
|
||||
public boolean containsAnnotations(
|
||||
java.lang.String key) {
|
||||
if (key == null) { throw new java.lang.NullPointerException(); }
|
||||
return internalGetAnnotations().getMap().containsKey(key);
|
||||
}
|
||||
/**
|
||||
* Use {@link #getAnnotationsMap()} instead.
|
||||
*/
|
||||
@java.lang.Deprecated
|
||||
public java.util.Map<java.lang.String, java.lang.String> getAnnotations() {
|
||||
return getAnnotationsMap();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
|
||||
public java.util.Map<java.lang.String, java.lang.String> getAnnotationsMap() {
|
||||
return internalGetAnnotations().getMap();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
|
||||
public java.lang.String getAnnotationsOrDefault(
|
||||
java.lang.String key,
|
||||
java.lang.String defaultValue) {
|
||||
if (key == null) { throw new java.lang.NullPointerException(); }
|
||||
java.util.Map<java.lang.String, java.lang.String> map =
|
||||
internalGetAnnotations().getMap();
|
||||
return map.containsKey(key) ? map.get(key) : defaultValue;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
|
||||
public java.lang.String getAnnotationsOrThrow(
|
||||
java.lang.String key) {
|
||||
if (key == null) { throw new java.lang.NullPointerException(); }
|
||||
java.util.Map<java.lang.String, java.lang.String> map =
|
||||
internalGetAnnotations().getMap();
|
||||
if (!map.containsKey(key)) {
|
||||
throw new java.lang.IllegalArgumentException();
|
||||
}
|
||||
return map.get(key);
|
||||
}
|
||||
|
||||
private byte memoizedIsInitialized = -1;
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
if (!getIdBytes().isEmpty()) {
|
||||
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_);
|
||||
}
|
||||
com.google.protobuf.GeneratedMessageV3
|
||||
.serializeStringMapTo(
|
||||
output,
|
||||
internalGetAnnotations(),
|
||||
AnnotationsDefaultEntryHolder.defaultEntry,
|
||||
2);
|
||||
unknownFields.writeTo(output);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (!getIdBytes().isEmpty()) {
|
||||
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_);
|
||||
}
|
||||
for (java.util.Map.Entry<java.lang.String, java.lang.String> entry
|
||||
: internalGetAnnotations().getMap().entrySet()) {
|
||||
com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
|
||||
annotations__ = AnnotationsDefaultEntryHolder.defaultEntry.newBuilderForType()
|
||||
.setKey(entry.getKey())
|
||||
.setValue(entry.getValue())
|
||||
.build();
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeMessageSize(2, annotations__);
|
||||
}
|
||||
size += unknownFields.getSerializedSize();
|
||||
memoizedSize = size;
|
||||
return size;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public boolean equals(final java.lang.Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof com.alibaba.nacos.istio.model.mcp.SinkNode)) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
com.alibaba.nacos.istio.model.mcp.SinkNode other = (com.alibaba.nacos.istio.model.mcp.SinkNode) obj;
|
||||
|
||||
if (!getId()
|
||||
.equals(other.getId())) return false;
|
||||
if (!internalGetAnnotations().equals(
|
||||
other.internalGetAnnotations())) return false;
|
||||
if (!unknownFields.equals(other.unknownFields)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public int hashCode() {
|
||||
if (memoizedHashCode != 0) {
|
||||
return memoizedHashCode;
|
||||
}
|
||||
int hash = 41;
|
||||
hash = (19 * hash) + getDescriptor().hashCode();
|
||||
hash = (37 * hash) + ID_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getId().hashCode();
|
||||
if (!internalGetAnnotations().getMap().isEmpty()) {
|
||||
hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER;
|
||||
hash = (53 * hash) + internalGetAnnotations().hashCode();
|
||||
}
|
||||
hash = (29 * hash) + unknownFields.hashCode();
|
||||
memoizedHashCode = hash;
|
||||
return hash;
|
||||
}
|
||||
|
||||
public static com.alibaba.nacos.istio.model.mcp.SinkNode parseFrom(
|
||||
java.nio.ByteBuffer data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.SinkNode parseFrom(
|
||||
java.nio.ByteBuffer data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.SinkNode parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.SinkNode parseFrom(
|
||||
com.google.protobuf.ByteString data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.SinkNode parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.SinkNode parseFrom(
|
||||
byte[] data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.SinkNode parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.SinkNode parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.SinkNode parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.SinkNode parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.SinkNode parseFrom(
|
||||
com.google.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input);
|
||||
}
|
||||
public static com.alibaba.nacos.istio.model.mcp.SinkNode parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
public static Builder newBuilder() {
|
||||
return DEFAULT_INSTANCE.toBuilder();
|
||||
}
|
||||
public static Builder newBuilder(com.alibaba.nacos.istio.model.mcp.SinkNode prototype) {
|
||||
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder toBuilder() {
|
||||
return this == DEFAULT_INSTANCE
|
||||
? new Builder() : new Builder().mergeFrom(this);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected Builder newBuilderForType(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
Builder builder = new Builder(parent);
|
||||
return builder;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Identifies a specific MCP sink node instance. The node identifier is
|
||||
* presented to the resource source, which may use this identifier
|
||||
* to distinguish per sink configuration for serving. This
|
||||
* information is not authoritative. Authoritative identity should come
|
||||
* from the underlying transport layer (e.g. rpc credentials).
|
||||
* </pre>
|
||||
*
|
||||
* Protobuf type {@code istio.mcp.v1alpha1.SinkNode}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
||||
// @@protoc_insertion_point(builder_implements:istio.mcp.v1alpha1.SinkNode)
|
||||
com.alibaba.nacos.istio.model.mcp.SinkNodeOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return com.alibaba.nacos.istio.model.mcp.Mcp.internal_static_istio_mcp_v1alpha1_SinkNode_descriptor;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
protected com.google.protobuf.MapField internalGetMapField(
|
||||
int number) {
|
||||
switch (number) {
|
||||
case 2:
|
||||
return internalGetAnnotations();
|
||||
default:
|
||||
throw new RuntimeException(
|
||||
"Invalid map field number: " + number);
|
||||
}
|
||||
}
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
protected com.google.protobuf.MapField internalGetMutableMapField(
|
||||
int number) {
|
||||
switch (number) {
|
||||
case 2:
|
||||
return internalGetMutableAnnotations();
|
||||
default:
|
||||
throw new RuntimeException(
|
||||
"Invalid map field number: " + number);
|
||||
}
|
||||
}
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return com.alibaba.nacos.istio.model.mcp.Mcp.internal_static_istio_mcp_v1alpha1_SinkNode_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
com.alibaba.nacos.istio.model.mcp.SinkNode.class, com.alibaba.nacos.istio.model.mcp.SinkNode.Builder.class);
|
||||
}
|
||||
|
||||
// Construct using com.alibaba.nacos.istio.model.mcp.SinkNode.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
super(parent);
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
private void maybeForceBuilderInitialization() {
|
||||
if (com.google.protobuf.GeneratedMessageV3
|
||||
.alwaysUseFieldBuilders) {
|
||||
}
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
id_ = "";
|
||||
|
||||
internalGetMutableAnnotations().clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return com.alibaba.nacos.istio.model.mcp.Mcp.internal_static_istio_mcp_v1alpha1_SinkNode_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.alibaba.nacos.istio.model.mcp.SinkNode getDefaultInstanceForType() {
|
||||
return com.alibaba.nacos.istio.model.mcp.SinkNode.getDefaultInstance();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.alibaba.nacos.istio.model.mcp.SinkNode build() {
|
||||
com.alibaba.nacos.istio.model.mcp.SinkNode result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.alibaba.nacos.istio.model.mcp.SinkNode buildPartial() {
|
||||
com.alibaba.nacos.istio.model.mcp.SinkNode result = new com.alibaba.nacos.istio.model.mcp.SinkNode(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
result.id_ = id_;
|
||||
result.annotations_ = internalGetAnnotations();
|
||||
result.annotations_.makeImmutable();
|
||||
onBuilt();
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder clone() {
|
||||
return super.clone();
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.setField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field) {
|
||||
return super.clearField(field);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearOneof(
|
||||
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
||||
return super.clearOneof(oneof);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
int index, java.lang.Object value) {
|
||||
return super.setRepeatedField(field, index, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder addRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.addRepeatedField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
if (other instanceof com.alibaba.nacos.istio.model.mcp.SinkNode) {
|
||||
return mergeFrom((com.alibaba.nacos.istio.model.mcp.SinkNode)other);
|
||||
} else {
|
||||
super.mergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder mergeFrom(com.alibaba.nacos.istio.model.mcp.SinkNode other) {
|
||||
if (other == com.alibaba.nacos.istio.model.mcp.SinkNode.getDefaultInstance()) return this;
|
||||
if (!other.getId().isEmpty()) {
|
||||
id_ = other.id_;
|
||||
onChanged();
|
||||
}
|
||||
internalGetMutableAnnotations().mergeFrom(
|
||||
other.internalGetAnnotations());
|
||||
this.mergeUnknownFields(other.unknownFields);
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
com.alibaba.nacos.istio.model.mcp.SinkNode parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (com.alibaba.nacos.istio.model.mcp.SinkNode) e.getUnfinishedMessage();
|
||||
throw e.unwrapIOException();
|
||||
} finally {
|
||||
if (parsedMessage != null) {
|
||||
mergeFrom(parsedMessage);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
private java.lang.Object id_ = "";
|
||||
/**
|
||||
* <pre>
|
||||
* An opaque identifier for the MCP node.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string id = 1;</code>
|
||||
* @return The id.
|
||||
*/
|
||||
public java.lang.String getId() {
|
||||
java.lang.Object ref = id_;
|
||||
if (!(ref instanceof java.lang.String)) {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
id_ = s;
|
||||
return s;
|
||||
} else {
|
||||
return (java.lang.String) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* An opaque identifier for the MCP node.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string id = 1;</code>
|
||||
* @return The bytes for id.
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getIdBytes() {
|
||||
java.lang.Object ref = id_;
|
||||
if (ref instanceof String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
id_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* An opaque identifier for the MCP node.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string id = 1;</code>
|
||||
* @param value The id to set.
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setId(
|
||||
java.lang.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
id_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* An opaque identifier for the MCP node.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string id = 1;</code>
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearId() {
|
||||
|
||||
id_ = getDefaultInstance().getId();
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* An opaque identifier for the MCP node.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string id = 1;</code>
|
||||
* @param value The bytes for id to set.
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setIdBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
checkByteStringIsUtf8(value);
|
||||
|
||||
id_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
private com.google.protobuf.MapField<
|
||||
java.lang.String, java.lang.String> annotations_;
|
||||
private com.google.protobuf.MapField<java.lang.String, java.lang.String>
|
||||
internalGetAnnotations() {
|
||||
if (annotations_ == null) {
|
||||
return com.google.protobuf.MapField.emptyMapField(
|
||||
AnnotationsDefaultEntryHolder.defaultEntry);
|
||||
}
|
||||
return annotations_;
|
||||
}
|
||||
private com.google.protobuf.MapField<java.lang.String, java.lang.String>
|
||||
internalGetMutableAnnotations() {
|
||||
onChanged();;
|
||||
if (annotations_ == null) {
|
||||
annotations_ = com.google.protobuf.MapField.newMapField(
|
||||
AnnotationsDefaultEntryHolder.defaultEntry);
|
||||
}
|
||||
if (!annotations_.isMutable()) {
|
||||
annotations_ = annotations_.copy();
|
||||
}
|
||||
return annotations_;
|
||||
}
|
||||
|
||||
public int getAnnotationsCount() {
|
||||
return internalGetAnnotations().getMap().size();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
|
||||
public boolean containsAnnotations(
|
||||
java.lang.String key) {
|
||||
if (key == null) { throw new java.lang.NullPointerException(); }
|
||||
return internalGetAnnotations().getMap().containsKey(key);
|
||||
}
|
||||
/**
|
||||
* Use {@link #getAnnotationsMap()} instead.
|
||||
*/
|
||||
@java.lang.Deprecated
|
||||
public java.util.Map<java.lang.String, java.lang.String> getAnnotations() {
|
||||
return getAnnotationsMap();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
|
||||
public java.util.Map<java.lang.String, java.lang.String> getAnnotationsMap() {
|
||||
return internalGetAnnotations().getMap();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
|
||||
public java.lang.String getAnnotationsOrDefault(
|
||||
java.lang.String key,
|
||||
java.lang.String defaultValue) {
|
||||
if (key == null) { throw new java.lang.NullPointerException(); }
|
||||
java.util.Map<java.lang.String, java.lang.String> map =
|
||||
internalGetAnnotations().getMap();
|
||||
return map.containsKey(key) ? map.get(key) : defaultValue;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
|
||||
public java.lang.String getAnnotationsOrThrow(
|
||||
java.lang.String key) {
|
||||
if (key == null) { throw new java.lang.NullPointerException(); }
|
||||
java.util.Map<java.lang.String, java.lang.String> map =
|
||||
internalGetAnnotations().getMap();
|
||||
if (!map.containsKey(key)) {
|
||||
throw new java.lang.IllegalArgumentException();
|
||||
}
|
||||
return map.get(key);
|
||||
}
|
||||
|
||||
public Builder clearAnnotations() {
|
||||
internalGetMutableAnnotations().getMutableMap()
|
||||
.clear();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
|
||||
public Builder removeAnnotations(
|
||||
java.lang.String key) {
|
||||
if (key == null) { throw new java.lang.NullPointerException(); }
|
||||
internalGetMutableAnnotations().getMutableMap()
|
||||
.remove(key);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Use alternate mutation accessors instead.
|
||||
*/
|
||||
@java.lang.Deprecated
|
||||
public java.util.Map<java.lang.String, java.lang.String>
|
||||
getMutableAnnotations() {
|
||||
return internalGetMutableAnnotations().getMutableMap();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
public Builder putAnnotations(
|
||||
java.lang.String key,
|
||||
java.lang.String value) {
|
||||
if (key == null) { throw new java.lang.NullPointerException(); }
|
||||
if (value == null) { throw new java.lang.NullPointerException(); }
|
||||
internalGetMutableAnnotations().getMutableMap()
|
||||
.put(key, value);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
|
||||
public Builder putAllAnnotations(
|
||||
java.util.Map<java.lang.String, java.lang.String> values) {
|
||||
internalGetMutableAnnotations().getMutableMap()
|
||||
.putAll(values);
|
||||
return this;
|
||||
}
|
||||
@java.lang.Override
|
||||
public final Builder setUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
return super.setUnknownFields(unknownFields);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final Builder mergeUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
return super.mergeUnknownFields(unknownFields);
|
||||
}
|
||||
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:istio.mcp.v1alpha1.SinkNode)
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:istio.mcp.v1alpha1.SinkNode)
|
||||
private static final com.alibaba.nacos.istio.model.mcp.SinkNode DEFAULT_INSTANCE;
|
||||
static {
|
||||
DEFAULT_INSTANCE = new com.alibaba.nacos.istio.model.mcp.SinkNode();
|
||||
}
|
||||
|
||||
public static com.alibaba.nacos.istio.model.mcp.SinkNode getDefaultInstance() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
private static final com.google.protobuf.Parser<SinkNode>
|
||||
PARSER = new com.google.protobuf.AbstractParser<SinkNode>() {
|
||||
@java.lang.Override
|
||||
public SinkNode parsePartialFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return new SinkNode(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
public static com.google.protobuf.Parser<SinkNode> parser() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Parser<SinkNode> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.alibaba.nacos.istio.model.mcp.SinkNode getDefaultInstanceForType() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,83 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: mcp.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.mcp;
|
||||
|
||||
public interface SinkNodeOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:istio.mcp.v1alpha1.SinkNode)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* An opaque identifier for the MCP node.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string id = 1;</code>
|
||||
* @return The id.
|
||||
*/
|
||||
java.lang.String getId();
|
||||
/**
|
||||
* <pre>
|
||||
* An opaque identifier for the MCP node.
|
||||
* </pre>
|
||||
*
|
||||
* <code>string id = 1;</code>
|
||||
* @return The bytes for id.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getIdBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
int getAnnotationsCount();
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
boolean containsAnnotations(
|
||||
java.lang.String key);
|
||||
/**
|
||||
* Use {@link #getAnnotationsMap()} instead.
|
||||
*/
|
||||
@java.lang.Deprecated
|
||||
java.util.Map<java.lang.String, java.lang.String>
|
||||
getAnnotations();
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
java.util.Map<java.lang.String, java.lang.String>
|
||||
getAnnotationsMap();
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
|
||||
java.lang.String getAnnotationsOrDefault(
|
||||
java.lang.String key,
|
||||
java.lang.String defaultValue);
|
||||
/**
|
||||
* <pre>
|
||||
* Opaque annotations extending the node identifier.
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<string, string> annotations = 2;</code>
|
||||
*/
|
||||
|
||||
java.lang.String getAnnotationsOrThrow(
|
||||
java.lang.String key);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,473 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: service_entry.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.naming;
|
||||
|
||||
public interface ServiceEntryOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:istio.networking.v1alpha3.ServiceEntry)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED. The hosts associated with the ServiceEntry. Could be a DNS
|
||||
* name with wildcard prefix.
|
||||
* 1. The hosts field is used to select matching hosts in VirtualServices and DestinationRules.
|
||||
* 2. For HTTP traffic the HTTP Host/Authority header will be matched against the hosts field.
|
||||
* 3. For HTTPs or TLS traffic containing Server Name Indication (SNI), the SNI value
|
||||
* will be matched against the hosts field.
|
||||
* Note that when resolution is set to type DNS
|
||||
* and no endpoints are specified, the host field will be used as the DNS name
|
||||
* of the endpoint to route traffic to.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string hosts = 1;</code>
|
||||
* @return A list containing the hosts.
|
||||
*/
|
||||
java.util.List<java.lang.String>
|
||||
getHostsList();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED. The hosts associated with the ServiceEntry. Could be a DNS
|
||||
* name with wildcard prefix.
|
||||
* 1. The hosts field is used to select matching hosts in VirtualServices and DestinationRules.
|
||||
* 2. For HTTP traffic the HTTP Host/Authority header will be matched against the hosts field.
|
||||
* 3. For HTTPs or TLS traffic containing Server Name Indication (SNI), the SNI value
|
||||
* will be matched against the hosts field.
|
||||
* Note that when resolution is set to type DNS
|
||||
* and no endpoints are specified, the host field will be used as the DNS name
|
||||
* of the endpoint to route traffic to.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string hosts = 1;</code>
|
||||
* @return The count of hosts.
|
||||
*/
|
||||
int getHostsCount();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED. The hosts associated with the ServiceEntry. Could be a DNS
|
||||
* name with wildcard prefix.
|
||||
* 1. The hosts field is used to select matching hosts in VirtualServices and DestinationRules.
|
||||
* 2. For HTTP traffic the HTTP Host/Authority header will be matched against the hosts field.
|
||||
* 3. For HTTPs or TLS traffic containing Server Name Indication (SNI), the SNI value
|
||||
* will be matched against the hosts field.
|
||||
* Note that when resolution is set to type DNS
|
||||
* and no endpoints are specified, the host field will be used as the DNS name
|
||||
* of the endpoint to route traffic to.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string hosts = 1;</code>
|
||||
* @param index The index of the element to return.
|
||||
* @return The hosts at the given index.
|
||||
*/
|
||||
java.lang.String getHosts(int index);
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED. The hosts associated with the ServiceEntry. Could be a DNS
|
||||
* name with wildcard prefix.
|
||||
* 1. The hosts field is used to select matching hosts in VirtualServices and DestinationRules.
|
||||
* 2. For HTTP traffic the HTTP Host/Authority header will be matched against the hosts field.
|
||||
* 3. For HTTPs or TLS traffic containing Server Name Indication (SNI), the SNI value
|
||||
* will be matched against the hosts field.
|
||||
* Note that when resolution is set to type DNS
|
||||
* and no endpoints are specified, the host field will be used as the DNS name
|
||||
* of the endpoint to route traffic to.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string hosts = 1;</code>
|
||||
* @param index The index of the value to return.
|
||||
* @return The bytes of the hosts at the given index.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getHostsBytes(int index);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The virtual IP addresses associated with the service. Could be CIDR
|
||||
* prefix. For HTTP traffic, generated route configurations will include http route
|
||||
* domains for both the `addresses` and `hosts` field values and the destination will
|
||||
* be identified based on the HTTP Host/Authority header.
|
||||
* If one or more IP addresses are specified,
|
||||
* the incoming traffic will be identified as belonging to this service
|
||||
* if the destination IP matches the IP/CIDRs specified in the addresses
|
||||
* field. If the Addresses field is empty, traffic will be identified
|
||||
* solely based on the destination port. In such scenarios, the port on
|
||||
* which the service is being accessed must not be shared by any other
|
||||
* service in the mesh. In other words, the sidecar will behave as a
|
||||
* simple TCP proxy, forwarding incoming traffic on a specified port to
|
||||
* the specified destination endpoint IP/host. Unix domain socket
|
||||
* addresses are not supported in this field.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string addresses = 2;</code>
|
||||
* @return A list containing the addresses.
|
||||
*/
|
||||
java.util.List<java.lang.String>
|
||||
getAddressesList();
|
||||
/**
|
||||
* <pre>
|
||||
* The virtual IP addresses associated with the service. Could be CIDR
|
||||
* prefix. For HTTP traffic, generated route configurations will include http route
|
||||
* domains for both the `addresses` and `hosts` field values and the destination will
|
||||
* be identified based on the HTTP Host/Authority header.
|
||||
* If one or more IP addresses are specified,
|
||||
* the incoming traffic will be identified as belonging to this service
|
||||
* if the destination IP matches the IP/CIDRs specified in the addresses
|
||||
* field. If the Addresses field is empty, traffic will be identified
|
||||
* solely based on the destination port. In such scenarios, the port on
|
||||
* which the service is being accessed must not be shared by any other
|
||||
* service in the mesh. In other words, the sidecar will behave as a
|
||||
* simple TCP proxy, forwarding incoming traffic on a specified port to
|
||||
* the specified destination endpoint IP/host. Unix domain socket
|
||||
* addresses are not supported in this field.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string addresses = 2;</code>
|
||||
* @return The count of addresses.
|
||||
*/
|
||||
int getAddressesCount();
|
||||
/**
|
||||
* <pre>
|
||||
* The virtual IP addresses associated with the service. Could be CIDR
|
||||
* prefix. For HTTP traffic, generated route configurations will include http route
|
||||
* domains for both the `addresses` and `hosts` field values and the destination will
|
||||
* be identified based on the HTTP Host/Authority header.
|
||||
* If one or more IP addresses are specified,
|
||||
* the incoming traffic will be identified as belonging to this service
|
||||
* if the destination IP matches the IP/CIDRs specified in the addresses
|
||||
* field. If the Addresses field is empty, traffic will be identified
|
||||
* solely based on the destination port. In such scenarios, the port on
|
||||
* which the service is being accessed must not be shared by any other
|
||||
* service in the mesh. In other words, the sidecar will behave as a
|
||||
* simple TCP proxy, forwarding incoming traffic on a specified port to
|
||||
* the specified destination endpoint IP/host. Unix domain socket
|
||||
* addresses are not supported in this field.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string addresses = 2;</code>
|
||||
* @param index The index of the element to return.
|
||||
* @return The addresses at the given index.
|
||||
*/
|
||||
java.lang.String getAddresses(int index);
|
||||
/**
|
||||
* <pre>
|
||||
* The virtual IP addresses associated with the service. Could be CIDR
|
||||
* prefix. For HTTP traffic, generated route configurations will include http route
|
||||
* domains for both the `addresses` and `hosts` field values and the destination will
|
||||
* be identified based on the HTTP Host/Authority header.
|
||||
* If one or more IP addresses are specified,
|
||||
* the incoming traffic will be identified as belonging to this service
|
||||
* if the destination IP matches the IP/CIDRs specified in the addresses
|
||||
* field. If the Addresses field is empty, traffic will be identified
|
||||
* solely based on the destination port. In such scenarios, the port on
|
||||
* which the service is being accessed must not be shared by any other
|
||||
* service in the mesh. In other words, the sidecar will behave as a
|
||||
* simple TCP proxy, forwarding incoming traffic on a specified port to
|
||||
* the specified destination endpoint IP/host. Unix domain socket
|
||||
* addresses are not supported in this field.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string addresses = 2;</code>
|
||||
* @param index The index of the value to return.
|
||||
* @return The bytes of the addresses at the given index.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getAddressesBytes(int index);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED. The ports associated with the external service. If the
|
||||
* Endpoints are Unix domain socket addresses, there must be exactly one
|
||||
* port.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.Port ports = 3;</code>
|
||||
*/
|
||||
java.util.List<com.alibaba.nacos.istio.model.Port>
|
||||
getPortsList();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED. The ports associated with the external service. If the
|
||||
* Endpoints are Unix domain socket addresses, there must be exactly one
|
||||
* port.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.Port ports = 3;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.Port getPorts(int index);
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED. The ports associated with the external service. If the
|
||||
* Endpoints are Unix domain socket addresses, there must be exactly one
|
||||
* port.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.Port ports = 3;</code>
|
||||
*/
|
||||
int getPortsCount();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED. The ports associated with the external service. If the
|
||||
* Endpoints are Unix domain socket addresses, there must be exactly one
|
||||
* port.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.Port ports = 3;</code>
|
||||
*/
|
||||
java.util.List<? extends com.alibaba.nacos.istio.model.PortOrBuilder>
|
||||
getPortsOrBuilderList();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED. The ports associated with the external service. If the
|
||||
* Endpoints are Unix domain socket addresses, there must be exactly one
|
||||
* port.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.Port ports = 3;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.PortOrBuilder getPortsOrBuilder(
|
||||
int index);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Specify whether the service should be considered external to the mesh
|
||||
* or part of the mesh.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.networking.v1alpha3.ServiceEntry.Location location = 4;</code>
|
||||
* @return The enum numeric value on the wire for location.
|
||||
*/
|
||||
int getLocationValue();
|
||||
/**
|
||||
* <pre>
|
||||
* Specify whether the service should be considered external to the mesh
|
||||
* or part of the mesh.
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.networking.v1alpha3.ServiceEntry.Location location = 4;</code>
|
||||
* @return The location.
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.naming.ServiceEntry.Location getLocation();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: Service discovery mode for the hosts. Care must be taken
|
||||
* when setting the resolution mode to NONE for a TCP port without
|
||||
* accompanying IP addresses. In such cases, traffic to any IP on
|
||||
* said port will be allowed (i.e. 0.0.0.0:<port>).
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.networking.v1alpha3.ServiceEntry.Resolution resolution = 5;</code>
|
||||
* @return The enum numeric value on the wire for resolution.
|
||||
*/
|
||||
int getResolutionValue();
|
||||
/**
|
||||
* <pre>
|
||||
* REQUIRED: Service discovery mode for the hosts. Care must be taken
|
||||
* when setting the resolution mode to NONE for a TCP port without
|
||||
* accompanying IP addresses. In such cases, traffic to any IP on
|
||||
* said port will be allowed (i.e. 0.0.0.0:<port>).
|
||||
* </pre>
|
||||
*
|
||||
* <code>.istio.networking.v1alpha3.ServiceEntry.Resolution resolution = 5;</code>
|
||||
* @return The resolution.
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.naming.ServiceEntry.Resolution getResolution();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* One or more endpoints associated with the service.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.ServiceEntry.Endpoint endpoints = 6;</code>
|
||||
*/
|
||||
java.util.List<com.alibaba.nacos.istio.model.naming.ServiceEntry.Endpoint>
|
||||
getEndpointsList();
|
||||
/**
|
||||
* <pre>
|
||||
* One or more endpoints associated with the service.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.ServiceEntry.Endpoint endpoints = 6;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.naming.ServiceEntry.Endpoint getEndpoints(int index);
|
||||
/**
|
||||
* <pre>
|
||||
* One or more endpoints associated with the service.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.ServiceEntry.Endpoint endpoints = 6;</code>
|
||||
*/
|
||||
int getEndpointsCount();
|
||||
/**
|
||||
* <pre>
|
||||
* One or more endpoints associated with the service.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.ServiceEntry.Endpoint endpoints = 6;</code>
|
||||
*/
|
||||
java.util.List<? extends com.alibaba.nacos.istio.model.naming.ServiceEntry.EndpointOrBuilder>
|
||||
getEndpointsOrBuilderList();
|
||||
/**
|
||||
* <pre>
|
||||
* One or more endpoints associated with the service.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated .istio.networking.v1alpha3.ServiceEntry.Endpoint endpoints = 6;</code>
|
||||
*/
|
||||
com.alibaba.nacos.istio.model.naming.ServiceEntry.EndpointOrBuilder getEndpointsOrBuilder(
|
||||
int index);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* A list of namespaces to which this service is exported. Exporting a service
|
||||
* allows it to be used by sidecars, gateways and virtual services defined in
|
||||
* other namespaces. This feature provides a mechanism for service owners
|
||||
* and mesh administrators to control the visibility of services across
|
||||
* namespace boundaries.
|
||||
* If no namespaces are specified then the service is exported to all
|
||||
* namespaces by default.
|
||||
* The value "." is reserved and defines an export to the same namespace that
|
||||
* the service is declared in. Similarly the value "*" is reserved and
|
||||
* defines an export to all namespaces.
|
||||
* For a Kubernetes Service, the equivalent effect can be achieved by setting
|
||||
* the annotation "networking.istio.io/exportTo" to a comma-separated list
|
||||
* of namespace names.
|
||||
* NOTE: in the current release, the `exportTo` value is restricted to
|
||||
* "." or "*" (i.e., the current namespace or all namespaces).
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string export_to = 7;</code>
|
||||
* @return A list containing the exportTo.
|
||||
*/
|
||||
java.util.List<java.lang.String>
|
||||
getExportToList();
|
||||
/**
|
||||
* <pre>
|
||||
* A list of namespaces to which this service is exported. Exporting a service
|
||||
* allows it to be used by sidecars, gateways and virtual services defined in
|
||||
* other namespaces. This feature provides a mechanism for service owners
|
||||
* and mesh administrators to control the visibility of services across
|
||||
* namespace boundaries.
|
||||
* If no namespaces are specified then the service is exported to all
|
||||
* namespaces by default.
|
||||
* The value "." is reserved and defines an export to the same namespace that
|
||||
* the service is declared in. Similarly the value "*" is reserved and
|
||||
* defines an export to all namespaces.
|
||||
* For a Kubernetes Service, the equivalent effect can be achieved by setting
|
||||
* the annotation "networking.istio.io/exportTo" to a comma-separated list
|
||||
* of namespace names.
|
||||
* NOTE: in the current release, the `exportTo` value is restricted to
|
||||
* "." or "*" (i.e., the current namespace or all namespaces).
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string export_to = 7;</code>
|
||||
* @return The count of exportTo.
|
||||
*/
|
||||
int getExportToCount();
|
||||
/**
|
||||
* <pre>
|
||||
* A list of namespaces to which this service is exported. Exporting a service
|
||||
* allows it to be used by sidecars, gateways and virtual services defined in
|
||||
* other namespaces. This feature provides a mechanism for service owners
|
||||
* and mesh administrators to control the visibility of services across
|
||||
* namespace boundaries.
|
||||
* If no namespaces are specified then the service is exported to all
|
||||
* namespaces by default.
|
||||
* The value "." is reserved and defines an export to the same namespace that
|
||||
* the service is declared in. Similarly the value "*" is reserved and
|
||||
* defines an export to all namespaces.
|
||||
* For a Kubernetes Service, the equivalent effect can be achieved by setting
|
||||
* the annotation "networking.istio.io/exportTo" to a comma-separated list
|
||||
* of namespace names.
|
||||
* NOTE: in the current release, the `exportTo` value is restricted to
|
||||
* "." or "*" (i.e., the current namespace or all namespaces).
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string export_to = 7;</code>
|
||||
* @param index The index of the element to return.
|
||||
* @return The exportTo at the given index.
|
||||
*/
|
||||
java.lang.String getExportTo(int index);
|
||||
/**
|
||||
* <pre>
|
||||
* A list of namespaces to which this service is exported. Exporting a service
|
||||
* allows it to be used by sidecars, gateways and virtual services defined in
|
||||
* other namespaces. This feature provides a mechanism for service owners
|
||||
* and mesh administrators to control the visibility of services across
|
||||
* namespace boundaries.
|
||||
* If no namespaces are specified then the service is exported to all
|
||||
* namespaces by default.
|
||||
* The value "." is reserved and defines an export to the same namespace that
|
||||
* the service is declared in. Similarly the value "*" is reserved and
|
||||
* defines an export to all namespaces.
|
||||
* For a Kubernetes Service, the equivalent effect can be achieved by setting
|
||||
* the annotation "networking.istio.io/exportTo" to a comma-separated list
|
||||
* of namespace names.
|
||||
* NOTE: in the current release, the `exportTo` value is restricted to
|
||||
* "." or "*" (i.e., the current namespace or all namespaces).
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string export_to = 7;</code>
|
||||
* @param index The index of the value to return.
|
||||
* @return The bytes of the exportTo at the given index.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getExportToBytes(int index);
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* The list of subject alternate names allowed for workload instances that
|
||||
* implement this service. This information is used to enforce
|
||||
* [secure-naming](https://istio.io/docs/concepts/security/#secure-naming).
|
||||
* If specified, the proxy will verify that the server
|
||||
* certificate's subject alternate name matches one of the specified values.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string subject_alt_names = 8;</code>
|
||||
* @return A list containing the subjectAltNames.
|
||||
*/
|
||||
java.util.List<java.lang.String>
|
||||
getSubjectAltNamesList();
|
||||
/**
|
||||
* <pre>
|
||||
* The list of subject alternate names allowed for workload instances that
|
||||
* implement this service. This information is used to enforce
|
||||
* [secure-naming](https://istio.io/docs/concepts/security/#secure-naming).
|
||||
* If specified, the proxy will verify that the server
|
||||
* certificate's subject alternate name matches one of the specified values.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string subject_alt_names = 8;</code>
|
||||
* @return The count of subjectAltNames.
|
||||
*/
|
||||
int getSubjectAltNamesCount();
|
||||
/**
|
||||
* <pre>
|
||||
* The list of subject alternate names allowed for workload instances that
|
||||
* implement this service. This information is used to enforce
|
||||
* [secure-naming](https://istio.io/docs/concepts/security/#secure-naming).
|
||||
* If specified, the proxy will verify that the server
|
||||
* certificate's subject alternate name matches one of the specified values.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string subject_alt_names = 8;</code>
|
||||
* @param index The index of the element to return.
|
||||
* @return The subjectAltNames at the given index.
|
||||
*/
|
||||
java.lang.String getSubjectAltNames(int index);
|
||||
/**
|
||||
* <pre>
|
||||
* The list of subject alternate names allowed for workload instances that
|
||||
* implement this service. This information is used to enforce
|
||||
* [secure-naming](https://istio.io/docs/concepts/security/#secure-naming).
|
||||
* If specified, the proxy will verify that the server
|
||||
* certificate's subject alternate name matches one of the specified values.
|
||||
* </pre>
|
||||
*
|
||||
* <code>repeated string subject_alt_names = 8;</code>
|
||||
* @param index The index of the value to return.
|
||||
* @return The bytes of the subjectAltNames at the given index.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getSubjectAltNamesBytes(int index);
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: service_entry.proto
|
||||
|
||||
package com.alibaba.nacos.istio.model.naming;
|
||||
|
||||
public final class ServiceEntryOuterClass {
|
||||
private ServiceEntryOuterClass() {}
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||
}
|
||||
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistry registry) {
|
||||
registerAllExtensions(
|
||||
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||
}
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_PortsEntry_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_PortsEntry_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_LabelsEntry_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_LabelsEntry_fieldAccessorTable;
|
||||
|
||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||
getDescriptor() {
|
||||
return descriptor;
|
||||
}
|
||||
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||
descriptor;
|
||||
static {
|
||||
java.lang.String[] descriptorData = {
|
||||
"\n\023service_entry.proto\022\031istio.networking." +
|
||||
"v1alpha3\032\rgateway.proto\"\206\006\n\014ServiceEntry" +
|
||||
"\022\r\n\005hosts\030\001 \003(\t\022\021\n\taddresses\030\002 \003(\t\022.\n\005po" +
|
||||
"rts\030\003 \003(\0132\037.istio.networking.v1alpha3.Po" +
|
||||
"rt\022B\n\010location\030\004 \001(\01620.istio.networking." +
|
||||
"v1alpha3.ServiceEntry.Location\022F\n\nresolu" +
|
||||
"tion\030\005 \001(\01622.istio.networking.v1alpha3.S" +
|
||||
"erviceEntry.Resolution\022C\n\tendpoints\030\006 \003(" +
|
||||
"\01320.istio.networking.v1alpha3.ServiceEnt" +
|
||||
"ry.Endpoint\022\021\n\texport_to\030\007 \003(\t\022\031\n\021subjec" +
|
||||
"t_alt_names\030\010 \003(\t\032\305\002\n\010Endpoint\022\017\n\007addres" +
|
||||
"s\030\001 \001(\t\022J\n\005ports\030\002 \003(\0132;.istio.networkin" +
|
||||
"g.v1alpha3.ServiceEntry.Endpoint.PortsEn" +
|
||||
"try\022L\n\006labels\030\003 \003(\0132<.istio.networking.v" +
|
||||
"1alpha3.ServiceEntry.Endpoint.LabelsEntr" +
|
||||
"y\022\017\n\007network\030\004 \001(\t\022\020\n\010locality\030\005 \001(\t\022\016\n\006" +
|
||||
"weight\030\006 \001(\r\032,\n\nPortsEntry\022\013\n\003key\030\001 \001(\t\022" +
|
||||
"\r\n\005value\030\002 \001(\r:\0028\001\032-\n\013LabelsEntry\022\013\n\003key" +
|
||||
"\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"0\n\010Location\022\021\n" +
|
||||
"\rMESH_EXTERNAL\020\000\022\021\n\rMESH_INTERNAL\020\001\"+\n\nR" +
|
||||
"esolution\022\010\n\004NONE\020\000\022\n\n\006STATIC\020\001\022\007\n\003DNS\020\002" +
|
||||
"B(\n$com.alibaba.nacos.istio.model.naming" +
|
||||
"P\001b\006proto3"
|
||||
};
|
||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||
com.alibaba.nacos.istio.model.GatewayOuterClass.getDescriptor(),
|
||||
});
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_descriptor =
|
||||
getDescriptor().getMessageTypes().get(0);
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_descriptor,
|
||||
new java.lang.String[] { "Hosts", "Addresses", "Ports", "Location", "Resolution", "Endpoints", "ExportTo", "SubjectAltNames", });
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_descriptor =
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_descriptor.getNestedTypes().get(0);
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_descriptor,
|
||||
new java.lang.String[] { "Address", "Ports", "Labels", "Network", "Locality", "Weight", });
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_PortsEntry_descriptor =
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_descriptor.getNestedTypes().get(0);
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_PortsEntry_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_PortsEntry_descriptor,
|
||||
new java.lang.String[] { "Key", "Value", });
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_LabelsEntry_descriptor =
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_descriptor.getNestedTypes().get(1);
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_LabelsEntry_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_istio_networking_v1alpha3_ServiceEntry_Endpoint_LabelsEntry_descriptor,
|
||||
new java.lang.String[] { "Key", "Value", });
|
||||
com.alibaba.nacos.istio.model.GatewayOuterClass.getDescriptor();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(outer_class_scope)
|
||||
}
|
471
istio/src/main/resources/gateway.proto
Normal file
471
istio/src/main/resources/gateway.proto
Normal file
@ -0,0 +1,471 @@
|
||||
// Copyright 2017 Istio Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "com.alibaba.nacos.istio.model";
|
||||
|
||||
package istio.networking.v1alpha3;
|
||||
|
||||
// $title: Gateway
|
||||
// $description: Configuration affecting edge load balancer.
|
||||
// $location: https://istio.io/docs/reference/config/networking/v1alpha3/gateway.html
|
||||
|
||||
// `Gateway` describes a load balancer operating at the edge of the mesh
|
||||
// receiving incoming or outgoing HTTP/TCP connections. The specification
|
||||
// describes a set of ports that should be exposed, the type of protocol to
|
||||
// use, SNI configuration for the load balancer, etc.
|
||||
//
|
||||
// For example, the following Gateway configuration sets up a proxy to act
|
||||
// as a load balancer exposing port 80 and 9080 (http), 443 (https),
|
||||
// 9443(https) and port 2379 (TCP) for ingress. The gateway will be
|
||||
// applied to the proxy running on a pod with labels `app:
|
||||
// my-gateway-controller`. While Istio will configure the proxy to listen
|
||||
// on these ports, it is the responsibility of the user to ensure that
|
||||
// external traffic to these ports are allowed into the mesh.
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: Gateway
|
||||
// metadata:
|
||||
// name: my-gateway
|
||||
// namespace: some-config-namespace
|
||||
// spec:
|
||||
// selector:
|
||||
// app: my-gateway-controller
|
||||
// servers:
|
||||
// - port:
|
||||
// number: 80
|
||||
// name: http
|
||||
// protocol: HTTP
|
||||
// hosts:
|
||||
// - uk.bookinfo.com
|
||||
// - eu.bookinfo.com
|
||||
// tls:
|
||||
// httpsRedirect: true # sends 301 redirect for http requests
|
||||
// - port:
|
||||
// number: 443
|
||||
// name: https-443
|
||||
// protocol: HTTPS
|
||||
// hosts:
|
||||
// - uk.bookinfo.com
|
||||
// - eu.bookinfo.com
|
||||
// tls:
|
||||
// mode: SIMPLE # enables HTTPS on this port
|
||||
// serverCertificate: /etc/certs/servercert.pem
|
||||
// privateKey: /etc/certs/privatekey.pem
|
||||
// - port:
|
||||
// number: 9443
|
||||
// name: https-9443
|
||||
// protocol: HTTPS
|
||||
// hosts:
|
||||
// - "bookinfo-namespace/*.bookinfo.com"
|
||||
// tls:
|
||||
// mode: SIMPLE # enables HTTPS on this port
|
||||
// credentialName: bookinfo-secret # fetches certs from Kubernetes secret
|
||||
// - port:
|
||||
// number: 9080
|
||||
// name: http-wildcard
|
||||
// protocol: HTTP
|
||||
// hosts:
|
||||
// - "*"
|
||||
// - port:
|
||||
// number: 2379 # to expose internal service via external port 2379
|
||||
// name: mongo
|
||||
// protocol: MONGO
|
||||
// hosts:
|
||||
// - "*"
|
||||
// ```
|
||||
//
|
||||
// The Gateway specification above describes the L4-L6 properties of a load
|
||||
// balancer. A `VirtualService` can then be bound to a gateway to control
|
||||
// the forwarding of traffic arriving at a particular host or gateway port.
|
||||
//
|
||||
// For example, the following VirtualService splits traffic for
|
||||
// `https://uk.bookinfo.com/reviews`, `https://eu.bookinfo.com/reviews`,
|
||||
// `http://uk.bookinfo.com:9080/reviews`,
|
||||
// `http://eu.bookinfo.com:9080/reviews` into two versions (prod and qa) of
|
||||
// an internal reviews service on port 9080. In addition, requests
|
||||
// containing the cookie "user: dev-123" will be sent to special port 7777
|
||||
// in the qa version. The same rule is also applicable inside the mesh for
|
||||
// requests to the "reviews.prod.svc.cluster.local" service. This rule is
|
||||
// applicable across ports 443, 9080. Note that `http://uk.bookinfo.com`
|
||||
// gets redirected to `https://uk.bookinfo.com` (i.e. 80 redirects to 443).
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: VirtualService
|
||||
// metadata:
|
||||
// name: bookinfo-rule
|
||||
// namespace: bookinfo-namespace
|
||||
// spec:
|
||||
// hosts:
|
||||
// - reviews.prod.svc.cluster.local
|
||||
// - uk.bookinfo.com
|
||||
// - eu.bookinfo.com
|
||||
// gateways:
|
||||
// - some-config-namespace/my-gateway
|
||||
// - mesh # applies to all the sidecars in the mesh
|
||||
// http:
|
||||
// - match:
|
||||
// - headers:
|
||||
// cookie:
|
||||
// exact: "user=dev-123"
|
||||
// route:
|
||||
// - destination:
|
||||
// port:
|
||||
// number: 7777
|
||||
// host: reviews.qa.svc.cluster.local
|
||||
// - match:
|
||||
// - uri:
|
||||
// prefix: /reviews/
|
||||
// route:
|
||||
// - destination:
|
||||
// port:
|
||||
// number: 9080 # can be omitted if it's the only port for reviews
|
||||
// host: reviews.prod.svc.cluster.local
|
||||
// weight: 80
|
||||
// - destination:
|
||||
// host: reviews.qa.svc.cluster.local
|
||||
// weight: 20
|
||||
// ```
|
||||
//
|
||||
// The following VirtualService forwards traffic arriving at (external)
|
||||
// port 27017 to internal Mongo server on port 5555. This rule is not
|
||||
// applicable internally in the mesh as the gateway list omits the
|
||||
// reserved name `mesh`.
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: VirtualService
|
||||
// metadata:
|
||||
// name: bookinfo-Mongo
|
||||
// namespace: bookinfo-namespace
|
||||
// spec:
|
||||
// hosts:
|
||||
// - mongosvr.prod.svc.cluster.local # name of internal Mongo service
|
||||
// gateways:
|
||||
// - some-config-namespace/my-gateway # can omit the namespace if gateway is in same
|
||||
// namespace as virtual service.
|
||||
// tcp:
|
||||
// - match:
|
||||
// - port: 27017
|
||||
// route:
|
||||
// - destination:
|
||||
// host: mongo.prod.svc.cluster.local
|
||||
// port:
|
||||
// number: 5555
|
||||
// ```
|
||||
//
|
||||
// It is possible to restrict the set of virtual services that can bind to
|
||||
// a gateway server using the namespace/hostname syntax in the hosts field.
|
||||
// For example, the following Gateway allows any virtual service in the ns1
|
||||
// namespace to bind to it, while restricting only the virtual service with
|
||||
// foo.bar.com host in the ns2 namespace to bind to it.
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: Gateway
|
||||
// metadata:
|
||||
// name: my-gateway
|
||||
// namespace: some-config-namespace
|
||||
// spec:
|
||||
// selector:
|
||||
// app: my-gateway-controller
|
||||
// servers:
|
||||
// - port:
|
||||
// number: 80
|
||||
// name: http
|
||||
// protocol: HTTP
|
||||
// hosts:
|
||||
// - "ns1/*"
|
||||
// - "ns2/foo.bar.com"
|
||||
// ```
|
||||
//
|
||||
|
||||
// Gateway describes a load balancer operating at the edge of the mesh
|
||||
// receiving incoming or outgoing HTTP/TCP connections.
|
||||
//
|
||||
// <!-- go code generation tags
|
||||
// +kubetype-gen
|
||||
// +kubetype-gen:groupVersion=networking.istio.io/v1alpha3
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen=true
|
||||
// -->
|
||||
message Gateway {
|
||||
// REQUIRED: A list of server specifications.
|
||||
repeated Server servers = 1;
|
||||
|
||||
// REQUIRED: One or more labels that indicate a specific set of pods/VMs
|
||||
// on which this gateway configuration should be applied. The scope of
|
||||
// label search is restricted to the configuration namespace in which the
|
||||
// the resource is present. In other words, the Gateway resource must
|
||||
// reside in the same namespace as the gateway workload instance.
|
||||
map<string, string> selector = 2;
|
||||
}
|
||||
|
||||
// `Server` describes the properties of the proxy on a given load balancer
|
||||
// port. For example,
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: Gateway
|
||||
// metadata:
|
||||
// name: my-ingress
|
||||
// spec:
|
||||
// selector:
|
||||
// app: my-ingress-gateway
|
||||
// servers:
|
||||
// - port:
|
||||
// number: 80
|
||||
// name: http2
|
||||
// protocol: HTTP2
|
||||
// hosts:
|
||||
// - "*"
|
||||
// ```
|
||||
//
|
||||
// Another example
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: Gateway
|
||||
// metadata:
|
||||
// name: my-tcp-ingress
|
||||
// spec:
|
||||
// selector:
|
||||
// app: my-tcp-ingress-gateway
|
||||
// servers:
|
||||
// - port:
|
||||
// number: 27018
|
||||
// name: mongo
|
||||
// protocol: MONGO
|
||||
// hosts:
|
||||
// - "*"
|
||||
// ```
|
||||
//
|
||||
// The following is an example of TLS configuration for port 443
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: Gateway
|
||||
// metadata:
|
||||
// name: my-tls-ingress
|
||||
// spec:
|
||||
// selector:
|
||||
// app: my-tls-ingress-gateway
|
||||
// servers:
|
||||
// - port:
|
||||
// number: 443
|
||||
// name: https
|
||||
// protocol: HTTPS
|
||||
// hosts:
|
||||
// - "*"
|
||||
// tls:
|
||||
// mode: SIMPLE
|
||||
// serverCertificate: /etc/certs/server.pem
|
||||
// privateKey: /etc/certs/privatekey.pem
|
||||
// ```
|
||||
message Server {
|
||||
// REQUIRED: The Port on which the proxy should listen for incoming
|
||||
// connections.
|
||||
Port port = 1;
|
||||
|
||||
// $hide_from_docs
|
||||
// The ip or the Unix domain socket to which the listener should be bound
|
||||
// to. Format: `x.x.x.x` or `unix:///path/to/uds` or `unix://@foobar`
|
||||
// (Linux abstract namespace). When using Unix domain sockets, the port
|
||||
// number should be 0.
|
||||
string bind = 4;
|
||||
|
||||
// REQUIRED. One or more hosts exposed by this gateway.
|
||||
// While typically applicable to
|
||||
// HTTP services, it can also be used for TCP services using TLS with SNI.
|
||||
// A host is specified as a `dnsName` with an optional `namespace/` prefix.
|
||||
// The `dnsName` should be specified using FQDN format, optionally including
|
||||
// a wildcard character in the left-most component (e.g., `prod/*.example.com`).
|
||||
// Set the `dnsName` to `*` to select all `VirtualService` hosts from the
|
||||
// specified namespace (e.g.,`prod/*`).
|
||||
//
|
||||
// The `namespace` can be set to `*` or `.`, representing any or the current
|
||||
// namespace, respectively. For example, `*/foo.example.com` selects the
|
||||
// service from any available namespace while `./foo.example.com` only selects
|
||||
// the service from the namespace of the sidecar. The default, if no `namespace/`
|
||||
// is specified, is `*/`, that is, select services from any namespace.
|
||||
// Any associated `DestinationRule` in the selected namespace will also be used.
|
||||
//
|
||||
// A `VirtualService` must be bound to the gateway and must have one or
|
||||
// more hosts that match the hosts specified in a server. The match
|
||||
// could be an exact match or a suffix match with the server's hosts. For
|
||||
// example, if the server's hosts specifies `*.example.com`, a
|
||||
// `VirtualService` with hosts `dev.example.com` or `prod.example.com` will
|
||||
// match. However, a `VirtualService` with host `example.com` or
|
||||
// `newexample.com` will not match.
|
||||
//
|
||||
// NOTE: Only virtual services exported to the gateway's namespace
|
||||
// (e.g., `exportTo` value of `*`) can be referenced.
|
||||
// Private configurations (e.g., `exportTo` set to `.`) will not be
|
||||
// available. Refer to the `exportTo` setting in `VirtualService`,
|
||||
// `DestinationRule`, and `ServiceEntry` configurations for details.
|
||||
repeated string hosts = 2;
|
||||
|
||||
message TLSOptions {
|
||||
// If set to true, the load balancer will send a 301 redirect for all
|
||||
// http connections, asking the clients to use HTTPS.
|
||||
bool https_redirect = 1;
|
||||
|
||||
// TLS modes enforced by the proxy
|
||||
enum TLSmode {
|
||||
// The SNI string presented by the client will be used as the match
|
||||
// criterion in a VirtualService TLS route to determine the
|
||||
// destination service from the service registry.
|
||||
PASSTHROUGH = 0;
|
||||
|
||||
// Secure connections with standard TLS semantics.
|
||||
SIMPLE = 1;
|
||||
|
||||
// Secure connections to the downstream using mutual TLS by presenting
|
||||
// server certificates for authentication.
|
||||
MUTUAL = 2;
|
||||
|
||||
// Similar to the passthrough mode, except servers with this TLS mode
|
||||
// do not require an associated VirtualService to map from the SNI
|
||||
// value to service in the registry. The destination details such as
|
||||
// the service/subset/port are encoded in the SNI value. The proxy
|
||||
// will forward to the upstream (Envoy) cluster (a group of
|
||||
// endpoints) specified by the SNI value. This server is typically
|
||||
// used to provide connectivity between services in disparate L3
|
||||
// networks that otherwise do not have direct connectivity between
|
||||
// their respective endpoints. Use of this mode assumes that both the
|
||||
// source and the destination are using Istio mTLS to secure traffic.
|
||||
AUTO_PASSTHROUGH = 3;
|
||||
|
||||
// Secure connections from the downstream using mutual TLS by presenting
|
||||
// server certificates for authentication.
|
||||
// Compared to Mutual mode, this mode uses certificates, representing
|
||||
// gateway workload identity, generated automatically by Istio for
|
||||
// mTLS authentication. When this mode is used, all other fields in
|
||||
// `TLSOptions` should be empty.
|
||||
ISTIO_MUTUAL = 4;
|
||||
};
|
||||
|
||||
// Optional: Indicates whether connections to this port should be
|
||||
// secured using TLS. The value of this field determines how TLS is
|
||||
// enforced.
|
||||
TLSmode mode = 2;
|
||||
|
||||
// REQUIRED if mode is `SIMPLE` or `MUTUAL`. The path to the file
|
||||
// holding the server-side TLS certificate to use.
|
||||
string server_certificate = 3;
|
||||
|
||||
// REQUIRED if mode is `SIMPLE` or `MUTUAL`. The path to the file
|
||||
// holding the server's private key.
|
||||
string private_key = 4;
|
||||
|
||||
// REQUIRED if mode is `MUTUAL`. The path to a file containing
|
||||
// certificate authority certificates to use in verifying a presented
|
||||
// client side certificate.
|
||||
string ca_certificates = 5;
|
||||
|
||||
// The credentialName stands for a unique identifier that can be used
|
||||
// to identify the serverCertificate and the privateKey. The
|
||||
// credentialName appended with suffix "-cacert" is used to identify
|
||||
// the CaCertificates associated with this server. Gateway workloads
|
||||
// capable of fetching credentials from a remote credential store such
|
||||
// as Kubernetes secrets, will be configured to retrieve the
|
||||
// serverCertificate and the privateKey using credentialName, instead
|
||||
// of using the file system paths specified above. If using mutual TLS,
|
||||
// gateway workload instances will retrieve the CaCertificates using
|
||||
// credentialName-cacert. The semantics of the name are platform
|
||||
// dependent. In Kubernetes, the default Istio supplied credential
|
||||
// server expects the credentialName to match the name of the
|
||||
// Kubernetes secret that holds the server certificate, the private
|
||||
// key, and the CA certificate (if using mutual TLS). Set the
|
||||
// `ISTIO_META_USER_SDS` metadata variable in the gateway's proxy to
|
||||
// enable the dynamic credential fetching feature.
|
||||
string credential_name = 10;
|
||||
|
||||
// A list of alternate names to verify the subject identity in the
|
||||
// certificate presented by the client.
|
||||
repeated string subject_alt_names = 6;
|
||||
|
||||
// An optional list of base64-encoded SHA-256 hashes of the SKPIs of
|
||||
// authorized client certificates.
|
||||
// Note: When both verify_certificate_hash and verify_certificate_spki
|
||||
// are specified, a hash matching either value will result in the
|
||||
// certificate being accepted.
|
||||
repeated string verify_certificate_spki = 11;
|
||||
|
||||
// An optional list of hex-encoded SHA-256 hashes of the
|
||||
// authorized client certificates. Both simple and colon separated
|
||||
// formats are acceptable.
|
||||
// Note: When both verify_certificate_hash and verify_certificate_spki
|
||||
// are specified, a hash matching either value will result in the
|
||||
// certificate being accepted.
|
||||
repeated string verify_certificate_hash = 12;
|
||||
|
||||
// TLS protocol versions.
|
||||
enum TLSProtocol {
|
||||
// Automatically choose the optimal TLS version.
|
||||
TLS_AUTO = 0;
|
||||
|
||||
// TLS version 1.0
|
||||
TLSV1_0 = 1;
|
||||
|
||||
// TLS version 1.1
|
||||
TLSV1_1 = 2;
|
||||
|
||||
// TLS version 1.2
|
||||
TLSV1_2 = 3;
|
||||
|
||||
// TLS version 1.3
|
||||
TLSV1_3 = 4;
|
||||
}
|
||||
|
||||
// Optional: Minimum TLS protocol version.
|
||||
TLSProtocol min_protocol_version = 7;
|
||||
|
||||
// Optional: Maximum TLS protocol version.
|
||||
TLSProtocol max_protocol_version = 8;
|
||||
|
||||
// Optional: If specified, only support the specified cipher list.
|
||||
// Otherwise default to the default cipher list supported by Envoy.
|
||||
repeated string cipher_suites = 9;
|
||||
}
|
||||
|
||||
// Set of TLS related options that govern the server's behavior. Use
|
||||
// these options to control if all http requests should be redirected to
|
||||
// https, and the TLS modes to use.
|
||||
TLSOptions tls = 3;
|
||||
|
||||
// The loopback IP endpoint or Unix domain socket to which traffic should
|
||||
// be forwarded to by default. Format should be `127.0.0.1:PORT` or
|
||||
// `unix:///path/to/socket` or `unix://@foobar` (Linux abstract namespace).
|
||||
string default_endpoint = 5;
|
||||
}
|
||||
|
||||
// Port describes the properties of a specific port of a service.
|
||||
message Port {
|
||||
// REQUIRED: A valid non-negative integer port number.
|
||||
uint32 number = 1;
|
||||
|
||||
// REQUIRED: The protocol exposed on the port.
|
||||
// MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS.
|
||||
// TLS implies the connection will be routed based on the SNI header to
|
||||
// the destination without terminating the TLS connection.
|
||||
string protocol = 2;
|
||||
|
||||
// Label assigned to the port.
|
||||
string name = 3;
|
||||
}
|
308
istio/src/main/resources/mcp.proto
Normal file
308
istio/src/main/resources/mcp.proto
Normal file
@ -0,0 +1,308 @@
|
||||
// Copyright 2018 Istio Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "com.alibaba.nacos.istio.model.mcp";
|
||||
|
||||
package istio.mcp.v1alpha1;
|
||||
|
||||
import "status.proto";
|
||||
import "resource.proto";
|
||||
|
||||
// Identifies a specific MCP sink node instance. The node identifier is
|
||||
// presented to the resource source, which may use this identifier
|
||||
// to distinguish per sink configuration for serving. This
|
||||
// information is not authoritative. Authoritative identity should come
|
||||
// from the underlying transport layer (e.g. rpc credentials).
|
||||
message SinkNode {
|
||||
// An opaque identifier for the MCP node.
|
||||
string id = 1;
|
||||
|
||||
// Opaque annotations extending the node identifier.
|
||||
map<string,string> annotations = 2;
|
||||
}
|
||||
|
||||
// A MeshConfigRequest requests a set of versioned resources of the
|
||||
// same type for a given client.
|
||||
message MeshConfigRequest {
|
||||
// The version_info provided in the request messages will be the
|
||||
// version_info received with the most recent successfully processed
|
||||
// response or empty on the first request. It is expected that no
|
||||
// new request is sent after a response is received until the client
|
||||
// instance is ready to ACK/NACK the new configuration. ACK/NACK
|
||||
// takes place by returning the new API config version as applied or
|
||||
// the previous API config version respectively. Each type_url (see
|
||||
// below) has an independent version associated with it.
|
||||
string version_info = 1;
|
||||
|
||||
// The sink node making the request.
|
||||
SinkNode sink_node = 2;
|
||||
|
||||
// Type of the resource that is being requested, e.g.
|
||||
// "type.googleapis.com/istio.io.networking.v1alpha3.VirtualService".
|
||||
string type_url = 3;
|
||||
|
||||
// The nonce corresponding to MeshConfigResponse being
|
||||
// ACK/NACKed. See above discussion on version_info and the
|
||||
// MeshConfigResponse nonce comment. This may be empty if no nonce is
|
||||
// available, e.g. at startup.
|
||||
string response_nonce = 4;
|
||||
|
||||
// This is populated when the previous MeshConfigResponse failed to
|
||||
// update configuration. The *message* field in *error_details*
|
||||
// provides the client internal exception related to the failure. It
|
||||
// is only intended for consumption during manual debugging, the
|
||||
// string provided is not guaranteed to be stable across client
|
||||
// versions.
|
||||
google.rpc.Status error_detail = 5;
|
||||
}
|
||||
|
||||
// A MeshConfigResponse delivers a set of versioned resources of the
|
||||
// same type in response to a MeshConfigRequest.
|
||||
message MeshConfigResponse {
|
||||
// The version of the response data.
|
||||
string version_info = 1;
|
||||
|
||||
// The response resources wrapped in the common MCP *Resource*
|
||||
// message.
|
||||
repeated Resource resources = 2;
|
||||
|
||||
// Type URL for resources wrapped in the provided resources(s). This
|
||||
// must be consistent with the type_url in the wrapper messages if
|
||||
// resources is non-empty.
|
||||
string type_url = 3;
|
||||
|
||||
// The nonce provides a way to explicitly ack a specific
|
||||
// MeshConfigResponse in a following MeshConfigRequest. Additional
|
||||
// messages may have been sent by client to the management server for
|
||||
// the previous version on the stream prior to this
|
||||
// MeshConfigResponse, that were unprocessed at response send
|
||||
// time. The nonce allows the management server to ignore any
|
||||
// further MeshConfigRequests for the previous version until a
|
||||
// MeshConfigRequest bearing the nonce.
|
||||
string nonce = 4;
|
||||
}
|
||||
|
||||
// IncrementalMeshConfigRequest are be sent in 2 situations:
|
||||
//
|
||||
// 1. Initial message in a MCP bidirectional gRPC stream.
|
||||
//
|
||||
// 2. As a ACK or NACK response to a previous IncrementalMeshConfigResponse.
|
||||
// In this case the response_nonce is set to the nonce value in the Response.
|
||||
// ACK or NACK is determined by the absence or presence of error_detail.
|
||||
message IncrementalMeshConfigRequest {
|
||||
// The sink node making the request.
|
||||
SinkNode sink_node = 1;
|
||||
|
||||
// Type of the resource that is being requested, e.g.
|
||||
// "type.googleapis.com/istio.io.networking.v1alpha3.VirtualService".
|
||||
string type_url = 2;
|
||||
|
||||
|
||||
// When the IncrementalMeshConfigRequest is the first in a stream,
|
||||
// the initial_resource_versions must be populated. Otherwise,
|
||||
// initial_resource_versions must be omitted. The keys are the
|
||||
// resources names of the MCP resources known to the MCP client. The
|
||||
// values in the map are the associated resource level version info.
|
||||
map<string, string> initial_resource_versions = 3;
|
||||
|
||||
// When the IncrementalMeshConfigRequest is a ACK or NACK message in response
|
||||
// to a previous IncrementalMeshConfigResponse, the response_nonce must be the
|
||||
// nonce in the IncrementalMeshConfigResponse.
|
||||
// Otherwise response_nonce must be omitted.
|
||||
string response_nonce = 4;
|
||||
|
||||
// This is populated when the previous IncrementalMeshConfigResponses
|
||||
// failed to update configuration. The *message* field in *error_details*
|
||||
// provides the client internal exception related to the failure.
|
||||
google.rpc.Status error_detail = 5;
|
||||
}
|
||||
|
||||
// IncrementalMeshConfigResponses do not need to include a full
|
||||
// snapshot of the tracked resources. Instead they are a diff to the
|
||||
// state of a MCP client. Per resource versions allow servers and
|
||||
// clients to track state at the resource granularity. An MCP
|
||||
// incremental session is always in the context of a gRPC
|
||||
// bidirectional stream. This allows the MCP server to keep track of
|
||||
// the state of MCP clients connected to it.
|
||||
//
|
||||
// In Incremental MCP the nonce field is required and used to pair
|
||||
// IncrementalMeshConfigResponse to an IncrementalMeshConfigRequest
|
||||
// ACK or NACK. Optionally, a response message level
|
||||
// system_version_info is present for debugging purposes only.
|
||||
message IncrementalMeshConfigResponse {
|
||||
// The version of the response data (used for debugging).
|
||||
string system_version_info = 1;
|
||||
|
||||
// The response resources wrapped in the common MCP *Resource*
|
||||
// message. These are typed resources that match the type url in the
|
||||
// IncrementalMeshConfigRequest.
|
||||
repeated Resource resources = 2;
|
||||
|
||||
// Resources names of resources that have be deleted and to be
|
||||
// removed from the MCP Client. Removed resources for missing
|
||||
// resources can be ignored.
|
||||
repeated string removed_resources = 3;
|
||||
|
||||
// The nonce provides a way for IncrementalMeshConfigRequests to
|
||||
// uniquely reference an IncrementalMeshConfigResponse. The nonce is
|
||||
// required.
|
||||
string nonce = 4;
|
||||
}
|
||||
|
||||
// The aggregated mesh configuration services allow a single
|
||||
// management server, via a single gRPC stream, to deliver all API
|
||||
// updates.
|
||||
service AggregatedMeshConfigService {
|
||||
// StreamAggregatedResources provides the ability to carefully
|
||||
// sequence updates across multiple resource types. A single stream
|
||||
// is used with multiple independent MeshConfigRequest /
|
||||
// MeshConfigResponses sequences multiplexed via the type URL.
|
||||
rpc StreamAggregatedResources(stream MeshConfigRequest)
|
||||
returns (stream MeshConfigResponse) {
|
||||
}
|
||||
|
||||
// IncrementalAggregatedResources provides the ability to incrementally
|
||||
// update the resources on the client. This supports the goal of
|
||||
// scalability of MCP resources.
|
||||
rpc IncrementalAggregatedResources(stream IncrementalMeshConfigRequest)
|
||||
returns (stream IncrementalMeshConfigResponse) {
|
||||
}
|
||||
}
|
||||
|
||||
// A RequestResource can be sent in two situations:
|
||||
//
|
||||
// Initial message in an MCP bidirectional change stream
|
||||
// as an ACK or NACK response to a previous Resources. In
|
||||
// this case the response_nonce is set to the nonce value
|
||||
// in the Resources. ACK/NACK is determined by the presence
|
||||
// of error_detail.
|
||||
//
|
||||
// * ACK (nonce!="",error_details==nil)
|
||||
// * NACK (nonce!="",error_details!=nil)
|
||||
// * New/Update request (nonce=="",error_details ignored)
|
||||
//
|
||||
message RequestResources {
|
||||
// The sink node making the request.
|
||||
SinkNode sink_node = 1;
|
||||
|
||||
// Type of resource collection that is being requested, e.g.
|
||||
//
|
||||
// istio/networking/v1alpha3/VirtualService
|
||||
// k8s/<apiVersion>/<kind>
|
||||
string collection = 2;
|
||||
|
||||
// When the RequestResources is the first in a stream, the initial_resource_versions must
|
||||
// be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
|
||||
// resources names of the MCP resources known to the MCP client. The values in the map
|
||||
// are the associated resource level version info.
|
||||
map<string, string> initial_resource_versions = 3;
|
||||
|
||||
// When the RequestResources is an ACK or NACK message in response to a previous RequestResources,
|
||||
// the response_nonce must be the nonce in the RequestResources. Otherwise response_nonce must
|
||||
// be omitted.
|
||||
string response_nonce = 4;
|
||||
|
||||
// This is populated when the previously received resources could not be applied
|
||||
// The *message* field in *error_details* provides the source internal error
|
||||
// related to the failure.
|
||||
google.rpc.Status error_detail = 5;
|
||||
|
||||
// Request an incremental update for the specified collection. The source may choose to
|
||||
// honor this request or ignore and and provide a full-state update in the corresponding
|
||||
// `Resource` response.
|
||||
bool incremental = 6;
|
||||
}
|
||||
|
||||
// Resources do not need to include a full snapshot of the tracked
|
||||
// resources. Instead they are a diff to the state of a MCP client.
|
||||
// Per resource versions allow sources and sinks to track state at
|
||||
// the resource granularity. An MCP incremental session is always
|
||||
// in the context of a gRPC bidirectional stream. This allows the
|
||||
// MCP source to keep track of the state of MCP sink connected to
|
||||
// it.
|
||||
//
|
||||
// In Incremental MCP the nonce field is required and used to pair
|
||||
// Resources to an RequestResources ACK or NACK.
|
||||
message Resources {
|
||||
// The version of the response data (used for debugging).
|
||||
string system_version_info = 1;
|
||||
|
||||
// Type of resource collection that is being requested, e.g.
|
||||
//
|
||||
// istio/networking/v1alpha3/VirtualService
|
||||
// k8s/<apiVersion>/<kind>
|
||||
string collection = 2;
|
||||
|
||||
// The response resources wrapped in the common MCP *Resource* message.
|
||||
// These are typed resources that match the type url in the
|
||||
// RequestResources message.
|
||||
//
|
||||
// When `incremental` is true, this contains an array of resources to add/update
|
||||
// for the specified collection. This modifies the existing collection at the sink
|
||||
//
|
||||
// When `incremental` is false, this contains the full set of resources for the
|
||||
// specified collection. This replaces any previously delivered resources.
|
||||
repeated Resource resources = 3;
|
||||
|
||||
// Names of resources that have been deleted and to be
|
||||
// removed from the MCP sink node. Removed resources for missing
|
||||
// resources can be ignored.
|
||||
//
|
||||
// When `incremental` is true, this contains an array of resource names to remove
|
||||
// for the specified collection. This modifies the existing resource collection at
|
||||
// the sink.
|
||||
//
|
||||
// When `incremental` is false, this field should be ignored.
|
||||
repeated string removed_resources = 4;
|
||||
|
||||
// Required. The nonce provides a way for RequestChange to uniquely
|
||||
// reference a RequestResources.
|
||||
string nonce = 5;
|
||||
|
||||
// This resource response is an incremental update. The source should only send
|
||||
// incremental updates if the sink requested them.
|
||||
bool incremental = 6;
|
||||
}
|
||||
|
||||
// ResourceSource and ResourceSink services are semantically
|
||||
// equivalent with regards to the message exchange. The only meaningful
|
||||
// difference is who initiates the connection and opens the stream. The
|
||||
// following high-level overview applies to both service variants.
|
||||
//
|
||||
// After the connection and streams have been established, the sink sends
|
||||
// a RequestResource messages to request the initial set of resources. The
|
||||
// source sends a Resource message when new resources are available for the
|
||||
// requested type. In response, the sink sends another RequestResource
|
||||
// to ACK/NACK the received resources and request the next set of resources.
|
||||
|
||||
// Service where the sink is the gRPC client. The sink is responsible for
|
||||
// initiating connections and opening streams.
|
||||
service ResourceSource {
|
||||
// The sink, acting as gRPC client, establishes a new resource stream
|
||||
// with the source. The sink sends RequestResources message to
|
||||
// and receives Resources messages from the source.
|
||||
rpc EstablishResourceStream(stream RequestResources) returns (stream Resources) {}
|
||||
}
|
||||
|
||||
// Service where the source is the gRPC client. The source is responsible for
|
||||
// initiating connections and opening streams.
|
||||
service ResourceSink {
|
||||
// The source, acting as gRPC client, establishes a new resource stream
|
||||
// with the sink. The sink sends RequestResources message to and
|
||||
// receives Resources messages from the source.
|
||||
rpc EstablishResourceStream(stream Resources) returns (stream RequestResources) {}
|
||||
}
|
74
istio/src/main/resources/metadata.proto
Normal file
74
istio/src/main/resources/metadata.proto
Normal file
@ -0,0 +1,74 @@
|
||||
// Copyright 2018 Istio Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "com.alibaba.nacos.istio.model.mcp";
|
||||
|
||||
package istio.mcp.v1alpha1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
// Metadata information that all resources within the Mesh Configuration Protocol must have.
|
||||
message Metadata {
|
||||
// Fully qualified name of the resource. Unique in context of a collection.
|
||||
//
|
||||
// The fully qualified name consists of a directory and basename. The directory identifies
|
||||
// the resources location in a resource hierarchy. The basename identifies the specific
|
||||
// resource name within the context of that directory.
|
||||
//
|
||||
// The directory and basename are composed of one or more segments. Segments must be
|
||||
// valid [DNS labels](https://tools.ietf.org/html/rfc1123). "/" is the delimiter between
|
||||
// segments
|
||||
//
|
||||
// The rightmost segment is the basename. All segments to the
|
||||
// left of the basename form the directory. Segments moving towards the left
|
||||
// represent higher positions in the resource hierarchy, similar to reverse
|
||||
// DNS notation. e.g.
|
||||
//
|
||||
// /<org>/<team>/<subteam>/<resource basename>
|
||||
//
|
||||
// An empty directory indicates a resource that is located at the root of the
|
||||
// hierarchy, e.g.
|
||||
//
|
||||
// /<globally scoped resource>
|
||||
//
|
||||
// On Kubernetes the resource hierarchy is two-levels: namespaces and
|
||||
// cluster-scoped (i.e. global).
|
||||
//
|
||||
// Namespace resources fully qualified name is of the form:
|
||||
//
|
||||
// "<k8s namespace>/<k8s resource name>"
|
||||
//
|
||||
// Cluster scoped resources are located at the root of the hierarchy and are of the form:
|
||||
//
|
||||
// "/<k8s resource name>"
|
||||
string name = 1;
|
||||
|
||||
// The creation timestamp of the resource.
|
||||
google.protobuf.Timestamp create_time = 2;
|
||||
|
||||
// Resource version. This is used to determine when resources change across
|
||||
// resource updates. It should be treated as opaque by consumers/sinks.
|
||||
string version = 3;
|
||||
|
||||
// Map of string keys and values that can be used to organize and categorize
|
||||
// resources within a collection.
|
||||
map<string,string> labels = 4;
|
||||
|
||||
// Map of string keys and values that can be used by source and sink to communicate
|
||||
// arbitrary metadata about this resource.
|
||||
map<string,string> annotations = 5;
|
||||
}
|
35
istio/src/main/resources/resource.proto
Normal file
35
istio/src/main/resources/resource.proto
Normal file
@ -0,0 +1,35 @@
|
||||
// Copyright 2018 Istio Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "com.alibaba.nacos.istio.model.mcp";
|
||||
|
||||
// This package defines the common, core types used by the Mesh Configuration Protocol.
|
||||
package istio.mcp.v1alpha1;
|
||||
|
||||
import "google/protobuf/any.proto";
|
||||
import "metadata.proto";
|
||||
|
||||
// Resource as transferred via the Mesh Configuration Protocol. Each
|
||||
// resource is made up of common metadata, and a type-specific resource payload.
|
||||
message Resource {
|
||||
// Common metadata describing the resource.
|
||||
Metadata metadata = 1;
|
||||
|
||||
// The primary payload for the resource.
|
||||
google.protobuf.Any body = 2;
|
||||
}
|
526
istio/src/main/resources/service_entry.proto
Normal file
526
istio/src/main/resources/service_entry.proto
Normal file
@ -0,0 +1,526 @@
|
||||
// Copyright 2018 Istio Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "com.alibaba.nacos.istio.model.naming";
|
||||
|
||||
package istio.networking.v1alpha3;
|
||||
|
||||
import "gateway.proto";
|
||||
|
||||
// $title: Service Entry
|
||||
// $description: Configuration affecting service registry.
|
||||
// $location: https://istio.io/docs/reference/config/networking/v1alpha3/service-entry.html
|
||||
|
||||
// `ServiceEntry` enables adding additional entries into Istio's internal
|
||||
// service registry, so that auto-discovered services in the mesh can
|
||||
// access/route to these manually specified services. A service entry
|
||||
// describes the properties of a service (DNS name, VIPs, ports, protocols,
|
||||
// endpoints). These services could be external to the mesh (e.g., web
|
||||
// APIs) or mesh-internal services that are not part of the platform's
|
||||
// service registry (e.g., a set of VMs talking to services in Kubernetes).
|
||||
//
|
||||
// The following example declares a few external APIs accessed by internal
|
||||
// applications over HTTPS. The sidecar inspects the SNI value in the
|
||||
// ClientHello message to route to the appropriate external service.
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: ServiceEntry
|
||||
// metadata:
|
||||
// name: external-svc-https
|
||||
// spec:
|
||||
// hosts:
|
||||
// - api.dropboxapi.com
|
||||
// - www.googleapis.com
|
||||
// - api.facebook.com
|
||||
// location: MESH_EXTERNAL
|
||||
// ports:
|
||||
// - number: 443
|
||||
// name: https
|
||||
// protocol: TLS
|
||||
// resolution: DNS
|
||||
// ```
|
||||
//
|
||||
// The following configuration adds a set of MongoDB instances running on
|
||||
// unmanaged VMs to Istio's registry, so that these services can be treated
|
||||
// as any other service in the mesh. The associated DestinationRule is used
|
||||
// to initiate mTLS connections to the database instances.
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: ServiceEntry
|
||||
// metadata:
|
||||
// name: external-svc-mongocluster
|
||||
// spec:
|
||||
// hosts:
|
||||
// - mymongodb.somedomain # not used
|
||||
// addresses:
|
||||
// - 192.192.192.192/24 # VIPs
|
||||
// ports:
|
||||
// - number: 27018
|
||||
// name: mongodb
|
||||
// protocol: MONGO
|
||||
// location: MESH_INTERNAL
|
||||
// resolution: STATIC
|
||||
// endpoints:
|
||||
// - address: 2.2.2.2
|
||||
// - address: 3.3.3.3
|
||||
// ```
|
||||
//
|
||||
// and the associated DestinationRule
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: DestinationRule
|
||||
// metadata:
|
||||
// name: mtls-mongocluster
|
||||
// spec:
|
||||
// host: mymongodb.somedomain
|
||||
// trafficPolicy:
|
||||
// tls:
|
||||
// mode: MUTUAL
|
||||
// clientCertificate: /etc/certs/myclientcert.pem
|
||||
// privateKey: /etc/certs/client_private_key.pem
|
||||
// caCertificates: /etc/certs/rootcacerts.pem
|
||||
// ```
|
||||
//
|
||||
// The following example uses a combination of service entry and TLS
|
||||
// routing in a virtual service to steer traffic based on the SNI value to
|
||||
// an internal egress firewall.
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: ServiceEntry
|
||||
// metadata:
|
||||
// name: external-svc-redirect
|
||||
// spec:
|
||||
// hosts:
|
||||
// - wikipedia.org
|
||||
// - "*.wikipedia.org"
|
||||
// location: MESH_EXTERNAL
|
||||
// ports:
|
||||
// - number: 443
|
||||
// name: https
|
||||
// protocol: TLS
|
||||
// resolution: NONE
|
||||
// ```
|
||||
//
|
||||
// And the associated VirtualService to route based on the SNI value.
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: VirtualService
|
||||
// metadata:
|
||||
// name: tls-routing
|
||||
// spec:
|
||||
// hosts:
|
||||
// - wikipedia.org
|
||||
// - "*.wikipedia.org"
|
||||
// tls:
|
||||
// - match:
|
||||
// - sniHosts:
|
||||
// - wikipedia.org
|
||||
// - "*.wikipedia.org"
|
||||
// route:
|
||||
// - destination:
|
||||
// host: internal-egress-firewall.ns1.svc.cluster.local
|
||||
// ```
|
||||
//
|
||||
// The virtual service with TLS match serves to override the default SNI
|
||||
// match. In the absence of a virtual service, traffic will be forwarded to
|
||||
// the wikipedia domains.
|
||||
//
|
||||
// The following example demonstrates the use of a dedicated egress gateway
|
||||
// through which all external service traffic is forwarded.
|
||||
// The 'exportTo' field allows for control over the visibility of a service
|
||||
// declaration to other namespaces in the mesh. By default, a service is exported
|
||||
// to all namespaces. The following example restricts the visibility to the
|
||||
// current namespace, represented by ".", so that it cannot be used by other
|
||||
// namespaces.
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: ServiceEntry
|
||||
// metadata:
|
||||
// name: external-svc-httpbin
|
||||
// namespace : egress
|
||||
// spec:
|
||||
// hosts:
|
||||
// - httpbin.com
|
||||
// exportTo:
|
||||
// - "."
|
||||
// location: MESH_EXTERNAL
|
||||
// ports:
|
||||
// - number: 80
|
||||
// name: http
|
||||
// protocol: HTTP
|
||||
// resolution: DNS
|
||||
// ```
|
||||
//
|
||||
// Define a gateway to handle all egress traffic.
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: Gateway
|
||||
// metadata:
|
||||
// name: istio-egressgateway
|
||||
// namespace: istio-system
|
||||
// spec:
|
||||
// selector:
|
||||
// istio: egressgateway
|
||||
// servers:
|
||||
// - port:
|
||||
// number: 80
|
||||
// name: http
|
||||
// protocol: HTTP
|
||||
// hosts:
|
||||
// - "*"
|
||||
// ```
|
||||
//
|
||||
// And the associated `VirtualService` to route from the sidecar to the
|
||||
// gateway service (`istio-egressgateway.istio-system.svc.cluster.local`), as
|
||||
// well as route from the gateway to the external service. Note that the
|
||||
// virtual service is exported to all namespaces enabling them to route traffic
|
||||
// through the gateway to the external service. Forcing traffic to go through
|
||||
// a managed middle proxy like this is a common practice.
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: VirtualService
|
||||
// metadata:
|
||||
// name: gateway-routing
|
||||
// namespace: egress
|
||||
// spec:
|
||||
// hosts:
|
||||
// - httpbin.com
|
||||
// exportTo:
|
||||
// - "*"
|
||||
// gateways:
|
||||
// - mesh
|
||||
// - istio-egressgateway
|
||||
// http:
|
||||
// - match:
|
||||
// - port: 80
|
||||
// gateways:
|
||||
// - mesh
|
||||
// route:
|
||||
// - destination:
|
||||
// host: istio-egressgateway.istio-system.svc.cluster.local
|
||||
// - match:
|
||||
// - port: 80
|
||||
// gateways:
|
||||
// - istio-egressgateway
|
||||
// route:
|
||||
// - destination:
|
||||
// host: httpbin.com
|
||||
// ```
|
||||
//
|
||||
// The following example demonstrates the use of wildcards in the hosts for
|
||||
// external services. If the connection has to be routed to the IP address
|
||||
// requested by the application (i.e. application resolves DNS and attempts
|
||||
// to connect to a specific IP), the discovery mode must be set to `NONE`.
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: ServiceEntry
|
||||
// metadata:
|
||||
// name: external-svc-wildcard-example
|
||||
// spec:
|
||||
// hosts:
|
||||
// - "*.bar.com"
|
||||
// location: MESH_EXTERNAL
|
||||
// ports:
|
||||
// - number: 80
|
||||
// name: http
|
||||
// protocol: HTTP
|
||||
// resolution: NONE
|
||||
// ```
|
||||
//
|
||||
// The following example demonstrates a service that is available via a
|
||||
// Unix Domain Socket on the host of the client. The resolution must be
|
||||
// set to STATIC to use Unix address endpoints.
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: ServiceEntry
|
||||
// metadata:
|
||||
// name: unix-domain-socket-example
|
||||
// spec:
|
||||
// hosts:
|
||||
// - "example.unix.local"
|
||||
// location: MESH_EXTERNAL
|
||||
// ports:
|
||||
// - number: 80
|
||||
// name: http
|
||||
// protocol: HTTP
|
||||
// resolution: STATIC
|
||||
// endpoints:
|
||||
// - address: unix:///var/run/example/socket
|
||||
// ```
|
||||
//
|
||||
// For HTTP-based services, it is possible to create a `VirtualService`
|
||||
// backed by multiple DNS addressable endpoints. In such a scenario, the
|
||||
// application can use the `HTTP_PROXY` environment variable to transparently
|
||||
// reroute API calls for the `VirtualService` to a chosen backend. For
|
||||
// example, the following configuration creates a non-existent external
|
||||
// service called foo.bar.com backed by three domains: us.foo.bar.com:8080,
|
||||
// uk.foo.bar.com:9080, and in.foo.bar.com:7080
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: ServiceEntry
|
||||
// metadata:
|
||||
// name: external-svc-dns
|
||||
// spec:
|
||||
// hosts:
|
||||
// - foo.bar.com
|
||||
// location: MESH_EXTERNAL
|
||||
// ports:
|
||||
// - number: 80
|
||||
// name: http
|
||||
// protocol: HTTP
|
||||
// resolution: DNS
|
||||
// endpoints:
|
||||
// - address: us.foo.bar.com
|
||||
// ports:
|
||||
// https: 8080
|
||||
// - address: uk.foo.bar.com
|
||||
// ports:
|
||||
// https: 9080
|
||||
// - address: in.foo.bar.com
|
||||
// ports:
|
||||
// https: 7080
|
||||
// ```
|
||||
//
|
||||
// With `HTTP_PROXY=http://localhost/`, calls from the application to
|
||||
// `http://foo.bar.com` will be load balanced across the three domains
|
||||
// specified above. In other words, a call to `http://foo.bar.com/baz` would
|
||||
// be translated to `http://uk.foo.bar.com/baz`.
|
||||
//
|
||||
// The following example illustrates the usage of a `ServiceEntry`
|
||||
// containing a subject alternate name
|
||||
// whose format conforms to the [SPIFFE standard](https://github.com/spiffe/spiffe/blob/master/standards/SPIFFE-ID.md):
|
||||
//
|
||||
// ```yaml
|
||||
// apiVersion: networking.istio.io/v1alpha3
|
||||
// kind: ServiceEntry
|
||||
// metadata:
|
||||
// name: httpbin
|
||||
// namespace : httpbin-ns
|
||||
// spec:
|
||||
// hosts:
|
||||
// - httpbin.com
|
||||
// location: MESH_INTERNAL
|
||||
// ports:
|
||||
// - number: 80
|
||||
// name: http
|
||||
// protocol: HTTP
|
||||
// resolution: STATIC
|
||||
// endpoints:
|
||||
// - address: 2.2.2.2
|
||||
// - address: 3.3.3.3
|
||||
// subjectAltNames:
|
||||
// - "spiffe://cluster.local/ns/httpbin-ns/sa/httpbin-service-account"
|
||||
// ```
|
||||
//
|
||||
|
||||
// ServiceEntry enables adding additional entries into Istio's internal
|
||||
// service registry.
|
||||
//
|
||||
// <!-- go code generation tags
|
||||
// +kubetype-gen
|
||||
// +kubetype-gen:groupVersion=networking.istio.io/v1alpha3
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen=true
|
||||
// -->
|
||||
message ServiceEntry {
|
||||
// REQUIRED. The hosts associated with the ServiceEntry. Could be a DNS
|
||||
// name with wildcard prefix.
|
||||
//
|
||||
// 1. The hosts field is used to select matching hosts in VirtualServices and DestinationRules.
|
||||
// 2. For HTTP traffic the HTTP Host/Authority header will be matched against the hosts field.
|
||||
// 3. For HTTPs or TLS traffic containing Server Name Indication (SNI), the SNI value
|
||||
// will be matched against the hosts field.
|
||||
//
|
||||
// Note that when resolution is set to type DNS
|
||||
// and no endpoints are specified, the host field will be used as the DNS name
|
||||
// of the endpoint to route traffic to.
|
||||
repeated string hosts = 1;
|
||||
|
||||
// The virtual IP addresses associated with the service. Could be CIDR
|
||||
// prefix. For HTTP traffic, generated route configurations will include http route
|
||||
// domains for both the `addresses` and `hosts` field values and the destination will
|
||||
// be identified based on the HTTP Host/Authority header.
|
||||
// If one or more IP addresses are specified,
|
||||
// the incoming traffic will be identified as belonging to this service
|
||||
// if the destination IP matches the IP/CIDRs specified in the addresses
|
||||
// field. If the Addresses field is empty, traffic will be identified
|
||||
// solely based on the destination port. In such scenarios, the port on
|
||||
// which the service is being accessed must not be shared by any other
|
||||
// service in the mesh. In other words, the sidecar will behave as a
|
||||
// simple TCP proxy, forwarding incoming traffic on a specified port to
|
||||
// the specified destination endpoint IP/host. Unix domain socket
|
||||
// addresses are not supported in this field.
|
||||
repeated string addresses = 2;
|
||||
|
||||
// REQUIRED. The ports associated with the external service. If the
|
||||
// Endpoints are Unix domain socket addresses, there must be exactly one
|
||||
// port.
|
||||
repeated Port ports = 3;
|
||||
|
||||
// Location specifies whether the service is part of Istio mesh or
|
||||
// outside the mesh. Location determines the behavior of several
|
||||
// features, such as service-to-service mTLS authentication, policy
|
||||
// enforcement, etc. When communicating with services outside the mesh,
|
||||
// Istio's mTLS authentication is disabled, and policy enforcement is
|
||||
// performed on the client-side as opposed to server-side.
|
||||
enum Location {
|
||||
// Signifies that the service is external to the mesh. Typically used
|
||||
// to indicate external services consumed through APIs.
|
||||
MESH_EXTERNAL = 0;
|
||||
|
||||
// Signifies that the service is part of the mesh. Typically used to
|
||||
// indicate services added explicitly as part of expanding the service
|
||||
// mesh to include unmanaged infrastructure (e.g., VMs added to a
|
||||
// Kubernetes based service mesh).
|
||||
MESH_INTERNAL = 1;
|
||||
};
|
||||
|
||||
// Specify whether the service should be considered external to the mesh
|
||||
// or part of the mesh.
|
||||
Location location = 4;
|
||||
|
||||
// Resolution determines how the proxy will resolve the IP addresses of
|
||||
// the network endpoints associated with the service, so that it can
|
||||
// route to one of them. The resolution mode specified here has no impact
|
||||
// on how the application resolves the IP address associated with the
|
||||
// service. The application may still have to use DNS to resolve the
|
||||
// service to an IP so that the outbound traffic can be captured by the
|
||||
// Proxy. Alternatively, for HTTP services, the application could
|
||||
// directly communicate with the proxy (e.g., by setting HTTP_PROXY) to
|
||||
// talk to these services.
|
||||
enum Resolution {
|
||||
// Assume that incoming connections have already been resolved (to a
|
||||
// specific destination IP address). Such connections are typically
|
||||
// routed via the proxy using mechanisms such as IP table REDIRECT/
|
||||
// eBPF. After performing any routing related transformations, the
|
||||
// proxy will forward the connection to the IP address to which the
|
||||
// connection was bound.
|
||||
NONE = 0;
|
||||
|
||||
// Use the static IP addresses specified in endpoints (see below) as the
|
||||
// backing instances associated with the service.
|
||||
STATIC = 1;
|
||||
|
||||
// Attempt to resolve the IP address by querying the ambient DNS,
|
||||
// during request processing. If no endpoints are specified, the proxy
|
||||
// will resolve the DNS address specified in the hosts field, if
|
||||
// wildcards are not used. If endpoints are specified, the DNS
|
||||
// addresses specified in the endpoints will be resolved to determine
|
||||
// the destination IP address. DNS resolution cannot be used with Unix
|
||||
// domain socket endpoints.
|
||||
DNS = 2;
|
||||
};
|
||||
|
||||
// REQUIRED: Service discovery mode for the hosts. Care must be taken
|
||||
// when setting the resolution mode to NONE for a TCP port without
|
||||
// accompanying IP addresses. In such cases, traffic to any IP on
|
||||
// said port will be allowed (i.e. 0.0.0.0:<port>).
|
||||
Resolution resolution = 5;
|
||||
|
||||
// Endpoint defines a network address (IP or hostname) associated with
|
||||
// the mesh service.
|
||||
message Endpoint {
|
||||
// REQUIRED: Address associated with the network endpoint without the
|
||||
// port. Domain names can be used if and only if the resolution is set
|
||||
// to DNS, and must be fully-qualified without wildcards. Use the form
|
||||
// unix:///absolute/path/to/socket for Unix domain socket endpoints.
|
||||
string address = 1;
|
||||
|
||||
// Set of ports associated with the endpoint. The ports must be
|
||||
// associated with a port name that was declared as part of the
|
||||
// service. Do not use for `unix://` addresses.
|
||||
map<string, uint32> ports = 2;
|
||||
|
||||
// One or more labels associated with the endpoint.
|
||||
map<string, string> labels = 3;
|
||||
|
||||
// Network enables Istio to group endpoints resident in the same L3
|
||||
// domain/network. All endpoints in the same network are assumed to be
|
||||
// directly reachable from one another. When endpoints in different
|
||||
// networks cannot reach each other directly, an Istio Gateway can be
|
||||
// used to establish connectivity (usually using the
|
||||
// AUTO_PASSTHROUGH mode in a Gateway Server). This is
|
||||
// an advanced configuration used typically for spanning an Istio mesh
|
||||
// over multiple clusters.
|
||||
string network = 4;
|
||||
|
||||
// The locality associated with the endpoint. A locality corresponds
|
||||
// to a failure domain (e.g., country/region/zone). Arbitrary failure
|
||||
// domain hierarchies can be represented by separating each
|
||||
// encapsulating failure domain by /. For example, the locality of an
|
||||
// an endpoint in US, in US-East-1 region, within availability zone
|
||||
// az-1, in data center rack r11 can be represented as
|
||||
// us/us-east-1/az-1/r11. Istio will configure the sidecar to route to
|
||||
// endpoints within the same locality as the sidecar. If none of the
|
||||
// endpoints in the locality are available, endpoints parent locality
|
||||
// (but within the same network ID) will be chosen. For example, if
|
||||
// there are two endpoints in same network (networkID "n1"), say e1
|
||||
// with locality us/us-east-1/az-1/r11 and e2 with locality
|
||||
// us/us-east-1/az-2/r12, a sidecar from us/us-east-1/az-1/r11 locality
|
||||
// will prefer e1 from the same locality over e2 from a different
|
||||
// locality. Endpoint e2 could be the IP associated with a gateway
|
||||
// (that bridges networks n1 and n2), or the IP associated with a
|
||||
// standard service endpoint.
|
||||
string locality = 5;
|
||||
|
||||
// The load balancing weight associated with the endpoint. Endpoints
|
||||
// with higher weights will receive proportionally higher traffic.
|
||||
uint32 weight = 6;
|
||||
};
|
||||
|
||||
// One or more endpoints associated with the service.
|
||||
repeated Endpoint endpoints = 6;
|
||||
|
||||
// A list of namespaces to which this service is exported. Exporting a service
|
||||
// allows it to be used by sidecars, gateways and virtual services defined in
|
||||
// other namespaces. This feature provides a mechanism for service owners
|
||||
// and mesh administrators to control the visibility of services across
|
||||
// namespace boundaries.
|
||||
//
|
||||
// If no namespaces are specified then the service is exported to all
|
||||
// namespaces by default.
|
||||
//
|
||||
// The value "." is reserved and defines an export to the same namespace that
|
||||
// the service is declared in. Similarly the value "*" is reserved and
|
||||
// defines an export to all namespaces.
|
||||
//
|
||||
// For a Kubernetes Service, the equivalent effect can be achieved by setting
|
||||
// the annotation "networking.istio.io/exportTo" to a comma-separated list
|
||||
// of namespace names.
|
||||
//
|
||||
// NOTE: in the current release, the `exportTo` value is restricted to
|
||||
// "." or "*" (i.e., the current namespace or all namespaces).
|
||||
repeated string export_to = 7;
|
||||
|
||||
// The list of subject alternate names allowed for workload instances that
|
||||
// implement this service. This information is used to enforce
|
||||
// [secure-naming](https://istio.io/docs/concepts/security/#secure-naming).
|
||||
// If specified, the proxy will verify that the server
|
||||
// certificate's subject alternate name matches one of the specified values.
|
||||
repeated string subject_alt_names = 8;
|
||||
}
|
93
istio/src/main/resources/status.proto
Normal file
93
istio/src/main/resources/status.proto
Normal file
@ -0,0 +1,93 @@
|
||||
// Copyright 2017 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package google.rpc;
|
||||
|
||||
import "google/protobuf/any.proto";
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "StatusProto";
|
||||
option java_package = "com.google.rpc";
|
||||
option objc_class_prefix = "RPC";
|
||||
|
||||
// The `Status` type defines a logical error model that is suitable for
|
||||
// different programming environments, including REST APIs and RPC APIs. It is
|
||||
// used by [gRPC](https://github.com/grpc). The error model is designed to be:
|
||||
//
|
||||
// - Simple to use and understand for most users
|
||||
// - Flexible enough to meet unexpected needs
|
||||
//
|
||||
// # Overview
|
||||
//
|
||||
// The `Status` message contains three pieces of data: error code, error
|
||||
// message, and error details. The error code should be an enum value of
|
||||
// [google.rpc.Code][google.rpc.Code], but it may accept additional error codes
|
||||
// if needed. The error message should be a developer-facing English message
|
||||
// that helps developers *understand* and *resolve* the error. If a localized
|
||||
// user-facing error message is needed, put the localized message in the error
|
||||
// details or localize it in the client. The optional error details may contain
|
||||
// arbitrary information about the error. There is a predefined set of error
|
||||
// detail types in the package `google.rpc` that can be used for common error
|
||||
// conditions.
|
||||
//
|
||||
// # Language mapping
|
||||
//
|
||||
// The `Status` message is the logical representation of the error model, but it
|
||||
// is not necessarily the actual wire format. When the `Status` message is
|
||||
// exposed in different client libraries and different wire protocols, it can be
|
||||
// mapped differently. For example, it will likely be mapped to some exceptions
|
||||
// in Java, but more likely mapped to some error codes in C.
|
||||
//
|
||||
// # Other uses
|
||||
//
|
||||
// The error model and the `Status` message can be used in a variety of
|
||||
// environments, either with or without APIs, to provide a
|
||||
// consistent developer experience across different environments.
|
||||
//
|
||||
// Example uses of this error model include:
|
||||
//
|
||||
// - Partial errors. If a service needs to return partial errors to the client,
|
||||
// it may embed the `Status` in the normal response to indicate the partial
|
||||
// errors.
|
||||
//
|
||||
// - Workflow errors. A typical workflow has multiple steps. Each step may
|
||||
// have a `Status` message for error reporting.
|
||||
//
|
||||
// - Batch operations. If a client uses batch request and batch response, the
|
||||
// `Status` message should be used directly inside batch response, one for
|
||||
// each error sub-response.
|
||||
//
|
||||
// - Asynchronous operations. If an API call embeds asynchronous operation
|
||||
// results in its response, the status of those operations should be
|
||||
// represented directly using the `Status` message.
|
||||
//
|
||||
// - Logging. If some API errors are stored in logs, the message `Status` could
|
||||
// be used directly after any stripping needed for security/privacy reasons.
|
||||
message Status {
|
||||
// The status code, which should be an enum value of
|
||||
// [google.rpc.Code][google.rpc.Code].
|
||||
int32 code = 1;
|
||||
|
||||
// A developer-facing error message, which should be in English. Any
|
||||
// user-facing error message should be localized and sent in the
|
||||
// [google.rpc.Status.details][google.rpc.Status.details] field, or localized
|
||||
// by the client.
|
||||
string message = 2;
|
||||
|
||||
// A list of messages that carry the error details. There is a common set of
|
||||
// message types for APIs to use.
|
||||
repeated google.protobuf.Any details = 3;
|
||||
}
|
@ -43,7 +43,7 @@ import java.util.Map;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
/**
|
||||
* A consistency protocol algorithm called <b>Partition</b>
|
||||
* A consistency protocol algorithm called <b>Distro</b>
|
||||
* <p>
|
||||
* Use a distro algorithm to divide data into many blocks. Each Nacos server node takes
|
||||
* responsibility for exactly one block of data. Each block of data is generated, removed
|
||||
|
@ -19,7 +19,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Stores some configurations for Partition protocol
|
||||
* Stores some configurations for Distro protocol
|
||||
*
|
||||
* @author nkorange
|
||||
* @since 1.0.0
|
||||
|
@ -43,7 +43,7 @@ public class GlobalExecutor {
|
||||
Thread t = new Thread(r);
|
||||
|
||||
t.setDaemon(true);
|
||||
t.setName("com.alibaba.nacos.naming.raft.timer");
|
||||
t.setName("com.alibaba.nacos.naming.timer");
|
||||
|
||||
return t;
|
||||
}
|
||||
@ -147,6 +147,10 @@ public class GlobalExecutor {
|
||||
executorService.scheduleAtFixedRate(runnable, 0, period, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
public static void schedule(Runnable runnable, long initialDelay, long period) {
|
||||
executorService.scheduleAtFixedRate(runnable, initialDelay, period, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
public static void notifyServerListChange(Runnable runnable) {
|
||||
notifyServerListExecutor.submit(runnable);
|
||||
}
|
||||
|
54
pom.xml
54
pom.xml
@ -202,6 +202,11 @@
|
||||
<ruleset>rulesets/java/ali-set.xml</ruleset>
|
||||
</rulesets>
|
||||
<printFailingErrors>true</printFailingErrors>
|
||||
<excludes>
|
||||
<exclude>**/istio/model/mcp/*.java</exclude>
|
||||
<exclude>**/istio/model/naming/*.java</exclude>
|
||||
<exclude>**/istio/model/*.java</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
@ -240,6 +245,7 @@
|
||||
<exclude>bin/*</exclude>
|
||||
<exclude>conf/*</exclude>
|
||||
<exclude>derby.log</exclude>
|
||||
<exclude>**/istio/model/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
@ -437,6 +443,7 @@
|
||||
<module>distribution</module>
|
||||
<module>console</module>
|
||||
<module>cmdb</module>
|
||||
<module>istio</module>
|
||||
</modules>
|
||||
|
||||
<!-- 所有的子项目默认依赖 -->
|
||||
@ -519,6 +526,12 @@
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>nacos-istio</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Alibaba libs-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
@ -706,6 +719,12 @@
|
||||
<version>4.1.42.Final</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-common</artifactId>
|
||||
<version>4.1.31.Final</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.mina</groupId>
|
||||
<artifactId>mina-core</artifactId>
|
||||
@ -715,7 +734,7 @@
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>19.0</version>
|
||||
<version>22.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@ -731,6 +750,39 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-netty</artifactId>
|
||||
<version>1.15.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-protobuf</artifactId>
|
||||
<version>1.15.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-stub</artifactId>
|
||||
<version>1.15.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.api.grpc</groupId>
|
||||
<artifactId>proto-google-common-protos</artifactId>
|
||||
<version>1.17.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java</artifactId>
|
||||
<version>3.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>protoc-gen-grpc-java</artifactId>
|
||||
<version>1.24.0</version>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
@ -159,6 +159,7 @@ public class ConfigBeta_ITCase {
|
||||
*/
|
||||
@Test
|
||||
public void publishBetaConfig_noBetaIps() throws Exception {
|
||||
|
||||
HttpHeaders headers = new HttpHeaders(); //不存在betaIps
|
||||
|
||||
ResponseEntity<String> response = request(CONFIG_CONTROLLER_PATH + "/configs", headers,
|
||||
|
@ -152,18 +152,25 @@ public class ConfigExportAndImportAPI_ITCase {
|
||||
String queryResult = httpClient.get(SERVER_ADDR + CONFIG_CONTROLLER_PATH + getDataUrl, null);
|
||||
JSONObject resultObj = JSON.parseObject(queryResult);
|
||||
JSONArray resultConfigs = resultObj.getJSONArray("pageItems");
|
||||
Assert.assertEquals(2, resultConfigs.size());
|
||||
Assert.assertEquals(3, resultConfigs.size());
|
||||
JSONObject config1 = resultConfigs.getJSONObject(0);
|
||||
JSONObject config2 = resultConfigs.getJSONObject(1);
|
||||
JSONObject config3 = resultConfigs.getJSONObject(2);
|
||||
String exportByIdsUrl = "?export=true&tenant=&group=DEFAULT_GROUP&appName=&ids=";
|
||||
byte[] zipData = httpClient.download(SERVER_ADDR + CONFIG_CONTROLLER_PATH + exportByIdsUrl, null);
|
||||
ZipUtils.UnZipResult unZiped = ZipUtils.unzip(zipData);
|
||||
List<ZipUtils.ZipItem> zipItemList = unZiped.getZipItemList();
|
||||
Assert.assertEquals(2, zipItemList.size());
|
||||
Assert.assertEquals(3, zipItemList.size());
|
||||
String config1Name = config1.getString("group") + "/" + config1.getString("dataId");
|
||||
String config2Name = config2.getString("group") + "/" + config2.getString("dataId");
|
||||
String config3Name = config3.getString("group") + "/" + config3.getString("dataId");
|
||||
|
||||
System.out.println(config1Name + ", " + config2Name + ", " + config3Name);
|
||||
|
||||
for(ZipUtils.ZipItem zipItem : zipItemList){
|
||||
if(!(config1Name.equals(zipItem.getItemName()) || config2Name.equals(zipItem.getItemName()))){
|
||||
if(!(config1Name.equals(zipItem.getItemName())
|
||||
|| config2Name.equals(zipItem.getItemName())
|
||||
|| config3Name.equals(zipItem.getItemName()))){
|
||||
Assert.fail();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user