2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.vendorlicense.impl;
23 import org.openecomp.core.util.UniqueValueUtil;
24 import org.openecomp.sdc.activityLog.ActivityLogManager;
25 import org.openecomp.sdc.activityLog.ActivityLogManagerFactory;
26 import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
27 import org.openecomp.sdc.common.errors.CoreException;
28 import org.openecomp.sdc.common.errors.ErrorCode;
29 import org.openecomp.sdc.datatypes.error.ErrorLevel;
30 import org.openecomp.sdc.logging.api.Logger;
31 import org.openecomp.sdc.logging.api.LoggerFactory;
32 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
33 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
34 import org.openecomp.sdc.logging.types.LoggerConstants;
35 import org.openecomp.sdc.logging.types.LoggerErrorCode;
36 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
37 import org.openecomp.sdc.logging.types.LoggerServiceName;
38 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
39 import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
40 import org.openecomp.sdc.vendorlicense.VendorLicenseManager;
41 import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao;
42 import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory;
43 import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao;
44 import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDaoFactory;
45 import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao;
46 import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDaoFactory;
47 import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao;
48 import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDaoFactory;
49 import org.openecomp.sdc.vendorlicense.dao.LimitDao;
50 import org.openecomp.sdc.vendorlicense.dao.LimitDaoFactory;
51 import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao;
52 import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDaoFactory;
53 import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
54 import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
55 import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel;
56 import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
57 import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel;
58 import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
59 import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity;
60 import org.openecomp.sdc.vendorlicense.dao.types.LimitType;
61 import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
62 import org.openecomp.sdc.vendorlicense.errors.InvalidDateErrorBuilder;
63 import org.openecomp.sdc.vendorlicense.errors.LimitErrorBuilder;
64 import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
65 import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory;
66 import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
67 import org.openecomp.sdc.versioning.VersioningManager;
68 import org.openecomp.sdc.versioning.VersioningManagerFactory;
69 import org.openecomp.sdc.versioning.VersioningUtil;
70 import org.openecomp.sdc.versioning.dao.types.Version;
71 import org.openecomp.sdc.versioning.dao.types.VersionStatus;
72 import org.openecomp.sdc.versioning.types.VersionInfo;
73 import org.openecomp.sdc.versioning.types.VersionableEntityAction;
74 import org.openecomp.sdcrests.activitylog.types.ActivityType;
76 import java.time.LocalDate;
77 import java.time.format.DateTimeFormatter;
78 import java.util.ArrayList;
79 import java.util.Collection;
80 import java.util.Iterator;
81 import java.util.List;
83 import java.util.Optional;
86 import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE;
88 public class VendorLicenseManagerImpl implements VendorLicenseManager {
89 private VersioningManager versioningManager;
90 private VendorLicenseFacade vendorLicenseFacade;
91 private VendorLicenseModelDao vendorLicenseModelDao;
92 private LicenseAgreementDao licenseAgreementDao;
93 private FeatureGroupDao featureGroupDao;
94 private EntitlementPoolDao entitlementPoolDao;
95 private LicenseKeyGroupDao licenseKeyGroupDao;
96 private LimitDao limitDao;
97 private ActivityLogManager activityLogManager;
99 private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
100 private static final Logger logger =
101 LoggerFactory.getLogger(VendorLicenseManagerImpl.class);
103 public VendorLicenseManagerImpl(VersioningManager versioningManager,
104 VendorLicenseFacade vendorLicenseFacade,
105 VendorLicenseModelDao vendorLicenseModelDao,
106 LicenseAgreementDao licenseAgreementDao,
107 FeatureGroupDao featureGroupDao,
108 EntitlementPoolDao entitlementPoolDao,
109 LicenseKeyGroupDao licenseKeyGroupDao,
110 ActivityLogManager activityLogManager,
112 this.versioningManager = versioningManager;
113 this.vendorLicenseFacade = vendorLicenseFacade;
114 this.vendorLicenseModelDao = vendorLicenseModelDao;
115 this.licenseAgreementDao = licenseAgreementDao;
116 this.featureGroupDao = featureGroupDao;
117 this.entitlementPoolDao = entitlementPoolDao;
118 this.licenseKeyGroupDao = licenseKeyGroupDao;
119 this.activityLogManager = activityLogManager;
120 this.limitDao = limitDao;
124 private static void sortVlmListByModificationTimeDescOrder(
125 List<VersionedVendorLicenseModel> vendorLicenseModels) {
126 vendorLicenseModels.sort((o1, o2) -> o2.getVendorLicenseModel().getWritetimeMicroSeconds()
127 .compareTo(o1.getVendorLicenseModel().getWritetimeMicroSeconds()));
131 public void checkout(String vendorLicenseModelId, String user) {
133 mdcDataDebugMessage.debugEntryMessage("VLM id", vendorLicenseModelId);
135 Version newVersion = versioningManager
136 .checkout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vendorLicenseModelId, user);
138 ActivityLogEntity activityLogEntity = new ActivityLogEntity(vendorLicenseModelId, String.valueOf(newVersion.getMajor()+1),
139 ActivityType.CHECKOUT.toString(), user, true, "", "");
140 activityLogManager.addActionLog(activityLogEntity, user);
142 newVersion.setStatus(VersionStatus.Locked);
143 vendorLicenseFacade.updateVlmLastModificationTime(vendorLicenseModelId, newVersion);
145 mdcDataDebugMessage.debugExitMessage("VLM id", vendorLicenseModelId);
149 public void undoCheckout(String vendorLicenseModelId, String user) {
151 mdcDataDebugMessage.debugEntryMessage("VLM id", vendorLicenseModelId);
153 Version newVersion = versioningManager
154 .undoCheckout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vendorLicenseModelId, user);
155 vendorLicenseFacade.updateVlmLastModificationTime(vendorLicenseModelId, newVersion);
157 mdcDataDebugMessage.debugExitMessage("VLM id", vendorLicenseModelId);
161 public void checkin(String vendorLicenseModelId, String user) {
163 mdcDataDebugMessage.debugEntryMessage("VLM id", vendorLicenseModelId);
165 Version newVersion = vendorLicenseFacade.checkin(vendorLicenseModelId, user);
167 ActivityLogEntity activityLogEntity = new ActivityLogEntity(vendorLicenseModelId,
168 String.valueOf(newVersion.getMajor()+1), ActivityType.CHECKIN.toString(), user, true, "", "");
169 activityLogManager.addActionLog(activityLogEntity, user);
171 mdcDataDebugMessage.debugExitMessage("VLM id", vendorLicenseModelId);
175 public void submit(String vendorLicenseModelId, String user) {
177 mdcDataDebugMessage.debugEntryMessage("VLM id", vendorLicenseModelId);
179 Version newVersion = vendorLicenseFacade.submit(vendorLicenseModelId, user);
181 ActivityLogEntity activityLogEntity = new ActivityLogEntity(vendorLicenseModelId, String.valueOf(newVersion.getMajor()),
182 ActivityType.SUBMIT.toString(), user, true, "", "");
183 activityLogManager.addActionLog(activityLogEntity, user);
185 mdcDataDebugMessage.debugExitMessage("VLM id", vendorLicenseModelId);
189 public Collection<VersionedVendorLicenseModel> listVendorLicenseModels(String versionFilter,
191 mdcDataDebugMessage.debugEntryMessage(null);
193 Map<String, VersionInfo> idToVersionsInfo = versioningManager
194 .listEntitiesVersionInfo(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, user,
195 VersionableEntityAction.Read);
197 List<VersionedVendorLicenseModel> vendorLicenseModels = new ArrayList<>();
198 for (Map.Entry<String, VersionInfo> entry : idToVersionsInfo.entrySet()) {
199 VersionInfo versionInfo = entry.getValue();
200 if (versionFilter != null && versionFilter.equals(VersionStatus.Final.name())) {
201 if (versionInfo.getLatestFinalVersion() == null) {
204 versionInfo.setActiveVersion(versionInfo.getLatestFinalVersion());
205 versionInfo.setStatus(VersionStatus.Final);
206 versionInfo.setLockingUser(null);
209 Version version = versionInfo.getActiveVersion();
210 if (user.equals(versionInfo.getLockingUser())) {
211 version.setStatus(VersionStatus.Locked);
215 VendorLicenseModelEntity vlm =
216 vendorLicenseModelDao.get(new VendorLicenseModelEntity(entry.getKey(), version));
218 VersionedVendorLicenseModel versionedVlm = new VersionedVendorLicenseModel();
219 versionedVlm.setVendorLicenseModel(vlm);
220 versionedVlm.setVersionInfo(versionInfo);
221 vendorLicenseModels.add(versionedVlm);
223 }catch(RuntimeException rte){
224 logger.error("Error trying to retrieve vlm["+entry.getKey()+"] version["+version.toString
231 sortVlmListByModificationTimeDescOrder(vendorLicenseModels);
233 mdcDataDebugMessage.debugExitMessage(null);
234 return vendorLicenseModels;
238 public VendorLicenseModelEntity createVendorLicenseModel(VendorLicenseModelEntity vendorLicenseModelEntity, String user) {
240 VendorLicenseModelEntity vendorLicenseModelCreated = vendorLicenseFacade.createVendorLicenseModel(vendorLicenseModelEntity, user);
242 ActivityLogEntity activityLogEntity = new ActivityLogEntity(vendorLicenseModelCreated.getId(),
243 String.valueOf(vendorLicenseModelCreated.getVersion().getMajor()+1),
244 ActivityType.CREATE_NEW.toString(), user, true, "", "");
245 activityLogManager.addActionLog(activityLogEntity, user);
247 return vendorLicenseModelCreated;
251 public void updateVendorLicenseModel(VendorLicenseModelEntity vendorLicenseModelEntity,
253 mdcDataDebugMessage.debugEntryMessage("VLM id", vendorLicenseModelEntity.getId());
255 Version version = resloveVersion(vendorLicenseModelEntity.getId(),null,
256 getVersionInfo(vendorLicenseModelEntity.getId(), VersionableEntityAction.Write, user),
258 vendorLicenseModelEntity.setVersion(version);
260 String existingVendorName = vendorLicenseModelDao.get(vendorLicenseModelEntity).getVendorName();
262 updateUniqueName(VendorLicenseConstants.UniqueValues.VENDOR_NAME, existingVendorName,
263 vendorLicenseModelEntity.getVendorName());
264 vendorLicenseModelDao.update(vendorLicenseModelEntity);
267 .updateVlmLastModificationTime(vendorLicenseModelEntity.getId(), version);
269 mdcDataDebugMessage.debugExitMessage("VLM id", vendorLicenseModelEntity.getId());
273 public VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version,
275 return vendorLicenseFacade.getVendorLicenseModel(vlmId, version, user);
279 public void deleteVendorLicenseModel(String vlmId, String user) {
280 MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
281 LoggerTragetServiceName.DELETE_ENTITY, ErrorLevel.ERROR.name(),
282 LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.UNSUPPORTED_OPERATION);
283 throw new UnsupportedOperationException(VendorLicenseConstants.UNSUPPORTED_OPERATION_ERROR);
287 public Collection<LicenseAgreementEntity> listLicenseAgreements(String vlmId, Version version,
289 mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
290 mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
291 LicenseAgreementEntity licenseAgreementEntity = createLicenseAgreementForList(vlmId, version,
293 // return licenseAgreementDao.list(new LicenseAgreementEntity(vlmId, VersioningUtil
294 // .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user), user),
296 return licenseAgreementDao.list(licenseAgreementEntity);
300 public LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement,
303 .debugEntryMessage("VLM id", licenseAgreement.getVendorLicenseModelId());
305 .debugExitMessage("VLM id", licenseAgreement.getVendorLicenseModelId());
306 return vendorLicenseFacade.createLicenseAgreement(licenseAgreement, user);
310 public void updateLicenseAgreement(LicenseAgreementEntity licenseAgreement,
311 Set<String> addedFeatureGroupIds,
312 Set<String> removedFeatureGroupIds, String user) {
313 mdcDataDebugMessage.debugEntryMessage("VLM id, LA id", licenseAgreement
314 .getVendorLicenseModelId(), licenseAgreement.getId());
316 Version version = VersioningUtil.resolveVersion(licenseAgreement.getVersion(),
317 getVersionInfo(licenseAgreement.getVendorLicenseModelId(), VersionableEntityAction.Write,
319 licenseAgreement.setVersion(version);
320 LicenseAgreementEntity retrieved = licenseAgreementDao.get(licenseAgreement);
322 .validateEntityExistence(retrieved, licenseAgreement, VendorLicenseModelEntity.ENTITY_TYPE);
323 VersioningUtil.validateContainedEntitiesExistence(new FeatureGroupEntity().getEntityType(),
324 removedFeatureGroupIds, retrieved, retrieved.getFeatureGroupIds());
325 VersioningUtil.validateEntitiesExistence(addedFeatureGroupIds,
326 new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(), version, null),
327 featureGroupDao, VendorLicenseModelEntity.ENTITY_TYPE);
329 updateUniqueName(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME,
330 retrieved.getName(), licenseAgreement.getName(), licenseAgreement.getVendorLicenseModelId(),
331 licenseAgreement.getVersion().toString());
332 licenseAgreementDao.updateColumnsAndDeltaFeatureGroupIds(licenseAgreement, addedFeatureGroupIds,
333 removedFeatureGroupIds);
335 addFeatureGroupsToLicenseAgreementRef(addedFeatureGroupIds, licenseAgreement);
336 removeFeatureGroupsToLicenseAgreementRef(removedFeatureGroupIds, licenseAgreement);
339 .updateVlmLastModificationTime(licenseAgreement.getVendorLicenseModelId(), version);
341 mdcDataDebugMessage.debugExitMessage("VLM id, LA id", licenseAgreement
342 .getVendorLicenseModelId(), licenseAgreement.getId());
346 public LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version,
347 String licenseAgreementId, String user) {
349 mdcDataDebugMessage.debugEntryMessage("VLM id, LA id", vlmId, licenseAgreementId);
350 mdcDataDebugMessage.debugExitMessage("VLM id, LA id", vlmId, licenseAgreementId);
351 return vendorLicenseFacade.getLicenseAgreementModel(vlmId, version, licenseAgreementId, user);
355 public void deleteLicenseAgreement(String vlmId, Version version, String licenseAgreementId,
357 mdcDataDebugMessage.debugEntryMessage("VLM id, LA id", vlmId, licenseAgreementId);
359 version = VersioningUtil
360 .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Write, user), user);
361 LicenseAgreementEntity input =
362 new LicenseAgreementEntity(vlmId, version, licenseAgreementId);
363 LicenseAgreementEntity retrieved = licenseAgreementDao.get(input);
364 VersioningUtil.validateEntityExistence(retrieved, input, VendorLicenseModelEntity.ENTITY_TYPE);
366 removeFeatureGroupsToLicenseAgreementRef(retrieved.getFeatureGroupIds(), retrieved);
368 licenseAgreementDao.delete(retrieved);
370 deleteUniqueName(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME,
371 retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
372 retrieved.getName());
375 .updateVlmLastModificationTime(input.getVendorLicenseModelId(), input.getVersion());
377 mdcDataDebugMessage.debugExitMessage("VLM id, LA id", vlmId, licenseAgreementId);
381 public Collection<FeatureGroupEntity> listFeatureGroups(String vlmId, Version version,
383 mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
384 mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
385 return vendorLicenseFacade.listFeatureGroups(vlmId, version, user);
389 public FeatureGroupEntity createFeatureGroup(FeatureGroupEntity featureGroup, String user) {
391 .debugEntryMessage("VLM id", featureGroup.getVendorLicenseModelId());
392 mdcDataDebugMessage.debugExitMessage("VLM id", featureGroup.getId());
393 return vendorLicenseFacade.createFeatureGroup(featureGroup, user);
397 public void updateFeatureGroup(FeatureGroupEntity featureGroup,
398 Set<String> addedLicenseKeyGroups,
399 Set<String> removedLicenseKeyGroups,
400 Set<String> addedEntitlementPools,
401 Set<String> removedEntitlementPools,
403 mdcDataDebugMessage.debugEntryMessage("VLM id, FG id", featureGroup
404 .getVendorLicenseModelId(), featureGroup.getId());
406 Version version = VersioningUtil.resolveVersion(featureGroup.getVersion(),
407 getVersionInfo(featureGroup.getVendorLicenseModelId(), VersionableEntityAction.Write, user),
409 featureGroup.setVersion(version);
411 FeatureGroupEntity retrieved = featureGroupDao.get(featureGroup);
413 .validateEntityExistence(retrieved, featureGroup, VendorLicenseModelEntity.ENTITY_TYPE);
415 VersioningUtil.validateContainedEntitiesExistence(new LicenseKeyGroupEntity().getEntityType(),
416 removedLicenseKeyGroups, retrieved, retrieved.getLicenseKeyGroupIds());
417 VersioningUtil.validateContainedEntitiesExistence(new EntitlementPoolEntity().getEntityType(),
418 removedEntitlementPools, retrieved, retrieved.getEntitlementPoolIds());
420 VersioningUtil.validateEntitiesExistence(addedLicenseKeyGroups,
421 new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(), version, null),
422 licenseKeyGroupDao, VendorLicenseModelEntity.ENTITY_TYPE);
423 VersioningUtil.validateEntitiesExistence(addedEntitlementPools,
424 new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(), version, null),
425 entitlementPoolDao, VendorLicenseModelEntity.ENTITY_TYPE);
427 updateUniqueName(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME,
428 retrieved.getName(), featureGroup.getName(), featureGroup.getVendorLicenseModelId(),
429 featureGroup.getVersion().toString());
431 addLicenseKeyGroupsToFeatureGroupsRef(addedLicenseKeyGroups, featureGroup);
432 removeLicenseKeyGroupsToFeatureGroupsRef(removedLicenseKeyGroups, featureGroup);
433 addEntitlementPoolsToFeatureGroupsRef(addedEntitlementPools, featureGroup);
434 removeEntitlementPoolsToFeatureGroupsRef(removedEntitlementPools, featureGroup);
436 featureGroupDao.updateFeatureGroup(featureGroup, addedEntitlementPools, removedEntitlementPools,
437 addedLicenseKeyGroups, removedLicenseKeyGroups);
440 .updateVlmLastModificationTime(featureGroup.getVendorLicenseModelId(), version);
442 mdcDataDebugMessage.debugExitMessage("VLM id, FG id", featureGroup
443 .getVendorLicenseModelId(), featureGroup.getId());
447 public FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup, String user) {
448 mdcDataDebugMessage.debugEntryMessage("VLM id, FG id",
449 featureGroup.getVendorLicenseModelId(), featureGroup.getId());
451 mdcDataDebugMessage.debugExitMessage("VLM id, FG id",
452 featureGroup.getVendorLicenseModelId(), featureGroup.getId());
453 return vendorLicenseFacade.getFeatureGroupModel(featureGroup, user);
457 public void deleteFeatureGroup(FeatureGroupEntity featureGroup, String user) {
458 mdcDataDebugMessage.debugEntryMessage("VLM id, FG id",
459 featureGroup.getVendorLicenseModelId(), featureGroup.getId());
461 Version version = VersioningUtil.resolveVersion(featureGroup.getVersion(),
462 getVersionInfo(featureGroup.getVendorLicenseModelId(), VersionableEntityAction.Write,
464 featureGroup.setVersion(version);
465 FeatureGroupEntity retrieved = featureGroupDao.get(featureGroup);
467 .validateEntityExistence(retrieved, featureGroup, VendorLicenseModelEntity.ENTITY_TYPE);
469 removeLicenseKeyGroupsToFeatureGroupsRef(retrieved.getLicenseKeyGroupIds(), featureGroup);
470 removeEntitlementPoolsToFeatureGroupsRef(retrieved.getEntitlementPoolIds(), featureGroup);
472 for (String licenceAgreementId : retrieved.getReferencingLicenseAgreements()) {
473 licenseAgreementDao.removeFeatureGroup(
474 new LicenseAgreementEntity(featureGroup.getVendorLicenseModelId(), version,
475 licenceAgreementId), featureGroup.getId());
478 featureGroupDao.delete(featureGroup);
480 deleteUniqueName(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME,
481 retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
482 retrieved.getName());
484 vendorLicenseFacade.updateVlmLastModificationTime(featureGroup.getVendorLicenseModelId(),
485 featureGroup.getVersion());
488 .debugExitMessage("VLM id, FG id",
489 featureGroup.getVendorLicenseModelId(), featureGroup.getId());
493 public Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version,
495 mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
496 mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
497 return vendorLicenseFacade.listEntitlementPools(vlmId, version, user);
501 public EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool,
504 .debugEntryMessage("VLM id", entitlementPool.getVendorLicenseModelId());
506 .debugExitMessage("VLM id", entitlementPool.getVendorLicenseModelId());
508 entitlementPool.setStartDate(entitlementPool.getStartDate() != null ? (entitlementPool
509 .getStartDate().trim().length() != 0 ? entitlementPool.getStartDate()+"T00:00:00Z"
511 entitlementPool.setExpiryDate(entitlementPool.getExpiryDate() != null ? (entitlementPool
512 .getExpiryDate().trim().length() != 0 ? entitlementPool.getExpiryDate()+"T23:59:59Z"
515 validateCreateDate(entitlementPool.getStartDate(), entitlementPool.getExpiryDate(),
516 entitlementPool.getVendorLicenseModelId());
517 return vendorLicenseFacade.createEntitlementPool(entitlementPool, user);
520 private void validateCreateDate(String startDate, String expiryDate, String vendorLicenseModelId){
521 mdcDataDebugMessage.debugEntryMessage("Start date and end date", startDate
524 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy'T'HH:mm:ss'Z'");
526 if(startDate != null && expiryDate != null) {
527 if (LocalDate.parse(startDate, formatter).atStartOfDay().isBefore
528 (LocalDate.now().atStartOfDay()) || LocalDate.parse(expiryDate, formatter).atStartOfDay()
529 .isEqual(LocalDate.parse(startDate, formatter).atStartOfDay()) || LocalDate
530 .parse(expiryDate, formatter).isBefore(LocalDate.parse(startDate, formatter))) {
531 MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
532 LoggerTragetServiceName.VALIDATE_DATE_RANGE,ErrorLevel.ERROR.name(),
533 LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
534 throw new CoreException(
535 new InvalidDateErrorBuilder(vendorLicenseModelId)
540 if(startDate != null && expiryDate == null) {
541 if (LocalDate.parse(startDate, formatter).atStartOfDay().isBefore
542 (LocalDate.now().atStartOfDay())) {
543 MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
544 LoggerTragetServiceName.VALIDATE_DATE_RANGE,ErrorLevel.ERROR.name(),
545 LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
546 throw new CoreException(
547 new InvalidDateErrorBuilder(vendorLicenseModelId)
552 if(startDate == null && expiryDate != null) {
553 MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
554 LoggerTragetServiceName.VALIDATE_DATE_RANGE,ErrorLevel.ERROR.name(),
555 LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
556 throw new CoreException(
557 new InvalidDateErrorBuilder(vendorLicenseModelId)
562 mdcDataDebugMessage.debugExitMessage(null,null);
565 private void validateUpdateDate(String startDate, String expiryDate, String vendorLicenseModelId){
566 mdcDataDebugMessage.debugEntryMessage("Start date and end date", startDate
569 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy'T'HH:mm:ss'Z'");
571 if(startDate != null && expiryDate != null) {
572 if (LocalDate.parse(expiryDate, formatter).atStartOfDay()
573 .isEqual(LocalDate.parse(startDate, formatter).atStartOfDay()) ||
574 LocalDate.parse(expiryDate, formatter).isBefore(LocalDate.parse(startDate, formatter))) {
575 MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
576 LoggerTragetServiceName.VALIDATE_DATE_RANGE,ErrorLevel.ERROR.name(),
577 LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
578 throw new CoreException(
579 new InvalidDateErrorBuilder(vendorLicenseModelId)
584 if(startDate == null && expiryDate != null) {
585 MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
586 LoggerTragetServiceName.VALIDATE_DATE_RANGE,ErrorLevel.ERROR.name(),
587 LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
588 throw new CoreException(
589 new InvalidDateErrorBuilder(vendorLicenseModelId)
594 mdcDataDebugMessage.debugExitMessage(null,null);
598 public void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user) {
599 mdcDataDebugMessage.debugEntryMessage("VLM id, EP id", entitlementPool
600 .getVendorLicenseModelId(), entitlementPool.getId());
602 entitlementPool.setStartDate(entitlementPool.getStartDate() != null ? (entitlementPool
603 .getStartDate().trim().length() != 0 ? entitlementPool.getStartDate()+"T00:00:00Z"
605 entitlementPool.setExpiryDate(entitlementPool.getExpiryDate() != null ? (entitlementPool
606 .getExpiryDate().trim().length() != 0 ? entitlementPool.getExpiryDate()+"T23:59:59Z"
609 validateUpdateDate(entitlementPool.getStartDate(), entitlementPool.getExpiryDate(),
610 entitlementPool.getVendorLicenseModelId());
611 Version version = VersioningUtil.resolveVersion(entitlementPool.getVersion(),
612 getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Write,
615 .updateVlmLastModificationTime(entitlementPool.getVendorLicenseModelId(), version);
616 vendorLicenseFacade.updateEntitlementPool(entitlementPool, user);
618 mdcDataDebugMessage.debugExitMessage("VLM id, EP id", entitlementPool
619 .getVendorLicenseModelId(), entitlementPool.getId());
623 public EntitlementPoolEntity getEntitlementPool(EntitlementPoolEntity entitlementPool,
625 mdcDataDebugMessage.debugEntryMessage("VLM id, EP id", entitlementPool
626 .getVendorLicenseModelId(), entitlementPool.getId());
628 entitlementPool.setVersion(VersioningUtil.resolveVersion(entitlementPool.getVersion(),
629 getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Read,
632 EntitlementPoolEntity retrieved = entitlementPoolDao.get(entitlementPool);
634 .validateEntityExistence(retrieved, entitlementPool, VendorLicenseModelEntity.ENTITY_TYPE);
636 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy'T'HH:mm:ss'Z'");
637 DateTimeFormatter targetFormatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
638 if(retrieved.getStartDate() != null){
639 retrieved.setStartDate(LocalDate.parse(retrieved.getStartDate(),formatter).format
643 if(retrieved.getExpiryDate() != null){
644 retrieved.setExpiryDate(LocalDate.parse(retrieved.getExpiryDate(),formatter).format
648 mdcDataDebugMessage.debugExitMessage("VLM id, EP id", entitlementPool
649 .getVendorLicenseModelId(), entitlementPool.getId());
654 public void deleteEntitlementPool(EntitlementPoolEntity entitlementPool, String user) {
655 mdcDataDebugMessage.debugEntryMessage("VLM id, EP id", entitlementPool
656 .getVendorLicenseModelId(), entitlementPool.getId());
658 Version version = VersioningUtil.resolveVersion(entitlementPool.getVersion(),
659 getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Write,
661 entitlementPool.setVersion(version);
663 EntitlementPoolEntity retrieved = entitlementPoolDao.get(entitlementPool);
665 .validateEntityExistence(retrieved, entitlementPool, VendorLicenseModelEntity.ENTITY_TYPE);
667 for (String referencingFeatureGroupId : retrieved.getReferencingFeatureGroups()) {
668 featureGroupDao.removeEntitlementPool(
669 new FeatureGroupEntity(entitlementPool.getVendorLicenseModelId(), version,
670 referencingFeatureGroupId), entitlementPool.getId());
673 deleteChildLimits(entitlementPool.getVendorLicenseModelId(), entitlementPool.getVersion(), entitlementPool.getId(), user);
675 entitlementPoolDao.delete(entitlementPool);
677 deleteUniqueName(VendorLicenseConstants.UniqueValues.ENTITLEMENT_POOL_NAME,
678 retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
679 retrieved.getName());
681 vendorLicenseFacade.updateVlmLastModificationTime(entitlementPool.getVendorLicenseModelId(),
682 entitlementPool.getVersion());
684 mdcDataDebugMessage.debugExitMessage("VLM id, EP id", entitlementPool
685 .getVendorLicenseModelId(), entitlementPool.getId());
688 protected void deleteChildLimits(String vlmId, Version version, String epLkgId, String user) {
689 Optional<Collection<LimitEntity>> limitEntities = Optional.ofNullable(
690 listLimits(vlmId, version, epLkgId, user));
691 limitEntities.ifPresent(entities->
692 entities.forEach(entity->
693 deleteLimit(entity, user)));
697 public Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version,
699 mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
700 mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
701 return vendorLicenseFacade.listLicenseKeyGroups(vlmId, version, user);
705 public LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup,
708 .debugEntryMessage("VLM id", licenseKeyGroup.getVendorLicenseModelId());
710 mdcDataDebugMessage.debugExitMessage("VLM id", licenseKeyGroup
711 .getVendorLicenseModelId());
713 licenseKeyGroup.setStartDate(licenseKeyGroup.getStartDate() != null ? (licenseKeyGroup
714 .getStartDate().trim().length() != 0 ? licenseKeyGroup.getStartDate()+"T00:00:00Z"
716 licenseKeyGroup.setExpiryDate(licenseKeyGroup.getExpiryDate() != null ? (licenseKeyGroup
717 .getExpiryDate().trim().length() != 0 ? licenseKeyGroup.getExpiryDate()+"T23:59:59Z"
720 validateCreateDate(licenseKeyGroup.getStartDate(), licenseKeyGroup.getExpiryDate(),
721 licenseKeyGroup.getVendorLicenseModelId());
722 return vendorLicenseFacade.createLicenseKeyGroup(licenseKeyGroup, user);
726 public void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user) {
727 mdcDataDebugMessage.debugEntryMessage("VLM id, LKG id", licenseKeyGroup
728 .getVendorLicenseModelId(), licenseKeyGroup.getId());
730 licenseKeyGroup.setStartDate(licenseKeyGroup.getStartDate() != null ? (licenseKeyGroup
731 .getStartDate().trim().length() != 0 ? licenseKeyGroup.getStartDate()+"T00:00:00Z"
733 licenseKeyGroup.setExpiryDate(licenseKeyGroup.getExpiryDate() != null ? (licenseKeyGroup
734 .getExpiryDate().trim().length() != 0 ? licenseKeyGroup.getExpiryDate()+"T23:59:59Z"
737 validateUpdateDate(licenseKeyGroup.getStartDate(), licenseKeyGroup.getExpiryDate(),
738 licenseKeyGroup.getVendorLicenseModelId());
740 Version version = VersioningUtil.resolveVersion(licenseKeyGroup.getVersion(),
741 getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Write,
744 .updateVlmLastModificationTime(licenseKeyGroup.getVendorLicenseModelId(), version);
746 vendorLicenseFacade.updateLicenseKeyGroup(licenseKeyGroup, user);
748 mdcDataDebugMessage.debugExitMessage("VLM id, LKG id", licenseKeyGroup
749 .getVendorLicenseModelId(), licenseKeyGroup.getId());
753 public LicenseKeyGroupEntity getLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup,
755 mdcDataDebugMessage.debugEntryMessage("VLM id, LKG id", licenseKeyGroup
756 .getVendorLicenseModelId(), licenseKeyGroup.getId());
758 licenseKeyGroup.setVersion(VersioningUtil.resolveVersion(licenseKeyGroup.getVersion(),
759 getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Read,
762 LicenseKeyGroupEntity retrieved = licenseKeyGroupDao.get(licenseKeyGroup);
764 .validateEntityExistence(retrieved, licenseKeyGroup, VendorLicenseModelEntity.ENTITY_TYPE);
766 mdcDataDebugMessage.debugExitMessage("VLM id, LKG id", licenseKeyGroup
767 .getVendorLicenseModelId(), licenseKeyGroup.getId());
772 public void deleteLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user) {
773 mdcDataDebugMessage.debugEntryMessage("VLM id, LKG id", licenseKeyGroup
774 .getVendorLicenseModelId(), licenseKeyGroup.getId());
776 Version version = VersioningUtil.resolveVersion(licenseKeyGroup.getVersion(),
777 getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Write,
779 licenseKeyGroup.setVersion(version);
781 LicenseKeyGroupEntity retrieved = licenseKeyGroupDao.get(licenseKeyGroup);
783 .validateEntityExistence(retrieved, licenseKeyGroup, VendorLicenseModelEntity.ENTITY_TYPE);
785 for (String referencingFeatureGroupId : retrieved.getReferencingFeatureGroups()) {
786 featureGroupDao.removeLicenseKeyGroup(
787 new FeatureGroupEntity(licenseKeyGroup.getVendorLicenseModelId(), version,
788 referencingFeatureGroupId), licenseKeyGroup.getId());
791 deleteChildLimits(licenseKeyGroup.getVendorLicenseModelId(), licenseKeyGroup.getVersion(), licenseKeyGroup.getId(), user);
793 licenseKeyGroupDao.delete(licenseKeyGroup);
795 deleteUniqueName(VendorLicenseConstants.UniqueValues.LICENSE_KEY_GROUP_NAME,
796 retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
797 retrieved.getName());
799 vendorLicenseFacade.updateVlmLastModificationTime(licenseKeyGroup.getVendorLicenseModelId(),
800 licenseKeyGroup.getVersion());
802 mdcDataDebugMessage.debugExitMessage("VLM id, LKG id", licenseKeyGroup
803 .getVendorLicenseModelId(), licenseKeyGroup.getId());
807 public LimitEntity createLimit(LimitEntity limit, String user) {
809 .debugEntryMessage("VLM id", limit.getVendorLicenseModelId(), "EP/LKGId", limit
812 .debugExitMessage("VLM id", limit.getVendorLicenseModelId(), "EP/LKGId", limit
814 validateLimit(limit, user);
815 return vendorLicenseFacade.createLimit(limit, user);
818 private void validateLimit(LimitEntity limit, String user) {
819 Version version = VersioningUtil.resolveVersion(limit.getVersion(),
820 getVersionInfo(limit.getVendorLicenseModelId(), VersionableEntityAction.Write,
822 Collection<LimitEntity> limitList = listLimits(limit.getVendorLicenseModelId(),version
823 ,limit.getEpLkgId(), user);
825 if (!isLimitNameUnique(limitList,limit.getName(), limit.getType(), limit.getId())) {
826 final ErrorCode duplicateLimitNameErrorBuilder =
827 LimitErrorBuilder.getDuplicateNameErrorbuilder(limit.getName(), limit.getType().name());
828 MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
829 LoggerServiceName.Create_LIMIT.toString(), ErrorLevel.ERROR.name(),
830 LoggerErrorCode.DATA_ERROR.getErrorCode(),
831 duplicateLimitNameErrorBuilder.message());
832 throw new CoreException(duplicateLimitNameErrorBuilder);
836 private boolean isLimitNameUnique(Collection<LimitEntity> limitList, String name, LimitType
838 for (LimitEntity limit : limitList) {
839 if(limit.getName().equalsIgnoreCase(name) &&
840 limit.getType().name().equalsIgnoreCase(type.name())) {
841 if(id != null && limit.getId().equals(id)){
851 public Collection<LimitEntity> listLimits(String vlmId, Version version, String epLkgId,
853 mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId, "EP/LKGId", epLkgId);
854 mdcDataDebugMessage.debugExitMessage("VLM id", vlmId, "EP/LKGId", epLkgId);
855 return vendorLicenseFacade.listLimits(vlmId, version, epLkgId, user);
859 public void deleteLimit(LimitEntity limitEntity, String user) {
860 mdcDataDebugMessage.debugEntryMessage("VLM id, EP id, Limit Id", limitEntity
861 .getVendorLicenseModelId(), limitEntity.getEpLkgId(), limitEntity.getId());
863 Version version = VersioningUtil.resolveVersion(limitEntity.getVersion(),
864 getVersionInfo(limitEntity.getVendorLicenseModelId(), VersionableEntityAction.Write,
866 limitEntity.setVersion(version);
868 if(!isLimitPresent(limitEntity)){
870 .validateEntityExistence(null, limitEntity, VendorLicenseModelEntity.ENTITY_TYPE);
872 LimitEntity retrieved = limitDao.get(limitEntity);
874 .validateEntityExistence(retrieved, limitEntity, VendorLicenseModelEntity.ENTITY_TYPE);
876 limitDao.delete(limitEntity);
878 vendorLicenseFacade.updateVlmLastModificationTime(limitEntity.getVendorLicenseModelId(),
879 limitEntity.getVersion());
881 mdcDataDebugMessage.debugExitMessage("VLM id, EP id, Limit Id", limitEntity
882 .getVendorLicenseModelId(), limitEntity.getEpLkgId(), limitEntity.getId());
886 public void updateLimit(LimitEntity limit, String user) {
888 .debugEntryMessage("VLM id", limit.getVendorLicenseModelId(), "EP/LKGId", limit
890 getLimit(limit,user);
891 validateLimit(limit, user);
892 vendorLicenseFacade.updateLimit(limit, user);
894 .debugExitMessage("VLM id", limit.getVendorLicenseModelId(), "EP/LKGId", limit
898 private boolean isLimitPresent(LimitEntity limit) {
899 return limitDao.isLimitPresent(limit);
903 public LimitEntity getLimit(LimitEntity limitEntity,
905 mdcDataDebugMessage.debugEntryMessage("VLM id", limitEntity.getVendorLicenseModelId(),
906 "EP/LKGId", limitEntity.getEpLkgId());
908 limitEntity.setVersion(VersioningUtil.resolveVersion(limitEntity.getVersion(),
909 getVersionInfo(limitEntity.getVendorLicenseModelId(), VersionableEntityAction.Read,
911 if(!isLimitPresent(limitEntity)){
913 .validateEntityExistence(null, limitEntity, VendorLicenseModelEntity.ENTITY_TYPE);
915 LimitEntity retrieved = limitDao.get(limitEntity);
917 .validateEntityExistence(retrieved, limitEntity, VendorLicenseModelEntity.ENTITY_TYPE);
919 mdcDataDebugMessage.debugExitMessage("VLM id", limitEntity.getVendorLicenseModelId(),
920 "EP/LKGId", limitEntity.getEpLkgId());
924 protected void addFeatureGroupsToLicenseAgreementRef(Set<String> featureGroupIds,
925 LicenseAgreementEntity licenseAgreement) {
926 if (featureGroupIds != null) {
927 for (String featureGroupId : featureGroupIds) {
928 featureGroupDao.addReferencingLicenseAgreement(
929 new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(),
930 licenseAgreement.getVersion(), featureGroupId), licenseAgreement.getId());
935 protected void removeFeatureGroupsToLicenseAgreementRef(Set<String> featureGroupIds,
936 LicenseAgreementEntity licenseAgreement) {
937 if (featureGroupIds != null) {
938 for (String featureGroupId : featureGroupIds) {
939 featureGroupDao.removeReferencingLicenseAgreement(
940 new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(),
941 licenseAgreement.getVersion(), featureGroupId), licenseAgreement.getId());
946 protected void addLicenseKeyGroupsToFeatureGroupsRef(Set<String> licenseKeyGroupIds,
947 FeatureGroupEntity featureGroup) {
948 if (licenseKeyGroupIds != null) {
949 for (String licenseKeyGroupId : licenseKeyGroupIds) {
950 licenseKeyGroupDao.addReferencingFeatureGroup(
951 new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(),
952 featureGroup.getVersion(), licenseKeyGroupId), featureGroup.getId());
957 protected void removeLicenseKeyGroupsToFeatureGroupsRef(Set<String> licenseKeyGroupIds,
958 FeatureGroupEntity featureGroup) {
959 if (licenseKeyGroupIds != null) {
960 for (String licenseKeyGroupId : licenseKeyGroupIds) {
961 licenseKeyGroupDao.removeReferencingFeatureGroup(
962 new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(),
963 featureGroup.getVersion(), licenseKeyGroupId), featureGroup.getId());
968 protected void addEntitlementPoolsToFeatureGroupsRef(Set<String> entitlementPoolIds,
969 FeatureGroupEntity featureGroup) {
970 if (entitlementPoolIds != null) {
971 for (String entitlementPoolId : entitlementPoolIds) {
972 entitlementPoolDao.addReferencingFeatureGroup(
973 new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(),
974 featureGroup.getVersion(), entitlementPoolId), featureGroup.getId());
979 protected void removeEntitlementPoolsToFeatureGroupsRef(Set<String> entitlementPoolIds,
980 FeatureGroupEntity featureGroup) {
981 if (entitlementPoolIds != null) {
982 for (String entitlementPoolId : entitlementPoolIds) {
983 entitlementPoolDao.removeReferencingFeatureGroup(
984 new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(),
985 featureGroup.getVersion(), entitlementPoolId), featureGroup.getId());
990 protected VersionInfo getVersionInfo(String vendorLicenseModelId, VersionableEntityAction action,
992 return vendorLicenseFacade.getVersionInfo(vendorLicenseModelId, action, user);
995 protected LicenseAgreementEntity createLicenseAgreementForList(String vlmId, Version version,
997 return new LicenseAgreementEntity(vlmId, VersioningUtil
998 .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user), user),
1002 protected void updateUniqueName(String uniqueValueType ,String oldName, String newName,String ...
1005 .updateUniqueValue(uniqueValueType, oldName, newName,context);
1008 protected void deleteUniqueName(String uniqueValueType,String ... uniqueCombination) {
1009 UniqueValueUtil.deleteUniqueValue(uniqueValueType, uniqueCombination);
1012 protected Version resloveVersion(String vlmId,Version requestedVersion, VersionInfo versionInfo,
1014 return VersioningUtil.resolveVersion(null,
1015 getVersionInfo(vlmId, VersionableEntityAction.Write, user), user);