Add customer name to pathComputationRequest input
[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.rev240205.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.rev230526.ServiceCreateInput;
17 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceList;
18 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.TempServiceCreateInput;
19 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.list.Services;
20 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev220118.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.rev230526.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      * @param pathDescription data to update the transport-assignment of the service
128      * @return result of createTempService operation
129      */
130     OperationResult createTempService(TempServiceCreateInput tempServiceCreateInput,
131                                       org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev240205
132                                               .service.path.rpc.result.PathDescription pathDescription);
133
134     Optional<ServicePathList> getServicePaths();
135
136     OperationResult modifyServicePath(PathDescription pathDescription, String serviceName);
137
138     /**
139      * deleteServicePath by name.
140      *
141      * @param serviceName
142      *     unique name of the service
143      * @return result of Delete operation
144      */
145     OperationResult deleteServicePath(String serviceName);
146
147     /**
148      * All actions (createService|modifyService|deleteService) combined.
149      * This method exists only for backwards compatibility. It will be deleted once refactoring is done.
150      *
151      * @param serviceName
152      *     unique name of the service
153      * @param input ServiceCreateInput data
154      * @param output PathComputationRequestOutput data
155      * @param choice 0:modify, 1:delete, 2:write
156      * @return result of createService, deleteService, or modifyService operation
157      */
158     @Deprecated
159     String writeOrModifyOrDeleteServiceList(String serviceName, ServiceCreateInput input,
160                                             PathComputationRequestOutput output, int choice);
161
162 }