0120d9004f226ab95a92fd5e6f9f450980d4fdfc
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / md / ModelDrivenSwitch.java
1 /**
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.openflowplugin.api.openflow.md;
9
10 import com.google.common.base.Optional;
11 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
12 import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionContext;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsService;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsService;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsService;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.NodeConfigService;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.service.rev131107.SalPortService;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsService;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.OpendaylightQueueStatisticsService;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService;
28 import org.opendaylight.yangtools.concepts.CompositeObjectRegistration;
29 import org.opendaylight.yangtools.concepts.Identifiable;
30 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
31
32 import java.math.BigInteger;
33
34 /**
35  * interface concatenating all md-sal services provided by OF-switch
36  */
37 public interface ModelDrivenSwitch
38         extends
39         SalGroupService,
40         SalFlowService,
41         SalMeterService, SalTableService, SalPortService, PacketProcessingService, NodeConfigService,
42         OpendaylightGroupStatisticsService, OpendaylightMeterStatisticsService, OpendaylightFlowStatisticsService,
43         OpendaylightPortStatisticsService, OpendaylightFlowTableStatisticsService, OpendaylightQueueStatisticsService,
44         Identifiable<InstanceIdentifier<Node>> {
45
46     /**
47      * @param rpcProviderRegistry
48      * @return wrapped list of {service provider + path} registration couples
49      */
50     CompositeObjectRegistration<ModelDrivenSwitch> register(RpcProviderRegistry rpcProviderRegistry);
51
52     /**
53      * @return id of encapsulated node (served by this impl)
54      */
55     NodeId getNodeId();
56
57     /**
58      * returnes the session context associated with this model-driven switch
59      *
60      * @return session context object
61      */
62     SessionContext getSessionContext();
63
64     /**
65      * Returns whether this *instance* is entity owner or not
66      * @return true if it's entity owner, else false.
67      */
68     boolean isEntityOwner();
69
70     /**
71      * Set entity ownership satus of this switch in *this* instance
72      * @param isOwner
73      */
74     void setEntityOwnership(boolean isOwner);
75
76     /**
77      * Send table feature to the switch to get tables features for all the tables.
78      * @return Transaction id
79      */
80     Optional<BigInteger> sendEmptyTableFeatureRequest();
81
82     /**
83      * Method send port/desc multipart request to the switch to fetch the initial details.
84      */
85
86     public abstract void requestSwitchDetails();
87
88 }