io.fabric8.api.registry.ApiSnapshot Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-registry Show documentation
Show all versions of api-registry Show documentation
Provides a global view of all APIs in the Kubernetes environment
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 io.fabric8.api.registry;
import io.fabric8.kubernetes.api.model.Pod;
import io.fabric8.swagger.model.ApiDeclaration;
import org.apache.cxf.jaxrs.ext.MessageContext;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Represents a snapshot of the current Pod and API state.
*/
public class ApiSnapshot {
private final Map podMap;
private String urlPrefix;
private final Map> apiMap = new HashMap<>();
private final Map podContainerToSwaggerMap = new HashMap<>();
private MessageContext messageContext;
private List serviceApis = new ArrayList<>();
public ApiSnapshot(Map podMap) {
this.podMap = podMap;
}
public Map getPodMap() {
return podMap;
}
public String getUrlPrefix() {
return urlPrefix;
}
public void setUrlPrefix(String urlPrefix) {
this.urlPrefix = urlPrefix;
}
public Map> getApiMap() {
return apiMap;
}
public Map getPodContainerToSwaggerMap() {
return podContainerToSwaggerMap;
}
public void putApis(String podId, List list) {
apiMap.put(podId, list);
}
public ApiDeclaration getSwaggerForPodAndContainer(PodAndContainerId key) {
return podContainerToSwaggerMap.get(key);
}
public void putPodAndContainerSwagger(PodAndContainerId key, ApiDeclaration swagger) {
podContainerToSwaggerMap.put(key, swagger);
}
public void setMessageContext(MessageContext messageContext) {
this.messageContext = messageContext;
}
public MessageContext getMessageContext() {
return messageContext;
}
public List getServiceApis() {
return serviceApis;
}
public void addServiceApi(ApiDTO apiDTO) {
serviceApis.add(apiDTO);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy