/** * {@inheritDoc} */ @Override @Transactional @MethodLog public void saveLabelToCmr(AbstractStorageLabel<?> storageLabel) { storageLabelDataDao.saveLabel(storageLabel); }
/** * {@inheritDoc} */ @Override @Transactional @MethodLog public void saveLabelsToCmr(Collection<AbstractStorageLabel<?>> storageLabels) { for (AbstractStorageLabel<?> label : storageLabels) { storageLabelDataDao.saveLabel(label); } }
/** * {@inheritDoc} */ @Override @Transactional @MethodLog public StorageData addLabelsToStorage(StorageData storageData, Collection<AbstractStorageLabel<?>> storageLabels, boolean doOverwrite) throws BusinessException { try { for (AbstractStorageLabel<?> storageLabel : storageLabels) { storageManager.addLabelToStorage(storageData, storageLabel, doOverwrite); storageLabelDataDao.saveLabel(storageLabel); } return storageManager.getStorageData(storageData.getId()); } catch (SerializationException e) { throw new TechnicalException("Add labels to the storage " + storageData + ".", StorageErrorCodeEnum.SERIALIZATION_FAILED, e); } catch (IOException e) { throw new TechnicalException("Add labels to the storage " + storageData + ".", StorageErrorCodeEnum.INPUT_OUTPUT_OPERATION_FAILED, e); } }
/** * {@inheritDoc} */ @Override @MethodLog public StorageData addLabelToStorage(StorageData storageData, AbstractStorageLabel<?> storageLabel, boolean doOverwrite) throws BusinessException { try { storageManager.addLabelToStorage(storageData, storageLabel, doOverwrite); storageLabelDataDao.saveLabel(storageLabel); return storageManager.getStorageData(storageData.getId()); } catch (SerializationException e) { throw new TechnicalException("Add a label to the storage " + storageData + ".", StorageErrorCodeEnum.SERIALIZATION_FAILED, e); } catch (IOException e) { throw new TechnicalException("Add a label to the storage " + storageData + ".", StorageErrorCodeEnum.INPUT_OUTPUT_OPERATION_FAILED, e); } }