ecff0f56d689ca03d87c9a2bcb9ba4bbb8a04002
[sdc.git] / openecomp-be / lib / openecomp-sdc-vendor-license-lib / openecomp-sdc-vendor-license-api / src / main / java / org / openecomp / sdc / vendorlicense / facade / VendorLicenseFacade.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.facade;
22
23 import org.openecomp.sdc.common.errors.ErrorCode;
24 import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
25 import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
26 import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel;
27 import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
28 import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel;
29 import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
30 import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
31 import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
32 import org.openecomp.sdc.versioning.dao.types.Version;
33 import org.openecomp.sdc.versioning.types.VersionInfo;
34 import org.openecomp.sdc.versioning.types.VersionableEntityAction;
35
36 import java.util.Collection;
37
38 public interface VendorLicenseFacade {
39
40   Version checkin(String vendorLicenseModelId, String user);
41
42   Version submit(String vendorLicenseModelId, String user);
43
44   FeatureGroupEntity getFeatureGroup(FeatureGroupEntity featureGroup, String user);
45
46   FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup, String user);
47
48   LicenseAgreementEntity getLicenseAgreement(String vlmId, Version version,
49                                              String licenseAgreementId, String user);
50
51   LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version,
52                                                  String licenseAgreementId, String user);
53
54   EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
55
56   void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
57
58   Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version,
59                                                          String user);
60
61   Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version,
62                                                          String user);
63
64   void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
65
66   LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
67
68
69   VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version, String user);
70
71   VendorLicenseModelEntity createVendorLicenseModel(
72       VendorLicenseModelEntity vendorLicenseModelEntity, String user);
73
74
75   LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement,
76                                                 String user);
77
78   FeatureGroupEntity createFeatureGroup(FeatureGroupEntity featureGroup, String user);
79
80
81   Collection<ErrorCode> validateLicensingData(String vlmId, Version vlmVersion,
82                                               String licenseAgreementId,
83                                               Collection<String> featureGroupIds);
84
85   VersionInfo getVersionInfo(String vendorLicenseModelId, VersionableEntityAction action,
86                              String user);
87
88   void updateVlmLastModificationTime(String vendorLicenseModelId, Version version);
89 }