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;
12 import org.opendaylight.transportpce.common.OperationResult;
13 import org.opendaylight.transportpce.servicehandler.ServiceInput;
14 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestOutput;
15 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev181130.State;
16 import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev181130.AdminStates;
17 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateInput;
18 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.TempServiceCreateInput;
19 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.Services;
22 * OpenROADM Service operations API providing basic operations on services.
24 public interface ServiceDataStoreOperations {
27 * initialize services DataStore.
32 * get service by name.
35 * unique name of the service
36 * @return Optional of Services
38 Optional<Services> getService(String serviceName);
41 * get temp service by common-id.
44 * unique common-id of the service
45 * @return Optional of Services
47 Optional<org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.temp.service.list
48 .Services> getTempService(String commonId);
51 * deleteService service by name.
54 * unique name of the service
55 * @return result of Delete operation
57 OperationResult deleteService(String serviceName);
60 * deleteService service by common-id.
63 * unique common-id of the service
64 * @return result of Delete operation
66 OperationResult deleteTempService(String commonId);
69 * modifyService service attributes.
72 * unique name of the service
73 * @param operationalState
74 * operational state of service
75 * @param administrativeState
76 * administrative state of service
77 * @return result of modifyService operation
79 OperationResult modifyService(String serviceName, State operationalState, AdminStates administrativeState);
82 * modify Temp Service.
84 * @param commonId unique common-id of the service
85 * @param operationalState operational state of service
86 * @param administrativeState administrative state of service
87 * @return result of modifyTempService operation
89 OperationResult modifyTempService(String commonId, State operationalState, AdminStates administrativeState);
92 * create new service entry.
94 * @param serviceCreateInput serviceCreateInput data for creation of service
95 * @return result of createService operation
97 OperationResult createService(ServiceCreateInput serviceCreateInput);
100 * create new servicePath entry.
102 * @param serviceInput
103 * ServiceInput data for creation of service
104 * @param outputFromPce
105 * output from pce request which is used as input for creating of service.
106 * @return result of createServicePath operation
108 OperationResult createServicePath(ServiceInput serviceInput, PathComputationRequestOutput outputFromPce);
111 * create new Temp service entry.
113 * @param tempServiceCreateInput tempServiceCreateInput data for creation of
115 * @return result of createTempService operation
117 OperationResult createTempService(TempServiceCreateInput tempServiceCreateInput);
120 * deleteServicePath by name.
123 * unique name of the service
124 * @return result of Delete operation
126 OperationResult deleteServicePath(String serviceName);
129 * All actions (createService|modifyService|deleteService) combined.
130 * This method exists only for backwards compatibility. It will be deleted once refactoring is done.
133 * unique name of the service
134 * @param input ServiceCreateInput data
135 * @param output PathComputationRequestOutput data
136 * @param choice 0:modify, 1:delete, 2:write
137 * @return result of createService, deleteService, or modifyService operation
140 String writeOrModifyOrDeleteServiceList(String serviceName, ServiceCreateInput input,
141 PathComputationRequestOutput output, int choice);