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.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;
18 * OpenROADM Service operations API providing basic operations on services.
20 public interface ServiceDataStoreOperations {
23 * initialize services DataStore.
28 * get service by name.
31 * unique name of the service
32 * @return Optional of Services
34 Optional<Services> getService(String serviceName);
37 * deleteService service by name.
40 * unique name of the service
41 * @return result of Delete operation
43 OperationResult deleteService(String serviceName);
46 * modifyService service attributes.
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
56 OperationResult modifyService(String serviceName, State operationalState, State administrativeState);
59 * create new service entry.
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
67 OperationResult createService(ServiceCreateInput serviceCreateInput, PathComputationRequestOutput outputFromPce);
70 * create new servicePath entry.
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
78 OperationResult createServicePath(ServiceCreateInput serviceCreateInput,
79 PathComputationRequestOutput outputFromPce);
82 * deleteServicePath by name.
85 * unique name of the service
86 * @return result of Delete operation
88 OperationResult deleteServicePath(String serviceName);
91 * All actions (createService|modifyService|deleteService) combined.
92 * This method exists only for backwards compatibility. It will be deleted once refactoring is done.
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
102 String writeOrModifyOrDeleteServiceList(String serviceName, ServiceCreateInput input,
103 PathComputationRequestOutput output, int choice);