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.rev171017.PathComputationRequestOutput;
15 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.State;
16 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceCreateInput;
17 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.TempServiceCreateInput;
18 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.Services;
21 * OpenROADM Service operations API providing basic operations on services.
23 public interface ServiceDataStoreOperations {
26 * initialize services DataStore.
31 * get service by name.
34 * unique name of the service
35 * @return Optional of Services
37 Optional<Services> getService(String serviceName);
40 * get temp service by common-id.
43 * unique common-id of the service
44 * @return Optional of Services
46 Optional<org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.temp.service.list
47 .Services> getTempService(String commonId);
50 * deleteService service by name.
53 * unique name of the service
54 * @return result of Delete operation
56 OperationResult deleteService(String serviceName);
59 * deleteService service by common-id.
62 * unique common-id of the service
63 * @return result of Delete operation
65 OperationResult deleteTempService(String commonId);
68 * modifyService service attributes.
71 * unique name of the service
72 * @param operationalState
73 * operational state of service
74 * @param administrativeState
75 * administrative state of service
76 * @return result of modifyService operation
78 OperationResult modifyService(String serviceName, State operationalState, State administrativeState);
81 * modify Temp Service.
83 * @param commonId unique common-id of the service
84 * @param operationalState operational state of service
85 * @param administrativeState administrative state of service
86 * @return result of modifyTempService operation
88 OperationResult modifyTempService(String commonId, State operationalState, State administrativeState);
91 * create new service entry.
93 * @param serviceCreateInput serviceCreateInput data for creation of service
94 * @return result of createService operation
96 OperationResult createService(ServiceCreateInput serviceCreateInput);
99 * create new servicePath entry.
101 * @param serviceInput
102 * ServiceInput data for creation of service
103 * @param outputFromPce
104 * output from pce request which is used as input for creating of service.
105 * @return result of createServicePath operation
107 OperationResult createServicePath(ServiceInput serviceInput, PathComputationRequestOutput outputFromPce);
110 * create new Temp service entry.
112 * @param tempServiceCreateInput tempServiceCreateInput data for creation of
114 * @return result of createTempService operation
116 OperationResult createTempService(TempServiceCreateInput tempServiceCreateInput);
119 * deleteServicePath by name.
122 * unique name of the service
123 * @return result of Delete operation
125 OperationResult deleteServicePath(String serviceName);
128 * All actions (createService|modifyService|deleteService) combined.
129 * This method exists only for backwards compatibility. It will be deleted once refactoring is done.
132 * unique name of the service
133 * @param input ServiceCreateInput data
134 * @param output PathComputationRequestOutput data
135 * @param choice 0:modify, 1:delete, 2:write
136 * @return result of createService, deleteService, or modifyService operation
139 String writeOrModifyOrDeleteServiceList(String serviceName, ServiceCreateInput input,
140 PathComputationRequestOutput output, int choice);