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.rev200128.PathComputationRequestOutput;
14 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev181130.State;
15 import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev181130.AdminStates;
16 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateInput;
17 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.TempServiceCreateInput;
18 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.Services;
19 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.service.path.PathDescription;
20 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.ServicePathList;
23 * OpenROADM Service operations API providing basic operations on services.
25 public interface ServiceDataStoreOperations {
28 * initialize services DataStore.
33 * get service by name.
36 * unique name of the service
37 * @return Optional of Services
39 Optional<Services> getService(String serviceName);
42 * get temp service by common-id.
45 * unique common-id of the service
46 * @return Optional of Services
48 Optional<org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.temp.service.list
49 .Services> getTempService(String commonId);
52 * deleteService service by name.
55 * unique name of the service
56 * @return result of Delete operation
58 OperationResult deleteService(String serviceName);
61 * deleteService service by common-id.
64 * unique common-id of the service
65 * @return result of Delete operation
67 OperationResult deleteTempService(String commonId);
70 * modifyService service attributes.
73 * unique name of the service
74 * @param operationalState
75 * operational state of service
76 * @param administrativeState
77 * administrative state of service
78 * @return result of modifyService operation
80 OperationResult modifyService(String serviceName, State operationalState, AdminStates administrativeState);
83 * modify Temp Service.
85 * @param commonId unique common-id of the service
86 * @param operationalState operational state of service
87 * @param administrativeState administrative state of service
88 * @return result of modifyTempService operation
90 OperationResult modifyTempService(String commonId, State operationalState, AdminStates administrativeState);
93 * create new service entry.
95 * @param serviceCreateInput serviceCreateInput data for creation of service
96 * @return result of createService operation
98 OperationResult createService(ServiceCreateInput serviceCreateInput);
101 * create new servicePath entry.
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
109 OperationResult createServicePath(ServiceInput serviceInput, PathComputationRequestOutput outputFromPce);
112 * create new Temp service entry.
114 * @param tempServiceCreateInput tempServiceCreateInput data for creation of
116 * @return result of createTempService operation
118 OperationResult createTempService(TempServiceCreateInput tempServiceCreateInput);
120 Optional<ServicePathList> getServicePaths();
122 OperationResult modifyServicePath(PathDescription pathDescription, String serviceName);
125 * deleteServicePath by name.
128 * unique name of the service
129 * @return result of Delete operation
131 OperationResult deleteServicePath(String serviceName);
134 * All actions (createService|modifyService|deleteService) combined.
135 * This method exists only for backwards compatibility. It will be deleted once refactoring is done.
138 * unique name of the service
139 * @param input ServiceCreateInput data
140 * @param output PathComputationRequestOutput data
141 * @param choice 0:modify, 1:delete, 2:write
142 * @return result of createService, deleteService, or modifyService operation
145 String writeOrModifyOrDeleteServiceList(String serviceName, ServiceCreateInput input,
146 PathComputationRequestOutput output, int choice);