private void getLinkedEnvironments(long accountId, Map<String, Long> links, Map<Long, Region> regionsIds, Map<String, ExternalProject> externalProjects) { List<AccountLink> accountLinks = objectManager.find(AccountLink.class, ACCOUNT_LINK.ACCOUNT_ID, accountId, ACCOUNT_LINK.REMOVED, null, ACCOUNT_LINK.LINKED_REGION_ID, new Condition(ConditionType.NOTNULL)); for (AccountLink link : accountLinks) { if (link.getState().equalsIgnoreCase(CommonStatesConstants.REMOVING)) { continue; } if(link.getState().equalsIgnoreCase(CommonStatesConstants.REMOVED)) { continue; } Region targetRegion = regionsIds.get(link.getLinkedRegionId()); if (targetRegion == null) { continue; } String UUID = getUUID(targetRegion.getName(), link.getLinkedAccount()); if (!externalProjects.containsKey(UUID)) { links.put(UUID, targetRegion.getId()); } } }
Region targetRegion = objectManager.loadResource(Region.class, link.getLinkedRegionId()); Region localRegion = objectManager.findAny(Region.class, REGION.LOCAL, true, REGION.REMOVED, null); if(localRegion == null) {
Region targetRegion = regionMap.get(link.getLinkedRegionId()); if(targetRegion == null) { objectProcessManager.executeStandardProcess(StandardProcess.REMOVE, link, null);
Region targetRegion = objectManager.loadResource(Region.class, link.getLinkedRegionId()); if(targetRegion == null) { return true;
/** * {@inheritDoc} */ @Override public void from(io.cattle.platform.core.model.AccountLink from) { setId(from.getId()); setName(from.getName()); setAccountId(from.getAccountId()); setKind(from.getKind()); setUuid(from.getUuid()); setDescription(from.getDescription()); setState(from.getState()); setCreated(from.getCreated()); setRemoved(from.getRemoved()); setRemoveTime(from.getRemoveTime()); setData(from.getData()); setLinkedAccountId(from.getLinkedAccountId()); setLinkedAccount(from.getLinkedAccount()); setLinkedRegionId(from.getLinkedRegionId()); setLinkedRegion(from.getLinkedRegion()); setExternal(from.getExternal()); }