2 * Copyright © 2017 Orange, Inc. and others. All rights reserved.
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
8 package org.opendaylight.transportpce.servicehandler.service;
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.rev220118.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.rev211210.ServiceCreateInput;
17 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceList;
18 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.TempServiceCreateInput;
19 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.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;
25 * OpenROADM Service operations API providing basic operations on services.
27 public interface ServiceDataStoreOperations {
30 * initialize services DataStore.
35 * get service by name.
38 * unique name of the service
39 * @return Optional of Services
41 Optional<Services> getService(String serviceName);
44 * get all OR services.
46 * @return Optional of Services
48 Optional<ServiceList> getServices();
51 * get temp service by common-id.
54 * unique common-id of the service
55 * @return Optional of Services
57 Optional<org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.temp.service.list
58 .Services> getTempService(String commonId);
61 * deleteService service by name.
64 * unique name of the service
65 * @return result of Delete operation
67 OperationResult deleteService(String serviceName);
70 * deleteService service by common-id.
73 * unique common-id of the service
74 * @return result of Delete operation
76 OperationResult deleteTempService(String commonId);
79 * modifyService service attributes.
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
89 OperationResult modifyService(String serviceName, State operationalState, AdminStates administrativeState);
92 * modify Temp Service.
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
99 OperationResult modifyTempService(String commonId, State operationalState, AdminStates administrativeState);
102 * create new service entry.
104 * @param serviceCreateInput serviceCreateInput data for creation of service
105 * @return result of createService operation
107 OperationResult createService(ServiceCreateInput serviceCreateInput);
109 Optional<ServicePaths> getServicePath(String serviceName);
112 * create new servicePath entry.
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
120 OperationResult createServicePath(ServiceInput serviceInput, PathComputationRequestOutput outputFromPce);
123 * create new Temp service entry.
125 * @param tempServiceCreateInput tempServiceCreateInput data for creation of
127 * @return result of createTempService operation
129 OperationResult createTempService(TempServiceCreateInput tempServiceCreateInput);
131 Optional<ServicePathList> getServicePaths();
133 OperationResult modifyServicePath(PathDescription pathDescription, String serviceName);
136 * deleteServicePath by name.
139 * unique name of the service
140 * @return result of Delete operation
142 OperationResult deleteServicePath(String serviceName);
145 * All actions (createService|modifyService|deleteService) combined.
146 * This method exists only for backwards compatibility. It will be deleted once refactoring is done.
149 * unique name of the service
150 * @param input ServiceCreateInput data
151 * @param output PathComputationRequestOutput data
152 * @param choice 0:modify, 1:delete, 2:write
153 * @return result of createService, deleteService, or modifyService operation
156 String writeOrModifyOrDeleteServiceList(String serviceName, ServiceCreateInput input,
157 PathComputationRequestOutput output, int choice);