Refactor network topologies listener of SH
[transportpce.git] / servicehandler / src / main / java / org / opendaylight / transportpce / servicehandler / service / ServiceDataStoreOperations.java
1 /*
2  * Copyright © 2017 Orange, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.transportpce.servicehandler.service;
9
10 import java.util.Optional;
11 import org.opendaylight.transportpce.common.OperationResult;
12 import org.opendaylight.transportpce.servicehandler.ServiceInput;
13 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestOutput;
14 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
15 import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev191129.AdminStates;
16 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateInput;
17 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.TempServiceCreateInput;
18 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.Services;
19 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.service.path.PathDescription;
20 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.ServicePathList;
21
22 /**
23  * OpenROADM Service operations API providing basic operations on services.
24  */
25 public interface ServiceDataStoreOperations {
26
27     /**
28      * initialize services DataStore.
29      */
30     void initialize();
31
32     /**
33      * get service by name.
34      *
35      * @param serviceName
36      *     unique name of the service
37      * @return Optional of Services
38      */
39     Optional<Services> getService(String serviceName);
40
41     /**
42      * get temp service by common-id.
43      *
44      * @param commonId
45      *     unique common-id of the service
46      * @return Optional of Services
47      */
48     Optional<org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.temp.service.list
49         .Services> getTempService(String commonId);
50
51     /**
52      * deleteService service by name.
53      *
54      * @param serviceName
55      *     unique name of the service
56      * @return result of Delete operation
57      */
58     OperationResult deleteService(String serviceName);
59
60     /**
61      * deleteService service by common-id.
62      *
63      * @param commonId
64      *     unique common-id of the service
65      * @return result of Delete operation
66      */
67     OperationResult deleteTempService(String commonId);
68
69     /**
70      * modifyService service attributes.
71      *
72      * @param serviceName
73      *     unique name of the service
74      * @param operationalState
75      *     operational state of service
76      * @param administrativeState
77      *     administrative state of service
78      * @return result of modifyService operation
79      */
80     OperationResult modifyService(String serviceName, State operationalState, AdminStates administrativeState);
81
82     /**
83      * modify Temp Service.
84      *
85      * @param commonId unique common-id of the service
86      * @param operationalState operational state of service
87      * @param administrativeState administrative state of service
88      * @return result of modifyTempService operation
89      */
90     OperationResult modifyTempService(String commonId, State operationalState, AdminStates administrativeState);
91
92     /**
93      * create new service entry.
94      *
95      * @param serviceCreateInput serviceCreateInput data for creation of service
96      * @return result of createService operation
97      */
98     OperationResult createService(ServiceCreateInput serviceCreateInput);
99
100     /**
101      * create new servicePath entry.
102      *
103      * @param serviceInput
104      *     ServiceInput data for creation of service
105      * @param outputFromPce
106      *     output from pce request which is used as input for creating of service.
107      * @return result of createServicePath operation
108      */
109     OperationResult createServicePath(ServiceInput serviceInput, PathComputationRequestOutput outputFromPce);
110
111     /**
112      * create new Temp service entry.
113      *
114      * @param tempServiceCreateInput tempServiceCreateInput data for creation of
115      *                               service
116      * @return result of createTempService operation
117      */
118     OperationResult createTempService(TempServiceCreateInput tempServiceCreateInput);
119
120     Optional<ServicePathList> getServicePaths();
121
122     OperationResult modifyServicePath(PathDescription pathDescription, String serviceName);
123
124     /**
125      * deleteServicePath by name.
126      *
127      * @param serviceName
128      *     unique name of the service
129      * @return result of Delete operation
130      */
131     OperationResult deleteServicePath(String serviceName);
132
133     /**
134      * All actions (createService|modifyService|deleteService) combined.
135      * This method exists only for backwards compatibility. It will be deleted once refactoring is done.
136      *
137      * @param serviceName
138      *     unique name of the service
139      * @param input ServiceCreateInput data
140      * @param output PathComputationRequestOutput data
141      * @param choice 0:modify, 1:delete, 2:write
142      * @return result of createService, deleteService, or modifyService operation
143      */
144     @Deprecated
145     String writeOrModifyOrDeleteServiceList(String serviceName, ServiceCreateInput input,
146                                             PathComputationRequestOutput output, int choice);
147
148 }