Modify spectrum assignment management in PCE
[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.rev210701.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.ServiceList;
18 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.TempServiceCreateInput;
19 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.Services;
20 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.service.path.PathDescription;
21 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.ServicePathList;
22 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePaths;
23
24 /**
25  * OpenROADM Service operations API providing basic operations on services.
26  */
27 public interface ServiceDataStoreOperations {
28
29     /**
30      * initialize services DataStore.
31      */
32     void initialize();
33
34     /**
35      * get service by name.
36      *
37      * @param serviceName
38      *     unique name of the service
39      * @return Optional of Services
40      */
41     Optional<Services> getService(String serviceName);
42
43     /**
44      * get all OR services.
45      *
46      * @return Optional of Services
47      */
48     Optional<ServiceList> getServices();
49
50     /**
51      * get temp service by common-id.
52      *
53      * @param commonId
54      *     unique common-id of the service
55      * @return Optional of Services
56      */
57     Optional<org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.temp.service.list
58         .Services> getTempService(String commonId);
59
60     /**
61      * deleteService service by name.
62      *
63      * @param serviceName
64      *     unique name of the service
65      * @return result of Delete operation
66      */
67     OperationResult deleteService(String serviceName);
68
69     /**
70      * deleteService service by common-id.
71      *
72      * @param commonId
73      *     unique common-id of the service
74      * @return result of Delete operation
75      */
76     OperationResult deleteTempService(String commonId);
77
78     /**
79      * modifyService service attributes.
80      *
81      * @param serviceName
82      *     unique name of the service
83      * @param operationalState
84      *     operational state of service
85      * @param administrativeState
86      *     administrative state of service
87      * @return result of modifyService operation
88      */
89     OperationResult modifyService(String serviceName, State operationalState, AdminStates administrativeState);
90
91     /**
92      * modify Temp Service.
93      *
94      * @param commonId unique common-id of the service
95      * @param operationalState operational state of service
96      * @param administrativeState administrative state of service
97      * @return result of modifyTempService operation
98      */
99     OperationResult modifyTempService(String commonId, State operationalState, AdminStates administrativeState);
100
101     /**
102      * create new service entry.
103      *
104      * @param serviceCreateInput serviceCreateInput data for creation of service
105      * @return result of createService operation
106      */
107     OperationResult createService(ServiceCreateInput serviceCreateInput);
108
109     Optional<ServicePaths> getServicePath(String serviceName);
110
111     /**
112      * create new servicePath entry.
113      *
114      * @param serviceInput
115      *     ServiceInput data for creation of service
116      * @param outputFromPce
117      *     output from pce request which is used as input for creating of service.
118      * @return result of createServicePath operation
119      */
120     OperationResult createServicePath(ServiceInput serviceInput, PathComputationRequestOutput outputFromPce);
121
122     /**
123      * create new Temp service entry.
124      *
125      * @param tempServiceCreateInput tempServiceCreateInput data for creation of
126      *                               service
127      * @return result of createTempService operation
128      */
129     OperationResult createTempService(TempServiceCreateInput tempServiceCreateInput);
130
131     Optional<ServicePathList> getServicePaths();
132
133     OperationResult modifyServicePath(PathDescription pathDescription, String serviceName);
134
135     /**
136      * deleteServicePath by name.
137      *
138      * @param serviceName
139      *     unique name of the service
140      * @return result of Delete operation
141      */
142     OperationResult deleteServicePath(String serviceName);
143
144     /**
145      * All actions (createService|modifyService|deleteService) combined.
146      * This method exists only for backwards compatibility. It will be deleted once refactoring is done.
147      *
148      * @param serviceName
149      *     unique name of the service
150      * @param input ServiceCreateInput data
151      * @param output PathComputationRequestOutput data
152      * @param choice 0:modify, 1:delete, 2:write
153      * @return result of createService, deleteService, or modifyService operation
154      */
155     @Deprecated
156     String writeOrModifyOrDeleteServiceList(String serviceName, ServiceCreateInput input,
157                                             PathComputationRequestOutput output, int choice);
158
159 }