ServiceHandler update for new PCE compatibility
[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.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
13 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.State;
14 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceCreateInput;
15 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.Services;
16
17 /**
18  * OpenROADM Service operations API providing basic operations on services.
19  */
20 public interface ServiceDataStoreOperations {
21
22     /**
23      * initialize services DataStore.
24      */
25     void initialize();
26
27     /**
28      * get service by name.
29      *
30      * @param serviceName
31      *   unique name of the service
32      * @return Optional of Services
33      */
34     Optional<Services> getService(String serviceName);
35
36     /**
37      * deleteService service by name.
38      *
39      * @param serviceName
40      *   unique name of the service
41      * @return result of Delete operation
42      */
43     OperationResult deleteService(String serviceName);
44
45     /**
46      * modifyService service attributes.
47      *
48      * @param serviceName
49      *   unique name of the service
50      * @param operationalState
51      *   operational state of service
52      * @param administrativeState
53      *   administrative state of service
54      * @return result of modifyService operation
55      */
56     OperationResult modifyService(String serviceName, State operationalState, State administrativeState);
57
58     /**
59      * create new service entry.
60      *
61      * @param serviceCreateInput
62      *   serviceCreateInput data for creation of service
63      * @param outputFromPce
64      *   output from pce request which is used as input for creating of service.
65      * @return result of createService operation
66      */
67     OperationResult createService(ServiceCreateInput serviceCreateInput, PathComputationRequestOutput outputFromPce);
68
69     /**
70      * create new servicePath entry.
71      *
72      * @param serviceCreateInput
73      *   serviceCreateInput data for creation of service
74      * @param outputFromPce
75      *   output from pce request which is used as input for creating of service.
76      * @return result of createServicePath operation
77      */
78     OperationResult createServicePath(ServiceCreateInput serviceCreateInput,
79         PathComputationRequestOutput outputFromPce);
80
81     /**
82      * deleteServicePath by name.
83      *
84      * @param serviceName
85      *   unique name of the service
86      * @return result of Delete operation
87      */
88     OperationResult deleteServicePath(String serviceName);
89
90     /**
91      * All actions (createService|modifyService|deleteService) combined.
92      * This method exists only for backwards compatibility. It will be deleted once refactoring is done.
93      *
94      * @param serviceName
95      *   unique name of the service
96      * @param input ServiceCreateInput data
97      * @param output PathComputationRequestOutput data
98      * @param choice 0:modify, 1:delete, 2:write
99      * @return result of createService, deleteService, or modifyService operation
100      */
101     @Deprecated
102     String writeOrModifyOrDeleteServiceList(String serviceName, ServiceCreateInput input,
103                                             PathComputationRequestOutput output, int choice);
104
105 }