|
|
|
@ -23,6 +23,7 @@ import com.google.common.util.concurrent.ListenableFuture; |
|
|
|
import com.google.common.util.concurrent.MoreExecutors; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.codec.binary.Base64; |
|
|
|
import org.bouncycastle.util.test.FixedSecureRandom; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.cache.Cache; |
|
|
|
import org.springframework.cache.CacheManager; |
|
|
|
@ -730,6 +731,11 @@ public class EdgeServiceImpl extends AbstractEntityService implements EdgeServic |
|
|
|
throw new DataValidationException("Edge with such name already exists!"); |
|
|
|
} |
|
|
|
); |
|
|
|
edgeDao.findByRoutingKey(edge.getTenantId().getId(), edge.getRoutingKey()).ifPresent( |
|
|
|
d -> { |
|
|
|
throw new DataValidationException("Edge with such routing_key already exists"); |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -743,13 +749,20 @@ public class EdgeServiceImpl extends AbstractEntityService implements EdgeServic |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
edgeDao.findByRoutingKey(edge.getTenantId().getId(), edge.getRoutingKey()).ifPresent( |
|
|
|
e -> { |
|
|
|
if (!e.getUuidId().equals(edge.getUuidId())) { |
|
|
|
throw new DataValidationException("Edge with such routing_key already exists!"); |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void validateDataImpl(TenantId tenantId, Edge edge) { |
|
|
|
if (StringUtils.isEmpty(edge.getType())) { |
|
|
|
throw new DataValidationException("Edge type should be specified!"); |
|
|
|
throw new DataValidationException("Edge typeshould be specified!"); |
|
|
|
} |
|
|
|
if (StringUtils.isEmpty(edge.getName())) { |
|
|
|
throw new DataValidationException("Edge name should be specified!"); |
|
|
|
|