[SDC] Onboarding 1710 rebase.
[sdc.git] / openecomp-be / backend / openecomp-sdc-vendor-license-manager / src / main / java / org / openecomp / sdc / vendorlicense / VendorLicenseManager.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.openecomp.sdc.vendorlicense;
22
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.vendorlicense.errors.LimitErrorBuilder;
32 import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
33 import org.openecomp.sdc.versioning.dao.types.Version;
34
35 import java.util.Collection;
36 import java.util.Set;
37
38 public interface VendorLicenseManager {
39
40   void checkout(String vendorLicenseModelId, String user);
41
42   void undoCheckout(String vendorLicenseModelId, String user);
43
44   void checkin(String vendorLicenseModelId, String user);
45
46   void submit(String vendorLicenseModelId, String user);
47
48   Collection<VersionedVendorLicenseModel> listVendorLicenseModels(String versionFilter,
49                                                                   String user);
50
51   VendorLicenseModelEntity createVendorLicenseModel(VendorLicenseModelEntity licenseModel,
52                                                     String user);
53
54   void updateVendorLicenseModel(VendorLicenseModelEntity licenseModel, String user);
55
56   VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version, String user);
57
58   void deleteVendorLicenseModel(String vlmId, String user);
59
60
61   Collection<LicenseAgreementEntity> listLicenseAgreements(String vlmId, Version version,
62                                                            String user);
63
64   LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement,
65                                                 String user);
66
67   void updateLicenseAgreement(LicenseAgreementEntity licenseAgreement,
68                               Set<String> addedFeatureGroupIds, Set<String> removedFeatureGroupIds,
69                               String user);
70
71   LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version,
72                                                  String licenseAgreementId, String user);
73
74   void deleteLicenseAgreement(String vlmId, Version version, String licenseAgreementId, String user);
75
76
77   Collection<FeatureGroupEntity> listFeatureGroups(String vlmId, Version version, String user);
78
79   FeatureGroupEntity createFeatureGroup(FeatureGroupEntity fg, String user);
80
81   void updateFeatureGroup(FeatureGroupEntity featureGroup,
82                           Set<String> addedLicenseKeyGroups, Set<String> removedLicenseKeyGroups,
83                           Set<String> addedEntitlementPools, Set<String> removedEntitlementPools,
84                           String user);
85
86   FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup, String user);
87
88   void deleteFeatureGroup(FeatureGroupEntity featureGroup, String user);
89
90
91   Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version,
92                                                          String user);
93
94   EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
95
96   void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
97
98   EntitlementPoolEntity getEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
99
100   void deleteEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
101
102
103   Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version,
104                                                          String user);
105
106   LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
107
108   void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
109
110   LicenseKeyGroupEntity getLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
111
112   void deleteLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
113
114   LimitEntity createLimit(LimitEntity limitEntity, String user);
115
116   Collection<LimitEntity> listLimits(String vlmId, Version version, String epLkgId, String user);
117
118   void deleteLimit(LimitEntity limitEntity, String user);
119
120   void updateLimit(LimitEntity limitEntity, String user);
121
122   LimitEntity getLimit(LimitEntity entitlementPool, String user);
123
124 }