private synchronized IIInstance loadIIInstance(String path) throws IOException { ResourceStore store = getStore(); logger.debug("Loading IIInstance " + store.getReadableResourcePath(path)); IIInstance IIInstance = null; try { IIInstance = store.getResource(path, IIInstance.class, II_SERIALIZER); IIInstance.setConfig(config); if (StringUtils.isBlank(IIInstance.getName())) throw new IllegalStateException("IIInstance name must not be blank"); iiMap.putLocal(IIInstance.getName(), IIInstance); for (IISegment segment : IIInstance.getSegments()) { usedStorageLocation.add(segment.getName()); } return IIInstance; } catch (Exception e) { logger.error("Error during load ii instance " + path, e); return null; } }
public static IIInstance create(String iiName, String projectName, IIDesc iiDesc) { IIInstance iii = new IIInstance(); iii.setConfig(iiDesc.getConfig()); iii.setName(iiName); iii.setDescName(iiDesc.getName()); iii.setCreateTimeUTC(System.currentTimeMillis()); iii.setStatus(RealizationStatusEnum.DISABLED); iii.updateRandomUuid(); return iii; }
private synchronized IIInstance reloadIILocalAt(String path) throws IOException { ResourceStore store = getStore(); logger.debug("Loading IIInstance " + store.getReadableResourcePath(path)); IIInstance ii = null; try { ii = store.getResource(path, IIInstance.class, II_SERIALIZER); ii.setConfig(config); if (StringUtils.isBlank(ii.getName())) throw new IllegalStateException("IIInstance name must not be blank"); iiMap.putLocal(ii.getName(), ii); for (IISegment segment : ii.getSegments()) { usedStorageLocation.put(ii.getName().toUpperCase(), segment.getStorageLocationIdentifier()); } return ii; } catch (Exception e) { logger.error("Error during load ii instance " + path, e); return null; } }
public static IIInstance create(String iiName, String projectName, IIDesc iiDesc) { IIInstance iii = new IIInstance(); iii.setConfig(iiDesc.getConfig()); iii.setName(iiName); iii.setDescName(iiDesc.getName()); iii.setCreateTimeUTC(System.currentTimeMillis()); iii.setStatus(RealizationStatusEnum.DISABLED); iii.updateRandomUuid(); return iii; }