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.versioning;
23 import org.openecomp.sdc.versioning.dao.types.Revision;
24 import org.openecomp.sdc.versioning.dao.types.Version;
25 import org.openecomp.sdc.versioning.types.VersionCreationMethod;
26 import org.openecomp.sdc.versioning.types.VersionInfo;
27 import org.openecomp.sdc.versioning.types.VersionableEntityAction;
28 import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
30 import java.util.List;
33 public interface VersioningManager {
35 void register(String entityType, VersionableEntityMetadata entityMetadata);
37 Version create(String entityType, String entityId, String user);
39 void delete(String entityType, String entityId, String user);
41 void undoDelete(String entityType, String entityId, String user);
43 Version checkout(String entityType, String entityId, String user);
45 Version undoCheckout(String entityType, String entityId, String user);
47 Version checkin(String entityType, String entityId, String user, String checkinDescription);
49 Version submit(String entityType, String entityId, String user, String submitDescription);
51 VersionInfo getEntityVersionInfo(String entityType, String entityId, String user,
52 VersionableEntityAction action);
54 Map<String, VersionInfo> listEntitiesVersionInfo(String entityType, String user,
55 VersionableEntityAction action);
57 Map<String, VersionInfo> listDeletedEntitiesVersionInfo(String entityType, String user,
58 VersionableEntityAction action);
61 List<Version> list(String itemId); // TODO: 5/24/2017 filter (by status for example)
63 Version get(String itemId, Version version);
65 Version create(String itemId, Version version,
66 VersionCreationMethod creationMethod);
68 void submit(String itemId, Version version, String submitDescription);
70 void publish(String itemId, Version version, String message);
72 void sync(String itemId, Version version);
74 void forceSync(String itemId, Version version);
76 void revert(String itemId, Version version, String revisionId);
78 List<Revision> listRevisions(String itemId, Version version);