use of com.ctrip.framework.apollo.common.dto.NamespaceLockDTO in project apollo by ctripcorp.
the class NamespaceController method getNamespaceLock.
@RequestMapping(value = "/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/lock", method = RequestMethod.GET)
public OpenNamespaceLockDTO getNamespaceLock(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName) {
NamespaceDTO namespace = namespaceService.loadNamespaceBaseInfo(appId, Env.fromString(env), clusterName, namespaceName);
NamespaceLockDTO lockDTO = namespaceLockService.getNamespaceLock(appId, Env.fromString(env), clusterName, namespaceName);
return OpenApiBeanUtils.transformFromNamespaceLockDTO(namespace.getNamespaceName(), lockDTO);
}
use of com.ctrip.framework.apollo.common.dto.NamespaceLockDTO in project apollo by ctripcorp.
the class ServerNamespaceOpenApiService method getNamespaceLock.
@Override
public OpenNamespaceLockDTO getNamespaceLock(String appId, String env, String clusterName, String namespaceName) {
NamespaceDTO namespace = namespaceService.loadNamespaceBaseInfo(appId, Env.valueOf(env), clusterName, namespaceName);
NamespaceLockDTO lockDTO = namespaceLockService.getNamespaceLock(appId, Env.valueOf(env), clusterName, namespaceName);
return OpenApiBeanUtils.transformFromNamespaceLockDTO(namespace.getNamespaceName(), lockDTO);
}
use of com.ctrip.framework.apollo.common.dto.NamespaceLockDTO in project apollo by ctripcorp.
the class NamespaceLockService method getNamespaceLockInfo.
public LockInfo getNamespaceLockInfo(String appId, Env env, String clusterName, String namespaceName) {
LockInfo lockInfo = new LockInfo();
NamespaceLockDTO namespaceLockDTO = namespaceLockAPI.getNamespaceLockOwner(appId, env, clusterName, namespaceName);
String lockOwner = namespaceLockDTO == null ? "" : namespaceLockDTO.getDataChangeCreatedBy();
lockInfo.setLockOwner(lockOwner);
lockInfo.setEmergencyPublishAllowed(portalConfig.isEmergencyPublishAllowed(env));
return lockInfo;
}
Aggregations