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