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