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