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;
23 import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
24 import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
25 import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel;
26 import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
27 import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel;
28 import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
29 import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity;
30 import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
31 import org.openecomp.sdc.versioning.dao.types.Version;
33 import java.util.Collection;
36 public interface VendorLicenseManager {
38 void validate(String vendorLicenseModelId, Version version);
40 VendorLicenseModelEntity createVendorLicenseModel(VendorLicenseModelEntity licenseModel);
42 void updateVendorLicenseModel(VendorLicenseModelEntity licenseModel);
44 VendorLicenseModelEntity getVendorLicenseModel(String vlmId, Version version);
46 void deleteVendorLicenseModel(String vlmId, Version version);
49 Collection<LicenseAgreementEntity> listLicenseAgreements(String vlmId, Version version);
51 LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement);
53 void updateLicenseAgreement(LicenseAgreementEntity licenseAgreement,
54 Set<String> addedFeatureGroupIds, Set<String> removedFeatureGroupIds);
56 LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version,
57 String licenseAgreementId);
59 void deleteLicenseAgreement(String vlmId, Version version, String licenseAgreementId);
62 Collection<FeatureGroupEntity> listFeatureGroups(String vlmId, Version version);
64 FeatureGroupEntity createFeatureGroup(FeatureGroupEntity fg);
66 void updateFeatureGroup(FeatureGroupEntity featureGroup,
67 Set<String> addedLicenseKeyGroups, Set<String> removedLicenseKeyGroups,
68 Set<String> addedEntitlementPools, Set<String> removedEntitlementPools);
70 FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup);
72 void deleteFeatureGroup(FeatureGroupEntity featureGroup);
75 Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version);
77 EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool);
79 void updateEntitlementPool(EntitlementPoolEntity entitlementPool);
81 EntitlementPoolEntity getEntitlementPool(EntitlementPoolEntity entitlementPool);
83 void deleteEntitlementPool(EntitlementPoolEntity entitlementPool);
86 Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version);
88 LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup);
90 void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup);
92 LicenseKeyGroupEntity getLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup);
94 void deleteLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup);
96 LimitEntity createLimit(LimitEntity limitEntity);
98 Collection<LimitEntity> listLimits(String vlmId, Version version, String epLkgId);
100 void deleteLimit(LimitEntity limitEntity);
102 void updateLimit(LimitEntity limitEntity);
104 LimitEntity getLimit(LimitEntity entitlementPool);