Search in sources :

Example 1 with BasePath

use of io.servicecomb.serviceregistry.api.registry.BasePath in project java-chassis by ServiceComb.

the class SchemaLoader method putSelfBasePathIfAbsent.

public void putSelfBasePathIfAbsent(String microserviceName, String basePath) {
    if (basePath == null || basePath.length() == 0) {
        return;
    }
    Microservice microservice = RegistryUtils.getMicroservice();
    if (!microservice.getServiceName().equals(microserviceName)) {
        return;
    }
    List<BasePath> paths = microservice.getPaths();
    for (BasePath path : paths) {
        if (path.getPath().equals(basePath)) {
            return;
        }
    }
    BasePath basePathObj = new BasePath();
    basePathObj.setPath(basePath);
    paths.add(basePathObj);
}
Also used : Microservice(io.servicecomb.serviceregistry.api.registry.Microservice) BasePath(io.servicecomb.serviceregistry.api.registry.BasePath)

Aggregations

BasePath (io.servicecomb.serviceregistry.api.registry.BasePath)1 Microservice (io.servicecomb.serviceregistry.api.registry.Microservice)1