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.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;
20 * OpenROADM Service operations API providing basic operations on services.
22 public interface ServiceDataStoreOperations {
25 * initialize services DataStore.
30 * get service by name.
33 * unique name of the service
34 * @return Optional of Services
36 Optional<Services> getService(String serviceName);
39 * get temp service by common-id.
42 * unique common-id of the service
43 * @return Optional of Services
45 Optional<org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.temp.service.list
46 .Services> getTempService(String commonId);
49 * deleteService service by name.
52 * unique name of the service
53 * @return result of Delete operation
55 OperationResult deleteService(String serviceName);
58 * deleteService service by common-id.
61 * unique common-id of the service
62 * @return result of Delete operation
64 OperationResult deleteTempService(String commonId);
67 * modifyService service attributes.
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
77 OperationResult modifyService(String serviceName, State operationalState, State administrativeState);
80 * modify Temp Service.
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
87 OperationResult modifyTempService(String commonId, State operationalState, State administrativeState);
90 * create new service entry.
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
98 OperationResult createService(ServiceCreateInput serviceCreateInput, PathComputationRequestOutput outputFromPce);
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
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
120 OperationResult createTempService(TempServiceCreateInput tempServiceCreateInput,
121 PathComputationRequestOutput outputFromPce);
124 * deleteServicePath by name.
127 * unique name of the service
128 * @return result of Delete operation
130 OperationResult deleteServicePath(String serviceName);
133 * All actions (createService|modifyService|deleteService) combined.
134 * This method exists only for backwards compatibility. It will be deleted once refactoring is done.
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
144 String writeOrModifyOrDeleteServiceList(String serviceName, ServiceCreateInput input,
145 PathComputationRequestOutput output, int choice);