Checkstyle enforcer 47/447/2
authorGiovanni Meo <gmeo@cisco.com>
Fri, 7 Jun 2013 21:17:55 +0000 (23:17 +0200)
committerEd Warnicke <eaw@cisco.com>
Sat, 8 Jun 2013 05:24:20 +0000 (22:24 -0700)
Started to enforce checkstyle, if the code style doesn't match the
checkstyle settings build will break. This is needed in order to make
sure folks comply to one code style and don't start diverging.

For now the enforcement is only limited to:
- make sure no TABS are present in the java files
- make sure that no trailing whitespaces are present

Along with code style enforcement updates all the files that didn't
comply else compilation would not be successful.

Added new exclusion in .gitignore

Change-Id: Ic95da373575cec3cfe0c99b31fce92f66bc41263
Signed-off-by: Giovanni Meo <gmeo@cisco.com>
227 files changed:
.gitignore
opendaylight/arphandler/src/test/java/org/opendaylight/controller/arphandler/internal/ArphandlerTest.java
opendaylight/clustering/integrationtest/src/test/resources/logback.xml
opendaylight/clustering/test/src/test/java/org/opendaylight/controller/clustering/test/internal/TestClusteringTest.java
opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/Acceptor.java
opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/AggregateTransformer.java
opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/CompositeClassBasedTransformer.java
opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/InputClassBasedTransformer.java
opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/RuleBasedTransformer.java
opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/SimpleConditionalTransformer.java
opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/transform/Transformer.java
opendaylight/commons/integrationtest/logback.xml [new file with mode: 0644]
opendaylight/commons/integrationtest/space_and_tabs_checks.xml [new file with mode: 0644]
opendaylight/commons/integrationtest/sun_coding_style.xml [new file with mode: 0644]
opendaylight/commons/opendaylight/pom.xml
opendaylight/commons/opendaylight/space_and_tabs_checks.xml [new file with mode: 0644]
opendaylight/configuration/implementation/src/main/java/org/opendaylight/controller/configuration/internal/ConfigurationContainerImpl.java
opendaylight/configuration/implementation/src/main/java/org/opendaylight/controller/configuration/internal/ConfigurationImpl.java
opendaylight/configuration/implementation/src/test/java/org/opendaylight/controller/configuration/internal/ConfigurationAwareTest.java
opendaylight/configuration/implementation/src/test/java/org/opendaylight/controller/configuration/internal/ConfigurationContainerAwareTest.java
opendaylight/configuration/implementation/src/test/java/org/opendaylight/controller/configuration/internal/ConfigurationContainerImplTest.java
opendaylight/configuration/implementation/src/test/java/org/opendaylight/controller/configuration/internal/ConfigurationImplTest.java
opendaylight/containermanager/api/src/main/java/org/opendaylight/controller/containermanager/IContainerManager.java
opendaylight/containermanager/implementation/src/test/java/org/opendaylight/controller/containermanager/internal/ContainerImplTest.java
opendaylight/containermanager/implementation/src/test/java/org/opendaylight/controller/containermanager/internal/ContainerManagerTest.java
opendaylight/forwarding/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/IForwardingStaticRouting.java
opendaylight/forwarding/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/StaticRouteConfig.java
opendaylight/forwarding/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/internal/StaticRoutingImplementation.java
opendaylight/forwarding/staticrouting/src/test/java/org/opendaylight/controller/forwarding/staticrouting/StaticRouteConfigTest.java
opendaylight/forwarding/staticrouting/src/test/java/org/opendaylight/controller/forwarding/staticrouting/StaticRouteTest.java
opendaylight/forwarding/staticrouting/src/test/java/org/opendaylight/controller/forwarding/staticrouting/internal/StaticRoutingImplementationTest.java
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/FlowEntry.java
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/FlowEntryInstall.java
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/IForwardingRulesManager.java
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/IForwardingRulesManagerAware.java
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/PortGroup.java
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/PortGroupChangeListener.java
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/PortGroupConfig.java
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/PortGroupProvider.java
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/Activator.java
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManagerImpl.java
opendaylight/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/IfHostListener.java
opendaylight/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/IfIptoHost.java
opendaylight/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/IfNewHostNotify.java
opendaylight/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/hostAware/IHostFinder.java
opendaylight/hosttracker/api/src/test/java/org/opendaylight/controller/hosttracker/hostAware/HostNodeConnectorTest.java
opendaylight/hosttracker/implementation/src/main/java/org/opendaylight/controller/hosttracker/internal/HostTrackerCallable.java
opendaylight/hosttracker/implementation/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerTest.java
opendaylight/logging/bridge/src/main/java/org/opendaylight/controller/logging/bridge/internal/Activator.java
opendaylight/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/exception/package-info.java
opendaylight/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/utils/NorthboundUtils.java
opendaylight/northbound/flowprogrammer/src/main/java/org/opendaylight/controller/flowprogrammer/northbound/FlowConfigs.java
opendaylight/northbound/flowprogrammer/src/main/java/org/opendaylight/controller/flowprogrammer/northbound/FlowProgrammerNorthbound.java
opendaylight/northbound/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/northbound/HostTrackerNorthbound.java
opendaylight/northbound/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/northbound/Hosts.java
opendaylight/northbound/integrationtest/src/test/java/org/opendaylight/controller/northbound/integrationtest/NorthboundIT.java
opendaylight/northbound/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/northbound/StaticRoutes.java
opendaylight/northbound/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/northbound/StaticRoutingNorthbound.java
opendaylight/northbound/statistics/src/main/java/org/opendaylight/controller/statistics/northbound/AllFlowStatistics.java
opendaylight/northbound/statistics/src/main/java/org/opendaylight/controller/statistics/northbound/AllPortStatistics.java
opendaylight/northbound/statistics/src/main/java/org/opendaylight/controller/statistics/northbound/FlowStatistics.java
opendaylight/northbound/statistics/src/main/java/org/opendaylight/controller/statistics/northbound/PortStatistics.java
opendaylight/northbound/statistics/src/main/java/org/opendaylight/controller/statistics/northbound/StatisticsNorthbound.java
opendaylight/northbound/subnets/src/main/java/org/opendaylight/controller/subnets/northbound/SubnetConfigs.java
opendaylight/northbound/subnets/src/main/java/org/opendaylight/controller/subnets/northbound/SubnetsNorthboundJAXRS.java
opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/NodeConnectors.java
opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/Nodes.java
opendaylight/northbound/switchmanager/src/test/java/org/opendaylight/controller/switchmanager/northbound/SwitchManagerNorthboundTest.java
opendaylight/northbound/topology/src/main/java/org/opendaylight/controller/topology/northbound/Topology.java
opendaylight/northbound/topology/src/main/java/org/opendaylight/controller/topology/northbound/TopologyNorthboundJAXRS.java
opendaylight/northbound/topology/src/main/java/org/opendaylight/controller/topology/northbound/TopologyUserLinks.java
opendaylight/northbound/topology/src/test/java/org/opendaylight/controller/topology/northbound/TopologyTest.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/IInventoryShimInternalListener.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/IOFStatisticsManager.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/IRefreshInternalProvider.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/IStatisticsListener.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/ITopologyServiceShimListener.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/IController.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/IMessageReadWrite.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/ISwitch.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/Controller.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/MessageReadWriteService.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/PriorityMessage.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/SecureMessageReadWriteService.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DataPacketMuxDemux.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DescStatisticsConverter.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DiscoveryService.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowConverter.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerNotifier.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerService.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowStatisticsConverter.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryServiceHelper.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/PortConverter.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/PortStatisticsConverter.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/TopologyServices.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/Utils.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6Error.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6FlowMod.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6Match.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6StatsReply.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6StatsRequest.java
opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/Activator.java
opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/FlowProgrammerService.java
opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/InventoryService.java
opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/ReadService.java
opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/StubNodeConnectorFactory.java
opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/StubNodeFactory.java
opendaylight/routing/dijkstra_implementation/src/main/java/org/opendaylight/controller/routing/dijkstra_implementation/internal/DijkstraImplementation.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/Action.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/Output.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/PushVlan.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/SetDlDst.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/SetDlSrc.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/SetDlType.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/SetNwDst.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/SetNwSrc.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/SetNwTos.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/SetTpDst.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/SetTpSrc.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/SetVlanCfi.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/SetVlanId.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/SetVlanPcp.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/authorization/AppRoleLevel.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/authorization/IResourceAuthorization.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/authorization/UserLevel.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Actions.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/AdvertisedBandwidth.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Bandwidth.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Buffers.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Capabilities.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/ComponentActivatorAbstractBase.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Config.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/ContainerFlow.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/PeerBandwidth.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/SupportedBandwidth.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Tables.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/discovery/IDiscoveryService.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/flowprogrammer/Flow.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/flowprogrammer/IFlowProgrammerService.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/flowprogrammer/IPluginInFlowProgrammerService.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/flowprogrammer/IPluginOutFlowProgrammerService.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/inventory/IListenInventoryUpdates.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/inventory/IPluginOutInventoryService.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/match/Match.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/match/MatchField.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/match/MatchType.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/BitBufferHelper.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/ICMP.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/IPv4.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/LLDP.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/PacketException.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/RawPacket.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/UDP.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/reader/FlowOnNode.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/reader/NodeConnectorStatistics.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/reader/NodeDescription.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/reader/NodeTableStatistics.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/topology/IListenTopoUpdates.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/topology/IPluginOutTopologyService.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/GlobalConstants.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/HexEncode.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/IPProtocols.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/NetUtils.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/Status.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/StatusCode.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/action/ActionTest.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/authorization/AuthorizationTest.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/core/NodeTest.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/match/MatchTest.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/packet/BitBufferHelperTest.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/packet/PacketTest.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/reader/FlowOnNodeTest.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/reader/NodeConnectorStatisticsTest.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/reader/NodeDescriptionTest.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/utils/EtherTypesTest.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/utils/HexEncodeTest.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/utils/NetUtilsTest.java
opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/Activator.java
opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/FlowProgrammerService.java
opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/Topology.java
opendaylight/sal/implementation/src/test/java/org/opendaylight/controller/sal/implementation/DataPacketServiceTest.java
opendaylight/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/ConfigManager.java
opendaylight/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/IConfigManager.java
opendaylight/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/LBConst.java
opendaylight/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/LBUtil.java
opendaylight/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/entities/Client.java
opendaylight/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/entities/Pool.java
opendaylight/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/entities/PoolMember.java
opendaylight/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/entities/VIP.java
opendaylight/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/internal/Activator.java
opendaylight/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/internal/LoadBalancerService.java
opendaylight/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/policies/ILoadBalancingPolicy.java
opendaylight/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/policies/RandomLBPolicy.java
opendaylight/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/policies/RoundRobinLBPolicy.java
opendaylight/samples/loadbalancer/src/test/java/org/opendaylight/controller/samples/loadbalancer/internal/LoadBalancerTest.java
opendaylight/samples/northbound/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/northbound/LoadBalancerNorthbound.java
opendaylight/samples/northbound/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/northbound/NBConst.java
opendaylight/samples/northbound/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/northbound/Pools.java
opendaylight/samples/northbound/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/northbound/VIPs.java
opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/SimpleForwardingImpl.java
opendaylight/statisticsmanager/api/src/main/java/org/opendaylight/controller/statisticsmanager/IStatisticsManager.java
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/IInventoryListener.java
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/ISpanAware.java
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/ISwitchManager.java
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/SwitchConfig.java
opendaylight/switchmanager/api/src/test/java/org/opendaylight/controller/switchmanager/SwitchTest.java
opendaylight/topologymanager/src/main/java/org/opendaylight/controller/topologymanager/TopologyUserLinkConfig.java
opendaylight/topologymanager/src/test/java/org/opendaylight/controller/topologymanager/internal/TopologyManagerImplTest.java
opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/IAAAProvider.java
opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/ISessionManager.java
opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/ODLUserLevel.java
opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/ServerConfig.java
opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/UserConfig.java
opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/security/SessionManager.java
opendaylight/usermanager/src/test/java/org/opendaylight/controller/usermanager/AuthResponseTest.java
opendaylight/usermanager/src/test/java/org/opendaylight/controller/usermanager/internal/AuthenticatedUserTest.java
opendaylight/usermanager/src/test/java/org/opendaylight/controller/usermanager/internal/AuthorizationUserConfigTest.java
opendaylight/usermanager/src/test/java/org/opendaylight/controller/usermanager/internal/ServerConfigTest.java
opendaylight/web/flows/src/main/java/org/opendaylight/controller/flows/web/Flows.java
opendaylight/web/root/src/main/java/org/opendaylight/controller/web/DaylightWebAdmin.java
opendaylight/web/root/src/main/java/org/opendaylight/controller/web/DaylightWebUtil.java
opendaylight/web/root/src/main/java/org/opendaylight/controller/web/IDaylightWeb.java
opendaylight/web/topology/src/main/java/org/opendaylight/controller/topology/web/Topology.java
opendaylight/web/topology/src/test/java/org/opendaylight/controller/topology/web/TopologyTest.java
opendaylight/web/troubleshoot/src/main/java/org/opendaylight/controller/troubleshoot/web/Troubleshoot.java

index b92845c8d76fafd514451b1c3dae3e1cbc6f2d4c..d1b82619fd423994f595239f7103389f1534a5eb 100644 (file)
@@ -12,3 +12,4 @@ target
 .project
 .settings
 MANIFEST.MF
+opendaylight/northbound/integrationtest/logs/*
index 5a6641c6857b40a821ea58a5c29202fb8cdb978d..19c8b4d35bd39f8a1c4ad516911ad149cfc5d9a0 100644 (file)
@@ -16,14 +16,14 @@ import org.junit.Assert;
 import org.junit.Test;\r
 \r
 public class ArphandlerTest extends TestCase {\r
-        \r
-       @Test\r
-       public void testArphandlerCreation() {\r
-                       \r
-               ArpHandler ah = null;\r
-               ah = new ArpHandler();\r
-               Assert.assertTrue(ah != null);\r
-                       \r
-       }\r
+\r
+        @Test\r
+        public void testArphandlerCreation() {\r
+\r
+                ArpHandler ah = null;\r
+                ah = new ArpHandler();\r
+                Assert.assertTrue(ah != null);\r
+\r
+        }\r
 \r
 }\r
index 2d63ce57448f88b77a39b1bcb0525b9721c08370..6d9dfda9a365f9a08f9d4ba5b7733f2cb6340ba6 100644 (file)
@@ -1,5 +1,4 @@
 <configuration scan="true">
-
   <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
     <encoder>
       <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
index fa00c7f455f90d0b9e1b883dc4c39ea851cb4c59..1142909f8562844075b3cbbf475b2a65d016738e 100644 (file)
@@ -17,51 +17,51 @@ import junit.framework.TestCase;
 \r
 public class TestClusteringTest extends TestCase {\r
 \r
-       @Test\r
-       public void testComplexClass() {\r
-               ComplexClass cc = new ComplexClass("cplxc1");\r
-               Assert.assertTrue(cc.whoAmI().equals("ComplexClass_cplxc1"));\r
-               cc.IAm("cplxc2");\r
-               Assert.assertTrue(cc.whoAmI().equals("ComplexClass_cplxc2"));\r
-       }\r
-               \r
-       @Test\r
-       public void testComplexClass1() {\r
-               ComplexClass1 cc1 = new ComplexClass1("cplxc1a");\r
-               Assert.assertTrue(cc1.whoAmI().equals("ComplexClass1_cplxc1a"));\r
-               cc1.IAm("cplxc1b");\r
-               Assert.assertTrue(cc1.whoAmI().equals("ComplexClass1_cplxc1b"));\r
-       }\r
-               \r
-               \r
-       @Test\r
-       public void testComplexContainer() {\r
-               ComplexContainer cplxcontnr1 = new ComplexContainer("cct1", 5);\r
-               Assert.assertTrue(cplxcontnr1.getIdentity().equals("[ComplexClass_cct1]-[ComplexClass1_cct1]"));\r
-               Assert.assertTrue(cplxcontnr1.getState() == 5);\r
-               \r
-               cplxcontnr1.setIdentity("cct2");\r
-               Assert.assertTrue(cplxcontnr1.getIdentity().equals("[ComplexClass_cct2]-[ComplexClass1_cct2]"));\r
-               \r
-               Assert.assertTrue(cplxcontnr1.toString().equals(\r
-                               "{ID:[ComplexClass_cct2]-[ComplexClass1_cct2],STATE:5}"));\r
-       }\r
-               \r
-       @Test\r
-       public void testStringContainer() {\r
-               StringContainer strcontainer1 = new StringContainer();\r
-               Assert.assertTrue(strcontainer1.getMystring() == null);\r
-               Assert.assertTrue(strcontainer1.hashCode() == 0);\r
-               \r
-               StringContainer strcontainer2 = new StringContainer("foo");\r
-               Assert.assertTrue(strcontainer2.getMystring() != null);\r
-               Assert.assertTrue(strcontainer2.hashCode() != 0);\r
-               \r
-               strcontainer1.setMystring("foo");\r
-               Assert.assertTrue(strcontainer2.equals(strcontainer1));\r
-               \r
-               Assert.assertTrue(strcontainer2.toString().equals("{foo}"));\r
-       }\r
-               \r
+        @Test\r
+        public void testComplexClass() {\r
+                ComplexClass cc = new ComplexClass("cplxc1");\r
+                Assert.assertTrue(cc.whoAmI().equals("ComplexClass_cplxc1"));\r
+                cc.IAm("cplxc2");\r
+                Assert.assertTrue(cc.whoAmI().equals("ComplexClass_cplxc2"));\r
+        }\r
+\r
+        @Test\r
+        public void testComplexClass1() {\r
+                ComplexClass1 cc1 = new ComplexClass1("cplxc1a");\r
+                Assert.assertTrue(cc1.whoAmI().equals("ComplexClass1_cplxc1a"));\r
+                cc1.IAm("cplxc1b");\r
+                Assert.assertTrue(cc1.whoAmI().equals("ComplexClass1_cplxc1b"));\r
+        }\r
+\r
+\r
+        @Test\r
+        public void testComplexContainer() {\r
+                ComplexContainer cplxcontnr1 = new ComplexContainer("cct1", 5);\r
+                Assert.assertTrue(cplxcontnr1.getIdentity().equals("[ComplexClass_cct1]-[ComplexClass1_cct1]"));\r
+                Assert.assertTrue(cplxcontnr1.getState() == 5);\r
+\r
+                cplxcontnr1.setIdentity("cct2");\r
+                Assert.assertTrue(cplxcontnr1.getIdentity().equals("[ComplexClass_cct2]-[ComplexClass1_cct2]"));\r
+\r
+                Assert.assertTrue(cplxcontnr1.toString().equals(\r
+                                "{ID:[ComplexClass_cct2]-[ComplexClass1_cct2],STATE:5}"));\r
+        }\r
+\r
+        @Test\r
+        public void testStringContainer() {\r
+                StringContainer strcontainer1 = new StringContainer();\r
+                Assert.assertTrue(strcontainer1.getMystring() == null);\r
+                Assert.assertTrue(strcontainer1.hashCode() == 0);\r
+\r
+                StringContainer strcontainer2 = new StringContainer("foo");\r
+                Assert.assertTrue(strcontainer2.getMystring() != null);\r
+                Assert.assertTrue(strcontainer2.hashCode() != 0);\r
+\r
+                strcontainer1.setMystring("foo");\r
+                Assert.assertTrue(strcontainer2.equals(strcontainer1));\r
+\r
+                Assert.assertTrue(strcontainer2.toString().equals("{foo}"));\r
+        }\r
+\r
 \r
 }\r
index 9d34dfb8a7d99fafe33806b6748abe41f63f31bc..9e9774e26601891bf215cb5b6994f151c10b7f8d 100644 (file)
@@ -12,7 +12,7 @@ package org.opendaylight.controller.concepts.transform;
 public interface Acceptor<I> {\r
 \r
     /**\r
-     * \r
+     *\r
      * @param input\r
      * @return true if input is accepted.\r
      */\r
index 23bcb563d38844df20971e56e89c03b994116a7b..061a57fc15831b942d952084eb2ad9731a2b24cf 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.controller.concepts.transform;
 \r
 import java.util.Collection;\r
 /**\r
- * \r
+ *\r
  * @author Tony Tkacik\r
  *\r
  * @param <I>\r
index fa6408d3d11ce89ea463c02a14a886aa1b573808..dae949912b96cfe564e018e2b99146597d26d626 100644 (file)
@@ -17,26 +17,26 @@ import java.util.concurrent.ConcurrentHashMap;
 /**\r
  * Transformer which aggregates multiple implementations of\r
  * {@link InputClassBasedTransformer}.\r
- * \r
+ *\r
  * The transformation process is driven by {@link Class} of input. The selection\r
  * of used {@link InputClassBasedTransformer} is done by using the {@link Class}\r
  * of input as a key to select the transformer.\r
- * \r
+ *\r
  * This approach provides quick resolution of transformer, but does not support\r
  * registering a super type of input to provide transformation support for all\r
  * subclasses, one must register a new instance of transformer for each valid\r
  * input class.\r
- * \r
+ *\r
  * If you need more flexible selection of transformation consider using\r
  * {@link CompositeConditionalTransformer} which is slower but most flexible or\r
  * {@link RuleBasedTransformer} which provides declarative approach for\r
  * transformation.\r
- * \r
+ *\r
  * See {@link #transform(Object)} for more information about tranformation\r
  * process.\r
- * \r
+ *\r
  * @author Tony Tkacik <ttkacik@cisco.com>\r
- * \r
+ *\r
  * @param <I>\r
  *            Input super-type\r
  * @param <P>\r
@@ -50,18 +50,18 @@ public abstract class CompositeClassBasedTransformer<I, P> implements
 \r
     /**\r
      * Transforms an input into instance of Product class.\r
-     * \r
+     *\r
      * The final registered transformer is the one which match following\r
      * condition:\r
-     * \r
+     *\r
      * <code>input.getClass() == transformer.getInputClass()</code>\r
-     * \r
+     *\r
      * This means that transformers are not resolved by class hierarchy, only\r
      * selected based on final class of the input. If you need more flexible\r
      * selection of transformation consider using\r
      * {@link CompositeConditionalTransformer} which is slower but more\r
      * flexible.\r
-     * \r
+     *\r
      */\r
     @Override\r
     public P transform(I input) {\r
@@ -76,11 +76,11 @@ public abstract class CompositeClassBasedTransformer<I, P> implements
 \r
     /**\r
      * Registers a new transformer.\r
-     * \r
+     *\r
      * The transformer is registered for class returned by\r
      * {@link InputClassBasedTransformer#getInputClass()}. Only one transformer\r
      * can be registered for particular input class.\r
-     * \r
+     *\r
      */\r
     public void addTransformer(\r
             InputClassBasedTransformer<I, ? extends I, P> transformer)\r
@@ -95,9 +95,9 @@ public abstract class CompositeClassBasedTransformer<I, P> implements
 \r
     /**\r
      * Removes an registered transformer.\r
-     * \r
+     *\r
      * Note: Removal is currently unsupported.\r
-     * \r
+     *\r
      * @param transformer\r
      *            Tranformer to be removed.\r
      * @throws IllegalArgumentException\r
@@ -108,7 +108,7 @@ public abstract class CompositeClassBasedTransformer<I, P> implements
             throws IllegalArgumentException {\r
         throw new UnsupportedOperationException("Not implemented yet");\r
     }\r
-    \r
+\r
     @Override\r
     public Collection<P> transformAll(Collection<? extends I> inputs) {\r
         Collection<P> ret = new ArrayList<P>();\r
index 3e6b39abf529abb28e16797017214094b2d7341a..1ad849bddc1de9e78989d96cfddae8216f6b5ab5 100644 (file)
@@ -10,15 +10,15 @@ package org.opendaylight.controller.concepts.transform;
 \r
 /**\r
  * Input class based transformer\r
- * \r
+ *\r
  * {@link Transformer} which accepts / transforms only specific classes of\r
  * input, and is useful if the selection of transformer should be based on the\r
  * class of the input and there is one-to-one mapping between input class and\r
  * transformer.\r
- * \r
- * \r
+ *\r
+ *\r
  * @author Tony Tkacik\r
- * \r
+ *\r
  * @param <S>\r
  *            Common supertype of input\r
  * @param <I>\r
@@ -31,7 +31,7 @@ public interface InputClassBasedTransformer<S, I extends S, P> extends
 \r
     /**\r
      * Returns an {@link Class} of input which is acceptable for transformation.\r
-     * \r
+     *\r
      * @return {@link Class} of input which is acceptable for transformation.\r
      */\r
     Class<? extends S> getInputClass();\r
index 9f717eaa5bff4a9f63d54f8b9009d10f21a2fcca..820b94a7acd15d1bb0944b16a25e32b930068825 100644 (file)
@@ -12,15 +12,15 @@ import java.util.Set;
 \r
 /**\r
  * Transformer with set of acceptance rules\r
- * \r
+ *\r
  * The transformer provides a set of {@link Acceptor}s, which could be used to\r
  * verify if the input will produce result using the transformer.\r
- * \r
+ *\r
  * The transormer is able to produce result if ANY of associated\r
  * {@link Acceptor}s accepted result.\r
- * \r
+ *\r
  * @author Tony Tkacik\r
- * \r
+ *\r
  * @param <I>\r
  *            Input class for transformation\r
  * @param <P>\r
@@ -31,10 +31,10 @@ public interface RuleBasedTransformer<I, P> extends Transformer<I, P> {
     /**\r
      * Set of {@link Acceptor}, which could be used to verify if the input is\r
      * usable by transformer.\r
-     * \r
+     *\r
      * The transformer is able to produce result if ANY of associated\r
      * {@link Acceptor}s accepted result.\r
-     * \r
+     *\r
      * @return Set of input acceptance rules associated to this transformer.\r
      */\r
     Set<Acceptor<I>> getRules();\r
index 81e43c39d1955cb54485c8977617a98055ea164f..4d0aa03e15cfda28584d4830948e07803dea8bcc 100644 (file)
@@ -10,15 +10,15 @@ package org.opendaylight.controller.concepts.transform;
 \r
 /**\r
  * Simple condition-based transformer\r
- * \r
+ *\r
  * The transformer provides {@link #isAcceptable(Object)} method,\r
  * which could be used to query transformer if the input will produce\r
  * result.\r
- * \r
+ *\r
  * This interface is simplified version of {@link RuleBasedTransformer} - does not\r
  * provide decoupling of Acceptance rule from transformer, and should be used only\r
  * for simple use-cases.\r
- *  \r
+ *\r
  * @author Tony Tkacik\r
  *\r
  * @param <I> Input class for transformation\r
@@ -28,9 +28,9 @@ public interface SimpleConditionalTransformer<I,P> extends Transformer<I, P>, Ac
 \r
 \r
     /**\r
-     * Checks if the input is acceptable \r
+     * Checks if the input is acceptable\r
      * for processing by the transformer.\r
-     * \r
+     *\r
      * @return true it the input is acceptable for processing by transformer.\r
      */\r
     @Override\r
index f80ccfffd84f6369e003bb0e6b177ddda9a15531..18184e122acd1f3e9e0718c2ace54d893c619cea 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.controller.concepts.transform;
 \r
 /**\r
  * Factory which produces product based on input object\r
- * \r
+ *\r
  * @author Tony Tkacik\r
  *\r
  * @param <I> Input\r
@@ -19,7 +19,7 @@ package org.opendaylight.controller.concepts.transform;
 public interface Transformer<I,P> {\r
     /**\r
      * Transforms input into instance of product.\r
-     * \r
+     *\r
      * @param input Input which drives transformation\r
      * @return Instance of product which was created from supplied input.\r
      */\r
diff --git a/opendaylight/commons/integrationtest/logback.xml b/opendaylight/commons/integrationtest/logback.xml
new file mode 100644 (file)
index 0000000..043ceef
--- /dev/null
@@ -0,0 +1,12 @@
+<configuration scan="true">
+  
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</pattern>
+    </encoder>
+  </appender>
+  
+  <root level="error">
+    <appender-ref ref="STDOUT" />
+  </root>
+</configuration>
diff --git a/opendaylight/commons/integrationtest/space_and_tabs_checks.xml b/opendaylight/commons/integrationtest/space_and_tabs_checks.xml
new file mode 100644 (file)
index 0000000..49a5802
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>\r
+<!DOCTYPE module PUBLIC\r
+    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"\r
+    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">\r
+\r
+<module name="Checker">\r
+    <module name="FileTabCharacter">\r
+        <property name="eachLine" value="true"/>\r
+    </module>\r
+\r
+    <module name="RegexpSingleline">\r
+        <!-- \s matches whitespace character, $ matches end of line. -->\r
+        <property name="format" value="\s+$"/>\r
+        <property name="message" value="Line has trailing spaces."/>\r
+    </module>\r
+\r
+</module>\r
diff --git a/opendaylight/commons/integrationtest/sun_coding_style.xml b/opendaylight/commons/integrationtest/sun_coding_style.xml
new file mode 100644 (file)
index 0000000..f4516b9
--- /dev/null
@@ -0,0 +1,291 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<profiles version="12">
+<profile kind="CodeFormatterProfile" name="SunCodingStyle" version="12">
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.source" value="1.7"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="8"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.7"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.7"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
+</profile>
+</profiles>
index 9814b5f91cf1ed0e7d535588cf17cd44329f25f4..2792adcb7be7fc82bba337e249af1fc830bdbfa1 100644 (file)
           <configFile>${project.parent.relativePath}/sun_coding_style.xml</configFile>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>2.10</version>
+        <executions>
+          <execution>
+            <phase>process-sources</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <failsOnError>true</failsOnError>
+          <configLocation>${project.parent.relativePath}/space_and_tabs_checks.xml</configLocation>
+        </configuration>
+      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-failsafe-plugin</artifactId>
                   </action>
                 </pluginExecution>
                 <pluginExecution>
-                       <pluginExecutionFilter>
-                               <groupId>org.ops4j.pax.exam</groupId>
-                               <artifactId>maven-paxexam-plugin</artifactId>
-                               <versionRange>[1.2.4,)</versionRange>
-                               <goals>
-                                       <goal>generate-depends-file</goal>
-                               </goals>
-                       </pluginExecutionFilter>
-                       <action>
-                               <ignore></ignore>
-                       </action>
+                  <pluginExecutionFilter>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>maven-paxexam-plugin</artifactId>
+                    <versionRange>[1.2.4,)</versionRange>
+                    <goals>
+                      <goal>generate-depends-file</goal>
+                    </goals>
+                  </pluginExecutionFilter>
+                  <action>
+                    <ignore/>
+                  </action>
+                </pluginExecution>
+                <pluginExecution>
+                  <pluginExecutionFilter>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-checkstyle-plugin</artifactId>
+                    <versionRange>[2.0,)</versionRange>
+                    <goals>
+                      <goal>check</goal>
+                    </goals>
+                  </pluginExecutionFilter>
+                  <action>
+                    <ignore/>
+                  </action>
                 </pluginExecution>
               </pluginExecutions>
             </lifecycleMappingMetadata>
diff --git a/opendaylight/commons/opendaylight/space_and_tabs_checks.xml b/opendaylight/commons/opendaylight/space_and_tabs_checks.xml
new file mode 100644 (file)
index 0000000..49a5802
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>\r
+<!DOCTYPE module PUBLIC\r
+    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"\r
+    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">\r
+\r
+<module name="Checker">\r
+    <module name="FileTabCharacter">\r
+        <property name="eachLine" value="true"/>\r
+    </module>\r
+\r
+    <module name="RegexpSingleline">\r
+        <!-- \s matches whitespace character, $ matches end of line. -->\r
+        <property name="format" value="\s+$"/>\r
+        <property name="message" value="Line has trailing spaces."/>\r
+    </module>\r
+\r
+</module>\r
index 3d0c5659d682c96ac874f90ffa43e410abc561d9..9fb0c23b365de5987d56434e698cbeed07861f71 100644 (file)
@@ -51,9 +51,9 @@ public class ConfigurationContainerImpl implements
     }
 
     public int getConfigurationAwareListSize() {
-       return this.configurationAwareList.size();
+        return this.configurationAwareList.size();
     }
-    
+
     public void removeConfigurationContainerAware(
             IConfigurationContainerAware configurationAware) {
         this.configurationAwareList.remove(configurationAware);
@@ -88,16 +88,16 @@ public class ConfigurationContainerImpl implements
 
             Status status = configurationAware.saveConfiguration();
             if (!status.isSuccess()) {
-               success = false;
-               logger.info("Failed to save config for {}",
-                               configurationAware.getClass().getSimpleName());
+                success = false;
+                logger.info("Failed to save config for {}",
+                                configurationAware.getClass().getSimpleName());
             }
         }
         if (success) {
             return new Status(StatusCode.SUCCESS, null);
         } else {
             return new Status(StatusCode.INTERNALERROR,
-                       "Failed to Save All Configurations");
+                        "Failed to Save All Configurations");
         }
     }
 
index ee15b4a9c2bc9f9822d40347dcee5eeb72212c55..20821f10282b038c19202a0f2c9d82839072b08b 100644 (file)
@@ -41,11 +41,11 @@ public class ConfigurationImpl implements IConfigurationService {
     private Set<IConfigurationAware> configurationAwareList = (Set<IConfigurationAware>) Collections
             .synchronizedSet(new HashSet<IConfigurationAware>());
 
-    
+
     public int getConfigurationAwareListSize() {
-       return this.configurationAwareList.size();
+        return this.configurationAwareList.size();
     }
-    
+
     public void addConfigurationAware(IConfigurationAware configurationAware) {
         if (!this.configurationAwareList.contains(configurationAware)) {
             this.configurationAwareList.add(configurationAware);
@@ -81,18 +81,18 @@ public class ConfigurationImpl implements IConfigurationService {
     public Status saveConfigurations() {
         boolean success = true;
         for (IConfigurationAware configurationAware : configurationAwareList) {
-               Status status = configurationAware.saveConfiguration();
+                Status status = configurationAware.saveConfiguration();
             if (!status.isSuccess()) {
-               success = false;
-               logger.info("Failed to save config for {}",
-                               configurationAware.getClass().getName());
+                success = false;
+                logger.info("Failed to save config for {}",
+                                configurationAware.getClass().getName());
             }
         }
         if (success) {
             return new Status(StatusCode.SUCCESS, null);
         } else {
             return new Status(StatusCode.INTERNALERROR,
-                       "Failed to Save All Configurations");
+                        "Failed to Save All Configurations");
         }
     }
 
index e93b467b9af9cb9e606f740d2e6b4054bbf6b614..c9dd5e2f397511fd81e9024aaa5ac0a1e2351ccf 100644 (file)
@@ -22,11 +22,11 @@ import org.opendaylight.controller.sal.utils.Status;
 
 public class ConfigurationAwareTest implements
 IConfigurationAware {
-       
-       @Override
-       public Status saveConfiguration() {
-               return null;
-       }
+
+        @Override
+        public Status saveConfiguration() {
+                return null;
+        }
 
 
 }
index 52f3776e6dcde888f8a7121b2ebafa4c3a25a9c2..c5d6bdc5d685a796d2388a87fb001d67c085fa36 100644 (file)
@@ -23,13 +23,13 @@ import org.opendaylight.controller.sal.utils.Status;
 public class ConfigurationContainerAwareTest implements
          IConfigurationContainerAware {
 
-       
-       
-       
-       @Override
-       public Status saveConfiguration() {
-               return null;
-       }
-       
-       
+
+
+
+        @Override
+        public Status saveConfiguration() {
+                return null;
+        }
+
+
 }
index 1d704a1937a6345c964553156e845c4ad4c8ed03..a82a9f23d8fcbdad031bf2c6e1da86f32960cada 100644 (file)
@@ -14,52 +14,51 @@ import org.opendaylight.controller.configuration.IConfigurationContainerAware;
 
 
 
-public class ConfigurationContainerImplTest { 
-       
-
-       @Test
-       public void testAddRemoveSaveConfiguration() {
-               
-               ConfigurationContainerImpl configurationContainerImpl = new ConfigurationContainerImpl();
-               IConfigurationContainerAware testConfigurationContainerAware = new ConfigurationContainerAwareTest();
-               
-               configurationContainerImpl.addConfigurationContainerAware(testConfigurationContainerAware);
-               configurationContainerImpl.addConfigurationContainerAware(testConfigurationContainerAware);
-               
-               Assert.assertEquals(1, configurationContainerImpl.getConfigurationAwareListSize());
-               
-               IConfigurationContainerAware testConfigurationAware1 = new ConfigurationContainerAwareTest();
-               configurationContainerImpl.addConfigurationContainerAware(testConfigurationAware1);
-               
-               Assert.assertEquals(2, configurationContainerImpl.getConfigurationAwareListSize());
-               
-               IConfigurationContainerAware testConfigurationAware2 = new ConfigurationContainerAwareTest();
-               configurationContainerImpl.addConfigurationContainerAware(testConfigurationAware2);
-               
-               Assert.assertEquals(3, configurationContainerImpl.getConfigurationAwareListSize());
-               
-               IConfigurationContainerAware testConfigurationAware3 = new ConfigurationContainerAwareTest();
-               configurationContainerImpl.addConfigurationContainerAware(testConfigurationAware3);
-               
-               Assert.assertEquals(4, configurationContainerImpl.getConfigurationAwareListSize());
-               
-               configurationContainerImpl.removeConfigurationContainerAware(testConfigurationContainerAware);
-               Assert.assertEquals(3, configurationContainerImpl.getConfigurationAwareListSize());
-               
-               configurationContainerImpl.removeConfigurationContainerAware(testConfigurationContainerAware);
-               Assert.assertEquals(3, configurationContainerImpl.getConfigurationAwareListSize());
-               
-               configurationContainerImpl.removeConfigurationContainerAware(testConfigurationAware3);
-               Assert.assertEquals(2, configurationContainerImpl.getConfigurationAwareListSize());
-               
-               configurationContainerImpl.removeConfigurationContainerAware(testConfigurationAware2);
-               Assert.assertEquals(1, configurationContainerImpl.getConfigurationAwareListSize());
-               
-               configurationContainerImpl.removeConfigurationContainerAware(testConfigurationAware1);
-               Assert.assertEquals(0, configurationContainerImpl.getConfigurationAwareListSize());
-               
-               
-       }
-       
-}
+public class ConfigurationContainerImplTest {
+
+
+        @Test
+        public void testAddRemoveSaveConfiguration() {
+
+                ConfigurationContainerImpl configurationContainerImpl = new ConfigurationContainerImpl();
+                IConfigurationContainerAware testConfigurationContainerAware = new ConfigurationContainerAwareTest();
+
+                configurationContainerImpl.addConfigurationContainerAware(testConfigurationContainerAware);
+                configurationContainerImpl.addConfigurationContainerAware(testConfigurationContainerAware);
+
+                Assert.assertEquals(1, configurationContainerImpl.getConfigurationAwareListSize());
+
+                IConfigurationContainerAware testConfigurationAware1 = new ConfigurationContainerAwareTest();
+                configurationContainerImpl.addConfigurationContainerAware(testConfigurationAware1);
+
+                Assert.assertEquals(2, configurationContainerImpl.getConfigurationAwareListSize());
+
+                IConfigurationContainerAware testConfigurationAware2 = new ConfigurationContainerAwareTest();
+                configurationContainerImpl.addConfigurationContainerAware(testConfigurationAware2);
+
+                Assert.assertEquals(3, configurationContainerImpl.getConfigurationAwareListSize());
 
+                IConfigurationContainerAware testConfigurationAware3 = new ConfigurationContainerAwareTest();
+                configurationContainerImpl.addConfigurationContainerAware(testConfigurationAware3);
+
+                Assert.assertEquals(4, configurationContainerImpl.getConfigurationAwareListSize());
+
+                configurationContainerImpl.removeConfigurationContainerAware(testConfigurationContainerAware);
+                Assert.assertEquals(3, configurationContainerImpl.getConfigurationAwareListSize());
+
+                configurationContainerImpl.removeConfigurationContainerAware(testConfigurationContainerAware);
+                Assert.assertEquals(3, configurationContainerImpl.getConfigurationAwareListSize());
+
+                configurationContainerImpl.removeConfigurationContainerAware(testConfigurationAware3);
+                Assert.assertEquals(2, configurationContainerImpl.getConfigurationAwareListSize());
+
+                configurationContainerImpl.removeConfigurationContainerAware(testConfigurationAware2);
+                Assert.assertEquals(1, configurationContainerImpl.getConfigurationAwareListSize());
+
+                configurationContainerImpl.removeConfigurationContainerAware(testConfigurationAware1);
+                Assert.assertEquals(0, configurationContainerImpl.getConfigurationAwareListSize());
+
+
+        }
+
+}
index 71d768d90754c321b370a2926290e88c3502e41b..816c6ce2bdecfe68d9335c45ee6b4c3de1639d26 100644 (file)
@@ -12,52 +12,51 @@ package org.opendaylight.controller.configuration.internal;
 import org.junit.*;
 import org.opendaylight.controller.configuration.IConfigurationAware;
 
-public class ConfigurationImplTest { 
-       
-
-       @Test
-       public void testAddRemoveSaveConfiguration() {
-               
-               ConfigurationImpl configurationImpl = new ConfigurationImpl();
-               IConfigurationAware testConfigurationAware = new ConfigurationAwareTest();
-               
-               configurationImpl.addConfigurationAware(testConfigurationAware);
-               configurationImpl.addConfigurationAware(testConfigurationAware);
-               
-               Assert.assertEquals(1, configurationImpl.getConfigurationAwareListSize());
-               
-               ConfigurationAwareTest testConfigurationAware1 = new ConfigurationAwareTest();
-               configurationImpl.addConfigurationAware(testConfigurationAware1);
-               
-               Assert.assertEquals(2, configurationImpl.getConfigurationAwareListSize());
-               
-               ConfigurationAwareTest testConfigurationAware2 = new ConfigurationAwareTest();
-               configurationImpl.addConfigurationAware(testConfigurationAware2);
-               
-               Assert.assertEquals(3, configurationImpl.getConfigurationAwareListSize());
-               
-               ConfigurationAwareTest testConfigurationAware3 = new ConfigurationAwareTest();
-               configurationImpl.addConfigurationAware(testConfigurationAware3);
-               
-               Assert.assertEquals(4, configurationImpl.getConfigurationAwareListSize());
-               
-               
-               configurationImpl.removeConfigurationAware(testConfigurationAware);
-               Assert.assertEquals(3, configurationImpl.getConfigurationAwareListSize());
-               
-               configurationImpl.removeConfigurationAware(testConfigurationAware);
-               Assert.assertEquals(3, configurationImpl.getConfigurationAwareListSize());
-               
-               configurationImpl.removeConfigurationAware(testConfigurationAware3);
-               Assert.assertEquals(2, configurationImpl.getConfigurationAwareListSize());
-               
-               configurationImpl.removeConfigurationAware(testConfigurationAware1);
-               Assert.assertEquals(1, configurationImpl.getConfigurationAwareListSize());
-               
-               configurationImpl.removeConfigurationAware(testConfigurationAware2);
-               Assert.assertEquals(0, configurationImpl.getConfigurationAwareListSize());
-               
-       }
-       
-}
+public class ConfigurationImplTest {
+
+
+        @Test
+        public void testAddRemoveSaveConfiguration() {
+
+                ConfigurationImpl configurationImpl = new ConfigurationImpl();
+                IConfigurationAware testConfigurationAware = new ConfigurationAwareTest();
+
+                configurationImpl.addConfigurationAware(testConfigurationAware);
+                configurationImpl.addConfigurationAware(testConfigurationAware);
+
+                Assert.assertEquals(1, configurationImpl.getConfigurationAwareListSize());
+
+                ConfigurationAwareTest testConfigurationAware1 = new ConfigurationAwareTest();
+                configurationImpl.addConfigurationAware(testConfigurationAware1);
+
+                Assert.assertEquals(2, configurationImpl.getConfigurationAwareListSize());
+
+                ConfigurationAwareTest testConfigurationAware2 = new ConfigurationAwareTest();
+                configurationImpl.addConfigurationAware(testConfigurationAware2);
+
+                Assert.assertEquals(3, configurationImpl.getConfigurationAwareListSize());
 
+                ConfigurationAwareTest testConfigurationAware3 = new ConfigurationAwareTest();
+                configurationImpl.addConfigurationAware(testConfigurationAware3);
+
+                Assert.assertEquals(4, configurationImpl.getConfigurationAwareListSize());
+
+
+                configurationImpl.removeConfigurationAware(testConfigurationAware);
+                Assert.assertEquals(3, configurationImpl.getConfigurationAwareListSize());
+
+                configurationImpl.removeConfigurationAware(testConfigurationAware);
+                Assert.assertEquals(3, configurationImpl.getConfigurationAwareListSize());
+
+                configurationImpl.removeConfigurationAware(testConfigurationAware3);
+                Assert.assertEquals(2, configurationImpl.getConfigurationAwareListSize());
+
+                configurationImpl.removeConfigurationAware(testConfigurationAware1);
+                Assert.assertEquals(1, configurationImpl.getConfigurationAwareListSize());
+
+                configurationImpl.removeConfigurationAware(testConfigurationAware2);
+                Assert.assertEquals(0, configurationImpl.getConfigurationAwareListSize());
+
+        }
+
+}
index f057959ee85f17db5eb071a7f5a99f5bc014797d..b956d76a2e8984241c3aa24e9e3adb0af4385816 100644 (file)
@@ -23,14 +23,14 @@ public interface IContainerManager {
     /**
      * Returns a list of Containers that currently exist.
      *
-     * @return array of String Container names
+     * @return  array of String Container names
      */
     public boolean hasNonDefaultContainer();
 
     /**
      * Returns a list of Containers that currently exist.
      *
-     * @return array of String Container names
+     * @return  array of String Container names
      */
     public List<String> getContainerNames();
 
@@ -39,7 +39,7 @@ public interface IContainerManager {
      * TODO : REMOVE THIS FUNCTION and make Save as a service rather than the
      * current hack of calling individual save routines.
      *
-     * @return status code
+     * @return  status code
      */
     public Status saveContainerConfig();
 }
index 4bdd6797d6717525a377e7f5c4d7de15ce23bd97..2d6439954a6911cb0078f4b1ec1d25bcb1a1e918 100644 (file)
@@ -20,41 +20,41 @@ import org.opendaylight.controller.sal.utils.NodeCreator;
 \r
 public class ContainerImplTest {\r
 \r
-       @Test\r
-       public void test() {\r
-               \r
-               ContainerImpl container1 = new ContainerImpl();\r
-                               \r
-               //Create Component for init\r
-               ComponentImpl component1 = new ComponentImpl(null, null, null);\r
-               component1.setInterface("serviceTestName", null);\r
-\r
-               //container1 does not have name yet\r
-               container1.init(component1);\r
-               assertNull(container1.getName());\r
-               \r
-               //Sets container1 name to TestName\r
-               Hashtable<String, String> properties = new Hashtable<String, String>();\r
-               properties.put("dummyKey", "dummyValue");\r
-               properties.put("containerName", "TestName");\r
-               component1.setInterface("serviceTestName", properties);\r
-\r
-               container1.init(component1);\r
-               assertEquals("TestName", container1.getName());\r
-               \r
-               //getContainerFlows always returns null for now\r
-               assertNull(container1.getContainerFlows());\r
-               \r
-               //getTag always returns 0 for now\r
-               Node n = NodeCreator.createOFNode(1L);\r
-               assertEquals(0, container1.getTag(n));\r
-               \r
-               //getNodeConnectors always returns null for now\r
-               assertNull(container1.getNodeConnectors());\r
-               \r
-               //getNodes always returns null for now\r
-               assertNull(container1.getNodes());\r
-               \r
-       }\r
+        @Test\r
+        public void test() {\r
+\r
+                ContainerImpl container1 = new ContainerImpl();\r
+\r
+                //Create Component for init\r
+                ComponentImpl component1 = new ComponentImpl(null, null, null);\r
+                component1.setInterface("serviceTestName", null);\r
+\r
+                //container1 does not have name yet\r
+                container1.init(component1);\r
+                assertNull(container1.getName());\r
+\r
+                //Sets container1 name to TestName\r
+                Hashtable<String, String> properties = new Hashtable<String, String>();\r
+                properties.put("dummyKey", "dummyValue");\r
+                properties.put("containerName", "TestName");\r
+                component1.setInterface("serviceTestName", properties);\r
+\r
+                container1.init(component1);\r
+                assertEquals("TestName", container1.getName());\r
+\r
+                //getContainerFlows always returns null for now\r
+                assertNull(container1.getContainerFlows());\r
+\r
+                //getTag always returns 0 for now\r
+                Node n = NodeCreator.createOFNode(1L);\r
+                assertEquals(0, container1.getTag(n));\r
+\r
+                //getNodeConnectors always returns null for now\r
+                assertNull(container1.getNodeConnectors());\r
+\r
+                //getNodes always returns null for now\r
+                assertNull(container1.getNodes());\r
+\r
+        }\r
 \r
 }\r
index b5e7a110977864b45fa49f3e0e0e1bcdd5103913..c7e35a069ca30b4e6a4418cf37c08968979c6786 100644 (file)
@@ -18,21 +18,21 @@ import org.opendaylight.controller.sal.utils.GlobalConstants;
 \r
 public class ContainerManagerTest {\r
 \r
-       @Test\r
-       public void test() {\r
-               ContainerManager cm = new ContainerManager();\r
-               \r
-               cm.init();\r
-               \r
-               ArrayList<String> names = (ArrayList<String>) cm.getContainerNames();\r
-               assertEquals(1, names.size());\r
-               assertEquals(GlobalConstants.DEFAULT.toString(), names.get(0));\r
-               \r
-               assertFalse(cm.hasNonDefaultContainer());\r
-               assertNull(cm.saveContainerConfig());\r
-               \r
-               cm.destroy();\r
-\r
-       }\r
+        @Test\r
+        public void test() {\r
+                ContainerManager cm = new ContainerManager();\r
+\r
+                cm.init();\r
+\r
+                ArrayList<String> names = (ArrayList<String>) cm.getContainerNames();\r
+                assertEquals(1, names.size());\r
+                assertEquals(GlobalConstants.DEFAULT.toString(), names.get(0));\r
+\r
+                assertFalse(cm.hasNonDefaultContainer());\r
+                assertNull(cm.saveContainerConfig());\r
+\r
+                cm.destroy();\r
+\r
+        }\r
 \r
 }\r
index 5fabb2629de3ca31a96a348fc94478d2e33c698f..0166d279f66528135322f3c8d250ec381bd2de1a 100644 (file)
@@ -12,14 +12,14 @@ package org.opendaylight.controller.forwarding.staticrouting;
 import java.net.InetAddress;
 import java.util.concurrent.ConcurrentMap;
 /**
- * 
+ *
  * This interface provides APIs to configure and manage static routes.
  *
  */
 import org.opendaylight.controller.sal.utils.Status;
 
 /**
- * 
+ *
  * This Interface provides APIs to manage and query the static routes
  *
  */
index 262c0170db9edc27d4885bb7fc1ca8a14e825d12..ceacebffb05cb57a8dfcc8fdf8ea8addc032e168 100644 (file)
@@ -151,18 +151,18 @@ public class StaticRouteConfig implements Serializable {
     public Status isValid() {
         if ((name == null) || (name.trim().length() < 1)) {
             return new Status(StatusCode.BADREQUEST,
-                       "Invalid Static Route name");
+                        "Invalid Static Route name");
         }
         if (!isValidStaticRouteEntry()) {
             return new Status(StatusCode.BADREQUEST,
-                       "Invalid Static Route entry. Please use the " +
-                       "IPAddress/mask format. Default gateway " +
-                       "(0.0.0.0/0) is NOT supported.");
+                        "Invalid Static Route entry. Please use the " +
+                        "IPAddress/mask format. Default gateway " +
+                        "(0.0.0.0/0) is NOT supported.");
         }
         if (!isValidNextHop()) {
             return new Status(StatusCode.BADREQUEST,
-                       "Invalid NextHop IP Address configuration. " +
-                                       "Please use the X.X.X.X format.");
+                        "Invalid NextHop IP Address configuration. " +
+                                        "Please use the X.X.X.X format.");
         }
 
         return new Status(StatusCode.SUCCESS, null);
index 1ac923c15ee266b737e202e62373fad4c8d0bc79..8819be39885d950e9f6aafc7ed4ad737247a2037 100644 (file)
@@ -131,7 +131,7 @@ public class StaticRoutingImplementation implements IfNewHostNotify,
         }
     }
 
-    
+
     private Status saveConfig() {
         // Publish the save config event to the cluster nodes
         configSaveEvent.put(new Date().getTime(), SAVE);
@@ -154,7 +154,7 @@ public class StaticRoutingImplementation implements IfNewHostNotify,
     }
 
     @SuppressWarnings("deprecation")
-       private void allocateCaches() {
+        private void allocateCaches() {
         if (this.clusterContainerService == null) {
             log
                     .info("un-initialized clusterContainerService, can't create cache");
@@ -207,7 +207,7 @@ public class StaticRoutingImplementation implements IfNewHostNotify,
     }
 
     @SuppressWarnings("deprecation")
-       private void destroyCaches() {
+        private void destroyCaches() {
         if (this.clusterContainerService == null) {
             log
                     .info("un-initialized clusterContainerService, can't destroy cache");
@@ -390,16 +390,16 @@ public class StaticRoutingImplementation implements IfNewHostNotify,
             return status;
         }
         if (staticRouteConfigs.get(config.getName()) != null) {
-               return new Status(StatusCode.CONFLICT,
-                               "A valid Static Route configuration with this name " +
-                                               "already exists. Please use a different name");
+                return new Status(StatusCode.CONFLICT,
+                                "A valid Static Route configuration with this name " +
+                                                "already exists. Please use a different name");
         }
         for (StaticRouteConfig s : staticRouteConfigs.values()) {
             if (s.equals(config)) {
-               return new Status(StatusCode.CONFLICT,
-                               "This conflicts with an existing Static Route " +
-                                       "Configuration. Please check the configuration " +
-                                               "and try again");
+                return new Status(StatusCode.CONFLICT,
+                                "This conflicts with an existing Static Route " +
+                                        "Configuration. Please check the configuration " +
+                                                "and try again");
             }
         }
 
@@ -407,7 +407,7 @@ public class StaticRoutingImplementation implements IfNewHostNotify,
         StaticRoute sRoute = new StaticRoute(config);
         staticRoutes.put(config.getName(), sRoute);
         checkAndUpdateListeners(sRoute, true);
-        return status; 
+        return status;
     }
 
     public Status removeStaticRoute(String name) {
@@ -417,8 +417,8 @@ public class StaticRoutingImplementation implements IfNewHostNotify,
             checkAndUpdateListeners(sRoute, false);
             return new Status(StatusCode.SUCCESS, null);
         }
-        return new Status(StatusCode.NOTFOUND, 
-                       "Static Route with name " + name + " is not found");
+        return new Status(StatusCode.NOTFOUND,
+                        "Static Route with name " + name + " is not found");
     }
 
     void setClusterContainerService(IClusterContainerServices s) {
index 84ec54b807ce42a8566a522e8acbd0ba3f338503..7cd085f8961b633028d74718f3c065650b8edc53 100644 (file)
@@ -18,94 +18,93 @@ import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.sal.utils.StatusCode;
 
 public class StaticRouteConfigTest {
-       
-       @Test
-       public void testStaticRouteSetGet() {
-               StaticRouteConfig staticRouteConfig1 = new StaticRouteConfig();
-               staticRouteConfig1.setName("route");
-               staticRouteConfig1.setStaticRoute("10.1.1.2/32");
-               staticRouteConfig1.setNextHop("200.2.2.2");
-               staticRouteConfig1.setNextHopType(NextHopType.IPADDRESS.toString());
-               StaticRouteConfig staticRouteConfig2 = new StaticRouteConfig("route", "10.1.1.2/32", "200.2.2.2");
-               
-               Assert.assertEquals(staticRouteConfig2.getName(), staticRouteConfig1.getName());
-               Assert.assertEquals(staticRouteConfig2.getStaticRoute(), staticRouteConfig1.getStaticRoute());
-               Assert.assertEquals(staticRouteConfig2.getNextHop(), staticRouteConfig1.getNextHop());
-               Assert.assertEquals("nexthop-ip", staticRouteConfig1.getNextHopType());
-       }
-               
-       @Test
-       public void testStaticRouteisValid() {  
+
+        @Test
+        public void testStaticRouteSetGet() {
+                StaticRouteConfig staticRouteConfig1 = new StaticRouteConfig();
+                staticRouteConfig1.setName("route");
+                staticRouteConfig1.setStaticRoute("10.1.1.2/32");
+                staticRouteConfig1.setNextHop("200.2.2.2");
+                staticRouteConfig1.setNextHopType(NextHopType.IPADDRESS.toString());
+                StaticRouteConfig staticRouteConfig2 = new StaticRouteConfig("route", "10.1.1.2/32", "200.2.2.2");
+
+                Assert.assertEquals(staticRouteConfig2.getName(), staticRouteConfig1.getName());
+                Assert.assertEquals(staticRouteConfig2.getStaticRoute(), staticRouteConfig1.getStaticRoute());
+                Assert.assertEquals(staticRouteConfig2.getNextHop(), staticRouteConfig1.getNextHop());
+                Assert.assertEquals("nexthop-ip", staticRouteConfig1.getNextHopType());
+        }
+
+        @Test
+        public void testStaticRouteisValid() {
         StaticRouteConfig staticRouteConfig1 = new StaticRouteConfig("route1", "10.1.1.254/24", "100.1.1.1");
-               Status receivedResponse1 = staticRouteConfig1.isValid();
-               Status expectedResponse1 = new Status(StatusCode.SUCCESS, null);
-               Assert.assertEquals(expectedResponse1.toString(), receivedResponse1.toString());
-               
+                Status receivedResponse1 = staticRouteConfig1.isValid();
+                Status expectedResponse1 = new Status(StatusCode.SUCCESS, null);
+                Assert.assertEquals(expectedResponse1.toString(), receivedResponse1.toString());
+
         StaticRouteConfig staticRouteConfig2 = new StaticRouteConfig("", "", "100.1.1.1");
-               Status receivedResponse2 = staticRouteConfig2.isValid();
-               Status expectedResponse2 = new Status(StatusCode.BADREQUEST,
-                       "Invalid Static Route name");
-               Assert.assertEquals(expectedResponse2.toString(), receivedResponse2.toString());
+                Status receivedResponse2 = staticRouteConfig2.isValid();
+                Status expectedResponse2 = new Status(StatusCode.BADREQUEST,
+                        "Invalid Static Route name");
+                Assert.assertEquals(expectedResponse2.toString(), receivedResponse2.toString());
 
         StaticRouteConfig staticRouteConfig3 = new StaticRouteConfig("route1", "10.1.1.254", "100.1.1.1");
-               Status receivedResponse3 = staticRouteConfig3.isValid();
-               Status expectedResponse3 = new Status(StatusCode.BADREQUEST,
-                       "Invalid Static Route entry. Please use the " +
-                       "IPAddress/mask format. Default gateway " +
-                       "(0.0.0.0/0) is NOT supported.");
-               Assert.assertEquals(expectedResponse3.toString(), receivedResponse3.toString());
+                Status receivedResponse3 = staticRouteConfig3.isValid();
+                Status expectedResponse3 = new Status(StatusCode.BADREQUEST,
+                        "Invalid Static Route entry. Please use the " +
+                        "IPAddress/mask format. Default gateway " +
+                        "(0.0.0.0/0) is NOT supported.");
+                Assert.assertEquals(expectedResponse3.toString(), receivedResponse3.toString());
 
         StaticRouteConfig staticRouteConfig4 = new StaticRouteConfig("route1", "289.1.1.254/24", "100.1.1.1");
-               Status receivedResponse4 = staticRouteConfig4.isValid();
-               Status expectedResponse4 = new Status(StatusCode.BADREQUEST,
-                       "Invalid Static Route entry. Please use the " +
-                       "IPAddress/mask format. Default gateway " +
-                       "(0.0.0.0/0) is NOT supported.");
-               Assert.assertEquals(expectedResponse4.toString(), receivedResponse4.toString());
-               
+                Status receivedResponse4 = staticRouteConfig4.isValid();
+                Status expectedResponse4 = new Status(StatusCode.BADREQUEST,
+                        "Invalid Static Route entry. Please use the " +
+                        "IPAddress/mask format. Default gateway " +
+                        "(0.0.0.0/0) is NOT supported.");
+                Assert.assertEquals(expectedResponse4.toString(), receivedResponse4.toString());
+
         StaticRouteConfig staticRouteConfig5 = new StaticRouteConfig("route1", "10.1.1.254/24", "100.1.1");
-               Status receivedResponse5 = staticRouteConfig5.isValid();
-               Status expectedResponse5 = new Status(StatusCode.BADREQUEST,
-                       "Invalid NextHop IP Address configuration. " +
-                               "Please use the X.X.X.X format.");
-               Assert.assertEquals(expectedResponse5.toString(), receivedResponse5.toString());
-       }
-       
-       @Test
-       public void testGetStaticRouteIP() {
+                Status receivedResponse5 = staticRouteConfig5.isValid();
+                Status expectedResponse5 = new Status(StatusCode.BADREQUEST,
+                        "Invalid NextHop IP Address configuration. " +
+                                "Please use the X.X.X.X format.");
+                Assert.assertEquals(expectedResponse5.toString(), receivedResponse5.toString());
+        }
+
+        @Test
+        public void testGetStaticRouteIP() {
         StaticRouteConfig staticRouteConfig1 = new StaticRouteConfig("route1", "10.1.1.0/24", "100.1.1.1");
         InetAddress ip1 = staticRouteConfig1.getStaticRouteIP();
-               Assert.assertEquals("10.1.1.0", ip1.getHostAddress());        
-               
+                Assert.assertEquals("10.1.1.0", ip1.getHostAddress());
+
         StaticRouteConfig staticRouteConfig2 = new StaticRouteConfig("route1", "10.1.1.0/80", "100.1.1.1");
         InetAddress ip2 = staticRouteConfig2.getStaticRouteIP();
-               Assert.assertEquals(null, ip2);        
+                Assert.assertEquals(null, ip2);
+
+        }
 
-       }
-       
-       @Test
-       public void testGetStaticRouteMask() {
+        @Test
+        public void testGetStaticRouteMask() {
         StaticRouteConfig staticRouteConfig1 = new StaticRouteConfig("route1", "10.1.1.0/24", "100.1.1.1");
-               Short receivedMaskLen1 = staticRouteConfig1.getStaticRouteMask();
-               Short expectedMaskLen1 = 24;
-               Assert.assertEquals(expectedMaskLen1, receivedMaskLen1);
-
-               StaticRouteConfig staticRouteConfig2 = new StaticRouteConfig("route1", "10.1.1.0/40", "100.1.1.1");
-               Short receivedMaskLen2 = staticRouteConfig2.getStaticRouteMask();
-               Short expectedMaskLen2 = 0;
-               Assert.assertEquals(expectedMaskLen2, receivedMaskLen2);
-       }
-       
-       @Test 
-       public void testGetNextHopIP() {
+                Short receivedMaskLen1 = staticRouteConfig1.getStaticRouteMask();
+                Short expectedMaskLen1 = 24;
+                Assert.assertEquals(expectedMaskLen1, receivedMaskLen1);
+
+                StaticRouteConfig staticRouteConfig2 = new StaticRouteConfig("route1", "10.1.1.0/40", "100.1.1.1");
+                Short receivedMaskLen2 = staticRouteConfig2.getStaticRouteMask();
+                Short expectedMaskLen2 = 0;
+                Assert.assertEquals(expectedMaskLen2, receivedMaskLen2);
+        }
+
+        @Test
+        public void testGetNextHopIP() {
         StaticRouteConfig staticRouteConfig1 = new StaticRouteConfig("route1", "10.1.1.254/24", "100.1.1.1");
         InetAddress ip1 = staticRouteConfig1.getNextHopIP();
-               Assert.assertEquals("100.1.1.1", ip1.getHostAddress());                
+                Assert.assertEquals("100.1.1.1", ip1.getHostAddress());
 
-               StaticRouteConfig staticRouteConfig2 = new StaticRouteConfig("route1", "10.1.1.254/24", "100.1.1");
+                StaticRouteConfig staticRouteConfig2 = new StaticRouteConfig("route1", "10.1.1.254/24", "100.1.1");
         InetAddress ip2 = staticRouteConfig2.getNextHopIP();
-               Assert.assertEquals(null, ip2);                
-       }
-       
-}
+                Assert.assertEquals(null, ip2);
+        }
 
+}
index f05b10c9cfb879fc485ed36233c5ce1b2fe33b46..4a497a058c0df7a1bdc5b16c5a0cac656010c8f3 100644 (file)
@@ -23,35 +23,35 @@ import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
 import org.opendaylight.controller.sal.utils.NodeCreator;
 
 public class StaticRouteTest {
-       
-       @Test
-       public void testStaticRouteGetSet() {
-               StaticRoute staticRoute = new StaticRoute();
-               InetAddress networkAddress = null;
-               InetAddress mask = null;
-               InetAddress nextHopAddress = null;
-               try {
-                       networkAddress = InetAddress.getByName("10.1.1.0");
-                       mask = InetAddress.getByName("255.255.255.0");
-                       nextHopAddress = InetAddress.getByName("200.0.0.1");
-                       
-               } catch (UnknownHostException e) {
-                       Assert.assertTrue(false);
-               }
-               staticRoute.setNetworkAddress(networkAddress);
-               Assert.assertEquals(networkAddress.getHostAddress(), staticRoute.getNetworkAddress().getHostAddress());
-               staticRoute.setMask(mask);
-               Assert.assertEquals(mask.getHostAddress(), staticRoute.getMask().getHostAddress());
-               staticRoute.setType(NextHopType.IPADDRESS);
-               Assert.assertEquals("nexthop-ip", staticRoute.getType().toString());
-               staticRoute.setNextHopAddress(nextHopAddress);
-               Assert.assertEquals(nextHopAddress.getHostAddress(), staticRoute.getNextHopAddress().getHostAddress());
-               Node node = NodeCreator.createOFNode(((long)10));
-               staticRoute.setNode(node);
-               Assert.assertEquals(node, staticRoute.getNode());
-               NodeConnector nc0 = NodeConnectorCreator.createOFNodeConnector((short)20, node);
-               staticRoute.setPort(nc0);
-               Assert.assertEquals(nc0, staticRoute.getPort());
+
+        @Test
+        public void testStaticRouteGetSet() {
+                StaticRoute staticRoute = new StaticRoute();
+                InetAddress networkAddress = null;
+                InetAddress mask = null;
+                InetAddress nextHopAddress = null;
+                try {
+                        networkAddress = InetAddress.getByName("10.1.1.0");
+                        mask = InetAddress.getByName("255.255.255.0");
+                        nextHopAddress = InetAddress.getByName("200.0.0.1");
+
+                } catch (UnknownHostException e) {
+                        Assert.assertTrue(false);
+                }
+                staticRoute.setNetworkAddress(networkAddress);
+                Assert.assertEquals(networkAddress.getHostAddress(), staticRoute.getNetworkAddress().getHostAddress());
+                staticRoute.setMask(mask);
+                Assert.assertEquals(mask.getHostAddress(), staticRoute.getMask().getHostAddress());
+                staticRoute.setType(NextHopType.IPADDRESS);
+                Assert.assertEquals("nexthop-ip", staticRoute.getType().toString());
+                staticRoute.setNextHopAddress(nextHopAddress);
+                Assert.assertEquals(nextHopAddress.getHostAddress(), staticRoute.getNextHopAddress().getHostAddress());
+                Node node = NodeCreator.createOFNode(((long)10));
+                staticRoute.setNode(node);
+                Assert.assertEquals(node, staticRoute.getNode());
+                NodeConnector nc0 = NodeConnectorCreator.createOFNodeConnector((short)20, node);
+                staticRoute.setPort(nc0);
+                Assert.assertEquals(nc0, staticRoute.getPort());
         InetAddress ip1 = null;
         HostNodeConnector h1 = null;
         try {
@@ -66,10 +66,10 @@ public class StaticRouteTest {
         }
         staticRoute.setHost(h1);
         Assert.assertEquals(h1, staticRoute.getHost());
-       }
-       
-       @Test
-       public void testStaticRouteComparison() {
+        }
+
+        @Test
+        public void testStaticRouteComparison() {
         StaticRouteConfig staticRouteConfig1 = new StaticRouteConfig("route1", "10.1.1.0/24", "100.1.1.1");
         StaticRouteConfig staticRouteConfig2 = new StaticRouteConfig("route2", "10.1.1.0/24", "100.2.1.1");
         StaticRouteConfig staticRouteConfig3 = new StaticRouteConfig("route3", "10.2.1.0/24", "100.3.1.1");
@@ -82,28 +82,28 @@ public class StaticRouteTest {
         Assert.assertTrue(staticRoute1.equals(staticRoute2));
         Assert.assertFalse(staticRoute1.equals(staticRoute3));
         Assert.assertFalse(staticRoute1.equals(staticRoute4));
-        
+
         Assert.assertTrue(staticRoute1.compareTo(staticRoute2) == 0 ? true : false);
         Assert.assertFalse(staticRoute1.compareTo(staticRoute3) == 0 ? true : false);
         Assert.assertTrue(staticRoute1.compareTo(staticRoute4) == 0 ? true : false);
-                       
-       }
-       
-       @Test
-       public void testLongestPrefixMatch() {
+
+        }
+
+        @Test
+        public void testLongestPrefixMatch() {
         StaticRouteConfig staticRouteConfig1 = new StaticRouteConfig("route1", "10.1.1.254/24", "100.1.1.1");
         StaticRoute staticRoute1 = new StaticRoute(staticRouteConfig1);
-               InetAddress ip1 = null;
-               InetAddress ip2 = null;
-               try {
-                       ip1 = InetAddress.getByName("10.1.0.2");
-                       ip2 = InetAddress.getByName("10.1.1.2");
-               } catch (UnknownHostException e) {
-                       Assert.assertTrue(false);
-               }
+                InetAddress ip1 = null;
+                InetAddress ip2 = null;
+                try {
+                        ip1 = InetAddress.getByName("10.1.0.2");
+                        ip2 = InetAddress.getByName("10.1.1.2");
+                } catch (UnknownHostException e) {
+                        Assert.assertTrue(false);
+                }
         InetAddress rxdIp1 = staticRoute1.longestPrefixMatch(ip1);
         InetAddress rxdIp2 = staticRoute1.longestPrefixMatch(ip2);
-               Assert.assertEquals(null, rxdIp1);
-               Assert.assertEquals("10.1.1.0", rxdIp2.getHostAddress());
-       }
+                Assert.assertEquals(null, rxdIp1);
+                Assert.assertEquals("10.1.1.0", rxdIp2.getHostAddress());
+        }
 }
index 4df0590b1da759c74b4274149ce2a537570e7614..4c9d4ab1f3a054f60f00295e3bef8407d0d23bf3 100644 (file)
@@ -13,16 +13,12 @@ import org.junit.Assert;
 import org.junit.Test;
 
 public class StaticRoutingImplementationTest {
-       
-       @Test
-       public void isIPv4AddressValidTest() {
-               StaticRoutingImplementation staticRouteImpl = new StaticRoutingImplementation();
-        Assert.assertTrue(staticRouteImpl.isIPv4AddressValid("192.168.100.0/24"));             
-        Assert.assertFalse(staticRouteImpl.isIPv4AddressValid("192.168.100.0/36"));            
-        Assert.assertFalse(staticRouteImpl.isIPv4AddressValid("192.168.300.0/32"));            
-       }
-}
-
-
-
 
+        @Test
+        public void isIPv4AddressValidTest() {
+                StaticRoutingImplementation staticRouteImpl = new StaticRoutingImplementation();
+        Assert.assertTrue(staticRouteImpl.isIPv4AddressValid("192.168.100.0/24"));
+        Assert.assertFalse(staticRouteImpl.isIPv4AddressValid("192.168.100.0/36"));
+        Assert.assertFalse(staticRouteImpl.isIPv4AddressValid("192.168.300.0/32"));
+        }
+}
index 6aa5b07e2a0e782c81f15de11835758ce1cc4cea..8a055329e1fcebc99c60a904b4dc547779010e56 100644 (file)
@@ -51,7 +51,7 @@ public class FlowEntry implements Cloneable, Serializable {
 
     /**
      * Return the actual Flow contained in this entry
-     * 
+     *
      * @return the flow
      */
     public Flow getFlow() {
@@ -147,12 +147,12 @@ public class FlowEntry implements Cloneable, Serializable {
 
     /**
      * Merges the current Flow with the passed Container Flow
-     * 
+     *
      * Note: Container Flow merging is not an injective function. Be m1 and m2
      * two different matches, and be f() the flow merge function, such that y1 =
      * f(m1) and y2 = f(m2) are the two merged matches, we may have: y1 = y2
-     * 
-     * 
+     *
+     *
      * @param containerFlow
      * @return this merged FlowEntry
      */
index 18255bc021aeffbc4ee5b887d98b19065dd9d08a..311d2f96ac05505fcbbd8d16b3b49c4037df5250 100644 (file)
@@ -17,10 +17,10 @@ import org.opendaylight.controller.sal.core.Node;
  * install, the container flow with which that entry had to be merged and the
  * resultant merged flow entry, which is the one that was eventually installed
  * on the network node
- * 
+ *
  * Note: If the container flow is null, the install entry will be a clone of the
  * original entry
- * 
+ *
  */
 public class FlowEntryInstall {
     private FlowEntry original;
@@ -115,7 +115,7 @@ public class FlowEntryInstall {
     public void setRequestId(long rid) {
         this.requestId = rid;
     }
-    
+
     public long getRequestId() {
         return requestId;
     }
index 087c0bc878b7140e4d409dc14ba5cad1b0b19b5d..b3d0c8acdf535f2f48d77c5940970587bbee954d 100644 (file)
@@ -18,7 +18,7 @@ import org.opendaylight.controller.sal.utils.Status;
 /**
  * Interface that describes methods for installing or removing forwarding rules
  * and to access to the flows database.
- * 
+ *
  */
 public interface IForwardingRulesManager {
 
@@ -27,7 +27,7 @@ public interface IForwardingRulesManager {
      * SDN protocol plugin to install the flow on the network node. Based on the
      * result of this operation FRM will update its database accordingly and
      * will return the proper {@code Status} code.
-     * 
+     *
      * @param flow
      *            the flow entry to install
      * @return the {@code Status} object indicating the result of this action.
@@ -39,7 +39,7 @@ public interface IForwardingRulesManager {
      * protocol plugin to uninstall the flow from the network node. Based on the
      * result of this operation FRM will update its database accordingly and
      * will return the proper {@code Status} code.
-     * 
+     *
      * @param flow
      *            the flow entry to uninstall
      * @return the {@code Status} object indicating the result of this action
@@ -53,7 +53,7 @@ public interface IForwardingRulesManager {
      * modify message depending on the SDN protocol specifications If the
      * current flow is equal to the new one it will be a no op and success code
      * is returned.
-     * 
+     *
      * @param current
      *            the current flow entry to modify
      * @param newone
@@ -72,8 +72,8 @@ public interface IForwardingRulesManager {
      * it, it will request plugin to add the new flow. If the passed entry is
      * not valid an error code is returned. If the existing flow is equal to the
      * passed one it will be a no op and success code is returned.
-     * 
-     * 
+     *
+     *
      * @param newone
      *            the new flow entry to install
      * @return the {@code Status} object indicating the result of this action
@@ -86,7 +86,7 @@ public interface IForwardingRulesManager {
      * SDN protocol plugin to install the flow on the network node. As immediate
      * result of this asynchronous call, FRM will update its flow database as if
      * the flow was successfully installed.
-     * 
+     *
      * @param flow
      *            the flow entry to install
      * @return the status of this request containing the request id associated
@@ -100,7 +100,7 @@ public interface IForwardingRulesManager {
      * SDN protocol plugin to uninstall the flow from the network node. As
      * immediate result of this asynchronous call, FRM will update its flow
      * database as if the flow was successfully installed.
-     * 
+     *
      * @param flow
      *            the flow entry to uninstall
      * @return the status of this request containing the unique id associated to
@@ -115,7 +115,7 @@ public interface IForwardingRulesManager {
      * this message to the network node. It could be a delete + add or a single
      * modify message depending on the SDN protocol specifications. If the
      * current flow is equal to the new one it will be a no op.
-     * 
+     *
      * @param current
      *            the current flow entry to modify
      * @param newone
@@ -136,7 +136,7 @@ public interface IForwardingRulesManager {
      * it, it will request plugin to add the new flow. If the passed entry is
      * not valid a zero request id is returned. If the existing flow is equal to
      * the passed one it will be a no op.
-     * 
+     *
      * @param newone
      *            the new flow entry to install
      * @return the unique id associated to this request. In case of not
@@ -154,7 +154,7 @@ public interface IForwardingRulesManager {
      * blocked until the solicitation response is received from the network node
      * or receive timeout. Otherwise, it is a non-blocking call and does not
      * guarantee the node will respond in any given time.
-     * 
+     *
      * @param node
      *            The network node to solicit a response
      * @param blocking
@@ -166,7 +166,7 @@ public interface IForwardingRulesManager {
 
     /**
      * Check whether the passed flow entry conflicts with the Container flows
-     * 
+     *
      * @param flow
      *            the flow entry to test
      * @return true if conflicts, false otherwise
@@ -176,7 +176,7 @@ public interface IForwardingRulesManager {
     /**
      * Returns the list of Flow entries across network nodes which are part of
      * the same flow group, policy
-     * 
+     *
      * @param group
      *            the group name
      * @return the list of flow entries belonging to the specified group
@@ -186,7 +186,7 @@ public interface IForwardingRulesManager {
     /**
      * Add a list of output port to the flow with the specified name on the
      * specified network node
-     * 
+     *
      * @param node
      *            the network node
      * @param flowName
@@ -200,7 +200,7 @@ public interface IForwardingRulesManager {
     /**
      * Remove a list of output port from the flow with the specified name on the
      * specified network node
-     * 
+     *
      * @param node
      *            the network node
      * @param flowName
@@ -214,7 +214,7 @@ public interface IForwardingRulesManager {
     /**
      * Replace the current output port in the specified flow with the specified
      * one
-     * 
+     *
      * @param node
      *            the network node
      * @param groupName
@@ -229,7 +229,7 @@ public interface IForwardingRulesManager {
 
     /**
      * Returns the output port configured on the specified flow
-     * 
+     *
      * @param node
      *            the network node
      * @param flowName
@@ -242,14 +242,14 @@ public interface IForwardingRulesManager {
      * Returns all the troubleshooting information that applications have set
      * along with the policy they have configured through forwarding rules
      * manger.
-     * 
+     *
      * @return the collection of troubleshooting objects
      */
     public Map<String, Object> getTSPolicyData();
 
     /**
      * Set the troubleshooting information for the policy
-     * 
+     *
      * @param policyname
      *            the flow group name
      * @param o
@@ -262,7 +262,7 @@ public interface IForwardingRulesManager {
     /**
      * Returns the troubleshooting information that was set for the specified
      * policy
-     * 
+     *
      * @param groupName
      *            the flows group name
      * @return the troubleshooting info object
@@ -272,7 +272,7 @@ public interface IForwardingRulesManager {
     /**
      * Returns the specifications of all the flows configured for all the
      * switches on the current container
-     * 
+     *
      * @return the list of flow configurations present in the database
      */
     public List<FlowConfig> getStaticFlows();
@@ -280,7 +280,7 @@ public interface IForwardingRulesManager {
     /**
      * Returns the specifications of all the flows configured for the given
      * switch on the current container
-     * 
+     *
      * @param node
      *            the network node identifier
      * @return the list of {@code FlowConfig} objects
@@ -290,7 +290,7 @@ public interface IForwardingRulesManager {
     /**
      * Returns the specification of the flow configured for the given network
      * node on the current container
-     * 
+     *
      * @param name
      *            the flow name
      * @param n
@@ -302,7 +302,7 @@ public interface IForwardingRulesManager {
     /**
      * Returns the list of names of flows configured for the given Network node
      * on the current container
-     * 
+     *
      * @param node
      *            the network node identifier
      * @return the list of flow names
@@ -311,14 +311,14 @@ public interface IForwardingRulesManager {
 
     /**
      * Returns the list of Node(s) for which a static flow has been configured
-     * 
+     *
      * @return the list of network nodes
      */
     public List<Node> getListNodeWithConfiguredFlows();
 
     /**
      * Save the flow configured so far to file
-     * 
+     *
      * @return the {@code Status} object indicating the result of this action.
      */
     public Status saveConfig();
@@ -326,7 +326,7 @@ public interface IForwardingRulesManager {
     /**
      * Add a flow specified by the {@code FlowConfig} object on the current
      * container
-     * 
+     *
      * @param config
      *            the {@code FlowConfig} object representing the static flow
      * @param restore
@@ -339,7 +339,7 @@ public interface IForwardingRulesManager {
     /**
      * Remove a flow specified by the {@code FlowConfig} object on the current
      * container
-     * 
+     *
      * @param config
      *            the {@code FlowConfig} object representing the static flow
      * @return the {@code Status} object indicating the result of this action
@@ -350,7 +350,7 @@ public interface IForwardingRulesManager {
      * Replace the flow identified by the {@code FlowConfig.name} name for the
      * {@code FlowConfig.node} network node with the new flow specified by
      * {@code FlowConfig} object
-     * 
+     *
      * @param config
      *            the {@code FlowConfig} object
      * @returnthe {@code Status} object indicating the result of this action
@@ -359,7 +359,7 @@ public interface IForwardingRulesManager {
 
     /**
      * Remove the flow specified by name on the passed network node
-     * 
+     *
      * @param name
      *            for the static flow
      * @param node
@@ -372,7 +372,7 @@ public interface IForwardingRulesManager {
      * Toggle the installation status of the specified configured flow If the
      * flow configuration status is active, this call will change the flow
      * status to inactive and vice-versa
-     * 
+     *
      * @param configObject
      *            the {@code FlowConfig} object
      * @return the {@code Status} object indicating the result of this action
@@ -383,7 +383,7 @@ public interface IForwardingRulesManager {
      * Toggle the installation status of the specified configured flow If the
      * flow configuration status is active, this call will change the flow
      * status to inactive and vice-versa
-     * 
+     *
      * @param name
      *            for the static flow
      * @param node
index 43d1b29a7577978e3ae8b76ae021ac91f0ba288c..952b3cdff7bb139890d6e533d6173f7da9f9cfe1 100644 (file)
@@ -11,14 +11,14 @@ package org.opendaylight.controller.forwardingrulesmanager;
 /**
  * The interface which describes the methods forwarding rules manager will call
  * for notifying the listeners of policy installation updates.
- * 
+ *
  */
 public interface IForwardingRulesManagerAware {
 
     /**
      * Inform the listeners that a troubleshooting information was added or
      * removed for the specified policy.
-     * 
+     *
      * @param policyName
      *            the policy affected
      * @param add
@@ -31,7 +31,7 @@ public interface IForwardingRulesManagerAware {
      * Inform listeners that the network node has notified us about a failure in
      * executing the controller generated asynchronous request identified by the
      * passed unique id.
-     * 
+     *
      * @param requestId
      *            the unique id associated with the request which failed to be
      *            executed on the network node
index 5acd3e2ebc28638a656eb7c1705aea2e4f790e3a..95e9b00d14d78dba23bc508b21c1859aea33cfc8 100644 (file)
@@ -14,11 +14,11 @@ import java.util.Set;
 /**
  * PortGroup is a simple data-structure to represent any arbitrary group of
  * ports on a Switch (that is represented using its switch-ID).
- * 
+ *
  * PortGroup is used by PortGroupProvider application to signal a set of ports
  * that represent a configured PortGroupConfig.
- * 
- * 
+ *
+ *
  */
 public class PortGroup {
     private long matrixSwitchId;
@@ -26,7 +26,7 @@ public class PortGroup {
 
     /**
      * PortGroup Constructor using Switch and Ports.
-     * 
+     *
      * @param matrixSwitchId
      *            Switch Id that represents an openflow Switch
      * @param ports
@@ -40,7 +40,7 @@ public class PortGroup {
 
     /**
      * PortGroup Constructor using Switch.
-     * 
+     *
      * @param matrixSwitchId
      *            Switch-Id that represents an openflow Switch
      */
@@ -51,7 +51,7 @@ public class PortGroup {
 
     /**
      * Returns the switchId representing the Switch that makes this PortGroup.
-     * 
+     *
      * @return long switchId
      */
     public long getMatrixSwitchId() {
@@ -60,7 +60,7 @@ public class PortGroup {
 
     /**
      * Assigns a Switch to this PortGroup
-     * 
+     *
      * @param matrixSwitchId
      *            Switch-Id that represents an openflow Switch
      */
@@ -70,7 +70,7 @@ public class PortGroup {
 
     /**
      * Returns the Set of Ports that makes this PortGroup.
-     * 
+     *
      * @return Set of short values representing openflow port-ids.
      */
     public Set<Short> getPorts() {
@@ -79,7 +79,7 @@ public class PortGroup {
 
     /**
      * Assigns a set of openflow ports to this PortGroup
-     * 
+     *
      * @param ports
      *            Set of short values representing openflow port-ids.
      */
@@ -89,7 +89,7 @@ public class PortGroup {
 
     /**
      * Adds a port to this PortGroup
-     * 
+     *
      * @param port
      *            Short value of a openflow port.
      */
index 7c8ade5b897dd72a7bcd954d7e19e5fbba5cc6d5..77ff64014b7e2a05a95e44c2a69a97e9508ef32b 100644 (file)
@@ -15,14 +15,14 @@ import org.opendaylight.controller.sal.core.Node;
 /**
  * PortGroupChangeListener listens to the PortGroup updates provided by the
  * PortGroupProvider.
- * 
- * 
+ *
+ *
  */
 public interface PortGroupChangeListener {
     /**
      * This method is invoked by PortGroupProvider whenever it detects a change
      * in PortGroup membership for a given PortGroupConfig.
-     * 
+     *
      * @param config
      *            Port Group Configuration
      * @param portGroupData
index 164f26484e24cd29eedc54e1707b5df8d63c1951..b45f4898bfd076c8c551f99d6c968f55ce571968 100644 (file)
@@ -16,12 +16,12 @@ import java.util.List;
 /**
  * PortGroupConfig class represents the User's Configuration with a Opaque
  * Regular Expression String that is parsed and handled by PortGroupProvider.
- * 
+ *
  * Typically, the opaque matchString will be a Regular Expression String
  * supported by a particular PortGroupProvider based on Customer requirements.
- * 
- * 
- * 
+ *
+ *
+ *
  */
 public class PortGroupConfig implements Serializable {
     private static final long serialVersionUID = 1L;
@@ -41,7 +41,7 @@ public class PortGroupConfig implements Serializable {
     /**
      * Constructor to create a Port Group Configuration using a Group Name and
      * an Opaque String that is managed by PortGroupProvider.
-     * 
+     *
      * @param name
      *            Group Name representing a Port Group configuration
      * @param matchString
@@ -55,7 +55,7 @@ public class PortGroupConfig implements Serializable {
 
     /**
      * Returns the user configured PortGroup Configuration name.
-     * 
+     *
      * @return Configuration Name
      */
     public String getName() {
@@ -64,7 +64,7 @@ public class PortGroupConfig implements Serializable {
 
     /**
      * Assigns a name to the configuration
-     * 
+     *
      * @param name
      *            configuration name
      */
@@ -74,7 +74,7 @@ public class PortGroupConfig implements Serializable {
 
     /**
      * Returns the Opaque string
-     * 
+     *
      * @return
      */
     public String getMatchString() {
@@ -83,7 +83,7 @@ public class PortGroupConfig implements Serializable {
 
     /**
      * Assigns an opaque String to the Configuration.
-     * 
+     *
      * @param matchString
      *            Opaque string handled by PortGroupProvider
      */
@@ -94,7 +94,7 @@ public class PortGroupConfig implements Serializable {
     /**
      * Returns the names of all the configurable fields in PortGroupConfig. This
      * method is typically used by NorthBound apis.
-     * 
+     *
      * @return List of Field names that can be configured.
      */
     public static List<String> getFieldsNames() {
@@ -113,7 +113,7 @@ public class PortGroupConfig implements Serializable {
      * Returns the names of all the configurable fields in PortGroupConfig in
      * human readable format for UI purposes. This method is typically used by
      * Web/UI apis.
-     * 
+     *
      * @return List of Human readable Strings that corresponds to the
      *         configurable field names.
      */
index 37cbcd17e6c149e57b0daab5da30085ce4d7f985..5a9281aea8da59ebc47a35627661b30ffbf23a5a 100644 (file)
@@ -17,15 +17,15 @@ import org.opendaylight.controller.sal.core.Node;
  * application to implement in order to provide Port Grouping Service. Custom
  * Application that implements this interface will have to handle the opaque
  * match criteria passed to it via PortGroupConfig.
- * 
- * 
- * 
+ *
+ *
+ *
  */
 public interface PortGroupProvider {
     /**
      * This method is invoked by the Controller towards the Provider when a new
      * port group is configured.
-     * 
+     *
      * @param config
      *            New PortGroupConfig object created by user Configuration.
      * @return true if successful. false otherwise.
@@ -35,7 +35,7 @@ public interface PortGroupProvider {
     /**
      * This method is invoked by the Controller towards the Provider when an
      * existing port group is deleted.
-     * 
+     *
      * @param config
      *            Existing Port Group Configuration deleted by the user.
      * @return true if successful. false otherwise.
@@ -47,7 +47,7 @@ public interface PortGroupProvider {
      * Configuration. Its the PortGroupProvider Application's responsibility to
      * manage the Switches & the Set of its Ports that correspond to each of the
      * Configuration and return it to the Controller when requested.
-     * 
+     *
      * @param config
      *            User Configuration
      * @see PortGroupConfig
@@ -61,7 +61,7 @@ public interface PortGroupProvider {
      * PortGroupProvider Application's responsibility to manage the Switches &
      * the Set of its Ports that correspond to each of the Configuration and
      * return it to the Controller when requested.
-     * 
+     *
      * @param config
      *            User Configuration
      * @param matrixSwitchId
@@ -76,7 +76,7 @@ public interface PortGroupProvider {
     /**
      * Registers a Listener for Port Group membership changes based on Custom
      * application algorithm.
-     * 
+     *
      * @param listener
      *            A Controller module that listens to events from the Custom
      *            Port Grouping Application.
@@ -89,7 +89,7 @@ public interface PortGroupProvider {
      * implement Custom Algorithm for Port Grouping. This method exposes the
      * custom algorithm to the user so that the user can configure the
      * matchString regular expression in PortGroupConfig appropriately.
-     * 
+     *
      * @return Usage string.
      */
     public String getApplicationDrivenMatchCriteriaUsage();
@@ -97,7 +97,7 @@ public interface PortGroupProvider {
     /**
      * Returns the name of the Custom Application that implements
      * PortGroupProvider interface.
-     * 
+     *
      * @return Provider Name
      */
     public String getProviderName();
@@ -105,7 +105,7 @@ public interface PortGroupProvider {
     /**
      * Controller uses this method to check with the Provider supports the
      * matchCriteria String configured by the User.
-     * 
+     *
      * @param matchCriteria
      * @return true if the Provider supports the matchCriteria String. false
      *         otherwise.
index d0a370276fa9d17995802e65c29193b911e266dc..969287719db083e747e25099e2f9fafbed50e4ff 100644 (file)
@@ -40,7 +40,7 @@ public class Activator extends ComponentActivatorAbstractBase {
     /**
      * Function called when the activator starts just after some initializations
      * are done by the ComponentActivatorAbstractBase.
-     * 
+     *
      */
     public void init() {
 
@@ -49,7 +49,7 @@ public class Activator extends ComponentActivatorAbstractBase {
     /**
      * Function called when the activator stops just before the cleanup done by
      * ComponentActivatorAbstractBase
-     * 
+     *
      */
     public void destroy() {
 
@@ -58,8 +58,8 @@ public class Activator extends ComponentActivatorAbstractBase {
     /**
      * Function that is used to communicate to dependency manager the list of
      * known implementations for services inside a container
-     * 
-     * 
+     *
+     *
      * @return An array containing all the CLASS objects that will be
      *         instantiated in order to get an fully working implementation
      *         Object
@@ -72,7 +72,7 @@ public class Activator extends ComponentActivatorAbstractBase {
     /**
      * Function that is called when configuration of the dependencies is
      * required.
-     * 
+     *
      * @param c
      *            dependency manager Component object, used for configuring the
      *            dependencies exported and imported
index 5fbe12bd1ca44218a9629e50489540bd85d83302..db1186e6b753a88e46ff9d2913f801d827764f01 100644 (file)
@@ -135,7 +135,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
      * Adds a flow entry onto the network node It runs various validity checks
      * and derive the final container flows merged entries that will be
      * attempted to be installed
-     * 
+     *
      * @param flowEntry
      *            the original flow entry application requested to add
      * @param async
@@ -144,7 +144,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
      *          will contain the unique id assigned to this request
      */
     private Status addEntry(FlowEntry flowEntry, boolean async) {
-        
+
         // Sanity Check
         if (flowEntry == null || flowEntry.getNode() == null) {
             String msg = "Invalid FlowEntry";
@@ -209,7 +209,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
                  * complication for now and assume we will always deal with
                  * one flow only per request
                  */
-                succeded = ret;   
+                succeded = ret;
             } else {
                 error = ret;
                 log.warn("Failed to install the entry: {}. The failure is: {}",
@@ -228,7 +228,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
      * flow entry is congruent with all the N container flows, then the output
      * install entry list will contain N entries. If the output list is empty,
      * it means the passed flow entry conflicts with all the container flows.
-     * 
+     *
      * @param cFlowList
      *            The list of container flows
      * @return the list of container flow merged entries good to be installed on
@@ -260,7 +260,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
     /**
      * Modify a flow entry with a new one It runs various validity check and
      * derive the final container flows merged flow entries to work with
-     * 
+     *
      * @param currentFlowEntry
      * @param newFlowEntry
      * @param async
@@ -335,13 +335,13 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
          * This is only possible when the new entry and current entry have
          * different match. In this scenario the modification would ultimately
          * be handled as a remove and add operations in the protocol plugin.
-         * 
+         *
          * Also, if any of the new flow entries would clash with an existing
          * one, we cannot proceed with the modify operation, because it would
          * fail for some entries and leave stale entries on the network node.
          * Modify path can be taken only if it can be performed completely, for
          * all entries.
-         * 
+         *
          * So, for the above two cases, to simplify, let's decouple the modify
          * in: 1) remove current entries 2) install new entries
          */
@@ -384,7 +384,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
              * (and might be wrong) that the same container flows that were
              * satisfied by the current entries are the same that are satisfied
              * by the new entries. Let's take the risk for now.
-             * 
+             *
              * Note: modification has to be complete. If any entry modification
              * fails, we need to stop, restore the already modified entries, and
              * declare failure.
@@ -440,7 +440,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
      * This is the function that modifies the final container flows merged
      * entries on the network node and update the database. It expects that all
      * the validity checks are passed
-     * 
+     *
      * @param currentEntries
      * @param newEntries
      * @param async
@@ -451,7 +451,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
     private Status modifyEntryInternal(FlowEntryInstall currentEntries,
             FlowEntryInstall newEntries, boolean async) {
         // Modify the flow on the network node
-        Status status = (async)? 
+        Status status = (async)?
                 programmer.modifyFlowAsync(currentEntries.getNode(),
                         currentEntries.getInstall().getFlow(), newEntries.getInstall()
                                 .getFlow()) :
@@ -481,7 +481,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
     /**
      * Remove a flow entry. If the entry is not present in the software view
      * (entry or node not present), it return successfully
-     * 
+     *
      * @param flowEntry
      *          the flow entry to remove
      * @param async
@@ -554,7 +554,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
      * This is the function that removes the final container flows merged entry
      * from the network node and update the database. It expects that all the
      * validity checks are passed
-     * 
+     *
      * @param entry
      *            the flow entry to remove
      * @param async
@@ -572,7 +572,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
                         .getInstall().getFlow()) :
                 programmer.removeFlow(entry.getNode(), entry
                         .getInstall().getFlow());
+
 
         if (!status.isSuccess()) {
             log.warn(
@@ -593,7 +593,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
      * on the network node and updates the database. It expects that all the
      * validity and conflict checks are passed. That means it does not check
      * whether this flow would conflict or overwrite an existing one.
-     * 
+     *
      * @param entry
      *            the flow entry to install
      * @param async
@@ -631,7 +631,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
      * means that if the function returns true, the passed flow entry is
      * congruent with at least one container flow, hence it is good to be
      * installed on this container.
-     * 
+     *
      * @param flowEntry
      * @return true if flow conflicts with all the container flows, false
      *         otherwise
@@ -837,7 +837,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
         }
         return status;
     }
-    
+
     @Override
     public Status modifyFlowEntry(FlowEntry currentFlowEntry,
             FlowEntry newFlowEntry) {
@@ -908,13 +908,13 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
         }
     }
 
-    
+
     /**
      * Try to find in the database if a Flow with the same Match and priority of
      * the passed one already exists for the specified network node. Flow,
      * priority and network node are all specified in the FlowEntry If found,
      * the respective FlowEntryInstall Object is returned
-     * 
+     *
      * @param flowEntry
      *            the FlowEntry to be tested against the ones installed
      * @param looseCheck
@@ -1409,9 +1409,9 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
          * multiple entry configuration (PortGroup) and hardware installation is
          * NOT done directly on this event. 3. The User prefers to retain the
          * configuration in Controller and skip hardware installation.
-         * 
+         *
          * Hence it is safe to update the StaticFlow DB at this point.
-         * 
+         *
          * Note : For the case of PortGrouping, it is essential to have this DB
          * populated before the PortGroupListeners can query for the DB
          * triggered using portGroupChanged event...
@@ -1924,7 +1924,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
 
     /**
      * Remove from the databases all the flows installed on the node
-     * 
+     *
      * @param node
      */
     private synchronized void cleanDatabaseForNode(Node node) {
@@ -2210,7 +2210,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
-     * 
+     *
      */
     void init() {
         frmAware = Collections
@@ -2245,7 +2245,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
      * Function called by the dependency manager when at least one dependency
      * become unsatisfied or when the component is shutting down because for
      * example bundle is being stopped.
-     * 
+     *
      */
     void destroy() {
         destroyCaches();
@@ -2254,7 +2254,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
     /**
      * Function called by dependency manager after "init ()" is called and after
      * the services provided by the class are registered in the service registry
-     * 
+     *
      */
     void start() {
         /*
@@ -2270,7 +2270,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
      * Function called by the dependency manager before the services exported by
      * the component are unregistered, this will be followed by a "destroy ()"
      * calls
-     * 
+     *
      */
     void stop() {
     }
@@ -2541,8 +2541,8 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
         /*
          *  If this was for a flow install, remove the corresponding entry
          *  from the software view. If it was a Looking for the rid going through the
-         *  software database. 
-         *  TODO: A more efficient rid <->  FlowEntryInstall mapping will 
+         *  software database.
+         *  TODO: A more efficient rid <->  FlowEntryInstall mapping will
          *  have to be added in future
          */
         Set<FlowEntryInstall> entries = nodeFlows.get(node);
@@ -2559,7 +2559,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
                 this.updateLocalDatabase(target, false);
             }
         }
-        
+
         // Notify listeners
         if (frmAware != null) {
             synchronized (frmAware) {
@@ -2573,19 +2573,19 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager,
             }
         }
     }
-    
+
     @Override
     public Status solicitStatusResponse(Node node, boolean blocking) {
         Status rv = new Status(StatusCode.INTERNALERROR);
-        
+
         if (this.programmer != null) {
             if (blocking) {
                 rv = programmer.syncSendBarrierMessage(node);
             } else {
-                rv = programmer.asyncSendBarrierMessage(node);                
+                rv = programmer.asyncSendBarrierMessage(node);
             }
         }
-        
+
         return rv;
     }
 }
index cb15fb09fd7e4e040013d8835730a7cd1c7a111c..d7c6fdbb3d7fead1d8d0d8c24ecee16ea907d493 100644 (file)
@@ -26,7 +26,7 @@ public interface IfHostListener {
      * of coming up a new Host. For the hosts which it has already
      * learned, it refreshes them.
      *
-     * @param host             Host info encapsulated in HostNodeConnector class
+     * @param host      Host info encapsulated in HostNodeConnector class
      */
     public void hostListener(HostNodeConnector host);
 }
index 554da42f4a7b0323cf4fb49f0843d2fe57248e57..fdb1e72b3f4ce9c7c1ccc147872409dd5b399060 100644 (file)
@@ -32,10 +32,10 @@ public interface IfIptoHost {
      * Northbound APIs. If a binding is unknown, then an ARP request is initiated
      * immediately to discover the host.
      *
-     * @param networkAddress   IP Address of the Host encapsulated in class InetAddress
-     * @return                                 {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
-     *                                                         Class that contains the Host info such as its MAC address,
-     *                                                         Switch ID, port, VLAN. If Host is not found, returns NULL
+     * @param networkAddress    IP Address of the Host encapsulated in class InetAddress
+     * @return                  {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
+     *                                                  Class that contains the Host info such as its MAC address,
+     *                                                  Switch ID, port, VLAN. If Host is not found, returns NULL
      */
     public HostNodeConnector hostFind(InetAddress networkAddress);
 
@@ -43,10 +43,10 @@ public interface IfIptoHost {
      * Checks the local Host Database to see if a Host has been learned for a
      * given IP address.
      *
-     * @param networkAddress   IP Address of the Host encapsulated in class InetAddress
-     * @return                                 {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
-     *                                                         Class that contains the Host info such as its MAC address,
-     *                                                         Switch ID, port, VLAN. If Host is not found, returns NULL
+     * @param networkAddress    IP Address of the Host encapsulated in class InetAddress
+     * @return                  {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
+     *                                                  Class that contains the Host info such as its MAC address,
+     *                                                  Switch ID, port, VLAN. If Host is not found, returns NULL
      *
      */
     public HostNodeConnector hostQuery(InetAddress networkAddress);
@@ -55,8 +55,8 @@ public interface IfIptoHost {
      * Initiates an immediate discovery of the Host for a given IP address. This
      * provides for the calling applications to block on the host discovery.
      *
-     * @param networkAddress           IP address encapsulated in InetAddress class
-     * @return                                         Future {@link org.opendaylight.controller.hosttracker.HostTrackerCallable}
+     * @param networkAddress            IP address encapsulated in InetAddress class
+     * @return                      Future {@link org.opendaylight.controller.hosttracker.HostTrackerCallable}
      */
     public Future<HostNodeConnector> discoverHost(InetAddress networkAddress);
 
@@ -64,8 +64,8 @@ public interface IfIptoHost {
      * Returns the Network Hierarchy for a given Host. This API is typically used by
      * applications like Hadoop for Rack Awareness functionality.
      *
-     * @param                                  IP address of the Host encapsulated in InetAddress class
-     * @return                                 List of String ArrayList containing the Hierarchies.
+     * @param                                   IP address of the Host encapsulated in InetAddress class
+     * @return                  List of String ArrayList containing the Hierarchies.
      */
     public List<List<String>> getHostNetworkHierarchy(InetAddress hostAddress);
 
@@ -73,9 +73,9 @@ public interface IfIptoHost {
      * Returns all the the Hosts either learned dynamically or added statically via
      * Northbound APIs.
      *
-     * @return                                 Set of {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}.
-     *                                                         Class that contains the Host info such as its MAC address,
-     *                                                         Switch ID, port, VLAN.
+     * @return                  Set of {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}.
+     *                                                  Class that contains the Host info such as its MAC address,
+     *                                                  Switch ID, port, VLAN.
      */
     public Set<HostNodeConnector> getAllHosts();
 
@@ -84,9 +84,9 @@ public interface IfIptoHost {
      * are categorized as "Active" because the Switch and Port they are connected to, are in
      * up state.
      *
-     * @return                                 Set of {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}.
-     *                                                         Class that contains the Host info such as MAC address,
-     *                                                         Switch ID, port, VLAN. If Host is not found, returns NULL
+     * @return                  Set of {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}.
+     *                                                  Class that contains the Host info such as MAC address,
+     *                                                  Switch ID, port, VLAN. If Host is not found, returns NULL
      */
     public Set<HostNodeConnector> getActiveStaticHosts();
 
@@ -95,10 +95,10 @@ public interface IfIptoHost {
      * are categorized as "Inactive" because either the Switch or the Port they are connected
      * to, is in down state.
      *
-     * @return                                 Set of HostNodeConnector {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}.
-     *                                                         HostNodeConnector is Class that
-     *                                                         contains the Host info such as its MAC address, OpenFlowNode
-     *                                                         ID, port, VLAN.
+     * @return                  Set of HostNodeConnector {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}.
+     *                                                  HostNodeConnector is Class that
+     *                                                  contains the Host info such as its MAC address, OpenFlowNode
+     *                                                  ID, port, VLAN.
      */
     public Set<HostNodeConnector> getInactiveStaticHosts();
 
@@ -106,12 +106,12 @@ public interface IfIptoHost {
      * Hosts can be learned dynamically or added statically. This method allows the addition
      * of a Host to the local database statically.
      *
-     * @param networkAddress           IP Address of the Host
-     * @param dataLayerAddress         MAC Address of the Host
-     * @param nc                                   NodeConnector to which the host is attached
-     * @param vlan                                     VLAN the host belongs to
-     * @return                                         The status object as described in {@code Status}
-     *                                                                 indicating the result of this action.
+     * @param networkAddress        IP Address of the Host
+     * @param dataLayerAddress      MAC Address of the Host
+     * @param nc                                    NodeConnector to which the host is attached
+     * @param vlan                  VLAN the host belongs to
+     * @return                      The status object as described in {@code Status}
+     *                                                          indicating the result of this action.
      */
     public Status addStaticHost(String networkAddress, String dataLayerAddress,
                                 NodeConnector nc, String vlan);
@@ -120,8 +120,8 @@ public interface IfIptoHost {
      * Allows the deletion of statically learned Host
      *
      * @param networkAddress
-     * @return                                         The status object as described in {@code Status}
-     *                                                                 indicating the result of this action.
+     * @return                      The status object as described in {@code Status}
+     *                                                          indicating the result of this action.
      */
     public Status removeStaticHost(String networkAddress);
 }
index 88db0811d7c56e40fe565ec407e1772907434028..561f78f5f5f17e5c26f6fdc0085906d6aaf695ed 100644 (file)
@@ -13,7 +13,7 @@ import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
 
 /**
  * This Interface defines the methods for client applications of
- * Host Tracker to get notifications when a new host is learned or 
+ * Host Tracker to get notifications when a new host is learned or
  * existing host is removed from the network.
  *
  */
@@ -21,7 +21,7 @@ public interface IfNewHostNotify {
     /**
      * Notifies the HostTracker Clients that a new Host has been learned
      *
-     * @param host             Host Info encapsulated in HostNodeConnector class
+     * @param host      Host Info encapsulated in HostNodeConnector class
      */
     public void notifyHTClient(HostNodeConnector host);
 
@@ -30,7 +30,7 @@ public interface IfNewHostNotify {
      * the past has been removed either due to switch/port down event or
      * due to ARP Aging
      *
-     * @param host             Host Info encapsulated in HostNodeConnector class
+     * @param host      Host Info encapsulated in HostNodeConnector class
      */
     public void notifyHTClientHostRemoved(HostNodeConnector host);
 }
index 5ea7fb0e49d2a7b7d87718df43c4ee52162334b3..533e7599bddfb01f386ad71f78329da024157d81 100644 (file)
@@ -26,7 +26,7 @@ public interface IHostFinder {
      * by query of an application to the HostTracker. The requested IP address
      * doesn't exist in the local database at this point.
      *
-     * @param networkAddress   IP Address encapsulated in InetAddress class
+     * @param networkAddress    IP Address encapsulated in InetAddress class
      *
      */
     public void find(InetAddress networkAddress);
@@ -35,7 +35,7 @@ public interface IHostFinder {
      * This method is called by HostTracker to see if a learned Host is still in the network.
      * Used mostly for ARP Aging.
      *
-     * @param host                     The Host that needs to be probed
+     * @param host          The Host that needs to be probed
      */
     public void probe(HostNodeConnector host);
 }
index c29e5b16453407e8999bdbaec21cd9eabc9185a5..2c2c49bfe18fb348302eb0cae929f9983ccac243 100644 (file)
@@ -29,61 +29,61 @@ import org.opendaylight.controller.sal.utils.NodeCreator;
 \r
 public class HostNodeConnectorTest extends TestCase {\r
 \r
-       @Test\r
-       public void testHostNodeConnector() throws UnknownHostException {\r
-               HostNodeConnector hostnodeconnector_1, hostnodeconnector_2, hostnodeconnector_3;\r
-               InetAddress hostIP_1 = InetAddress.getByName("192.168.0.8");\r
-               InetAddress hostIP_2 = InetAddress.getByName("2001:420:281:1004:e123:e688:d655:a1b0");\r
-               InetAddress hostIP_3 = InetAddress.getByName("192.168.0.28");\r
-               byte[] hostMAC_2 = new byte[]{(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x22,(byte)0x22,(byte)0x22};\r
-               byte[] hostMAC_3 = new byte[]{(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x33,(byte)0x33,(byte)0x33};\r
-               \r
-               Node node  = NodeCreator.createOFNode(1L);\r
-               NodeConnector nc1 = NodeConnectorCreator.createOFNodeConnector((short) 2, node);\r
-               NodeConnector nc2 = NodeConnectorCreator.createOFNodeConnector((short) 1, node);\r
-               \r
-               try {\r
-                       hostnodeconnector_1 = new HostNodeConnector(hostIP_1);\r
-                       Assert.assertTrue(hostnodeconnector_1.equalsByIP(hostIP_1));\r
-                       Assert.assertTrue(hostnodeconnector_1.isV4Host());\r
-                       Assert.assertTrue(hostnodeconnector_1.equalsByIP(hostIP_1));\r
-               } catch (ConstructionException e) {\r
-                       Assert.assertTrue(false);\r
-               }\r
-               \r
-               try {\r
-                       hostnodeconnector_2 = new HostNodeConnector(\r
-                               hostMAC_2, hostIP_2, nc1, (short)2);\r
-                       Assert.assertTrue(hostnodeconnector_2.isV6Host());\r
-                       Assert.assertTrue(hostnodeconnector_2.getnodeConnector().equals(nc1));\r
-                       Assert.assertTrue(hostnodeconnector_2.getnodeconnectorNode().equals(node));\r
+        @Test\r
+        public void testHostNodeConnector() throws UnknownHostException {\r
+                HostNodeConnector hostnodeconnector_1, hostnodeconnector_2, hostnodeconnector_3;\r
+                InetAddress hostIP_1 = InetAddress.getByName("192.168.0.8");\r
+                InetAddress hostIP_2 = InetAddress.getByName("2001:420:281:1004:e123:e688:d655:a1b0");\r
+                InetAddress hostIP_3 = InetAddress.getByName("192.168.0.28");\r
+                byte[] hostMAC_2 = new byte[]{(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x22,(byte)0x22,(byte)0x22};\r
+                byte[] hostMAC_3 = new byte[]{(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x33,(byte)0x33,(byte)0x33};\r
+\r
+                Node node  = NodeCreator.createOFNode(1L);\r
+                NodeConnector nc1 = NodeConnectorCreator.createOFNodeConnector((short) 2, node);\r
+                NodeConnector nc2 = NodeConnectorCreator.createOFNodeConnector((short) 1, node);\r
+\r
+                try {\r
+                        hostnodeconnector_1 = new HostNodeConnector(hostIP_1);\r
+                        Assert.assertTrue(hostnodeconnector_1.equalsByIP(hostIP_1));\r
+                        Assert.assertTrue(hostnodeconnector_1.isV4Host());\r
+                        Assert.assertTrue(hostnodeconnector_1.equalsByIP(hostIP_1));\r
+                } catch (ConstructionException e) {\r
+                        Assert.assertTrue(false);\r
+                }\r
+\r
+                try {\r
+                        hostnodeconnector_2 = new HostNodeConnector(\r
+                                hostMAC_2, hostIP_2, nc1, (short)2);\r
+                        Assert.assertTrue(hostnodeconnector_2.isV6Host());\r
+                        Assert.assertTrue(hostnodeconnector_2.getnodeConnector().equals(nc1));\r
+                        Assert.assertTrue(hostnodeconnector_2.getnodeconnectorNode().equals(node));\r
                         Assert.assertTrue(node.equals(hostnodeconnector_2.getnodeconnectorNode()));\r
-               } catch (ConstructionException e) {\r
-                       Assert.assertTrue(false);\r
-               }\r
-               \r
-               try {\r
-                       hostnodeconnector_3 = new HostNodeConnector(\r
-                                       new EthernetAddress(hostMAC_3), hostIP_3, nc2, (short)3);\r
-                       byte[] hostMAC_3_rb = hostnodeconnector_3.getDataLayerAddressBytes();\r
-                       HostNodeConnector  hostnodeconnector_3rb = new HostNodeConnector(\r
-                                       new EthernetAddress(hostMAC_3_rb), hostIP_3, nc2, (short)3);\r
-                       Assert.assertTrue(hostnodeconnector_3.equals(hostnodeconnector_3rb));\r
-                       \r
-                       Assert.assertTrue(hostnodeconnector_3.getVlan() == (short)3);\r
-                       \r
-                       hostnodeconnector_3.setStaticHost(true);\r
-                       Assert.assertTrue(hostnodeconnector_3.isStaticHost());\r
-                       \r
-                       Assert.assertTrue(hostnodeconnector_3.isRewriteEnabled());\r
-                       \r
-                       hostnodeconnector_3.initArpSendCountDown().setArpSendCountDown((short) 10);\r
-                       Assert.assertTrue(hostnodeconnector_3.getArpSendCountDown() == (short)10);\r
-                       \r
-               } catch (ConstructionException e) {\r
-                       Assert.assertTrue(false);\r
-               }\r
-               \r
-       }\r
+                } catch (ConstructionException e) {\r
+                        Assert.assertTrue(false);\r
+                }\r
+\r
+                try {\r
+                        hostnodeconnector_3 = new HostNodeConnector(\r
+                                        new EthernetAddress(hostMAC_3), hostIP_3, nc2, (short)3);\r
+                        byte[] hostMAC_3_rb = hostnodeconnector_3.getDataLayerAddressBytes();\r
+                        HostNodeConnector  hostnodeconnector_3rb = new HostNodeConnector(\r
+                                        new EthernetAddress(hostMAC_3_rb), hostIP_3, nc2, (short)3);\r
+                        Assert.assertTrue(hostnodeconnector_3.equals(hostnodeconnector_3rb));\r
+\r
+                        Assert.assertTrue(hostnodeconnector_3.getVlan() == (short)3);\r
+\r
+                        hostnodeconnector_3.setStaticHost(true);\r
+                        Assert.assertTrue(hostnodeconnector_3.isStaticHost());\r
+\r
+                        Assert.assertTrue(hostnodeconnector_3.isRewriteEnabled());\r
+\r
+                        hostnodeconnector_3.initArpSendCountDown().setArpSendCountDown((short) 10);\r
+                        Assert.assertTrue(hostnodeconnector_3.getArpSendCountDown() == (short)10);\r
+\r
+                } catch (ConstructionException e) {\r
+                        Assert.assertTrue(false);\r
+                }\r
+\r
+        }\r
 \r
 }\r
index 0af523aaa9b22dbedd7f54d0da0edf26b6e0aecb..1230d340eba4ebd8b013de252de2df96efe601d8 100644 (file)
@@ -15,8 +15,8 @@ package org.opendaylight.controller.hosttracker.internal;
 
 /**
  * This Class provides methods to discover Host through a blocking call
- * mechanism. Applications can make use of these methods if they don't 
- * find a host in HostTracker's database and want to discover the host  
+ * mechanism. Applications can make use of these methods if they don't
+ * find a host in HostTracker's database and want to discover the host
  * in the same thread without being called by a callback function.
  */
 import java.net.InetAddress;
index 9bd28c8e45315a5c7be43ad08a62909612004291..a99100b2956762fcefd4e92d891d25585b5bf3e0 100644 (file)
@@ -22,38 +22,38 @@ import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
 \r
 public class HostTrackerTest extends TestCase {\r
 \r
-       @Test\r
-       public void testHostTrackerCallable() throws UnknownHostException {\r
-               \r
-               HostTracker hostTracker = null;\r
-               hostTracker = new HostTracker();\r
-               Assert.assertFalse(hostTracker== null);\r
-               \r
-               InetAddress hostIP = InetAddress.getByName("192.168.0.8");\r
-               \r
-               HostTrackerCallable htCallable = new HostTrackerCallable (hostTracker, hostIP);\r
-               Assert.assertTrue(htCallable.trackedHost.equals(hostIP));\r
-               Assert.assertTrue(htCallable.hostTracker.equals(hostTracker));\r
-\r
-               long count = htCallable.latch.getCount();\r
-               htCallable.wakeup();\r
-               Assert.assertTrue(htCallable.latch.getCount() == --count );\r
-       }               \r
-               \r
-       \r
-       \r
-       @Test\r
-       public void testHostTracker() throws UnknownHostException {\r
-               HostTracker hostTracker = null;\r
-               hostTracker = new HostTracker();\r
-               Assert.assertFalse(hostTracker== null);\r
-               \r
-               InetAddress hostIP_1 = InetAddress.getByName("192.168.0.8");\r
-               InetAddress hostIP_2 = InetAddress.getByName("192.168.0.18");\r
-               Future<HostNodeConnector> dschost = hostTracker.discoverHost(hostIP_1);\r
-               dschost = hostTracker.discoverHost(hostIP_2);\r
-               hostTracker.nonClusterObjectCreate();\r
-       }\r
-       \r
+        @Test\r
+        public void testHostTrackerCallable() throws UnknownHostException {\r
+\r
+                HostTracker hostTracker = null;\r
+                hostTracker = new HostTracker();\r
+                Assert.assertFalse(hostTracker== null);\r
+\r
+                InetAddress hostIP = InetAddress.getByName("192.168.0.8");\r
+\r
+                HostTrackerCallable htCallable = new HostTrackerCallable (hostTracker, hostIP);\r
+                Assert.assertTrue(htCallable.trackedHost.equals(hostIP));\r
+                Assert.assertTrue(htCallable.hostTracker.equals(hostTracker));\r
+\r
+                long count = htCallable.latch.getCount();\r
+                htCallable.wakeup();\r
+                Assert.assertTrue(htCallable.latch.getCount() == --count );\r
+        }\r
+\r
+\r
+\r
+        @Test\r
+        public void testHostTracker() throws UnknownHostException {\r
+                HostTracker hostTracker = null;\r
+                hostTracker = new HostTracker();\r
+                Assert.assertFalse(hostTracker== null);\r
+\r
+                InetAddress hostIP_1 = InetAddress.getByName("192.168.0.8");\r
+                InetAddress hostIP_2 = InetAddress.getByName("192.168.0.18");\r
+                Future<HostNodeConnector> dschost = hostTracker.discoverHost(hostIP_1);\r
+                dschost = hostTracker.discoverHost(hostIP_2);\r
+                hostTracker.nonClusterObjectCreate();\r
+        }\r
+\r
 \r
 }\r
index 6bafee0b2cdb053c09401f653dbbd5dcc56d3dbd..7061954e80e199b2a52c49eeace78ad27b9d4518 100644 (file)
@@ -56,7 +56,7 @@ public class Activator implements BundleActivator {
                         this.listener.logged(entry);
                     }
                 }
-                
+
                 /*
                  * Install the default exception handler so that the uncaught
                  * exceptions are handled by our customized handler. This new
@@ -65,13 +65,13 @@ public class Activator implements BundleActivator {
                  */
                 Thread.setDefaultUncaughtExceptionHandler(new org.opendaylight.
                         controller.logging.bridge.internal.UncaughtExceptionHandler());
-                
+
                 /*
                  * Install the Shutdown handler. This will intercept SIGTERM signal and
                  * close the system bundle. This allows for a graceful  closing of OSGI
                  * framework.
                  */
-                
+
                 Runtime.getRuntime().addShutdownHook(new shutdownHandler(context));
             } else {
                 this.log.error("Cannot register the LogListener because "
@@ -95,13 +95,13 @@ public class Activator implements BundleActivator {
         this.listener = null;
         this.log = null;
     }
-    
+
     private class shutdownHandler extends Thread {
         BundleContext bundlecontext;
         public shutdownHandler(BundleContext ctxt) {
                 this.bundlecontext = ctxt;
         }
-        
+
         public void run () {
             try {
                 this.bundlecontext.getBundle(0).stop();
@@ -109,7 +109,7 @@ public class Activator implements BundleActivator {
             } catch (BundleException e) {
                 log.debug("Bundle couldn't be stopped");
             }
-        }   
+        }
     }
 
 }
index 7069ff041f6d5c8d1c7b33ca0f735287315d1f07..3fedd0c9f8ea9d4fe8d5a470ca603e3298776f0a 100644 (file)
@@ -9,11 +9,11 @@ import org.opendaylight.controller.usermanager.IUserManager;
 
 public class NorthboundUtils {
 
-    
+
     /**
      * Returns whether the current user has the required privilege on the
      * specified container
-     * 
+     *
      * @param userName
      *            The user name
      * @param containerName
@@ -21,21 +21,21 @@ public class NorthboundUtils {
      * @param required
      *            Operation to be performed - READ/WRITE
      * @param bundle
-     *            Class from where the function is invoked           
+     *            Class from where the function is invoked
      * @return The Status of the request, either Success or Unauthorized
      */
     public static boolean isAuthorized(String userName, String containerName,
             Privilege required,Object bundle) {
-        
+
          if (containerName.equals(GlobalConstants.DEFAULT.toString())) {
             IUserManager auth = (IUserManager) ServiceHelper.getGlobalInstance(
                     IUserManager.class, bundle);
-            
+
             switch (required) {
             case WRITE:
                 return (auth.getUserLevel(userName).ordinal() <= UserLevel.NETWORKADMIN.ordinal());
             case READ:
-                return (auth.getUserLevel(userName).ordinal() <= UserLevel.NETWORKOPERATOR.ordinal());                    
+                return (auth.getUserLevel(userName).ordinal() <= UserLevel.NETWORKOPERATOR.ordinal());
             default:
                 return false;
             }
@@ -56,5 +56,5 @@ public class NorthboundUtils {
         }
         return true;
     }
-    
+
 }
index f6a757ec2919133af9a2604505f89d7d347eecea..4b3761219ff6673f789dd870fa6852550a22c214 100644 (file)
@@ -21,22 +21,22 @@ import org.opendaylight.controller.forwardingrulesmanager.FlowConfig;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class FlowConfigs {
-       @XmlElement
-       List<FlowConfig> flowConfig;
-       //To satisfy JAXB
-       private FlowConfigs() {
-               
-       }
-       
-       public FlowConfigs(List<FlowConfig> flowConfig) {
-               this.flowConfig = flowConfig;
-       }
-
-       public List<FlowConfig> getFlowConfig() {
-               return flowConfig;
-       }
-
-       public void setFlowConfig(List<FlowConfig> flowConfig) {
-               this.flowConfig = flowConfig;
-       }
+        @XmlElement
+        List<FlowConfig> flowConfig;
+        //To satisfy JAXB
+        private FlowConfigs() {
+
+        }
+
+        public FlowConfigs(List<FlowConfig> flowConfig) {
+                this.flowConfig = flowConfig;
+        }
+
+        public List<FlowConfig> getFlowConfig() {
+                return flowConfig;
+        }
+
+        public void setFlowConfig(List<FlowConfig> flowConfig) {
+                this.flowConfig = flowConfig;
+        }
 }
index 99452b4b21542b9a77a4dc73bbe83413e2fc1fc0..b419a9b29df1c25f5d044a279a085126457230f5 100644 (file)
@@ -48,7 +48,7 @@ import org.opendaylight.controller.switchmanager.ISwitchManager;
 
 /**
  * Flow Configuration Northbound API
- * 
+ *
  * <br>
  * <br>
  * Authentication scheme : <b>HTTP Basic</b><br>
@@ -60,7 +60,7 @@ import org.opendaylight.controller.switchmanager.ISwitchManager;
  * trusted authority.<br>
  * More info :
  * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- * 
+ *
  */
 @Path("/")
 public class FlowProgrammerNorthbound {
@@ -147,7 +147,7 @@ public class FlowProgrammerNorthbound {
 
     /**
      * Returns a list of Flows configured on the given container
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
@@ -177,7 +177,7 @@ public class FlowProgrammerNorthbound {
 
     /**
      * Returns a list of Flows configured on a Node in a given container
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
@@ -217,7 +217,7 @@ public class FlowProgrammerNorthbound {
     /**
      * Returns the flow configuration matching a human-readable name and nodeId
      * on a given Container.
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
@@ -266,7 +266,7 @@ public class FlowProgrammerNorthbound {
 
     /**
      * Add a flow configuration
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
@@ -330,9 +330,9 @@ public class FlowProgrammerNorthbound {
 
     /**
      * Delete a Flow configuration
-     * 
+     *
      * DELETE /flows/{containerName}/{nodeType}/{nodeId}/{name}
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
@@ -392,7 +392,7 @@ public class FlowProgrammerNorthbound {
 
     /**
      * Toggle a Flow configuration
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
index a9f210e0eceebdad88e783640ae2bc120b6b7b31..dbc99d06e477bb238a5c49af13cade4dd30ae5dd 100644 (file)
@@ -56,7 +56,7 @@ import org.opendaylight.controller.sal.authorization.Privilege;
  * Location is represented by Host node connector which is essentially a logical
  * entity that represents a Switch/Port. A host is represented by it's
  * IP-address and mac-address.
- * 
+ *
  * <br>
  * <br>
  * Authentication scheme : <b>HTTP Basic</b><br>
@@ -68,7 +68,7 @@ import org.opendaylight.controller.sal.authorization.Privilege;
  * trusted authority.<br>
  * More info :
  * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- * 
+ *
  */
 
 @Path("/")
@@ -120,7 +120,7 @@ public class HostTrackerNorthbound {
     /**
      * Returns a list of all Hosts : both configured via PUT API and dynamically
      * learnt on the network.
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
@@ -135,7 +135,7 @@ public class HostTrackerNorthbound {
             @ResponseCode(code = 404, condition = "The containerName is not found"),
             @ResponseCode(code = 503, condition = "One or more of Controller Services are unavailable") })
     public Hosts getActiveHosts(@PathParam("containerName") String containerName) {
+
         if (!NorthboundUtils.isAuthorized(
                 getUserName(), containerName, Privilege.READ, this)) {
             throw new UnauthorizedException(
@@ -154,7 +154,7 @@ public class HostTrackerNorthbound {
     /**
      * Returns a list of Hosts that are statically configured and are connected
      * to a NodeConnector that is down.
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
@@ -187,7 +187,7 @@ public class HostTrackerNorthbound {
 
     /**
      * Returns a host that matches the IP Address value passed as parameter.
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
@@ -236,7 +236,7 @@ public class HostTrackerNorthbound {
 
     /**
      * Add a Static Host configuration
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
@@ -320,7 +320,7 @@ public class HostTrackerNorthbound {
 
     /**
      * Delete a Static Host configuration
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
@@ -342,7 +342,7 @@ public class HostTrackerNorthbound {
     public Response deleteFlow(
             @PathParam(value = "containerName") String containerName,
             @PathParam(value = "networkAddress") String networkAddress) {
+
         if (!NorthboundUtils.isAuthorized(
                 getUserName(), containerName, Privilege.WRITE, this)) {
             throw new UnauthorizedException(
index 463b493536f8ebc71808046701c9b7de65d34be6..c9ada2aeedd528e615b756a562aa32e47b5e25fb 100644 (file)
@@ -21,18 +21,18 @@ import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class Hosts {
-       @XmlElement (name="host")
-       Set<HostNodeConnector> hostNodeConnector;
-       
-       public Hosts() {
-       }
-       public Hosts (Set<HostNodeConnector> hostNodeConnector) {
-               this.hostNodeConnector = hostNodeConnector;
-       }
-       public Set<HostNodeConnector> getHostNodeConnector() {
-               return hostNodeConnector;
-       }
-       public void setHostNodeConnector(Set<HostNodeConnector> hostNodeConnector) {
-               this.hostNodeConnector = hostNodeConnector;
-       }
+        @XmlElement (name="host")
+        Set<HostNodeConnector> hostNodeConnector;
+
+        public Hosts() {
+        }
+        public Hosts (Set<HostNodeConnector> hostNodeConnector) {
+                this.hostNodeConnector = hostNodeConnector;
+        }
+        public Set<HostNodeConnector> getHostNodeConnector() {
+                return hostNodeConnector;
+        }
+        public void setHostNodeConnector(Set<HostNodeConnector> hostNodeConnector) {
+                this.hostNodeConnector = hostNodeConnector;
+        }
 }
index 24eb3d7a4c0933380c2ed5914e8281c6f6d16265..0065cb5a08c78488542bb7d065667b0d4f917b38 100644 (file)
@@ -403,7 +403,7 @@ public class NorthboundIT {
             fc = "{\"dynamic\":\"false\", \"name\":\"test2\", \"nwSrc\":\"1.1.1.1\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
             result = getJsonResult(baseURL + "STUB/51966/test2", "POST", fc);
             Assert.assertTrue(httpResponseCode == 201);
-            
+
             // check that request returns both flows given node.
             result = getJsonResult(baseURL + "STUB/51966/", "GET");
             jt = new JSONTokener(result);
index 9511b8c7caed25de41a5378acf3f2a4e79e3691e..683a9a2d906a285b37dab19bdb4b36b528aa8b57 100644 (file)
@@ -21,22 +21,22 @@ import org.opendaylight.controller.forwardingrulesmanager.FlowConfig;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class StaticRoutes {
-       @XmlElement
-       List<StaticRoute> staticRoute;
-       //To satisfy JAXB
-       private StaticRoutes() {
-               
-       }
-       
-       public StaticRoutes(List<StaticRoute> staticRoute) {
-               this.staticRoute = staticRoute;
-       }
-
-       public List<StaticRoute> getFlowConfig() {
-               return staticRoute;
-       }
-
-       public void setFlowConfig(List<StaticRoute> staticRoute) {
-               this.staticRoute = staticRoute;
-       }
+        @XmlElement
+        List<StaticRoute> staticRoute;
+        //To satisfy JAXB
+        private StaticRoutes() {
+
+        }
+
+        public StaticRoutes(List<StaticRoute> staticRoute) {
+                this.staticRoute = staticRoute;
+        }
+
+        public List<StaticRoute> getFlowConfig() {
+                return staticRoute;
+        }
+
+        public void setFlowConfig(List<StaticRoute> staticRoute) {
+                this.staticRoute = staticRoute;
+        }
 }
index c48d7ec02684463962909ec2d60b600e3b270167..b85f5641c73ea9af99fd3b201909220367c8240b 100644 (file)
@@ -51,7 +51,7 @@ import org.opendaylight.controller.sal.utils.Status;
  * Authentication realm : <b>opendaylight</b><br>
  * Transport : <b>HTTP and HTTPS</b><br>
  * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in tomcat-server.xml after adding 
+ * HTTPS Authentication is disabled by default. Administrator can enable it in tomcat-server.xml after adding
  * a proper keystore / SSL certificate from a trusted authority.<br>
  * More info : http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
  */
@@ -59,18 +59,18 @@ import org.opendaylight.controller.sal.utils.Status;
 public class StaticRoutingNorthbound {
 
 
-       private String username;
-       
+        private String username;
+
     @Context
     public void setSecurityContext(SecurityContext context) {
-       username = context.getUserPrincipal().getName();
+        username = context.getUserPrincipal().getName();
     }
     protected String getUserName() {
         return username;
     }
-       
 
-       
+
+
     private List<StaticRoute> getStaticRoutesInternal(String containerName) {
 
         IForwardingStaticRouting staticRouting = (IForwardingStaticRouting) ServiceHelper
@@ -109,9 +109,9 @@ public class StaticRoutingNorthbound {
     public StaticRoutes getStaticRoutes(
             @PathParam("containerName") String containerName) {
 
-        if(!NorthboundUtils.isAuthorized(getUserName(), containerName, 
+        if(!NorthboundUtils.isAuthorized(getUserName(), containerName,
                 Privilege.WRITE, this)){
-            throw new 
+            throw new
                 UnauthorizedException("User is not authorized to perform this operation on container "
                             + containerName);
         }
@@ -136,9 +136,9 @@ public class StaticRoutingNorthbound {
             @PathParam("containerName") String containerName,
             @PathParam("name") String name) {
 
-        if(!NorthboundUtils.isAuthorized(getUserName(), containerName, 
+        if(!NorthboundUtils.isAuthorized(getUserName(), containerName,
                 Privilege.WRITE, this)){
-            throw new 
+            throw new
                 UnauthorizedException("User is not authorized to perform this operation on container "
                             + containerName);
         }
@@ -174,10 +174,10 @@ public class StaticRoutingNorthbound {
             @PathParam(value = "name") String name,
             @TypeHint(StaticRoute.class) JAXBElement<StaticRoute> staticRouteData) {
 
-   
-        if(!NorthboundUtils.isAuthorized(getUserName(), containerName, 
+
+        if(!NorthboundUtils.isAuthorized(getUserName(), containerName,
                 Privilege.WRITE, this)){
-            throw new 
+            throw new
                 UnauthorizedException("User is not authorized to perform this operation on container "
                             + containerName);
         }
@@ -221,10 +221,10 @@ public class StaticRoutingNorthbound {
     public Response removeStaticRoute(
             @PathParam(value = "containerName") String containerName,
             @PathParam(value = "name") String name) {
-        if(!NorthboundUtils.isAuthorized(getUserName(), containerName, 
+
+        if(!NorthboundUtils.isAuthorized(getUserName(), containerName,
                 Privilege.WRITE, this)){
-            throw new 
+            throw new
                 UnauthorizedException("User is not authorized to perform this operation on container "
                             + containerName);
         }
index 0e96c5411c2c3e0649407dd5776b61eb11af4d09..7f37afec21eb4c2e1201af6696c4076e2beda05b 100644 (file)
@@ -19,22 +19,22 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class AllFlowStatistics {
-       @XmlElement
-       List<FlowStatistics> flowStatistics;
-       //To satisfy JAXB
-       private AllFlowStatistics() {
-       }
-       
-       public AllFlowStatistics(List<FlowStatistics> flowStatistics) {
-               this.flowStatistics = flowStatistics;
-       }
-
-       public List<FlowStatistics> getFlowStatistics() {
-               return flowStatistics;
-       }
-
-       public void setFlowStatistics(List<FlowStatistics> flowStatistics) {
-               this.flowStatistics = flowStatistics;
-       }
+        @XmlElement
+        List<FlowStatistics> flowStatistics;
+        //To satisfy JAXB
+        private AllFlowStatistics() {
+        }
+
+        public AllFlowStatistics(List<FlowStatistics> flowStatistics) {
+                this.flowStatistics = flowStatistics;
+        }
+
+        public List<FlowStatistics> getFlowStatistics() {
+                return flowStatistics;
+        }
+
+        public void setFlowStatistics(List<FlowStatistics> flowStatistics) {
+                this.flowStatistics = flowStatistics;
+        }
 
 }
index a1bf1904e4d7fc6dcc0d796a1206a86a50e63b64..e377de2b8836a10c1089eddb098533e2bf95820b 100644 (file)
@@ -19,22 +19,22 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class AllPortStatistics {
-       @XmlElement
-       List<PortStatistics> portStatistics;
-       //To satisfy JAXB
-       private AllPortStatistics() {
-       }
-       
-       public AllPortStatistics(List<PortStatistics> portStatistics) {
-               this.portStatistics = portStatistics;
-       }
-
-       public List<PortStatistics> getPortStatistics() {
-               return portStatistics;
-       }
-
-       public void setPortStatistics(List<PortStatistics> portStatistics) {
-               this.portStatistics = portStatistics;
-       }
+        @XmlElement
+        List<PortStatistics> portStatistics;
+        //To satisfy JAXB
+        private AllPortStatistics() {
+        }
+
+        public AllPortStatistics(List<PortStatistics> portStatistics) {
+                this.portStatistics = portStatistics;
+        }
+
+        public List<PortStatistics> getPortStatistics() {
+                return portStatistics;
+        }
+
+        public void setPortStatistics(List<PortStatistics> portStatistics) {
+                this.portStatistics = portStatistics;
+        }
 
 }
index 146e95ab32a457fc1f6e90bbc112b70c191f900f..25b671c1a881d44cd7e61137fdaca09621aa1885 100644 (file)
@@ -27,7 +27,7 @@ public class FlowStatistics {
 
     // To satisfy JAXB
     @SuppressWarnings("unused")
-       private FlowStatistics() {
+        private FlowStatistics() {
     }
 
     public FlowStatistics(Node node, List<FlowOnNode> flowStat) {
index 068baa15fac733e015fe53565c46be0e7b6dfe42..876bb7f7b08f11b85c068a12edb37a38747750ab 100644 (file)
@@ -28,7 +28,7 @@ public class PortStatistics {
 
     // To satisfy JAXB
     @SuppressWarnings("unused")
-       private PortStatistics() {
+        private PortStatistics() {
     }
 
     public PortStatistics(Node node, List<NodeConnectorStatistics> portStats) {
index dee52932bda41ed77ca5b0be273bae94886b791e..197ebabf9133d43f7b81f5360f46b7d3138b1f9e 100644 (file)
@@ -40,7 +40,7 @@ import org.opendaylight.controller.switchmanager.ISwitchManager;
 /**
  * Northbound APIs that returns various Statistics exposed by the Southbound
  * plugins such as Openflow.
- * 
+ *
  * <br>
  * <br>
  * Authentication scheme : <b>HTTP Basic</b><br>
@@ -52,7 +52,7 @@ import org.opendaylight.controller.switchmanager.ISwitchManager;
  * trusted authority.<br>
  * More info :
  * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- * 
+ *
  */
 @Path("/")
 public class StatisticsNorthbound {
@@ -102,7 +102,7 @@ public class StatisticsNorthbound {
 
     /**
      * Returns a list of all Flow Statistics from all the Nodes.
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
@@ -154,7 +154,7 @@ public class StatisticsNorthbound {
 
     /**
      * Returns a list of Flow Statistics for a given Node.
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
@@ -204,7 +204,7 @@ public class StatisticsNorthbound {
     /**
      * Returns a list of all the Port Statistics across all the NodeConnectors
      * on all the Nodes.
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
@@ -255,7 +255,7 @@ public class StatisticsNorthbound {
     /**
      * Returns a list of all the Port Statistics across all the NodeConnectors
      * in a given Node.
-     * 
+     *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
index 60062edd2914d5165484426bbdb42ac5f9d1a2f4..3361f1b3d29cfdf38527d0589774b9129cb278a3 100644 (file)
@@ -21,22 +21,22 @@ import org.opendaylight.controller.switchmanager.SubnetConfig;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class SubnetConfigs {
-       @XmlElement
-       List<SubnetConfig> subnetConfig;
-       //To satisfy JAXB
-       private SubnetConfigs() {
-               
-       }
-       
-       public SubnetConfigs(List<SubnetConfig> subnetConfig) {
-               this.subnetConfig = subnetConfig;
-       }
-
-       public List<SubnetConfig> getSubnetConfig() {
-               return subnetConfig;
-       }
-
-       public void setSubnetConfig(List<SubnetConfig> subnetConfig) {
-               this.subnetConfig = subnetConfig;
-       }
+        @XmlElement
+        List<SubnetConfig> subnetConfig;
+        //To satisfy JAXB
+        private SubnetConfigs() {
+
+        }
+
+        public SubnetConfigs(List<SubnetConfig> subnetConfig) {
+                this.subnetConfig = subnetConfig;
+        }
+
+        public List<SubnetConfig> getSubnetConfig() {
+                return subnetConfig;
+        }
+
+        public void setSubnetConfig(List<SubnetConfig> subnetConfig) {
+                this.subnetConfig = subnetConfig;
+        }
 }
index 05bb5b1dd938ff9208eb5fcda84c6d262e50be33..5c327c4f72243b0cd9af6ddb92b1b747630bdca2 100644 (file)
@@ -55,10 +55,10 @@ public class SubnetsNorthboundJAXRS {
 
     /**
      * List all the subnets in a given container
-     * 
+     *
      * @param containerName
      *            container in which we want to query the subnets
-     * 
+     *
      * @return a List of SubnetConfig
      */
     @Path("/{containerName}")
@@ -86,12 +86,12 @@ public class SubnetsNorthboundJAXRS {
 
     /**
      * List the configuration of a subnet in a given container
-     * 
+     *
      * @param containerName
      *            container in which we want to query the subnet
      * @param subnetName
      *            of the subnet being queried
-     * 
+     *
      * @return a SubnetConfig
      */
     @Path("/{containerName}/{subnetName}")
@@ -129,7 +129,7 @@ public class SubnetsNorthboundJAXRS {
 
     /**
      * Add/Update a subnet to a container
-     * 
+     *
      * @param containerName
      *            container in which we want to add/update the subnet
      * @param subnetName
@@ -137,7 +137,7 @@ public class SubnetsNorthboundJAXRS {
      * @param subnet
      *            pair default gateway IP/mask that identify the subnet being
      *            added modified
-     * 
+     *
      */
     @Path("/{containerName}/{subnetName}")
     @POST
@@ -183,12 +183,12 @@ public class SubnetsNorthboundJAXRS {
 
     /**
      * Delete a subnet from a container
-     * 
+     *
      * @param containerName
      *            container in which we want to delete the subnet by name
      * @param subnetName
      *            of the subnet to be remove.
-     * 
+     *
      */
     @Path("/{containerName}/{subnetName}")
     @DELETE
@@ -225,56 +225,56 @@ public class SubnetsNorthboundJAXRS {
     }
 
     /*
-     * 
+     *
      * Add or remove switch ports to a subnet POST subnets/green/sw
-     * 
+     *
      * @param model
-     * 
+     *
      * @param containerName
-     * 
+     *
      * @param name
-     * 
+     *
      * @param subnet: the subnet name name
-     * 
+     *
      * @param switchports: datapath ID/port list =>
      * xx:xx:xx:xx:xx:xx:xx:xx/a,b,c-m,r-t,y
-     * 
+     *
      * @return
-     * 
+     *
      * @RequestMapping(value = "/{containerName}/{name}", method =
      * RequestMethod.POST)
-     * 
+     *
      * public View addSwitchports(Map<String, Object> model,
-     * 
+     *
      * @PathVariable(value = "containerName") String containerName,
-     * 
+     *
      * @PathVariable(value = "name") String name,
-     * 
+     *
      * @RequestParam(value = "nodeports") String nodePorts,
-     * 
+     *
      * @RequestParam(value = "action") String action) {
-     * 
+     *
      * checkDefaultDisabled(containerName); ISwitchManager switchManager = null;
      * try { BundleContext bCtx = FrameworkUtil.getBundle(this.getClass())
      * .getBundleContext();
-     * 
+     *
      * ServiceReference[] services = bCtx.getServiceReferences(
      * ISwitchManager.class.getName(), "(containerName=" + containerName + ")");
-     * 
+     *
      * if (services != null) { switchManager = (ISwitchManager)
      * bCtx.getService(services[0]); logger.debug("Switch manager reference is:"
      * + switchManager); } } catch (Exception e) {
      * logger.error("Switch Manager reference is NULL"); }
-     * 
+     *
      * checkContainerExists(switchManager);
-     * 
+     *
      * String ret; if (action.equals("add")) { ret =
      * switchManager.addPortsToSubnet(name, nodePorts); } else if
      * (action.equals("remove")) { ret =
      * switchManager.removePortsFromSubnet(name, nodePorts); } else { throw new
      * UnsupportedMediaTypeException(RestMessages.UNKNOWNACTION .toString() +
      * ": " + action); }
-     * 
+     *
      * return returnViewOrThrowConflicEx(model, ret); }
      */
 }
index ac9be4d07591e6e463c6be05b00a7ba48e125823..4a31317d95b3b61926ec96ca751bc5205c5f59c5 100644 (file)
@@ -19,22 +19,22 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class NodeConnectors {
-       @XmlElement
-       List<NodeConnectorProperties> nodeConnectorProperties;
-       //To satisfy JAXB
-       private NodeConnectors() {
-               
-       }
-       
-       public NodeConnectors(List<NodeConnectorProperties> nodeConnectorProperties) {
-               this.nodeConnectorProperties = nodeConnectorProperties;
-       }
-
-       public List<NodeConnectorProperties> getNodeConnectorProperties() {
-               return nodeConnectorProperties;
-       }
-
-       public void setNodeConnectorProperties(List<NodeConnectorProperties> nodeConnectorProperties) {
-               this.nodeConnectorProperties = nodeConnectorProperties;
-       }
+        @XmlElement
+        List<NodeConnectorProperties> nodeConnectorProperties;
+        //To satisfy JAXB
+        private NodeConnectors() {
+
+        }
+
+        public NodeConnectors(List<NodeConnectorProperties> nodeConnectorProperties) {
+                this.nodeConnectorProperties = nodeConnectorProperties;
+        }
+
+        public List<NodeConnectorProperties> getNodeConnectorProperties() {
+                return nodeConnectorProperties;
+        }
+
+        public void setNodeConnectorProperties(List<NodeConnectorProperties> nodeConnectorProperties) {
+                this.nodeConnectorProperties = nodeConnectorProperties;
+        }
 }
index 07d7b7c33b7b87cdf716c2233529c45dca6d750c..b7f1c53ae850dec4c7d8bf258853bbec849e5801 100644 (file)
@@ -19,22 +19,22 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class Nodes {
-       @XmlElement
-       List<NodeProperties> nodeProperties;
-       //To satisfy JAXB
-       private Nodes() {
-               
-       }
-       
-       public Nodes(List<NodeProperties> nodeProperties) {
-               this.nodeProperties = nodeProperties;
-       }
-
-       public List<NodeProperties> getNodeProperties() {
-               return nodeProperties;
-       }
-
-       public void setNodeProperties(List<NodeProperties> nodeProperties) {
-               this.nodeProperties = nodeProperties;
-       }
+        @XmlElement
+        List<NodeProperties> nodeProperties;
+        //To satisfy JAXB
+        private Nodes() {
+
+        }
+
+        public Nodes(List<NodeProperties> nodeProperties) {
+                this.nodeProperties = nodeProperties;
+        }
+
+        public List<NodeProperties> getNodeProperties() {
+                return nodeProperties;
+        }
+
+        public void setNodeProperties(List<NodeProperties> nodeProperties) {
+                this.nodeProperties = nodeProperties;
+        }
 }
index a8b18d5637b5fb8394de825706e168b9cf06c230..5386d4142fd55f0d3c7c79a5254aaa4faa70710b 100644 (file)
@@ -18,58 +18,58 @@ import org.opendaylight.controller.sal.utils.NodeCreator;
 
 public class SwitchManagerNorthboundTest extends TestCase {
 
-       @Test
-       public void testNodes() {
-               List<NodeProperties> nodeProperties = new ArrayList<NodeProperties>();
-               Nodes nodes = new Nodes(nodeProperties);
-               Assert.assertTrue(nodes.getNodeProperties().equals(nodeProperties));
-               nodes.setNodeProperties(null);
-               Assert.assertTrue(nodes.getNodeProperties() == null);
-       }
-       
-       @Test
-       public void testNodeProperties() {
-               Node node = NodeCreator.createOFNode(1L);
-               NodeProperties np= new NodeProperties(node, null);
-               Assert.assertTrue(np.getNode().equals(node));
-               Assert.assertTrue(np.getProperties() == null);
-               
-               Node node2 = NodeCreator.createOFNode(2L);
-               np.setNode(node2);
-               Assert.assertTrue(np.getNode().equals(node2));
+        @Test
+        public void testNodes() {
+                List<NodeProperties> nodeProperties = new ArrayList<NodeProperties>();
+                Nodes nodes = new Nodes(nodeProperties);
+                Assert.assertTrue(nodes.getNodeProperties().equals(nodeProperties));
+                nodes.setNodeProperties(null);
+                Assert.assertTrue(nodes.getNodeProperties() == null);
+        }
 
-               Set<Property> props = new HashSet<Property>();
-               np.setProperties(props);
-               Assert.assertTrue(np.getProperties().equals(props));
-       }
+        @Test
+        public void testNodeProperties() {
+                Node node = NodeCreator.createOFNode(1L);
+                NodeProperties np= new NodeProperties(node, null);
+                Assert.assertTrue(np.getNode().equals(node));
+                Assert.assertTrue(np.getProperties() == null);
 
-       @Test
-       public void testNodeConnectors() {
-               List<NodeConnectorProperties> nodeConnectorProperties = new ArrayList<NodeConnectorProperties>();
-               NodeConnectors ncs = new NodeConnectors(nodeConnectorProperties);
-               Assert.assertTrue(ncs.getNodeConnectorProperties().equals(nodeConnectorProperties));
-               ncs.setNodeConnectorProperties(null);
-               Assert.assertTrue(ncs.getNodeConnectorProperties() == null);
-       }
-       
-       @Test
-       public void testNodeConnectorProperties() {
-               Node node = NodeCreator.createOFNode(1L);
+                Node node2 = NodeCreator.createOFNode(2L);
+                np.setNode(node2);
+                Assert.assertTrue(np.getNode().equals(node2));
+
+                Set<Property> props = new HashSet<Property>();
+                np.setProperties(props);
+                Assert.assertTrue(np.getProperties().equals(props));
+        }
+
+        @Test
+        public void testNodeConnectors() {
+                List<NodeConnectorProperties> nodeConnectorProperties = new ArrayList<NodeConnectorProperties>();
+                NodeConnectors ncs = new NodeConnectors(nodeConnectorProperties);
+                Assert.assertTrue(ncs.getNodeConnectorProperties().equals(nodeConnectorProperties));
+                ncs.setNodeConnectorProperties(null);
+                Assert.assertTrue(ncs.getNodeConnectorProperties() == null);
+        }
+
+        @Test
+        public void testNodeConnectorProperties() {
+                Node node = NodeCreator.createOFNode(1L);
         NodeConnector port = NodeConnectorCreator.createOFNodeConnector(
                 (short) 24, node);
-        
+
         NodeConnectorProperties ncp= new NodeConnectorProperties(port, null);
-               Assert.assertTrue(ncp.getProperties() == null);
-               Assert.assertTrue(ncp.getNodeConnector().equals(port));
-               
+                Assert.assertTrue(ncp.getProperties() == null);
+                Assert.assertTrue(ncp.getNodeConnector().equals(port));
+
         NodeConnector port2 = NodeConnectorCreator.createOFNodeConnector(
                 (short) 33, node);
-               ncp.setNodeConnector(port2);
-               Assert.assertTrue(ncp.getNodeConnector().equals(port2));
+                ncp.setNodeConnector(port2);
+                Assert.assertTrue(ncp.getNodeConnector().equals(port2));
+
+                Set<Property> props = new HashSet<Property>();
+                ncp.setProperties(props);
+                Assert.assertTrue(ncp.getProperties().equals(props));
+        }
 
-               Set<Property> props = new HashSet<Property>();
-               ncp.setProperties(props);
-               Assert.assertTrue(ncp.getProperties().equals(props));
-       }
-       
 }
index bfc86cf34b7fda45fb3ca1869c7d9a87680a62ae..15548d94286ceb0eb3058e0211cb5c3abcb29024 100644 (file)
@@ -19,22 +19,22 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class Topology {
-       @XmlElement
-       List<EdgeProperties> edgeProperties;
-       //To satisfy JAXB
-       private Topology() {
-               
-       }
-       
-       public Topology(List<EdgeProperties> edgeProperties) {
-               this.edgeProperties = edgeProperties;
-       }
-
-       public List<EdgeProperties> getEdgeProperties() {
-               return edgeProperties;
-       }
-
-       public void setEdgeProperties(List<EdgeProperties> edgeProperties) {
-               this.edgeProperties = edgeProperties;
-       }
+        @XmlElement
+        List<EdgeProperties> edgeProperties;
+        //To satisfy JAXB
+        private Topology() {
+
+        }
+
+        public Topology(List<EdgeProperties> edgeProperties) {
+                this.edgeProperties = edgeProperties;
+        }
+
+        public List<EdgeProperties> getEdgeProperties() {
+                return edgeProperties;
+        }
+
+        public void setEdgeProperties(List<EdgeProperties> edgeProperties) {
+                this.edgeProperties = edgeProperties;
+        }
 }
index 10480bc4ec3f153312b6d1f7cae0f0bf658772a1..323e2d2211deaa916ce5b81257bde2074592aa65 100644 (file)
@@ -45,7 +45,7 @@ import org.opendaylight.controller.topologymanager.TopologyUserLinkConfig;
 
 /**
  * Topology Northbound REST API
- * 
+ *
  * <br>
  * <br>
  * Authentication scheme : <b>HTTP Basic</b><br>
@@ -74,12 +74,12 @@ public class TopologyNorthboundJAXRS {
     }
 
     /**
-     * 
+     *
      * Retrieve the Topology
-     * 
+     *
      * @param containerName
      *            The container for which we want to retrieve the topology
-     * 
+     *
      * @return A List of EdgeProps each EdgeProp represent an Edge of the grap
      *         with the corresponding properties attached to it.
      */
@@ -119,10 +119,10 @@ public class TopologyNorthboundJAXRS {
 
     /**
      * Retrieve the user configured links
-     * 
+     *
      * @param containerName
      *            The container for which we want to retrieve the user links
-     * 
+     *
      * @return A List of user configured links
      */
     @Path("/{containerName}/userLink")
@@ -159,7 +159,7 @@ public class TopologyNorthboundJAXRS {
 
     /**
      * Add an User Link
-     * 
+     *
      * @param containerName
      *            Name of the Container. The base Container is "default".
      * @param TopologyUserLinkConfig
@@ -202,7 +202,7 @@ public class TopologyNorthboundJAXRS {
 
     /**
      * Delete an User Link
-     * 
+     *
      * @param containerName
      *            Name of the Container. The base Container is "default".
      * @param name
index 1b19edc5f617bde3b5f66a6ffc2455055666ef38..db24755a2985e396f2128a5420ad819c425a7397 100644 (file)
@@ -22,23 +22,23 @@ import org.opendaylight.controller.topologymanager.TopologyUserLinkConfig;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class TopologyUserLinks {
-       @XmlElement
-       List<TopologyUserLinkConfig> userLinks;
-       
-       //To satisfy JAXB
-       private TopologyUserLinks() {
-               
-       }
-       
-       public List<TopologyUserLinkConfig> getUserLinks() {
-               return userLinks;
-       }
-
-       public void setUserLinks(List<TopologyUserLinkConfig> userLinks) {
-               this.userLinks = userLinks;
-       }
-
-       public TopologyUserLinks(List<TopologyUserLinkConfig> userLinks) {
-               this.userLinks = new ArrayList<TopologyUserLinkConfig>(userLinks);
-       }
+        @XmlElement
+        List<TopologyUserLinkConfig> userLinks;
+
+        //To satisfy JAXB
+        private TopologyUserLinks() {
+
+        }
+
+        public List<TopologyUserLinkConfig> getUserLinks() {
+                return userLinks;
+        }
+
+        public void setUserLinks(List<TopologyUserLinkConfig> userLinks) {
+                this.userLinks = userLinks;
+        }
+
+        public TopologyUserLinks(List<TopologyUserLinkConfig> userLinks) {
+                this.userLinks = new ArrayList<TopologyUserLinkConfig>(userLinks);
+        }
 }
index 6b328961fc40d4936314a5880fb7f1c1139b84fe..9bcd7c0dc45229a4efa1cc845f20a51dc1bbb726 100644 (file)
@@ -24,22 +24,22 @@ public interface IInventoryShimInternalListener {
     /**
      * Updates node and its properties
      *
-     * @param node                     {@link org.opendaylight.controller.sal.core.Node} being updated
-     * @param type             {@link org.opendaylight.controller.sal.core.UpdateType}
-     * @param props            set of {@link org.opendaylight.controller.sal.core.Property} such as
-     *                                                 {@link org.opendaylight.controller.sal.core.Description} and/or
-     *                                                 {@link org.opendaylight.controller.sal.core.Tier} etc.
+     * @param node                      {@link org.opendaylight.controller.sal.core.Node} being updated
+     * @param type              {@link org.opendaylight.controller.sal.core.UpdateType}
+     * @param props             set of {@link org.opendaylight.controller.sal.core.Property} such as
+     *                                          {@link org.opendaylight.controller.sal.core.Description} and/or
+     *                                          {@link org.opendaylight.controller.sal.core.Tier} etc.
      */
     public void updateNode(Node node, UpdateType type, Set<Property> props);
 
     /**
      * Updates node connector and its properties
      *
-     * @param nodeConnector    {@link org.opendaylight.controller.sal.core.NodeConnector} being updated
-     * @param type             {@link org.opendaylight.controller.sal.core.UpdateType}
-     * @param props            set of {@link org.opendaylight.controller.sal.core.Property} such as
-     *                                                 {@link org.opendaylight.controller.sal.core.Description} and/or
-     *                                                 {@link org.opendaylight.controller.sal.core.State} etc.
+     * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector} being updated
+     * @param type              {@link org.opendaylight.controller.sal.core.UpdateType}
+     * @param props             set of {@link org.opendaylight.controller.sal.core.Property} such as
+     *                                          {@link org.opendaylight.controller.sal.core.Description} and/or
+     *                                          {@link org.opendaylight.controller.sal.core.State} etc.
      */
     public void updateNodeConnector(NodeConnector nodeConnector,
             UpdateType type, Set<Property> props);
index 74dc84aec9613671bb24a17bfd38f788b5c8f35d..d619b7377672616e538ecd161473fc8453a91015 100644 (file)
@@ -80,7 +80,7 @@ public interface IOFStatisticsManager {
      *                                  For port statistics, it is the port id. If null the query
      *                                  will be performed for all the targets for the specified
      *                                  statistics type.
-     * 
+     *
      * @param timeout the timeout in milliseconds the system will wait for a response
      *                  from the switch, before declaring failure
      * @return the list of openflow statistics
index fd762d4aa9376a24ceb6cd48105f4b0b8744280e..9fca60f1a039d1b9514469ad0410024b0b2147ce 100644 (file)
 package org.opendaylight.controller.protocol_plugin.openflow;
 
 /**
- * @file       IRefreshInternalProvider.java
+ * @file        IRefreshInternalProvider.java
  *
- * @brief      Topology refresh notifications requested by application
- *                     to be fetched from the plugin
+ * @brief       Topology refresh notifications requested by application
+ *                      to be fetched from the plugin
  *
  * For example, an application that has been started late, will want to
  * be up to date with the latest topology.  Hence, it requests for a
index 4f15a1055a324b74d11a6454ebe4ccb8292a979e..d837e01c01a5c89546fa10af9185521192c81cc7 100644 (file)
@@ -8,6 +8,6 @@ import org.openflow.protocol.statistics.OFDescriptionStatistics;
  * is updated with new one.
  */
 public interface IStatisticsListener {
-       public void descriptionRefreshed(Long switchId,
-                                       OFDescriptionStatistics description);
+        public void descriptionRefreshed(Long switchId,
+                                        OFDescriptionStatistics description);
 }
index e90823726c926d70304666055445b06df7ee4558..45c0025b54ea2eda642f3c82b79e85b0f58f733a 100644 (file)
@@ -22,7 +22,7 @@ import org.opendaylight.controller.sal.topology.TopoEdgeUpdate;
 public interface ITopologyServiceShimListener {
     /**
      * Called to update on Edge in the topology graph
-     * 
+     *
      * @param topoedgeupdateList
      *            List of topoedgeupdates Each topoedgeupdate includes edge, its
      *            Properties ( BandWidth and/or Latency etc) and update type.
@@ -32,7 +32,7 @@ public interface ITopologyServiceShimListener {
     /**
      * Called when an Edge utilization is above the safe threshold configured on
      * the controller
-     * 
+     *
      * @param {@link org.opendaylight.controller.sal.core.Edge}
      */
     public void edgeOverUtilized(Edge edge);
@@ -40,7 +40,7 @@ public interface ITopologyServiceShimListener {
     /**
      * Called when the Edge utilization is back to normal, below the safety
      * threshold level configured on the controller
-     * 
+     *
      * @param {@link org.opendaylight.controller.sal.core.Edge}
      */
     public void edgeUtilBackToNormal(Edge edge);
index 8fb9a6acb8a2c498533ce15db5161af7a28d6562..ce91e1f2750ce1343ecac5d39488b2b9993a9c31 100644 (file)
@@ -19,35 +19,35 @@ import org.openflow.protocol.OFMessage;
  * encryption and decryption of the network data.
  */
 public interface IMessageReadWrite {
-       /**
-        * Sends the OF message out over the socket channel. For secure
-        * communication, the data will be encrypted.
-        * 
-        * @param msg OF message to be sent
-        * @throws Exception
-        */
-       public void asyncSend(OFMessage msg) throws Exception;
-
-       /**
-        * Resumes sending the remaining messages in the outgoing buffer
-        * @throws Exception
-        */
-       public void resumeSend() throws Exception;
-
-       /**
-        * Reads the incoming network data from the socket and retrieves the OF
-        * messages. For secure communication, the data will be decrypted first.
-        * 
-        * @return list of OF messages
-        * @throws Exception
-        */
+        /**
+         * Sends the OF message out over the socket channel. For secure
+         * communication, the data will be encrypted.
+         *
+         * @param msg OF message to be sent
+         * @throws Exception
+         */
+        public void asyncSend(OFMessage msg) throws Exception;
+
+        /**
+         * Resumes sending the remaining messages in the outgoing buffer
+         * @throws Exception
+         */
+        public void resumeSend() throws Exception;
+
+        /**
+         * Reads the incoming network data from the socket and retrieves the OF
+         * messages. For secure communication, the data will be decrypted first.
+         *
+         * @return list of OF messages
+         * @throws Exception
+         */
     public List<OFMessage> readMessages() throws Exception;
-    
-       /**
-        * Proper clean up when the switch connection is closed
-        * 
-        * @return
-        * @throws Exception
-        */
+
+        /**
+         * Proper clean up when the switch connection is closed
+         *
+         * @return
+         * @throws Exception
+         */
     public void stop() throws Exception;
 }
index 196fbbfb4c454e0ff6f748cf2a11dc50d7186c16..41da311fd916dc8c1913b98f19976d9b319bf7d8 100644 (file)
@@ -19,54 +19,54 @@ import org.openflow.protocol.OFStatisticsRequest;
 
 /**
  * This interface defines an abstraction of an Open Flow Switch.
- * 
+ *
  */
 public interface ISwitch {
     /**
      * Gets a unique XID.
-     * 
+     *
      * @return XID
      */
     public int getNextXid();
 
     /**
      * Returns the Switch's ID.
-     * 
+     *
      * @return the Switch's ID
      */
     public Long getId();
 
     /**
      * Returns the Switch's table numbers supported by datapath
-     * 
+     *
      * @return the tables
      */
     public Byte getTables();
 
     /**
      * Returns the Switch's bitmap of supported ofp_action_type
-     * 
+     *
      * @return the actions
      */
     public Integer getActions();
 
     /**
      * Returns the Switch's bitmap of supported ofp_capabilities
-     * 
+     *
      * @return the capabilities
      */
     public Integer getCapabilities();
 
     /**
      * Returns the Switch's buffering capacity in Number of Pkts
-     * 
+     *
      * @return the buffers
      */
     public Integer getBuffers();
 
     /**
      * Returns the Date when the switch was connected.
-     * 
+     *
      * @return Date The date when the switch was connected
      */
     public Date getConnectedDate();
@@ -77,7 +77,7 @@ public interface ISwitch {
      * should be used for non-critical messages such as statistics request,
      * discovery packets, etc. An unique XID is generated automatically and
      * inserted into the message.
-     * 
+     *
      * @param msg
      *            The OF message to be sent
      * @return The XID used
@@ -89,7 +89,7 @@ public interface ISwitch {
      * priority. It will be served after high priority messages. The method
      * should be used for non-critical messages such as statistics request,
      * discovery packets, etc. The specified XID is inserted into the message.
-     * 
+     *
      * @param msg
      *            The OF message to be Sent
      * @param xid
@@ -104,7 +104,7 @@ public interface ISwitch {
      * method should be used for critical messages such as hello, echo reply
      * etc. An unique XID is generated automatically and inserted into the
      * message.
-     * 
+     *
      * @param msg
      *            The OF message to be sent
      * @return The XID used
@@ -116,7 +116,7 @@ public interface ISwitch {
      * priority. It will be served first before normal priority messages. The
      * method should be used for critical messages such as hello, echo reply
      * etc. The specified XID is inserted into the message.
-     * 
+     *
      * @param msg
      *            The OF message to be sent
      * @return The XID used
@@ -126,7 +126,7 @@ public interface ISwitch {
     /**
      * Sends the OF message followed by a Barrier Request with a unique XID
      * which is automatically generated, and waits for a result from the switch.
-     * 
+     *
      * @param msg
      *            The message to be sent
      * @return An Object which has one of the followings instances/values:
@@ -141,21 +141,21 @@ public interface ISwitch {
 
     /**
      * Returns a map containing all OFPhysicalPorts of this switch.
-     * 
+     *
      * @return The Map of OFPhysicalPort
      */
     public Map<Short, OFPhysicalPort> getPhysicalPorts();
 
     /**
      * Returns a Set containing all port IDs of this switch.
-     * 
+     *
      * @return The Set of port ID
      */
     public Set<Short> getPorts();
 
     /**
      * Returns OFPhysicalPort of the specified portNumber of this switch.
-     * 
+     *
      * @param portNumber
      *            The port ID
      * @return OFPhysicalPort for the specified PortNumber
@@ -164,7 +164,7 @@ public interface ISwitch {
 
     /**
      * Returns the bandwidth of the specified portNumber of this switch.
-     * 
+     *
      * @param portNumber
      *            the port ID
      * @return bandwidth
@@ -173,7 +173,7 @@ public interface ISwitch {
 
     /**
      * Returns True if the port is enabled,
-     * 
+     *
      * @param portNumber
      * @return True if the port is enabled
      */
@@ -181,7 +181,7 @@ public interface ISwitch {
 
     /**
      * Returns True if the port is enabled.
-     * 
+     *
      * @param port
      * @return True if the port is enabled
      */
@@ -189,7 +189,7 @@ public interface ISwitch {
 
     /**
      * Returns a list containing all enabled ports of this switch.
-     * 
+     *
      * @return: List containing all enabled ports of this switch
      */
     public List<OFPhysicalPort> getEnabledPorts();
@@ -197,7 +197,7 @@ public interface ISwitch {
     /**
      * Sends OFStatisticsRequest with a unique XID generated automatically and
      * waits for a result from the switch.
-     * 
+     *
      * @param req
      *            the OF Statistic Request to be sent
      * @return Object has one of the following instances/values::
@@ -211,7 +211,7 @@ public interface ISwitch {
     /**
      * Returns true if the switch has reached the operational state (has sent
      * FEATURE_REPLY to the controller).
-     * 
+     *
      * @return true if the switch is operational
      */
     public boolean isOperational();
index 2863070cc5a7a34ff0f2d95475cd5a9359a443f3..7fb5f9fcf134c2b83a4d6534dca9356af206103b 100644 (file)
@@ -107,7 +107,7 @@ public class Controller implements IController, CommandProvider {
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
-     * 
+     *
      */
     public void init() {
         logger.debug("Initializing!");
@@ -122,7 +122,7 @@ public class Controller implements IController, CommandProvider {
     /**
      * Function called by dependency manager after "init ()" is called and after
      * the services provided by the class are registered in the service registry
-     * 
+     *
      */
     public void start() {
         logger.debug("Starting!");
@@ -145,7 +145,7 @@ public class Controller implements IController, CommandProvider {
      * Function called by the dependency manager before the services exported by
      * the component are unregistered, this will be followed by a "destroy ()"
      * calls
-     * 
+     *
      */
     public void stop() {
         for (Iterator<Entry<Long, ISwitch>> it = switches.entrySet().iterator(); it
@@ -166,7 +166,7 @@ public class Controller implements IController, CommandProvider {
      * Function called by the dependency manager when at least one dependency
      * become unsatisfied or when the component is shutting down because for
      * example bundle is being stopped.
-     * 
+     *
      */
     public void destroy() {
     }
@@ -224,7 +224,7 @@ public class Controller implements IController, CommandProvider {
                     instanceName);
             switchHandler.start();
             if (sc.isConnected()) {
-                logger.info("Switch:{} is connected to the Controller", 
+                logger.info("Switch:{} is connected to the Controller",
                         sc.socket().getRemoteSocketAddress()
                         .toString().split("/")[1]);
             }
index d2dab0fc94483b4827890d087c996e0c9ebe3a09..fc2e0ee324b2cc4934a1f4181988cf674d6bebc1 100644 (file)
@@ -52,7 +52,7 @@ public class MessageReadWriteService implements IMessageReadWrite {
 
     /**
      * Sends the OF message out over the socket channel.
-     * 
+     *
      * @param msg
      *            OF message to be sent
      * @throws Exception
@@ -90,7 +90,7 @@ public class MessageReadWriteService implements IMessageReadWrite {
 
     /**
      * Resumes sending the remaining messages in the outgoing buffer
-     * 
+     *
      * @throws Exception
      */
     @Override
@@ -116,7 +116,7 @@ public class MessageReadWriteService implements IMessageReadWrite {
     /**
      * Reads the incoming network data from the socket and retrieves the OF
      * messages.
-     * 
+     *
      * @return list of OF messages
      * @throws Exception
      */
index 6a2cb9e9c4f576949a79a1b63976605a3970d95f..0386ef6f74f7382bf8f8a7385d1db139b68a0ab4 100644 (file)
@@ -22,7 +22,7 @@ class PriorityMessage {
     final static AtomicLong seq = new AtomicLong();
     final long seqNum;
     boolean syncReply; // set to true if we want to be blocked until the response arrives
-    
+
     public PriorityMessage(OFMessage msg, int priority) {
         this.msg = msg;
         this.priority = priority;
index 43a64814d8498a1842ae9f4e2ce4ee75a08aca2f..64031fd01212cceeaaed4ae95b65a0db3904f3da 100644 (file)
@@ -71,7 +71,7 @@ public class SecureMessageReadWriteService implements IMessageReadWrite {
 
     /**
      * Bring up secure channel using SSL Engine
-     * 
+     *
      * @param socket
      *            TCP socket channel
      * @throws Exception
@@ -143,7 +143,7 @@ public class SecureMessageReadWriteService implements IMessageReadWrite {
     /**
      * Sends the OF message out over the socket channel. The message is
      * encrypted by SSL Engine.
-     * 
+     *
      * @param msg
      *            OF message to be sent
      * @throws Exception
@@ -196,7 +196,7 @@ public class SecureMessageReadWriteService implements IMessageReadWrite {
 
     /**
      * Resumes sending the remaining messages in the outgoing buffer
-     * 
+     *
      * @throws Exception
      */
     @Override
@@ -234,7 +234,7 @@ public class SecureMessageReadWriteService implements IMessageReadWrite {
     /**
      * Reads the incoming network data from the socket, decryptes them and then
      * retrieves the OF messages.
-     * 
+     *
      * @return list of OF messages
      * @throws Exception
      */
index dc84304a047573307e62fa0205fc2ff6dce16a71..2d8cdd206a7e2c651151c6515e003ba8e862c8fa 100644 (file)
@@ -131,7 +131,7 @@ public class DataPacketMuxDemux implements IContainerListener,
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
-     * 
+     *
      */
     void init() {
         this.controller.addMessageListener(OFType.PACKET_IN, this);
@@ -141,7 +141,7 @@ public class DataPacketMuxDemux implements IContainerListener,
      * Function called by the dependency manager when at least one dependency
      * become unsatisfied or when the component is shutting down because for
      * example bundle is being stopped.
-     * 
+     *
      */
     void destroy() {
         this.controller.removeMessageListener(OFType.PACKET_IN, this);
index e2945628868d0b4e1b6477e2f4285353f0d3f941..ffd5fd4315747e40c7bf16b298c98f7c1bbd34eb 100644 (file)
@@ -28,7 +28,7 @@ public class DescStatisticsConverter {
 
     public DescStatisticsConverter(List<OFStatistics> statsList) {
         this.hwDesc = null;
-        this.ofDesc = (statsList == null || statsList.isEmpty())? 
+        this.ofDesc = (statsList == null || statsList.isEmpty())?
                 null : (OFDescriptionStatistics) statsList.get(0);
     }
 
index 3be6f22742432795a55f17540fa03b8792b1bac9..c3833d224626832b821dea92503f5b41b756faed 100644 (file)
@@ -933,20 +933,20 @@ public class DiscoveryService implements IInventoryShimExternalListener,
         help.append("\t pcc                             - Print CC info\n");
         help.append("\t psize                           - Print sizes of all the lists\n");
         help.append("\t ptm                             - Print timeout info\n");
-        help.append("\t ecc                            - Enable CC\n");
-        help.append("\t dcc                            - Disable CC\n");
+        help.append("\t ecc                             - Enable CC\n");
+        help.append("\t dcc                             - Disable CC\n");
         help.append("\t scc [multiple]                  - Set/show CC multiple and interval\n");
-        help.append("\t sports [ports]                         - Set/show max ports per batch\n");
+        help.append("\t sports [ports]                  - Set/show max ports per batch\n");
         help.append("\t spause [ticks]                  - Set/show pause period\n");
-        help.append("\t sdi [ticks]                            - Set/show discovery interval in ticks\n");
+        help.append("\t sdi [ticks]                     - Set/show discovery interval in ticks\n");
         help.append("\t stm [ticks]                     - Set/show per timeout ticks\n");
-        help.append("\t sretry [count]                         - Set/show num of retries\n");
-        help.append("\t addsw <swid>                   - Add a switch\n");
-        help.append("\t remsw <swid>                   - Remove a switch\n");
+        help.append("\t sretry [count]                  - Set/show num of retries\n");
+        help.append("\t addsw <swid>                    - Add a switch\n");
+        help.append("\t remsw <swid>                    - Remove a switch\n");
         help.append("\t page                            - Print aging info\n");
         help.append("\t sage                            - Set/Show aging time limit\n");
-        help.append("\t eage                           - Enable aging\n");
-        help.append("\t dage                           - Disable aging\n");
+        help.append("\t eage                            - Enable aging\n");
+        help.append("\t dage                            - Disable aging\n");
         help.append("\t pthrot                          - Print throttling\n");
         help.append("\t ethrot                          - Enable throttling\n");
         help.append("\t dthrot                          - Disable throttling\n");
@@ -1048,7 +1048,7 @@ public class DiscoveryService implements IInventoryShimExternalListener,
             }
         }
         ci.println("\n");
-        ci.println("              NodeConnector                                                Edge ");
+        ci.println("              NodeConnector                                                 Edge ");
         Set<NodeConnector> keySet = prodMap.keySet();
         if (keySet == null) {
             return;
index 074774a25e2e8c295801c5ae9763f4661ba6a79c..45c92aa91a6b806e310f1e62bfeb3e75bf6a92a8 100644 (file)
@@ -100,7 +100,7 @@ public class FlowConverter {
     /**
      * Returns the match in OF 1.0 (OFMatch) form or OF 1.0 + IPv6 extensions
      * form (V6Match)
-     * 
+     *
      * @return
      */
     public OFMatch getOFMatch() {
@@ -262,7 +262,7 @@ public class FlowConverter {
 
     /**
      * Returns the list of actions in OF 1.0 form
-     * 
+     *
      * @return
      */
     public List<OFAction> getOFActions() {
@@ -424,7 +424,7 @@ public class FlowConverter {
     /**
      * Utility to convert a SAL flow to an OF 1.0 (OFFlowMod) or to an OF 1.0 +
      * IPv6 extension (V6FlowMod) Flow modifier Message
-     * 
+     *
      * @param sw
      * @param command
      * @param port
index cad0dfa8078e0d642339d4f49d55ae4015290c75..2a62d6c34a08a19c4cccb898acdf90945ada255b 100644 (file)
@@ -37,7 +37,7 @@ public class FlowProgrammerNotifier implements IFlowProgrammerNotifier {
      * Function called by the dependency manager when at least one dependency
      * become unsatisfied or when the component is shutting down because for
      * example bundle is being stopped.
-     * 
+     *
      */
     void destroy() {
         logger.debug("DESTROY called!");
@@ -46,7 +46,7 @@ public class FlowProgrammerNotifier implements IFlowProgrammerNotifier {
     /**
      * Function called by dependency manager after "init ()" is called and after
      * the services provided by the class are registered in the service registry
-     * 
+     *
      */
     void start() {
         logger.debug("START called!");
@@ -56,7 +56,7 @@ public class FlowProgrammerNotifier implements IFlowProgrammerNotifier {
      * Function called by the dependency manager before the services exported by
      * the component are unregistered, this will be followed by a "destroy ()"
      * calls
-     * 
+     *
      */
     void stop() {
         logger.debug("STOP called!");
index 96ea6cd14f9612aa80a328faab5b1160277ec0e7..f58acf62edb0962703b9e4971e582bc412314c47 100644 (file)
@@ -110,7 +110,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
-     * 
+     *
      */
     void init() {
         this.controller.addMessageListener(OFType.FLOW_REMOVED, this);
@@ -122,7 +122,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
      * Function called by the dependency manager when at least one dependency
      * become unsatisfied or when the component is shutting down because for
      * example bundle is being stopped.
-     * 
+     *
      */
     void destroy() {
     }
@@ -130,7 +130,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
     /**
      * Function called by dependency manager after "init ()" is called and after
      * the services provided by the class are registered in the service registry
-     * 
+     *
      */
     void start() {
     }
@@ -139,7 +139,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
      * Function called by the dependency manager before the services exported by
      * the component are unregistered, this will be followed by a "destroy ()"
      * calls
-     * 
+     *
      */
     void stop() {
     }
@@ -201,7 +201,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
                      * will be inserted automatically to synchronize the
                      * progression.
                      */
-                    result = asyncMsgSend(node, sw, msg, rid);  
+                    result = asyncMsgSend(node, sw, msg, rid);
                 }
                 return getStatusInternal(result, action, rid);
             } else {
@@ -392,7 +392,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
         if ((rid == null) || (rid == 0)) {
             return;
         }
-        
+
         /*
          * Notifies the caller that error has been reported for a previous flow
          * programming request
@@ -466,7 +466,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
         return new Status(StatusCode.INTERNALERROR,
                 "Failed to send Barrier message.");
     }
-    
+
     @Override
     public Status asyncSendBarrierMessage(Node node) {
         if (!node.getType().equals(NodeIDType.OPENFLOW)) {
@@ -489,14 +489,14 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
         return new Status(StatusCode.INTERNALERROR,
                 "Failed to send Barrier message.");
     }
-    
+
     /**
      * This method sends the message asynchronously until the number of messages
      * sent reaches a threshold. Then a Barrier message is sent automatically
      * for sync purpose. An unique Request ID associated with the message is
      * passed down by the caller. The Request ID will be returned to the caller
      * when an error message is received from the switch.
-     * 
+     *
      * @param node
      *            The node
      * @param msg
@@ -514,25 +514,25 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
 
         xid = sw.asyncSend(msg);
         addXid2Rid(swid, xid, rid);
-        
+
         Map<Integer, Long> swxid2rid = this.xid2rid.get(swid);
         if (swxid2rid == null) {
             return result;
         }
-        
+
         int size = swxid2rid.size();
         if (size % barrierMessagePriorCount == 0) {
             result = asyncSendBarrierMessage(node);
         }
-        
+
         return result;
     }
-    
+
     /**
      * A number of async messages are sent followed by a synchronous Barrier
      * message. This method returns the maximum async messages that can be sent
      * before the Barrier message.
-     * 
+     *
      * @return The max count of async messages sent prior to Barrier message
      */
     private int getBarrierMessagePriorCount() {
@@ -548,11 +548,11 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
 
         return rv;
     }
-    
+
     /**
      * This method returns the message Request ID previously assigned by the
      * caller for a given OF message xid
-     * 
+     *
      * @param swid
      *            The switch id
      * @param xid
@@ -576,14 +576,14 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
     /**
      * This method returns a copy of outstanding xid to rid mappings.for a given
      * switch
-     * 
+     *
      * @param swid
      *            The switch id
      * @return a copy of xid2rid mappings
      */
     public Map<Integer, Long> getSwXid2Rid(long swid) {
         Map<Integer, Long> swxid2rid = this.xid2rid.get(swid);
-        
+
         if (swxid2rid != null) {
             return new HashMap<Integer, Long>(swxid2rid);
         } else {
@@ -593,7 +593,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
 
     /**
      * Adds xid to rid mapping to the local DB
-     * 
+     *
      * @param swid
      *            The switch id
      * @param xid
@@ -611,7 +611,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
     /**
      * When an Error message is received, this method will be invoked to remove
      * the offending xid from the local DB.
-     * 
+     *
      * @param swid
      *            The switch id
      * @param xid
@@ -626,7 +626,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
 
     /**
      * Convert various result into Status
-     * 
+     *
      * @param result
      *            The returned result from previous action
      * @param action
@@ -652,11 +652,11 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
                     "send", action, "Internal Error"));
         }
     }
-    
+
     /**
      * When a Barrier reply is received, this method will be invoked to clear
      * the local DB
-     * 
+     *
      * @param swid
      *            The switch id
      */
@@ -670,7 +670,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
     @Override
     public void updateNode(Node node, UpdateType type, Set<Property> props) {
         long swid = (Long)node.getID();
-        
+
         switch (type) {
         case ADDED:
             Map<Integer, Long> swxid2rid = new HashMap<Integer, Long>();
@@ -712,7 +712,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
             ci.println("Please enter a valid node id");
             return;
         }
-        
+
         long sid;
         try {
             sid = HexEncode.stringToLong(st);
@@ -720,7 +720,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
             ci.println("Please enter a valid node id");
             return;
         }
-        
+
         Map<Integer, Long> swxid2rid = this.xid2rid.get(sid);
         if (swxid2rid == null) {
             ci.println("The node id entered does not exist");
@@ -728,7 +728,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
         }
 
         ci.println("xid             rid");
-        
+
         Set<Integer> xidSet = swxid2rid.keySet();
         if (xidSet == null) {
             return;
index 7afe6ce5be9a863d49938aa80c1576ef68e4ecf4..82dbf670a9517ee1b998442f2d524f37628f5815 100644 (file)
@@ -23,9 +23,9 @@ import org.slf4j.LoggerFactory;
 /**
  * Converts an openflow list of flow statistics in a SAL list of FlowOnNode
  * objects
- * 
- * 
- * 
+ *
+ *
+ *
  */
 public class FlowStatisticsConverter {
     private static final Logger log = LoggerFactory
index 33afa9463338d7168458b1618edbac2acd6438b8..5e5f056c5aba0002a8cb1e3178ca9d1dddf842c3 100644 (file)
@@ -108,27 +108,27 @@ public class InventoryServiceHelper {
         if (bw != null) {
             props.add(bw);
         }
-        
+
         Bandwidth abw = InventoryServiceHelper.OFPortToBandWidth(port.getAdvertisedFeatures());
         if (abw != null) {
-               AdvertisedBandwidth a = new AdvertisedBandwidth(abw.getValue());
-               if (a != null) {
-                       props.add(a);
-               }
+                AdvertisedBandwidth a = new AdvertisedBandwidth(abw.getValue());
+                if (a != null) {
+                        props.add(a);
+                }
         }
         Bandwidth sbw = InventoryServiceHelper.OFPortToBandWidth(port.getSupportedFeatures());
         if (sbw != null) {
-               SupportedBandwidth s = new SupportedBandwidth(sbw.getValue());
-               if (s != null) {
-                       props.add(s);
-               }
+                SupportedBandwidth s = new SupportedBandwidth(sbw.getValue());
+                if (s != null) {
+                        props.add(s);
+                }
         }
         Bandwidth pbw = InventoryServiceHelper.OFPortToBandWidth(port.getPeerFeatures());
         if (pbw != null) {
-               PeerBandwidth p = new PeerBandwidth(pbw.getValue());
-               if (p != null) {
-                       props.add(p);
-               }
+                PeerBandwidth p = new PeerBandwidth(pbw.getValue());
+                if (p != null) {
+                        props.add(p);
+                }
         }
         props.add(new Name(port.getName()));
         props.add(InventoryServiceHelper.OFPortToConfig(port.getConfig()));
index 78fddc773637c8aefb338b729d4e416e66e85441..21a632e1de0226dadfd035b432f2dec85f5a57f2 100644 (file)
@@ -129,7 +129,7 @@ IInventoryShimExternalListener, CommandProvider {
 
         /**
          * Returns the average transmit rate in bps
-         * 
+         *
          * @return the average transmit rate [bps]
          */
         public long getAverageTxRate() {
@@ -162,7 +162,7 @@ IInventoryShimExternalListener, CommandProvider {
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
-     * 
+     *
      */
     void init() {
         flowStatistics = new ConcurrentHashMap<Long, List<OFStatistics>>();
@@ -227,7 +227,7 @@ IInventoryShimExternalListener, CommandProvider {
      * Function called by the dependency manager when at least one dependency
      * become unsatisfied or when the component is shutting down because for
      * example bundle is being stopped.
-     * 
+     *
      */
     void destroy() {
     }
@@ -235,7 +235,7 @@ IInventoryShimExternalListener, CommandProvider {
     /**
      * Function called by dependency manager after "init ()" is called and after
      * the services provided by the class are registered in the service registry
-     * 
+     *
      */
     void start() {
         // Start managed timers
@@ -255,7 +255,7 @@ IInventoryShimExternalListener, CommandProvider {
      * Function called by the dependency manager before the services exported by
      * the component are unregistered, this will be followed by a "destroy ()"
      * calls
-     * 
+     *
      */
     void stop() {
         // Stop managed timers
@@ -896,7 +896,7 @@ IInventoryShimExternalListener, CommandProvider {
     /**
      * Update the cached port rates for this switch with the latest retrieved
      * port transmit byte count
-     * 
+     *
      * @param switchId
      */
     private synchronized void updatePortsTxRate(long switchId) {
index 410781683bdbd424f8fc2ffbb87118459890f40e..0b605ab875a145ff1935f56453d087b2e9115314 100644 (file)
@@ -20,9 +20,9 @@ import org.slf4j.LoggerFactory;
 /**
  * Abstract class which provides the utilities for converting the Openflow port
  * number to the equivalent NodeConnector and vice versa
- * 
- * 
- * 
+ *
+ *
+ *
  */
 public abstract class PortConverter {
     private static final Logger log = LoggerFactory
index 3fbf68fbc1746723f9c7119947e077ca2acfd5e0..b18eae971b9526fef38a927b798c0a1dccc8e9d9 100644 (file)
@@ -22,9 +22,9 @@ import org.slf4j.LoggerFactory;
 /**
  * Converts an openflow list of port statistics in a SAL list of
  * NodeConnectorStatistics objects
- * 
- * 
- * 
+ *
+ *
+ *
  */
 public class PortStatisticsConverter {
     private static final Logger log = LoggerFactory
index bcb01b1392ac8661f2ee6aeb3db5e34c47362a41..22e8a4dc74eb897847c0d2835f9060f3f506ea01 100644 (file)
@@ -284,9 +284,9 @@ public class ReadServiceFilter implements IPluginReadServiceFilter,
     /**
      * Returns whether the passed NodeConnector belongs to the container
      *
-     * @param container        container name
-     * @param p                node connector to test
-     * @return                 true if belongs false otherwise
+     * @param container container name
+     * @param p     node connector to test
+     * @return          true if belongs false otherwise
      */
     public boolean containerOwnsNodeConnector(String container, NodeConnector p) {
         // All node connectors belong to the default container
@@ -300,9 +300,9 @@ public class ReadServiceFilter implements IPluginReadServiceFilter,
     /**
      * Returns whether the passed NodeConnector belongs to the container
      *
-     * @param container        container name
-     * @param table            node table to test
-     * @return                 true if belongs false otherwise
+     * @param container container name
+     * @param table     node table to test
+     * @return          true if belongs false otherwise
      */
     public boolean containerOwnsNodeTable(String container, NodeTable table) {
         // All node table belong to the default container
index b23737c52037058d246d18bad2acd32caf52abc6..68572fb65086ef4c7901dc4179caf03e57c12233 100644 (file)
@@ -32,7 +32,7 @@ public class TopologyServices implements ITopologyServiceShimListener,
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
-     * 
+     *
      */
     @SuppressWarnings("unchecked")
     void init(Component c) {
@@ -46,7 +46,7 @@ public class TopologyServices implements ITopologyServiceShimListener,
      * Function called by the dependency manager when at least one dependency
      * become unsatisfied or when the component is shutting down because for
      * example bundle is being stopped.
-     * 
+     *
      */
     void destroy() {
         logger.trace("DESTROY called!");
@@ -55,7 +55,7 @@ public class TopologyServices implements ITopologyServiceShimListener,
     /**
      * Function called by dependency manager after "init ()" is called and after
      * the services provided by the class are registered in the service registry
-     * 
+     *
      */
     void start() {
         logger.trace("START called!");
@@ -65,7 +65,7 @@ public class TopologyServices implements ITopologyServiceShimListener,
      * Function called by the dependency manager before the services exported by
      * the component are unregistered, this will be followed by a "destroy ()"
      * calls
-     * 
+     *
      */
     void stop() {
         logger.trace("STOP called!");
@@ -73,7 +73,7 @@ public class TopologyServices implements ITopologyServiceShimListener,
 
     /**
      * Retrieve SAL service IPluginOutTopologyService
-     * 
+     *
      * @param s
      *            Called by Dependency Manager as soon as the SAL service is
      *            available
@@ -85,7 +85,7 @@ public class TopologyServices implements ITopologyServiceShimListener,
 
     /**
      * called when SAL service IPluginOutTopologyService is no longer available
-     * 
+     *
      * @param s
      *            Called by Dependency Manager as soon as the SAL service is
      *            unavailable
@@ -99,7 +99,7 @@ public class TopologyServices implements ITopologyServiceShimListener,
 
     /**
      * Retrieve OF protocol_plugin service IRefreshInternalProvider
-     * 
+     *
      * @param s
      *            Called by Dependency Manager as soon as the SAL service is
      *            available
@@ -112,7 +112,7 @@ public class TopologyServices implements ITopologyServiceShimListener,
     /**
      * called when OF protocol_plugin service IRefreshInternalProvider is no
      * longer available
-     * 
+     *
      * @param s
      *            Called by Dependency Manager as soon as the SAL service is
      *            unavailable
index f1ce03af281ffbfe51846173f6ebbc744e4d37d1..4f7bf4889fd6b6d1c59a07e9d06f384a3ae3f54b 100644 (file)
@@ -33,7 +33,7 @@ public abstract class Utils {
             er.readFrom(bb);
             return er.toString();
         }
-        
+
         // Handle OF1.0 errors here
         OFErrorType et = OFErrorType.values()[0xffff & error.getErrorType()];
         String errorStr = "Error : " + et.toString();
index c52c3f56b800a57ff247bc4a7246db2b3065c49d..9e44073e21a2f7376def5edd8f57458b1a7b3291 100644 (file)
@@ -6,21 +6,21 @@ import java.util.Arrays;
 import org.openflow.protocol.OFError;
 
 public class V6Error extends OFError {
-       private static final long serialVersionUID = 1L;
-       public static int MINIMUM_LENGTH = 20;//OfHdr(8) + NXET_VENDOR(2) + NXEC_VENDOR_ERROR(2) + struct nx_vendor_error(8)
-       public static final short NICIRA_VENDOR_ERRORTYPE = (short)0xb0c2;
-       protected int V6VendorId;
+        private static final long serialVersionUID = 1L;
+        public static int MINIMUM_LENGTH = 20;//OfHdr(8) + NXET_VENDOR(2) + NXEC_VENDOR_ERROR(2) + struct nx_vendor_error(8)
+        public static final short NICIRA_VENDOR_ERRORTYPE = (short)0xb0c2;
+        protected int V6VendorId;
     protected short V6VendorErrorType;
     protected short V6VendorErrorCode;
     protected byte[] V6ErrorData;
-    
+
     public V6Error(OFError e) {
         this.length = (short)e.getLengthU();
         this.errorType = e.getErrorType();
         this.errorCode = e.getErrorCode();
         this.xid = e.getXid();
     }
-    
+
     @Override
     public void readFrom(ByteBuffer data) {
         this.V6VendorId = data.getInt();
@@ -30,37 +30,37 @@ public class V6Error extends OFError {
         if (dataLength > 0) {
             this.V6ErrorData = new byte[dataLength];
             data.get(this.V6ErrorData);
-        }   
+        }
     }
-    
+
     /**
      * @return the V6VendorId
      */
     public int getVendorId() {
         return V6VendorId;
     }
-    
+
     /**
      * @return the V6VendorErrorType
      */
     public short getVendorErrorType() {
         return V6VendorErrorType;
     }
-    
+
     /**
      * @return the VendorErrorType
      */
     public short getVendorErrorCode() {
         return V6VendorErrorCode;
     }
-    
+
     /**
      * @return the Error Bytes
      */
     public byte[] getError() {
         return V6ErrorData;
     }
-    
+
     @Override
     public int hashCode() {
         final int prime = 31;
index 53f4e1d5ad0e73f61219483fc16344d34ed0ca95..81ee6dc07054fc57f8a4fd027f91def3b52d5423 100644 (file)
@@ -24,7 +24,7 @@ import org.slf4j.LoggerFactory;
 /**
  * This class is used to create IPv6 Vendor Extension messages. Specfically, It
  * defines the methods used in creation of Vendor specific IPv6 Flow Mod message.
- * 
+ *
  *
  */
 public class V6FlowMod extends OFVendor implements Cloneable {
@@ -49,7 +49,7 @@ public class V6FlowMod extends OFVendor implements Cloneable {
     private static int IPV6_EXT_MIN_HDR_LEN = 36;
 
     /**
-     * Constructor for the V6FlowMod class. Initializes OFVendor (parent class) 
+     * Constructor for the V6FlowMod class. Initializes OFVendor (parent class)
      * fields by calling the parent class' constructor.
      */
     public V6FlowMod() {
@@ -58,7 +58,7 @@ public class V6FlowMod extends OFVendor implements Cloneable {
 
     /**
      * This method sets the match fields of V6FlowMod object
-     * @param match            V6Match object for this V6FlowMod message
+     * @param match     V6Match object for this V6FlowMod message
      */
     public void setMatch(V6Match match) {
         this.match = match;
@@ -66,7 +66,7 @@ public class V6FlowMod extends OFVendor implements Cloneable {
 
     /**
      * Sets the list of actions V6FlowMod message
-     * @param actions  a list of ordered OFAction objects
+     * @param actions   a list of ordered OFAction objects
      */
     public void setActions(List<OFAction> actions) {
         this.actions = actions;
@@ -74,7 +74,7 @@ public class V6FlowMod extends OFVendor implements Cloneable {
 
     /**
      * Sets the priority field of V6FlowMod message
-     * @param priority         Priority of the message
+     * @param priority  Priority of the message
      */
     public void setPriority(short priority) {
         this.priority = priority;
@@ -82,7 +82,7 @@ public class V6FlowMod extends OFVendor implements Cloneable {
 
     /**
      * Sets the cookie field of V6FlowMod message
-     * @param cookie   Cookie of the message
+     * @param cookie    Cookie of the message
      */
     public void setCookie(long cookie) {
         this.cookie = cookie;
@@ -90,7 +90,7 @@ public class V6FlowMod extends OFVendor implements Cloneable {
 
     /**
      * Sets the command field of V6FlowMod message
-     * @param command  Command type of the message (ADD or DELETE)
+     * @param command   Command type of the message (ADD or DELETE)
      */
     public V6FlowMod setCommand(short command) {
         this.command = command;
@@ -99,7 +99,7 @@ public class V6FlowMod extends OFVendor implements Cloneable {
 
     /**
      * Sets the outPort field of V6FlowMod message
-     * @param outPort  outPort of the message
+     * @param outPort   outPort of the message
      */
     public V6FlowMod setOutPort(OFPort port) {
         this.outPort = port.getValue();
@@ -108,7 +108,7 @@ public class V6FlowMod extends OFVendor implements Cloneable {
 
     /**
      * Sets the idle_timeout of V6FlowMod message
-     * @param idleTimeout      idle timeout for this message
+     * @param idleTimeout   idle timeout for this message
      */
     public void setIdleTimeout(short idleTimeout) {
         this.idleTimeout = idleTimeout;
@@ -116,7 +116,7 @@ public class V6FlowMod extends OFVendor implements Cloneable {
 
     /**
      * Sets the hardTimeout field of V6FlowMod message
-     * @param hardTimeout      hard timeout of the message
+     * @param hardTimeout       hard timeout of the message
      */
     public void setHardTimeout(short hardTimeout) {
         this.hardTimeout = hardTimeout;
@@ -124,21 +124,21 @@ public class V6FlowMod extends OFVendor implements Cloneable {
 
     /**
      * Returns the Flow Mod message subtype for V6FlowMod message
-     * @return                 message subtype
+     * @return          message subtype
      */
     private int getIPv6ExtensionFlowModAddSubType() {
         return IPV6EXT_ADD_FLOW_MSG_TYPE;
     }
-    
+
     /**
      * Returns the minimum header size for V6Flow Message type
-     * @return         minimum header size
+     * @return      minimum header size
      */
 
     public int getV6FlowModMinHdrSize() {
         return IPV6_EXT_MIN_HDR_LEN;
     }
-    
+
     /**
      * Sets the Vendor type in OFVendor message
      */
@@ -146,7 +146,7 @@ public class V6FlowMod extends OFVendor implements Cloneable {
     public void setVendor() {
         super.setVendor(V6StatsRequest.NICIRA_VENDOR_ID);
     }
-    
+
     /**
      * Get flags
      * @return
@@ -162,12 +162,12 @@ public class V6FlowMod extends OFVendor implements Cloneable {
     public void setFlags(short flags) {
         this.flags = flags;
     }
-    
+
     /**
      * This method forms the Vendor extension IPv6 Flow Mod message.It uses the
-     * fields in V6FlowMod class, and writes the data according to vendor 
+     * fields in V6FlowMod class, and writes the data according to vendor
      * extension format. The fields include flow properties (cookie, timeout,
-     * priority, etc), flow match, and action list. It also takes care of 
+     * priority, etc), flow match, and action list. It also takes care of
      * required padding.
      */
 
@@ -209,7 +209,7 @@ public class V6FlowMod extends OFVendor implements Cloneable {
 
     /**
      * Forms the clone of V6FlowMod Object. If Object is returned
-     * successfully, then returns the cloned object. Throws an 
+     * successfully, then returns the cloned object. Throws an
      * exception if cloning is not supported.
      */
     @Override
index 2da6b9b00891008850075e31920d02c01888ad16..0edcfead0c87fff08faf22161ab2580e9243bf3e 100644 (file)
@@ -27,14 +27,14 @@ import org.slf4j.LoggerFactory;
 /**
  * This Class forms the vendor specific IPv6 Flow Match messages as well as
  * processes the vendor specific IPv6 Stats Reply message.
- * 
- * For message creation, it parses the user entered IPv6 match fields, creates 
- * a sub-message for each field which are later used to form the complete 
- * message.  
- * 
+ *
+ * For message creation, it parses the user entered IPv6 match fields, creates
+ * a sub-message for each field which are later used to form the complete
+ * message.
+ *
  * For message processing, it parses the incoming message and reads each field
  * of the message and stores in appropriate field of V6Match object.
- *  
+ *
  *
  */
 public class V6Match extends OFMatch implements Cloneable {
@@ -472,7 +472,7 @@ public class V6Match extends OFMatch implements Cloneable {
 
     /**
      * Sets this (V6Match) object's member variables based on a comma-separated key=value pair similar to OFMatch's fromString.
-     * 
+     *
      * @param match a key=value comma separated string.
      */
     @Override
index 6893fa78e279979bb3149038a3f87b3bc4234a49..bd3c2a2c04e95fb01ce31c1d595ba02069b8a04a 100644 (file)
@@ -19,9 +19,9 @@ import org.openflow.util.U16;
 /**
  * This Class processes the OpenFlow Vendor Extension Reply message of a Stats
  * Request. It parses the reply message and initializes fields of  V6StatsReply
- * object. Multiple instances of this class objects are created and used by 
+ * object. Multiple instances of this class objects are created and used by
  * OpenDaylight's Troubleshooting Application.
- * 
+ *
  */
 
 public class V6StatsReply extends OFVendorStatistics {
index 593b464d3c68cec4f3a753657c3085a9081b94bf..c96419ef11e9d465823f112ed8f81280fb22911b 100644 (file)
@@ -16,9 +16,9 @@ import org.openflow.protocol.statistics.OFVendorStatistics;
 
 
 /**
- * This Class creates the OpenFlow Vendor Extension IPv6 Flow Stats Request 
+ * This Class creates the OpenFlow Vendor Extension IPv6 Flow Stats Request
  * messages and also reads the Reply of a stats request message.
- * 
+ *
  */
 
 public class V6StatsRequest extends OFVendorStatistics {
index 8e4c985c06b76ea6055717ae7a5d46370335673e..614e70b1b859b0e23c7500549f776dd961558d53 100644 (file)
@@ -28,8 +28,8 @@ import org.slf4j.LoggerFactory;
 
 /**
  * stub protocol plugin Activator
- * 
- * 
+ *
+ *
  */
 public class Activator extends ComponentActivatorAbstractBase {
     protected static final Logger logger = LoggerFactory
@@ -38,7 +38,7 @@ public class Activator extends ComponentActivatorAbstractBase {
     /**
      * Function called when the activator starts just after some initializations
      * are done by the ComponentActivatorAbstractBase.
-     * 
+     *
      */
     public void init() {
         Node.NodeIDType.registerIDType("STUB", Integer.class);
@@ -48,7 +48,7 @@ public class Activator extends ComponentActivatorAbstractBase {
     /**
      * Function called when the activator stops just before the cleanup done by
      * ComponentActivatorAbstractBase
-     * 
+     *
      */
     public void destroy() {
         Node.NodeIDType.unRegisterIDType("STUB");
@@ -58,8 +58,8 @@ public class Activator extends ComponentActivatorAbstractBase {
     /**
      * Function that is used to communicate to dependency manager the list of
      * known implementations for services inside a container
-     * 
-     * 
+     *
+     *
      * @return An array containing all the CLASS objects that will be
      *         instantiated in order to get an fully working implementation
      *         Object
@@ -72,7 +72,7 @@ public class Activator extends ComponentActivatorAbstractBase {
     /**
      * Function that is called when configuration of the dependencies is
      * required.
-     * 
+     *
      * @param c
      *            dependency manager Component object, used for configuring the
      *            dependencies exported and imported
@@ -103,12 +103,12 @@ public class Activator extends ComponentActivatorAbstractBase {
             c.setInterface(IPluginInInventoryService.class.getName(), props);
         }
     }
-    
+
     public Object[] getGlobalImplementations() {
         Object[] res = { FlowProgrammerService.class, StubNodeFactory.class, StubNodeConnectorFactory.class };
         return res;
     }
-    
+
     public void configureGlobalInstance(Component c, Object imp){
         if (imp.equals(FlowProgrammerService.class)) {
             // export the service to be used by SAL
@@ -136,6 +136,6 @@ public class Activator extends ComponentActivatorAbstractBase {
             props.put("protocolName", "STUB");
             c.setInterface(INodeConnectorFactory.class.getName(), props);
         }
-        
+
     }
 }
index 834b3faceb2a95a3458bee693dc27069d24c9f88..305829705a88b32983c3eb7954a74eb3ca07e109 100644 (file)
@@ -29,7 +29,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService
      * Function called by the dependency manager when at least one dependency
      * become unsatisfied or when the component is shutting down because for
      * example bundle is being stopped.
-     * 
+     *
      */
     void destroy() {
     }
@@ -37,7 +37,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService
     /**
      * Function called by dependency manager after "init ()" is called and after
      * the services provided by the class are registered in the service registry
-     * 
+     *
      */
     void start() {
     }
@@ -46,15 +46,15 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService
      * Function called by the dependency manager before the services exported by
      * the component are unregistered, this will be followed by a "destroy ()"
      * calls
-     * 
+     *
      */
     void stop() {
     }
-    
-    
+
+
     /**
      * Synchronously add a flow to the network node
-     * 
+     *
      * @param node
      * @param flow
      */
@@ -64,7 +64,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService
 
     /**
      * Synchronously modify existing flow on the switch
-     * 
+     *
      * @param node
      * @param flow
      */
@@ -73,7 +73,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService
     }
     /**
      * Synchronously remove the flow from the network node
-     * 
+     *
      * @param node
      * @param flow
      */
@@ -83,7 +83,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService
 
     /**
      * Asynchronously add a flow to the network node
-     * 
+     *
      * @param node
      * @param flow
      * @param rid
@@ -94,7 +94,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService
 
     /**
      * Asynchronously modify existing flow on the switch
-     * 
+     *
      * @param node
      * @param flow
      * @param rid
@@ -105,7 +105,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService
 
     /**
      * Asynchronously remove the flow from the network node
-     * 
+     *
      * @param node
      * @param flow
      * @param rid
@@ -116,7 +116,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService
 
     /**
      * Remove all flows present on the network node
-     * 
+     *
      * @param node
      */
     public Status removeAllFlows(Node node){
@@ -126,7 +126,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService
     /**
      * Send Barrier message synchronously. The caller will be blocked until the
      * Barrier reply arrives.
-     * 
+     *
      * @param node
      */
     public Status syncSendBarrierMessage(Node node){
@@ -135,7 +135,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService
 
     /**
      * Send Barrier message asynchronously. The caller is not blocked.
-     * 
+     *
      * @param node
      */
     public Status asyncSendBarrierMessage(Node node){
index b4d6166d3636efa901aa490a8dd0d23dad0bbe4c..b3909a775bbe36156fa127e9b54841f02556a40e 100644 (file)
@@ -112,24 +112,24 @@ public class InventoryService implements IPluginInInventoryService {
             node = new Node("STUB", new Integer(0xCAFE));
         }catch(ConstructionException e){
             node = null;
-        }       
-     
+        }
+
         nodeProps.put(node, propMap);
-        
+
         try{
             node = new Node("STUB", 3366);
         }catch(ConstructionException e){
             node = null;
-        }       
+        }
         nodeProps.put(node, propMap);
-        
+
         try{
             node = new Node("STUB", 4477);
         }catch(ConstructionException e){
             node = null;
-        }       
+        }
         nodeProps.put(node, propMap);
-        
+
         return nodeProps;
     }
 
index 27ba897fdfc57b44e0d2d4c2ae391ffeae9364c3..b580021b690f996a35b396423bc337aed8752752 100644 (file)
@@ -47,8 +47,8 @@ import org.opendaylight.controller.sal.reader.NodeDescription;
 import org.opendaylight.controller.sal.reader.NodeTableStatistics;
 /**
  * Stub Implementation for IPluginInReadService used by SAL
- * 
- * 
+ *
+ *
  */
 public class ReadService implements IPluginInReadService {
     private static final Logger logger = LoggerFactory
@@ -57,7 +57,7 @@ public class ReadService implements IPluginInReadService {
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
-     * 
+     *
      */
     void init() {
     }
@@ -66,7 +66,7 @@ public class ReadService implements IPluginInReadService {
      * Function called by the dependency manager when at least one dependency
      * become unsatisfied or when the component is shutting down because for
      * example bundle is being stopped.
-     * 
+     *
      */
     void destroy() {
     }
@@ -74,7 +74,7 @@ public class ReadService implements IPluginInReadService {
     /**
      * Function called by dependency manager after "init ()" is called and after
      * the services provided by the class are registered in the service registry
-     * 
+     *
      */
     void start() {
     }
@@ -83,7 +83,7 @@ public class ReadService implements IPluginInReadService {
      * Function called by the dependency manager before the services exported by
      * the component are unregistered, this will be followed by a "destroy ()"
      * calls
-     * 
+     *
      */
     void stop() {
     }
index 0c1963d93396aa9be2bea92600e55f58fde2ed6d..53adef24276ee017d0be495213cdc63cad542756 100644 (file)
@@ -13,7 +13,7 @@ public class StubNodeConnectorFactory implements INodeConnectorFactory
        * Function called by the dependency manager when at least one dependency
        * become unsatisfied or when the component is shutting down because for
        * example bundle is being stopped.
-       * 
+       *
        */
       void destroy() {
       }
@@ -21,7 +21,7 @@ public class StubNodeConnectorFactory implements INodeConnectorFactory
       /**
        * Function called by dependency manager after "init ()" is called and after
        * the services provided by the class are registered in the service registry
-       * 
+       *
        */
       void start() {
       }
@@ -30,11 +30,11 @@ public class StubNodeConnectorFactory implements INodeConnectorFactory
        * Function called by the dependency manager before the services exported by
        * the component are unregistered, this will be followed by a "destroy ()"
        * calls
-       * 
+       *
        */
       void stop() {
       }
-      
+
       public NodeConnector fromStringNoNode(String typeStr, String IDStr,
               Node n){
           if(typeStr.equals("STUB")){
index 5b8ee12e567791f963caee163415f1db41616edf..25382429fd7126c595d76a2702250be76a96e036 100644 (file)
@@ -13,7 +13,7 @@ public class StubNodeFactory implements INodeFactory
        * Function called by the dependency manager when at least one dependency
        * become unsatisfied or when the component is shutting down because for
        * example bundle is being stopped.
-       * 
+       *
        */
       void destroy() {
       }
@@ -21,7 +21,7 @@ public class StubNodeFactory implements INodeFactory
       /**
        * Function called by dependency manager after "init ()" is called and after
        * the services provided by the class are registered in the service registry
-       * 
+       *
        */
       void start() {
       }
@@ -30,11 +30,11 @@ public class StubNodeFactory implements INodeFactory
        * Function called by the dependency manager before the services exported by
        * the component are unregistered, this will be followed by a "destroy ()"
        * calls
-       * 
+       *
        */
       void stop() {
       }
-      
+
       public Node fromString(String nodeType, String nodeId){
           if(nodeType.equals("STUB"))
               try{
index 26ae86243b7b83279443b2a2a2b477aa85a4e179..3a0faa91d4bbca4018d18022ac2418b2e8fa8804 100644 (file)
@@ -381,7 +381,7 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
-     * 
+     *
      */
     @SuppressWarnings({ "unchecked", "rawtypes" })
     public void init() {
@@ -401,7 +401,7 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
      * Function called by the dependency manager when at least one dependency
      * become unsatisfied or when the component is shutting down because for
      * example bundle is being stopped.
-     * 
+     *
      */
     void destroy() {
         log.debug("Routing destroy() is called");
@@ -410,7 +410,7 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
     /**
      * Function called by dependency manager after "init ()" is called and after
      * the services provided by the class are registered in the service registry
-     * 
+     *
      */
     void start() {
         log.debug("Routing start() is called");
@@ -437,7 +437,7 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
      * Function called by the dependency manager before the services exported by
      * the component are unregistered, this will be followed by a "destroy ()"
      * calls
-     * 
+     *
      */
     public void stop() {
         log.debug("Routing stop() is called");
index d8144d7bb74eaaf7a043ce3cba623b58b53c041b..332e31f6bf5337e93f0516eafe03166680450e88 100644 (file)
@@ -24,8 +24,8 @@ import org.slf4j.LoggerFactory;
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 @XmlSeeAlso({Controller.class, Drop.class, Flood.class, FloodAll.class, HwPath.class, Loopback.class, Output.class,
-                        PopVlan.class, PushVlan.class, SetDlDst.class, SetDlSrc.class, SetDlType.class, SetNwDst.class, SetNwSrc.class,
-                        SetNwTos.class, SetTpDst.class, SetTpSrc.class, SetVlanCfi.class, SetVlanId.class, SetVlanPcp.class, SwPath.class})
+                         PopVlan.class, PushVlan.class, SetDlDst.class, SetDlSrc.class, SetDlType.class, SetNwDst.class, SetNwSrc.class,
+                         SetNwTos.class, SetTpDst.class, SetTpSrc.class, SetVlanCfi.class, SetVlanId.class, SetVlanPcp.class, SwPath.class})
 public abstract class Action {
     private static final Logger logger = LoggerFactory.getLogger(Action.class);
     private static boolean debug = false; // Enable to find where in the code an invalid assignment is made
@@ -39,9 +39,9 @@ public abstract class Action {
 
     /*
     public Action (ActionType type, Object value) {
-       this.type = type;
-       this.value = value;
-       this.isValid = true;
+        this.type = type;
+        this.value = value;
+        this.isValid = true;
     } */
 
     /**
@@ -112,7 +112,7 @@ public abstract class Action {
     /**
      * Returns whether the Action is valid or not
      *
-     * @return boolean
+     * @return  boolean
      */
     public boolean isValid() {
         return isValid;
index e09968836ff1877cfb195974808aaceda1ef4680..774c79a543feacae6b59e052c04326311f31cd0c 100644 (file)
@@ -26,7 +26,7 @@ import org.opendaylight.controller.sal.core.NodeConnector;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class Output extends Action {
-       @XmlElement
+        @XmlElement
     private NodeConnector port;
 
     /* Dummy constructor for JAXB */
index f3b862fe7e2d2e16e5a5e07da4afa992d0478a6a..b5783d487a1c236948cbdc976e34e2334a51b37b 100644 (file)
@@ -21,7 +21,7 @@ import org.opendaylight.controller.sal.utils.EtherTypes;
  * Execute it multiple times to achieve QinQ
  *
  * 802.1q = [TPID(16) + TCI(16)]
- *                     TCI = [PCP(3) + CFI(1) + VID(12)]
+ *                      TCI = [PCP(3) + CFI(1) + VID(12)]
  *
  *
  *
index 2413c23314b5732c3e5d17cbbb44058835cb3d2d..c2c40bfcc8df8b70e9d007e992f16a463b95186e 100644 (file)
@@ -45,12 +45,12 @@ public class SetDlDst extends Action {
     public byte[] getDlAddress() {
         return address.clone();
     }
-    
+
     @XmlElement(name = "address")
     public String getDlAddressString() {
         return HexEncode.bytesToHexString(address);
     }
-    
+
     @Override
     public boolean equals(Object obj) {
         if (this == obj)
index 3cdd5b617038c9aadf5aad41115edfebc26ef768..91909993f3422d012003ff4e26c267033f463e49 100644 (file)
@@ -54,7 +54,7 @@ public class SetDlSrc extends Action {
     public String getDlAddressString() {
         return HexEncode.bytesToHexString(address);
     }
-    
+
     @Override
     public boolean equals(Object obj) {
         if (this == obj)
index f76000c64948d42849fd4e5c1cde568e373dcf4b..d15424ee15b9aabf9e0a493ce4a396a53c12fef1 100644 (file)
@@ -24,7 +24,7 @@ import org.opendaylight.controller.sal.utils.EtherTypes;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class SetDlType extends Action {
-       @XmlElement
+        @XmlElement
     private int dlType;
 
     /* Dummy constructor for JAXB */
index bccca3f1f236b99aafee3a77d8803aad9111a284..2fa71f5d7b86195d8ae1671e43f69acf8260ed7b 100644 (file)
@@ -38,15 +38,15 @@ public class SetNwDst extends Action {
     /**
      * Returns the network address this action will set
      *
-     * @return InetAddress
+     * @return  InetAddress
      */
     public InetAddress getAddress() {
         return address;
     }
-    
+
     @XmlElement (name="address")
     public String getAddressAsString() {
-       return address.getHostAddress();
+        return address.getHostAddress();
     }
 
     @Override
index 5595b610de6f153cd3fbea6b8e46039ceadfaaea..c57f1a53a96b4dde4ffcb9c638fb202fc20d3367 100644 (file)
@@ -38,7 +38,7 @@ public class SetNwSrc extends Action {
     /**
      * Returns the network address this action will set
      *
-     * @return InetAddress
+     * @return  InetAddress
      */
     public InetAddress getAddress() {
         return address;
@@ -46,7 +46,7 @@ public class SetNwSrc extends Action {
 
     @XmlElement (name="address")
     public String getAddressAsString() {
-       return address.getHostAddress();
+        return address.getHostAddress();
     }
 
     @Override
index 69fdd89ffb4cfb10f12ae899498c007454511edf..62dec0cd58198dfcbfa0b77e89a28ab9b97e1d88 100644 (file)
@@ -21,7 +21,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class SetNwTos extends Action {
-       @XmlElement
+        @XmlElement
     private int tos;
 
     /* Dummy constructor for JAXB */
index 825092c54fe355b520d0098771142b662c265930..c32c346307a8fb3d0ebb8aca9c9387ac24eac096 100644 (file)
@@ -21,7 +21,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class SetTpDst extends Action {
-       @XmlElement
+        @XmlElement
     private int port;
 
     /* Dummy constructor for JAXB */
index cdae5aad2ac7385c300f9c0f1f43f6456fd73f7d..d56f33d51ef0f9a55b0995de325e3caab3b1f5ed 100644 (file)
@@ -22,7 +22,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class SetTpSrc extends Action {
-       @XmlElement
+        @XmlElement
     private int port;
 
     /* Dummy constructor for JAXB */
index fc3d0a60ef2a742a3929f8d6f09490db2f3511ab..0385f63d561f43b21064036c920ff2734ebb8d71 100644 (file)
@@ -22,7 +22,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class SetVlanCfi extends Action {
-       @XmlElement
+        @XmlElement
     private int cfi;
 
     /* Dummy constructor for JAXB */
index b1e4748bc3b4f9dd1426cd4958af319eabda5e23..5370648227eb379c746f578e9d6476f4ef45b188 100644 (file)
@@ -22,13 +22,13 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class SetVlanId extends Action {
-       @XmlElement
+        @XmlElement
     private int vlanId;
 
-       private SetVlanId() {
-               
-       }
-       
+        private SetVlanId() {
+
+        }
+
     public SetVlanId(int vlanId) {
         type = ActionType.SET_VLAN_ID;
         this.vlanId = vlanId;
index c47723ebdf61021bde42532dfe45ac4e26584cee..1ee74fdf3f76b2d9d2a4fa5f75958d410653bbb4 100644 (file)
@@ -21,13 +21,13 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class SetVlanPcp extends Action {
-       @XmlElement
+        @XmlElement
     private int pcp;
 
-       private SetVlanPcp() {
-               
-       }
-       
+        private SetVlanPcp() {
+
+        }
+
     public SetVlanPcp(int pcp) {
         type = ActionType.SET_VLAN_PCP;
         this.pcp = pcp;
index f08fc84a2ca8a842c961eb92a99e7bf2e7f73631..7e73dd414f4e18dd927b3085b074bd02af56f762 100644 (file)
@@ -43,13 +43,13 @@ public enum AppRoleLevel implements Serializable {
     public String toStringPretty() {
         return this.prettyLevel;
     }
-    
+
     public static AppRoleLevel fromString(String levelString) {
-       for (AppRoleLevel level : AppRoleLevel.values()) {
-               if (level.toString().equals(levelString)) {
-                       return level;
-               }
-       }
-       return null;                    
+        for (AppRoleLevel level : AppRoleLevel.values()) {
+                if (level.toString().equals(levelString)) {
+                        return level;
+                }
+        }
+        return null;
     }
-} 
+}
index 8f6cfa42512642ba6e1115332c68898bb35ece75..453976bf680d1ee3af50fa7719aececff1cedc74 100644 (file)
@@ -25,20 +25,20 @@ public interface IResourceAuthorization {
     /**
      * Create a Role name for the application
      *
-     * @param role     the role name
-     * @param userLevel        the user level in the application context
-        * @return the status of the request
-        */
+     * @param role  the role name
+     * @param userLevel the user level in the application context
+         * @return the status of the request
+         */
     public Status createRole(String role, AppRoleLevel userLevel);
 
     /**
      * Remove a Role
-     * 
+     *
      * @param role the role name
      * @return the status of the request
      */
     public Status removeRole(String role);
-    
+
     /**
      * Return the list of roles configured for the application
      *
@@ -53,7 +53,7 @@ public interface IResourceAuthorization {
      *
      * @param roleName the role name to query
      * @return the application level of the given role in the application context as specified by {@link AppRoleLevel}
-     *                         if the role is not part of this application's roles, <code>NOUSER<code> is returned
+     *                  if the role is not part of this application's roles, <code>NOUSER<code> is returned
      */
     public AppRoleLevel getApplicationRoleLevel(String roleName);
 
@@ -61,7 +61,7 @@ public interface IResourceAuthorization {
      * Returns whether the specified role is part of this application's roles
      *
      * @param roleName the role name to test
-     * @return true if the role belongs to this application, false otherwise
+     * @return  true if the role belongs to this application, false otherwise
      */
     public boolean isApplicationRole(String roleName);
 
@@ -110,16 +110,16 @@ public interface IResourceAuthorization {
      * @return the status of the request
      */
     public Status assignResourceGroupToRole(String groupName, String role);
-    
+
     /**
      * Unassign the passed resource group from the specified role
-     * 
+     *
      * @param group
      * @param role
      * @return the status of the request
      */
     public Status unassignResourceGroupFromRole(String group, String role);
-    
+
     /**
      * Returns the list of resource groups the given Role is authorized to use
      * The returning object expresses the resource group name and the access
index a2e1d1c56d116672f0e7ea4a0c73ec473b73d677..70b41cdd8aa6b082b28a510d0768ca0fc057bed5 100644 (file)
@@ -15,11 +15,11 @@ import java.io.Serializable;
  * Describes the user role level in the controller space
  */
 public enum UserLevel implements Serializable {
-    SYSTEMADMIN(0, "System-Admin", "System Administrator"),    // can do everything
-    NETWORKADMIN(1, "Network-Admin", "Network Administrator"), // can do everything but setting a system admin user profile
-    NETWORKOPERATOR(2, "Network-Operator", "Network Operator"),        // can only see what is configured anywhere
-    CONTAINERUSER(4, "Container-User", "Container User"),              // container context user
-    APPUSER(5, "App-User", "Application User"),                                // application context user
+    SYSTEMADMIN(0, "System-Admin", "System Administrator"),     // can do everything
+    NETWORKADMIN(1, "Network-Admin", "Network Administrator"),  // can do everything but setting a system admin user profile
+    NETWORKOPERATOR(2, "Network-Operator", "Network Operator"), // can only see what is configured anywhere
+    CONTAINERUSER(4, "Container-User", "Container User"),       // container context user
+    APPUSER(5, "App-User", "Application User"),                                 // application context user
     NOUSER(255, "Not Authorized", "Not Authorized");
 
     private int userLevel;
index 3f81d0c4c5524150bf386158e8d22921f57249f6..135a67dcd1cbfdd83a00f5695ab2d18e4833fc9d 100644 (file)
@@ -22,33 +22,33 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 @XmlRootElement
 public class Actions extends Property {
-       private static final long serialVersionUID = 1L;
+        private static final long serialVersionUID = 1L;
     @XmlElement
     private int actionsValue;
-    
-    public enum ActionType { 
-       OUTPUT_PORT_ACTION(1<<0),
-       VLAN_VID_ACTION(1<<1),
-       VLAN_PCP_ACTION(1<<2),
-       VLAN_STRIP_ACTION(1<<3),
-       DLSRC_ACTION(1<<4),
-       DLDST_ACTION(1<<5),
-       NWSRC_ACTION(1<<6),
-       NWDST_ACTION(1<<7),
-       NWTOS_ACTION(1<<8),
-       TPTSRC_ACTION(1<<9),
-       TPTDST_ACTION(1<<10),
-       ENQUEUE_ACTION(1<<11),
-       VENDOR_ACTION(0xffff);
-       private final int at;
-       ActionType(int val) {
-               this.at = val;
-       }
-       public int getValue() {
-               return at;
-       }
+
+    public enum ActionType {
+        OUTPUT_PORT_ACTION(1<<0),
+        VLAN_VID_ACTION(1<<1),
+        VLAN_PCP_ACTION(1<<2),
+        VLAN_STRIP_ACTION(1<<3),
+        DLSRC_ACTION(1<<4),
+        DLDST_ACTION(1<<5),
+        NWSRC_ACTION(1<<6),
+        NWDST_ACTION(1<<7),
+        NWTOS_ACTION(1<<8),
+        TPTSRC_ACTION(1<<9),
+        TPTDST_ACTION(1<<10),
+        ENQUEUE_ACTION(1<<11),
+        VENDOR_ACTION(0xffff);
+        private final int at;
+        ActionType(int val) {
+                this.at = val;
+        }
+        public int getValue() {
+                return at;
+        }
     }
-    
+
     public static final String ActionsPropName = "actions";
     /**
      * Construct a actions property
@@ -72,12 +72,12 @@ public class Actions extends Property {
     public Actions clone() {
         return new Actions(this.actionsValue);
     }
-    
+
     public int getValue() {
-       return this.actionsValue;
+        return this.actionsValue;
     }
-    
-    
+
+
     @Override
     public int hashCode() {
         final int prime = 31;
index 37aa60deef058e9f08ac3920cab4a3adb86815e0..ab546d73023c6c5fe45a03387969eba0beff58cb 100644 (file)
@@ -23,25 +23,25 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 @SuppressWarnings("serial")
 public class AdvertisedBandwidth extends Bandwidth {
-       public static final String AdvertisedBandwidthPropName = "advertisedBandwidth";
-       
-       public AdvertisedBandwidth(long value) {
-               super(AdvertisedBandwidthPropName);
-               this.bandwidthValue = value;
-       }
-       
-       /*
+        public static final String AdvertisedBandwidthPropName = "advertisedBandwidth";
+
+        public AdvertisedBandwidth(long value) {
+                super(AdvertisedBandwidthPropName);
+                this.bandwidthValue = value;
+        }
+
+        /*
      * Private constructor used for JAXB mapping
      */
     private AdvertisedBandwidth() {
-       super(AdvertisedBandwidthPropName);
-               this.bandwidthValue = 0;
+        super(AdvertisedBandwidthPropName);
+                this.bandwidthValue = 0;
     }
-       
-       public AdvertisedBandwidth clone() {
-               return new AdvertisedBandwidth(this.bandwidthValue);  
+
+        public AdvertisedBandwidth clone() {
+                return new AdvertisedBandwidth(this.bandwidthValue);
     }
-       
+
     @Override
     public String toString() {
         StringBuffer sb = new StringBuffer();
index fa5cc10827d5847140dd21ec72b24138b23b901f..8048cf882c6c9eec22883b9f3c823b23d8c72149 100644 (file)
@@ -66,7 +66,7 @@ public class Bandwidth extends Property {
         super(BandwidthPropName);
         this.bandwidthValue = (long) bandwidth;
     }
-    
+
     public Bandwidth(String name) {
         super(name);
     }
index 991ed688f2eda4d630d63f15b965983ca07acc97..99089d9096c9db1e0c37391e790322b093db5f47 100644 (file)
@@ -21,16 +21,16 @@ import javax.xml.bind.annotation.XmlRootElement;
  */
 @XmlRootElement
 public class Buffers extends Property {
-       private static final long serialVersionUID = 1L;
+        private static final long serialVersionUID = 1L;
     @XmlElement
     private int buffersValue;
-    
+
     public static final String BuffersPropName = "buffers";
-    
+
     /**
      * Construct a Buffers property
      *
-     * @param buffers the Buffers 
+     * @param buffers the Buffers
      * @return Constructed object
      */
     public Buffers(int buffers) {
@@ -53,7 +53,7 @@ public class Buffers extends Property {
     public int getValue() {
         return this.buffersValue;
     }
-    
+
     @Override
     public int hashCode() {
         final int prime = 31;
index a41a0e22904482050bbcfe95c4338c2acb0dc520..fb121d7b9a48aa4c4c21b626de4f6baf5d661444 100644 (file)
@@ -21,28 +21,28 @@ import javax.xml.bind.annotation.XmlRootElement;
  */
 @XmlRootElement
 public class Capabilities extends Property {
-       private static final long serialVersionUID = 1L;
+        private static final long serialVersionUID = 1L;
     @XmlElement
     private int capabilitiesValue;
-    
-    public enum CapabilitiesType { 
-       FLOW_STATS_CAPABILITY(1<<0),
-       TABLE_STATS_CAPABILITY(1<<1),
-       PORT_STATS_CAPABILITY(1<<2),
-       STP_CAPABILITY(1<<3),
-       RSVD_CAPABILITY(1<<4),
-       IP_REASSEM_CAPABILITY(1<<5),
-       QUEUE_STATS_CAPABILITY(1<<6),
-       ARP_MATCH_IP_CAPABILITY(1<<7);
-       private final int ct;
-       CapabilitiesType(int val) {
-               this.ct = val;
-       }
-       public int getValue() {
-               return ct;
-       }
+
+    public enum CapabilitiesType {
+        FLOW_STATS_CAPABILITY(1<<0),
+        TABLE_STATS_CAPABILITY(1<<1),
+        PORT_STATS_CAPABILITY(1<<2),
+        STP_CAPABILITY(1<<3),
+        RSVD_CAPABILITY(1<<4),
+        IP_REASSEM_CAPABILITY(1<<5),
+        QUEUE_STATS_CAPABILITY(1<<6),
+        ARP_MATCH_IP_CAPABILITY(1<<7);
+        private final int ct;
+        CapabilitiesType(int val) {
+                this.ct = val;
+        }
+        public int getValue() {
+                return ct;
+        }
     }
-   
+
     public static final String CapabilitiesPropName = "capabilities";
     /**
      * Construct a Capabilities property
@@ -68,9 +68,9 @@ public class Capabilities extends Property {
     }
 
     public int getValue() {
-       return this.capabilitiesValue;
+        return this.capabilitiesValue;
     }
-    
+
     @Override
     public int hashCode() {
         final int prime = 31;
index 039acf52e698945d6ec9275db7eb87dee1571d46..66882af5d3098d95b97fb7eee530ce57d834974c 100644 (file)
@@ -354,7 +354,7 @@ abstract public class ComponentActivatorAbstractBase implements
                     }
                 }
             }
-            
+
             // Register with OSGi the provider for the service IContainerAware
             context.registerService(
                     IContainerAware.class.getName(), this, null);
index c547c2bb455bd89f9d26b0c1483d9d6b3d8cc8d2..bae984eaec00f4f9524e4e0db719c8e2ec74e4e3 100644 (file)
@@ -13,8 +13,8 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 /**
  * The class represents Admin Config status
- * 
- * 
+ *
+ *
  */
 @XmlRootElement
 @SuppressWarnings("serial")
index 2a80bd608823e2bf0a0ee329379a9578127af000..ebf623b7b00ff8bcf9dd784530b61de735bb0839 100644 (file)
@@ -127,7 +127,7 @@ public class ContainerFlow implements Serializable {
     /**
      * Returns whether the specified match is allowed
      *
-     * @param match    the match to test
+     * @param match the match to test
      * @return true if the match is allowed, false otherwise
      */
     public boolean allowsMatch(Match target) {
index de2877597ff9171dd794ff62b73f9826c8cf866b..a1b436ef1a24b52b2a6d8f7578c91147ea80875d 100644 (file)
@@ -21,27 +21,27 @@ import javax.xml.bind.annotation.XmlRootElement;
  */
 @XmlRootElement
 public class PeerBandwidth extends Bandwidth {
-       private static final long serialVersionUID = 1L;
-       
-       public static final String PeerBandwidthPropName = "peerBandwidth";
-       
-       public PeerBandwidth(long value) {
-               super(PeerBandwidthPropName);
-               this.bandwidthValue = value;
-       }
-       
-       /*
+        private static final long serialVersionUID = 1L;
+
+        public static final String PeerBandwidthPropName = "peerBandwidth";
+
+        public PeerBandwidth(long value) {
+                super(PeerBandwidthPropName);
+                this.bandwidthValue = value;
+        }
+
+        /*
      * Private constructor used for JAXB mapping
      */
     private PeerBandwidth() {
-       super(PeerBandwidthPropName);
-               this.bandwidthValue = 0;
+        super(PeerBandwidthPropName);
+                this.bandwidthValue = 0;
     }
 
-       public PeerBandwidth clone() {
-               return new PeerBandwidth(this.bandwidthValue);  
+        public PeerBandwidth clone() {
+                return new PeerBandwidth(this.bandwidthValue);
     }
-       
+
 
     @Override
     public String toString() {
index 5cb7b33890b04e6f491a4dc0f1b39f69c77bde2e..cd6589ed6d3da0d492fa1217dff859dc3dd56d89 100644 (file)
@@ -22,24 +22,24 @@ import javax.xml.bind.annotation.XmlRootElement;
  */
 @XmlRootElement
 public class SupportedBandwidth extends Bandwidth {
-       private static final long serialVersionUID = 1L;
-       public static final String SupportedBandwidthPropName = "supportedBandwidth";
-       
-       public SupportedBandwidth(long value) {
-               super(SupportedBandwidthPropName);
-               this.bandwidthValue = value;
-       }
-       
-       /*
+        private static final long serialVersionUID = 1L;
+        public static final String SupportedBandwidthPropName = "supportedBandwidth";
+
+        public SupportedBandwidth(long value) {
+                super(SupportedBandwidthPropName);
+                this.bandwidthValue = value;
+        }
+
+        /*
      * Private constructor used for JAXB mapping
      */
     private SupportedBandwidth() {
-       super(SupportedBandwidthPropName);
-               this.bandwidthValue = 0;
+        super(SupportedBandwidthPropName);
+                this.bandwidthValue = 0;
     }
-       
-       public SupportedBandwidth clone() {
-               return new SupportedBandwidth(this.bandwidthValue);  
+
+        public SupportedBandwidth clone() {
+                return new SupportedBandwidth(this.bandwidthValue);
     }
 
     @Override
index 22cff90bb5dd3a9fc7f3852e7e100ab9b5fb65ff..156a0b8ee0225a3b719b7019976c6bc4556a55ba 100644 (file)
@@ -21,15 +21,15 @@ import javax.xml.bind.annotation.XmlRootElement;
  */
 @XmlRootElement
 public class Tables extends Property {
-       private static final long serialVersionUID = 1L;
+        private static final long serialVersionUID = 1L;
     @XmlElement
     private byte tablesValue;
-    
+
     public static final String TablesPropName = "tables";
     /**
      * Construct a Tables property
      *
-     * @param tables the Tables 
+     * @param tables the Tables
      * @return Constructed object
      */
     public Tables(byte tables) {
@@ -52,7 +52,7 @@ public class Tables extends Property {
     public byte getValue() {
         return this.tablesValue;
     }
-    
+
     @Override
     public int hashCode() {
         final int prime = 31;
index 29094d34f954c606f23a6c87ca35ca65c0d1b088..f640ac2a33f80db4ea24dfbed440c5bb69e7b1ed 100644 (file)
@@ -23,11 +23,11 @@ public interface IDiscoveryService {
     /**
      * The methods is called when an edge is added/deleted/changed
      *
-     * @param edge                     {@link org.opendaylight.controller.sal.core.Edge} being updated
-     * @param type             {@link org.opendaylight.controller.sal.core.UpdateType}
-     * @param props            set of {@link org.opendaylight.controller.sal.core.Property} like
-     *                                                 {@link org.opendaylight.controller.sal.core.Bandwidth} and/or
-     *                                                 {@link org.opendaylight.controller.sal.core.Latency} etc.
+     * @param edge                      {@link org.opendaylight.controller.sal.core.Edge} being updated
+     * @param type              {@link org.opendaylight.controller.sal.core.UpdateType}
+     * @param props             set of {@link org.opendaylight.controller.sal.core.Property} like
+     *                                          {@link org.opendaylight.controller.sal.core.Bandwidth} and/or
+     *                                          {@link org.opendaylight.controller.sal.core.Latency} etc.
      */
     public void notifyEdge(Edge edge, UpdateType type, Set<Property> props);
 }
index f56c13d34524efe0685047c005baeb71ed26130f..f70e254ff548e6b6b7b0e7e8b3ed283e45ea46b0 100644 (file)
@@ -39,8 +39,8 @@ import org.slf4j.LoggerFactory;
 public class Flow implements Cloneable, Serializable {
     protected static final Logger logger = LoggerFactory
     .getLogger(Flow.class);
-       private static final long serialVersionUID = 1L;
-       @XmlElement
+        private static final long serialVersionUID = 1L;
+        @XmlElement
     private Match match;
     @XmlElement
     private List<Action> actions;
index d2af1a8c7c5a4a026d8fd43e9168f8d65e83a81c..0b38dda8cb6c4e8f02ee97494fd8bd201a4efeb4 100644 (file)
@@ -18,7 +18,7 @@ import org.opendaylight.controller.sal.utils.Status;
 public interface IFlowProgrammerService {
     /**
      * Synchronously add a flow to the network node
-     * 
+     *
      * @param node
      *            The target network node
      * @param flow
@@ -29,7 +29,7 @@ public interface IFlowProgrammerService {
 
     /**
      * Synchronously modify existing flow on the switch
-     * 
+     *
      * @param node
      *            The target network node
      * @param oldFlow
@@ -42,7 +42,7 @@ public interface IFlowProgrammerService {
 
     /**
      * Synchronously remove the flow from the network node
-     * 
+     *
      * @param node
      *            The target network node
      * @param flow
@@ -53,7 +53,7 @@ public interface IFlowProgrammerService {
 
     /**
      * Asynchronously add a flow to the network node
-     * 
+     *
      * @param node
      *            The target network node
      * @param flow
@@ -64,7 +64,7 @@ public interface IFlowProgrammerService {
 
     /**
      * Asynchronously modify existing flow on the switch
-     * 
+     *
      * @param node
      *            The target network node
      * @param oldFlow
@@ -77,7 +77,7 @@ public interface IFlowProgrammerService {
 
     /**
      * Asynchronously remove the flow from the network node
-     * 
+     *
      * @param node
      *            The target network node
      * @param flow
@@ -88,7 +88,7 @@ public interface IFlowProgrammerService {
 
     /**
      * Remove all flows present on the network node
-     * 
+     *
      * @param node
      *            The target network node
      * @return The status of this request containing the unique request id
@@ -98,13 +98,13 @@ public interface IFlowProgrammerService {
     /**
      * Send Barrier message synchronously. The caller will be blocked until the
      * solicitation response arrives.
-     * 
+     *
      * Solicit the network node to report whether all the requests sent so far
      * are completed. When this call is done, caller knows that all past flow
      * operations requested to the node in asynchronous fashion were satisfied
      * by the network node and that in case of any failure, a message was sent
      * to the controller.
-     * 
+     *
      * @param node
      *            The network node to solicit
      * @return The status of this request containing the unique request id
@@ -113,13 +113,13 @@ public interface IFlowProgrammerService {
 
     /**
      * Send Barrier message asynchronously. The caller is not blocked.
-     * 
+     *
      * Solicit the network node to report whether all the requests sent so far
      * are completed. When this call is done, caller knows that all past flow
      * operations requested to the node in asynchronous fashion were satisfied
      * by the network node and that in case of any failure, a message was sent
      * to the controller.
-     * 
+     *
      * @param node
      *            The network node to solicit
      * @return The status of this request containing the unique request id
index 3c40b96cc74d240b116e3746a17820119e8b77b0..5157788ce7b58982414fdc91436d8cf24f5eb167 100644 (file)
@@ -13,13 +13,13 @@ import org.opendaylight.controller.sal.utils.Status;
 
 /**
  * @file IPluginOutFlowProgrammer.java
- * 
+ *
  * @brief Flow programmer interface to be implemented by protocol plugins
  */
 public interface IPluginInFlowProgrammerService {
     /**
      * Synchronously add a flow to the network node
-     * 
+     *
      * @param node
      * @param flow
      */
@@ -27,7 +27,7 @@ public interface IPluginInFlowProgrammerService {
 
     /**
      * Synchronously modify existing flow on the switch
-     * 
+     *
      * @param node
      * @param flow
      */
@@ -35,7 +35,7 @@ public interface IPluginInFlowProgrammerService {
 
     /**
      * Synchronously remove the flow from the network node
-     * 
+     *
      * @param node
      * @param flow
      */
@@ -43,7 +43,7 @@ public interface IPluginInFlowProgrammerService {
 
     /**
      * Asynchronously add a flow to the network node
-     * 
+     *
      * @param node
      * @param flow
      * @param rid
@@ -52,7 +52,7 @@ public interface IPluginInFlowProgrammerService {
 
     /**
      * Asynchronously modify existing flow on the switch
-     * 
+     *
      * @param node
      * @param flow
      * @param rid
@@ -61,7 +61,7 @@ public interface IPluginInFlowProgrammerService {
 
     /**
      * Asynchronously remove the flow from the network node
-     * 
+     *
      * @param node
      * @param flow
      * @param rid
@@ -70,7 +70,7 @@ public interface IPluginInFlowProgrammerService {
 
     /**
      * Remove all flows present on the network node
-     * 
+     *
      * @param node
      */
     Status removeAllFlows(Node node);
@@ -78,14 +78,14 @@ public interface IPluginInFlowProgrammerService {
     /**
      * Send Barrier message synchronously. The caller will be blocked until the
      * Barrier reply arrives.
-     * 
+     *
      * @param node
      */
     Status syncSendBarrierMessage(Node node);
 
     /**
      * Send Barrier message asynchronously. The caller is not blocked.
-     * 
+     *
      * @param node
      */
     Status asyncSendBarrierMessage(Node node);
index f1b80272d43083da329a4528679c2b7562a7b978..1fc6741611495b42eb2beb3ad89e39f1103db117 100644 (file)
@@ -20,7 +20,7 @@ public interface IPluginOutFlowProgrammerService {
      * Inform SAL that the flow on the specified node has been removed Consumer
      * has to expect this notification only for flows which were installed with
      * an idle or hard timeout specified.
-     * 
+     *
      * @param node
      *            the network node on which the flow got removed
      * @param flow
@@ -33,7 +33,7 @@ public interface IPluginOutFlowProgrammerService {
      * Inform SAL that an error message has been received from a switch
      * regarding a flow message previously sent to the switch. A Request ID
      * associated with the offending message is also returned.
-     * 
+     *
      * @param node
      *            the network node on which the error reported
      * @param rid
index ccfb3388494452088203732a2b322654b7d5fe2a..0438023165a18293fa522041d1bf9fd3d6eb7da6 100644 (file)
@@ -24,22 +24,22 @@ public interface IListenInventoryUpdates {
     /**
      * This method is called when some properties of a node are added/deleted/changed.
      *
-     * @param node                     {@link org.opendaylight.controller.sal.core.Node} being updated
-     * @param type             {@link org.opendaylight.controller.sal.core.UpdateType}
-     * @param props            set of {@link org.opendaylight.controller.sal.core.Property} such as
-     *                                                 {@link org.opendaylight.controller.sal.core.Description} and/or
-     *                                                 {@link org.opendaylight.controller.sal.core.Tier} etc.
+     * @param node                      {@link org.opendaylight.controller.sal.core.Node} being updated
+     * @param type              {@link org.opendaylight.controller.sal.core.UpdateType}
+     * @param props             set of {@link org.opendaylight.controller.sal.core.Property} such as
+     *                                          {@link org.opendaylight.controller.sal.core.Description} and/or
+     *                                          {@link org.opendaylight.controller.sal.core.Tier} etc.
      */
     public void updateNode(Node node, UpdateType type, Set<Property> props);
 
     /**
      * This method is called when some properties of a node connector are added/deleted/changed.
      *
-     * @param nodeConnector    {@link org.opendaylight.controller.sal.core.NodeConnector} being updated
-     * @param type             {@link org.opendaylight.controller.sal.core.UpdateType}
-     * @param props            set of {@link org.opendaylight.controller.sal.core.Property} such as
-     *                                                 {@link org.opendaylight.controller.sal.core.Description} and/or
-     *                                                 {@link org.opendaylight.controller.sal.core.State} etc.
+     * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector} being updated
+     * @param type              {@link org.opendaylight.controller.sal.core.UpdateType}
+     * @param props             set of {@link org.opendaylight.controller.sal.core.Property} such as
+     *                                          {@link org.opendaylight.controller.sal.core.Description} and/or
+     *                                          {@link org.opendaylight.controller.sal.core.State} etc.
      */
     public void updateNodeConnector(NodeConnector nodeConnector,
             UpdateType type, Set<Property> props);
index 42c9ab7475ef09f4e3289124f56a5a591df9f037..bda32b88fa8796583b32019fc3f057b9ceff5ad4 100644 (file)
@@ -24,22 +24,22 @@ public interface IPluginOutInventoryService {
     /**
      * This method is called when some properties of a node are added/deleted/changed.
      *
-     * @param node                     {@link org.opendaylight.controller.sal.core.Node} being updated
-     * @param type             {@link org.opendaylight.controller.sal.core.UpdateType}
-     * @param props            set of {@link org.opendaylight.controller.sal.core.Property} such as
-     *                                                 {@link org.opendaylight.controller.sal.core.Description} and/or
-     *                                                 {@link org.opendaylight.controller.sal.core.Tier} etc.
+     * @param node                      {@link org.opendaylight.controller.sal.core.Node} being updated
+     * @param type              {@link org.opendaylight.controller.sal.core.UpdateType}
+     * @param props             set of {@link org.opendaylight.controller.sal.core.Property} such as
+     *                                          {@link org.opendaylight.controller.sal.core.Description} and/or
+     *                                          {@link org.opendaylight.controller.sal.core.Tier} etc.
      */
     public void updateNode(Node node, UpdateType type, Set<Property> props);
 
     /**
      * This method is called when some properties of a node connector are added/deleted/changed.
      *
-     * @param nodeConnector    {@link org.opendaylight.controller.sal.core.NodeConnector} being updated
-     * @param type             {@link org.opendaylight.controller.sal.core.UpdateType}
-     * @param props            set of {@link org.opendaylight.controller.sal.core.Property} such as
-     *                                                 {@link org.opendaylight.controller.sal.core.Description} and/or
-     *                                                 {@link org.opendaylight.controller.sal.core.State} etc.
+     * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector} being updated
+     * @param type              {@link org.opendaylight.controller.sal.core.UpdateType}
+     * @param props             set of {@link org.opendaylight.controller.sal.core.Property} such as
+     *                                          {@link org.opendaylight.controller.sal.core.Description} and/or
+     *                                          {@link org.opendaylight.controller.sal.core.State} etc.
      */
     public void updateNodeConnector(NodeConnector nodeConnector,
             UpdateType type, Set<Property> props);
index 2ead8cdbc4b7e645b6d6a0a6d0ae8039c08923f2..00a2f57308d57e1d76c8f0e88aeb86d74a3f910a 100644 (file)
@@ -38,8 +38,8 @@ import org.opendaylight.controller.sal.utils.NetUtils;
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 public class Match implements Cloneable, Serializable {
-       private static final long serialVersionUID = 1L;
-       private static final Map<MatchType, MatchType> reversableMatches;
+        private static final long serialVersionUID = 1L;
+        private static final Map<MatchType, MatchType> reversableMatches;
     static {
         Map<MatchType, MatchType> map = new HashMap<MatchType, MatchType>();
         map.put(MatchType.DL_SRC, MatchType.DL_DST);
@@ -67,9 +67,9 @@ public class Match implements Cloneable, Serializable {
      * Generic setter for frame/packet/message's header fields against which to match
      * Note: For MAC addresses, please pass the cloned value to this function
      *
-     * @param type             packet's header field type
-     * @param value    field's value to assign to the match
-     * @param mask             field's bitmask to apply to the match (has to be of the same class type of value)
+     * @param type      packet's header field type
+     * @param value     field's value to assign to the match
+     * @param mask      field's bitmask to apply to the match (has to be of the same class type of value)
      */
     public void setField(MatchType type, Object value, Object mask) {
         MatchField field = new MatchField(type, value, mask);
@@ -83,8 +83,8 @@ public class Match implements Cloneable, Serializable {
      * Generic setter for frame/packet/message's header fields against which to match
      * Note: For MAC addresses, please pass the cloned value to this function
      *
-     * @param type             packet's header field type
-     * @param value    field's value to assign to the match
+     * @param type      packet's header field type
+     * @param value     field's value to assign to the match
      */
     public void setField(MatchType type, Object value) {
         MatchField field = new MatchField(type, value);
@@ -117,7 +117,7 @@ public class Match implements Cloneable, Serializable {
     /**
      * Generic getter for fields against which the match is programmed
      *
-     * @param type     frame/packet/message's header field type
+     * @param type  frame/packet/message's header field type
      * @return
      */
     public MatchField getField(MatchType type) {
@@ -137,7 +137,7 @@ public class Match implements Cloneable, Serializable {
     /**
      * Returns the list of MatchType fields the match is set for
      *
-     * @return List of individual MatchType fields. 
+     * @return List of individual MatchType fields.
      */
     public List<MatchType> getMatchesList() {
         return new ArrayList<MatchType>(fields.keySet());
@@ -146,13 +146,13 @@ public class Match implements Cloneable, Serializable {
     /**
      * Returns the list of MatchFields the match is set for
      *
-     * @return List of individual MatchField values. 
+     * @return List of individual MatchField values.
      */
     @XmlElement(name="matchField")
     public List<MatchField> getMatchFields() {
-       return new ArrayList<MatchField>(fields.values());
+        return new ArrayList<MatchField>(fields.values());
     }
-    
+
     /**
      * Returns whether this match is for an IPv6 flow
      */
index 7d7b29c293aca87bdfcc35b48f8abda3fe4a1055..bd5ef2bafbd4134e74469824962b6e18f42edaeb 100644 (file)
@@ -20,7 +20,7 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Represents the generic matching field
- * 
+ *
  */
 
 @XmlRootElement
@@ -42,7 +42,7 @@ public class MatchField implements Cloneable, Serializable {
 
     /**
      * Mask based match constructor
-     * 
+     *
      * @param type
      * @param value
      * @param mask
@@ -59,7 +59,7 @@ public class MatchField implements Cloneable, Serializable {
 
     /**
      * Full match constructor
-     * 
+     *
      * @param type
      * @param value
      */
@@ -73,7 +73,7 @@ public class MatchField implements Cloneable, Serializable {
 
     /**
      * Returns the value set for this match field
-     * 
+     *
      * @return
      */
     public Object getValue() {
@@ -87,7 +87,7 @@ public class MatchField implements Cloneable, Serializable {
 
     /**
      * Returns the type field this match field object is for
-     * 
+     *
      * @return
      */
     public MatchType getType() {
@@ -102,7 +102,7 @@ public class MatchField implements Cloneable, Serializable {
     /**
      * Returns the mask value set for this field match A null mask means this is
      * a full match
-     * 
+     *
      * @return
      */
     public Object getMask() {
@@ -116,7 +116,7 @@ public class MatchField implements Cloneable, Serializable {
 
     /**
      * Returns the bitmask set for this field match
-     * 
+     *
      * @return
      */
     public long getBitMask() {
@@ -125,7 +125,7 @@ public class MatchField implements Cloneable, Serializable {
 
     /**
      * Returns whether the field match configuration is valid or not
-     * 
+     *
      * @return
      */
     public boolean isValid() {
index 5ad4bd5b660dbc58e4041a5422205d61edf4a3d0..62c1b435dc1d0a37b377c9f1ebb79f79aa1ecc77 100644 (file)
@@ -19,9 +19,9 @@ import org.opendaylight.controller.sal.utils.NetUtils;
  * Represents the binding between the id, the value and mask type and the range
  * values of the elements type that can be matched on the network
  * frame/packet/message
- * 
- * 
- * 
+ *
+ *
+ *
  */
 public enum MatchType {
     IN_PORT("inPort", 1 << 0, NodeConnector.class, 1, 0),
@@ -73,7 +73,7 @@ public enum MatchType {
 
     /**
      * Perform the assignment type validation
-     * 
+     *
      * @param value
      * @param mask
      * @return
@@ -119,7 +119,7 @@ public enum MatchType {
 
     /**
      * Perform the value and mask range validation
-     * 
+     *
      * @param value
      * @param mask
      * @return
@@ -162,7 +162,7 @@ public enum MatchType {
 
     /**
      * Return the mask value in 64 bits bitmask form
-     * 
+     *
      * @param mask
      * @return
      */
index 5c81a1830b58010bea88f7d5b238ccf58463a75d..c3982ae08e280dc1fd45b70896934791cfe7f092 100644 (file)
@@ -210,7 +210,7 @@ public abstract class BitBufferHelper {
      * @param int startOffset - offset to start fetching bits from data from
      * @param int numBits - number of bits to be fetched from data
      * @return byte [] - LSB aligned bits
-     * 
+     *
      * @throws BufferException
      *             when the startOffset and numBits parameters are not congruent
      *             with the data buffer size
@@ -291,7 +291,7 @@ public abstract class BitBufferHelper {
      * @param byte - input byte to be inserted
      * @param startOffset - offset of data[] to start inserting byte from
      * @param numBits - number of bits of input to be inserted into data[]
-     * 
+     *
      * @throws BufferException
      *             when the input, startOffset and numBits are not congruent
      *             with the data buffer size
@@ -322,7 +322,7 @@ public abstract class BitBufferHelper {
 
     /**
      * Returns numBits 1's in the MSB position
-     * 
+     *
      * @param numBits
      * @return
      */
@@ -336,7 +336,7 @@ public abstract class BitBufferHelper {
 
     /**
      * Returns numBits 1's in the LSB position
-     * 
+     *
      * @param numBits
      * @return
      */
@@ -350,7 +350,7 @@ public abstract class BitBufferHelper {
 
     /**
      * Returns the numerical value of the byte array passed
-     * 
+     *
      * @param byte[] - array
      * @return long - numerical value of byte array passed
      */
@@ -371,7 +371,7 @@ public abstract class BitBufferHelper {
     /**
      * Returns the numerical value of the last numBits (LSB bits) of the byte
      * array passed
-     * 
+     *
      * @param byte[] - array
      * @param int - numBits
      * @return long - numerical value of byte array passed
@@ -404,10 +404,10 @@ public abstract class BitBufferHelper {
      * Accepts a number as input and returns its value in byte form in LSB
      * aligned form example: input = 5000 [1001110001000] bytes = 19, -120
      * [00010011] [10001000]
-     * 
+     *
      * @param Number
      * @return byte[]
-     * 
+     *
      */
 
     public static byte[] toByteArray(Number input) {
@@ -443,12 +443,12 @@ public abstract class BitBufferHelper {
      * Accepts a number as input and returns its value in byte form in MSB
      * aligned form example: input = 5000 [1001110001000] bytes = -114, 64
      * [10011100] [01000000]
-     * 
+     *
      * @param Number
      *            input
      * @param int numBits - the number of bits to be returned
      * @return byte[]
-     * 
+     *
      */
     public static byte[] toByteArray(Number input, int numBits) {
         Class<? extends Number> dataType = input.getClass();
@@ -500,7 +500,7 @@ public abstract class BitBufferHelper {
     /**
      * Takes an LSB aligned byte array and returned the LSB numBits in a MSB
      * aligned byte array
-     * 
+     *
      * @param inputbytes
      * @param numBits
      * @return
@@ -508,10 +508,10 @@ public abstract class BitBufferHelper {
     /**
      * It aligns the last numBits bits to the head of the byte array following
      * them with numBits % 8 zero bits.
-     * 
+     *
      * Example: For inputbytes = [00000111][01110001] and numBits = 12 it
      * returns: shiftedBytes = [01110111][00010000]
-     * 
+     *
      * @param byte[] inputBytes
      * @param int numBits - number of bits to be left aligned
      * @return byte[]
@@ -566,10 +566,10 @@ public abstract class BitBufferHelper {
     /**
      * It aligns the first numBits bits to the right end of the byte array
      * preceding them with numBits % 8 zero bits.
-     * 
+     *
      * Example: For inputbytes = [01110111][00010000] and numBits = 12 it
      * returns: shiftedBytes = [00000111][01110001]
-     * 
+     *
      * @param byte[] inputBytes
      * @param int numBits - number of bits to be right aligned
      * @return byte[]
@@ -603,7 +603,7 @@ public abstract class BitBufferHelper {
      * Insert in the data buffer at position dictated by the offset the number
      * of bits specified from the input data byte array. The input byte array
      * has the bits stored starting from the LSB
-     * 
+     *
      * @param byte[] data
      * @param byte[] inputdata
      * @param int startOffset
@@ -623,8 +623,8 @@ public abstract class BitBufferHelper {
         int InputMSBbits = 0, InputLSBbits = 0;
         int i;
 
-        if (numBits == 0) { 
-            return; 
+        if (numBits == 0) {
+            return;
         }
 
         if (extraOffsetBits == 0) {
index 0429c0dd279e1231ace4a0bfd7c6b880163101ba..9bdb5d084c57b7fede9fe1557a4934ae31e981e4 100644 (file)
@@ -68,7 +68,7 @@ public class ICMP extends Packet {
 
     /**
      * Sets the type for the current ICMP message
-     * 
+     *
      * @param type
      *            The ICMP message type
      * @return This ICMP object
@@ -81,7 +81,7 @@ public class ICMP extends Packet {
 
     /**
      * Sets the ICMP code (type subtype) for the current ICMP object instance
-     * 
+     *
      * @param code
      *            The ICMP message type subtype
      * @return This ICMP object
@@ -136,7 +136,7 @@ public class ICMP extends Packet {
 
     /**
      * Computes the ICMP checksum on the serialized ICMP message
-     * 
+     *
      * @param serialized
      *            The data stream
      * @param start
index 44318aab8c5c1626eb787b960acfaa3ede7bea29..7a7a5a757fb4ab4ff7184da84a25662f42729e07 100644 (file)
@@ -378,9 +378,9 @@ public class IPv4 extends Packet {
      * @param checksum the checksum to set
      */
     /*public IPv4 setChecksum() {
-       short ipChecksum = computeChecksum();
+        short ipChecksum = computeChecksum();
         byte[] checksum = BitBufferHelper.toByteArray(ipChecksum);
-       fieldValues.put(CHECKSUM, checksum);
+        fieldValues.put(CHECKSUM, checksum);
         return this;
     }*/
 
@@ -444,7 +444,7 @@ public class IPv4 extends Packet {
     /**
      * Computes the IPv4 header checksum on the passed stream of bytes
      * representing the packet
-     * 
+     *
      * @param data
      *            The byte stream
      * @param offset
index 562d03b7abe503088664c28d5ecb04bb546b1258..6a896c6c712aee0e06d94b7be31bbf27529c7845 100644 (file)
@@ -223,7 +223,7 @@ public class LLDP extends Packet {
 
     /**
      * Returns the size of LLDP packet in bytes
-     * 
+     *
      * @return int - LLDP Packet size in bytes
      */
     private int getLLDPPacketLength() {
index ee5027335921b95c2b86b069cb05506d0126830a..5685b0a58af2e16300104e9ccd7f482b311ec0be 100644 (file)
@@ -11,7 +11,7 @@ package org.opendaylight.controller.sal.packet;
  * Describes an exception that is raised when the process of serializing or
  * deserializing a network packet/stream fails. This generally happens when the
  * packet/stream is malformed.
- * 
+ *
  */
 public class PacketException extends Exception {
     private static final long serialVersionUID = 1L;
index a7956d81b3d178ffa5b0a06052e000de1a389fa3..590f5d923e792f03f4abc8498bd405c64e770204 100644 (file)
@@ -24,10 +24,10 @@ import org.opendaylight.controller.sal.core.NodeConnector;
 import org.opendaylight.controller.sal.core.TimeStamp;
 
 /**
- * 
+ *
  * Describe a raw Data Packet, this is how a packet is received from the network
  * and how it will be transmitted. It essentially wraps the raw bytestream
- * 
+ *
  */
 public class RawPacket {
     private byte[] packetData;
@@ -41,8 +41,8 @@ public class RawPacket {
     /**
      * If the packet is being sent this parameter tells where the packet is sent
      * toward
-     * 
-     * 
+     *
+     *
      * @return the NodeConnector toward where the packet is being sent
      */
     public NodeConnector getOutgoingNodeConnector() {
@@ -51,7 +51,7 @@ public class RawPacket {
 
     /**
      * Setter method for OutGoing NodeConnector
-     * 
+     *
      * @param outgoingNodeConnector
      *            NodeConnector toward where the packet is travelling
      */
@@ -61,7 +61,7 @@ public class RawPacket {
 
     /**
      * Return the incoming NodeConnector if the packet was received
-     * 
+     *
      * @return NodeConnector where the packet was received from
      */
     public NodeConnector getIncomingNodeConnector() {
@@ -70,7 +70,7 @@ public class RawPacket {
 
     /**
      * Setter for Incoming NodeConnector
-     * 
+     *
      * @param incomingNodeConnector
      *            NodeConnector to be used and incoming one
      */
@@ -80,10 +80,10 @@ public class RawPacket {
 
     /**
      * Retrieve a given property attached to the packet, if exits of course
-     * 
+     *
      * @param key
      *            Key to retrieve the wanted property attached to the packet
-     * 
+     *
      * @return The property attached to the packet
      */
     public Object getProps(Object key) {
@@ -95,7 +95,7 @@ public class RawPacket {
 
     /**
      * Generic data associated to the data packet
-     * 
+     *
      * @param key
      *            key for the association
      * @param value
@@ -111,12 +111,12 @@ public class RawPacket {
 
     /**
      * Constructor for RawPacket
-     * 
+     *
      * @param data
      *            content of the packet as bytestream
      * @param e
      *            datalink encapsulation for the packet
-     * 
+     *
      */
     public RawPacket(byte[] data, LinkEncap e) throws ConstructionException {
         if (data == null) {
@@ -137,10 +137,10 @@ public class RawPacket {
      * Copy Constructor for RawPacket, it performs a copy of the packet so each
      * packet can be modified independently without worrying that source packet
      * content is touched
-     * 
+     *
      * @param src
      *            packet to copy data from
-     * 
+     *
      */
     public RawPacket(RawPacket src) throws ConstructionException {
         if (src == null) {
@@ -164,10 +164,10 @@ public class RawPacket {
 
     /**
      * Constructor for RawPacket with Ethernet encapsulation
-     * 
+     *
      * @param data
      *            content of the packet as bytestream
-     * 
+     *
      */
     public RawPacket(byte[] data) throws ConstructionException {
         this(data, LinkEncap.ETHERNET);
@@ -175,7 +175,7 @@ public class RawPacket {
 
     /**
      * Read the time stamp when the packet has entered the system
-     * 
+     *
      * @return The time stamp when the packet has entered the system
      */
     public TimeStamp getIncomingTime() {
@@ -184,7 +184,7 @@ public class RawPacket {
 
     /**
      * Read the packet encapsulation
-     * 
+     *
      * @return The encapsulation for the raw packet, necessary to start parsing
      *         the packet
      */
@@ -194,7 +194,7 @@ public class RawPacket {
 
     /**
      * Get bytestream of the packet body
-     * 
+     *
      * @return The raw bytestream composing the packet
      */
     public byte[] getPacketData() {
@@ -204,7 +204,7 @@ public class RawPacket {
     /**
      * Returns the time at which the current instance of RawPacket was created
      * as a copy of the original one.
-     * 
+     *
      * @return The time stamp at which this RawPacket instance was created. null
      *         if this is the original instance.
      */
index fba3f5c917ffc3b625c33c261c7e78b4a0245d01..b9bed9a67dd7aab46ed607f807ee7ed9787fe94b 100644 (file)
@@ -110,7 +110,7 @@ public class UDP extends Packet {
      */
     public void setHeaderField(String headerField, byte[] readValue) {
         /*if (headerField.equals("Protocol")) {
-               payloadClass = decodeMap.get(readValue);
+                payloadClass = decodeMap.get(readValue);
         }*/
         hdrFieldsMap.put(headerField, readValue);
     }
index 431f5895638d52a1f14abcb515db65fb17d4b48e..fe93d1c985878dfad7f0c3d0d0e392530cbe8132 100644 (file)
@@ -40,7 +40,7 @@ public class FlowOnNode {
     /* Dummy constructor for JAXB */
     private FlowOnNode () {
     }
-    
+
     public FlowOnNode(Flow flow) {
         this.flow = flow;
     }
index a8c83e7913b25c227ed0f042d48d0a097ce75dae..49018d83edde915d6334fa39c5ad9a5e97ae872f 100644 (file)
@@ -25,37 +25,37 @@ import org.opendaylight.controller.sal.core.NodeConnector;
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 public class NodeConnectorStatistics {
-       @XmlElement
+        @XmlElement
     private NodeConnector nodeConnector;
-       @XmlElement
+        @XmlElement
     private long receivePackets;
-       @XmlElement
+        @XmlElement
     private long transmitPackets;
-       @XmlElement
+        @XmlElement
     private long receiveBytes;
-       @XmlElement
+        @XmlElement
     private long transmitBytes;
-       @XmlElement
+        @XmlElement
     private long receiveDrops;
-       @XmlElement
+        @XmlElement
     private long transmitDrops;
-       @XmlElement
+        @XmlElement
     private long receiveErrors;
-       @XmlElement
+        @XmlElement
     private long transmitErrors;
-       @XmlElement
+        @XmlElement
     private long receiveFrameError;
-       @XmlElement
+        @XmlElement
     private long receiveOverRunError;
-       @XmlElement
+        @XmlElement
     private long receiveCrcError;
-       @XmlElement
+        @XmlElement
     private long collisionCount;
 
-       //To Satisfy JAXB
-       public NodeConnectorStatistics() {
-               
-       }
+        //To Satisfy JAXB
+        public NodeConnectorStatistics() {
+
+        }
     /**
      * Set the node connector
      * @param port
index 65efd3c29dc1dc944b6dbe52e2c629d0dd6e6ec8..26c8e1dec352673efff83fcc9350bb053567338e 100644 (file)
@@ -67,7 +67,7 @@ public class NodeDescription {
     @Override
     public String toString() {
         return "HwDescription[manufacturer=" + manufacturer + ", hardware="
-                       + hardware + ", software=" + software + ", serialNumber=" 
-                       + serialNumber + ", description=" + description + "]";
+                        + hardware + ", software=" + software + ", serialNumber="
+                        + serialNumber + ", description=" + description + "]";
     }
 }
index 3ccf8f59297701c0848bade6a9ef0a404a6ce6a0..46448bd09832d31493542b17aa9bc2f129820f1b 100644 (file)
@@ -17,7 +17,7 @@ import org.opendaylight.controller.sal.core.NodeTable;
 /**
  * @author Aditya Prakash Vaja <aditya.vaja@bigswitch.com>
  * Represents the Table statistics for the node
- * 
+ *
  */
 
 @XmlRootElement
index b4c44c00d94ba82fdb8b8ac1190321a575e697b7..11cdc990131a1ab6bbadc9cb142fcc7fb4476205 100644 (file)
@@ -25,12 +25,12 @@ import org.opendaylight.controller.sal.core.Edge;
 
 /**
  * Topology notifications provided by SAL toward the application
- * 
+ *
  */
 public interface IListenTopoUpdates {
     /**
      * Called to update on Edge in the topology graph
-     * 
+     *
      * @param topoedgeupdateList
      *            List of topoedgeupdates Each topoedgeupdate includes edge, its
      *            Properties ( BandWidth and/or Latency etc) and update type.
@@ -40,7 +40,7 @@ public interface IListenTopoUpdates {
     /**
      * Called when an Edge utilization is above the safety threshold configured
      * on the controller
-     * 
+     *
      * @param edge
      *            The edge which bandwidth usage is above the safety level
      */
@@ -49,7 +49,7 @@ public interface IListenTopoUpdates {
     /**
      * Called when the Edge utilization is back to normal, below the safety
      * threshold level configured on the controller
-     * 
+     *
      * @param edge
      */
     public void edgeUtilBackToNormal(Edge edge);
index b85eec84283ab4c37918bf9916b8c0618a0a2a2b..6667628b0dcfc201a2d6e80aad1c49ad03cd97ce 100644 (file)
@@ -27,13 +27,13 @@ import org.opendaylight.controller.sal.core.UpdateType;
 
 /**
  * Methods that are invoked from Protocol Plugin toward SAL
- * 
+ *
  */
 public interface IPluginOutTopologyService {
 
     /**
      * Called to update on Edge in the topology graph
-     * 
+     *
      * @param topoedgeupdateList
      *            List of topoedgeupdates Each topoedgeupdate includes edge, its
      *            Properties ( BandWidth and/or Latency etc) and update type.
@@ -43,7 +43,7 @@ public interface IPluginOutTopologyService {
     /**
      * Called when an Edge utilization is above the safety threshold configured
      * on the controller
-     * 
+     *
      * @param edge
      */
     public void edgeOverUtilized(Edge edge);
@@ -51,7 +51,7 @@ public interface IPluginOutTopologyService {
     /**
      * Called when the Edge utilization is back to normal, below the safety
      * threshold level configured on the controller
-     * 
+     *
      * @param edge
      */
     public void edgeUtilBackToNormal(Edge edge);
index 6f60a522fdb5ba5780dc5034c9be45efee931528..0ebf633c55c123b742f8ba5365905f372f328b02 100644 (file)
@@ -14,11 +14,11 @@ package org.opendaylight.controller.sal.utils;
  *
  */
 public enum GlobalConstants {
-    DEFAULT("default"), 
-    CONTAINERMANAGER("containermanager"), 
-    CONTAINERNAME("name"), 
-    STATICVLAN("staticvlan"), 
-    CLUSTERINGSERVICES("clusteringservices"), 
+    DEFAULT("default"),
+    CONTAINERMANAGER("containermanager"),
+    CONTAINERNAME("name"),
+    STATICVLAN("staticvlan"),
+    CLUSTERINGSERVICES("clusteringservices"),
     STARTUPHOME("configuration/startup/");
 
     private GlobalConstants(String name) {
index 41b4b7a57ddc8deae989f3eb98605a10ca7a8bcd..37661358cd18a4eb0439db820efa5f42e3d8f8d4 100644 (file)
@@ -19,7 +19,7 @@ import java.math.BigInteger;
 public class HexEncode {
     /**
      * This method converts byte array into String format without ":" inserted.
-     * 
+     *
      * @param bytes
      *            The byte array to convert to string
      * @return The hexadecimal representation of the byte array. If bytes is
index 416018d98ed80d915d5e470c1db871436fc53e96..cdb4463c02acb2636a0991053f9e64951e3f3ba5 100644 (file)
@@ -23,14 +23,14 @@ import java.util.List;
 // Openflow 1.0 supports the IP Proto match only for ICMP, TCP and UDP
 public enum IPProtocols {
     ANY("any", 0),
-    /* HOPOPT("HOPOPT",0),
+    /*  HOPOPT("HOPOPT",0),
      */ICMP("ICMP", 1),
-    /* IGMP("IGMP",2),
+    /*  IGMP("IGMP",2),
      GGP("GGP",3),
      IPV4("IPv4",4),
      ST("ST",5),
      */TCP("TCP", 6),
-    /* CBT("CBT",7),
+    /*  CBT("CBT",7),
      EGP("EGP",8),
      IGP("IGP",9),
      BBNRCCMON("BBN-RCC-MON",10),
@@ -41,7 +41,7 @@ public enum IPProtocols {
      XNET("XNET",15),
      CHAOS("CHAOS",16),
      */UDP("UDP", 17),
-    /* MUX("MUX",18),
+    /*  MUX("MUX",18),
      DCNMEAS("DCN-MEAS",19),
      HMP("HMP",20),
      PRM("PRM",21),
@@ -82,7 +82,7 @@ public enum IPProtocols {
      TLSP("TLSP",56),
      SKIP("SKIP",57),
      */IPV6ICMP("IPv6-ICMP", 58);
-    /* IPV6NoNxt("IPv6-NoNxt",59),
+    /*  IPV6NoNxt("IPv6-NoNxt",59),
      IPV6Opts("IPv6-Opts",60),
      ANYHOST("ANY-HOST",61),
      CFTP("CFTP",62),
index 691ddc93561bc0359858fa778b9e83d73b3cf2e3..23d785e0c76b029b4819af3804f8e2f8ca50185c 100644 (file)
@@ -36,8 +36,8 @@ public abstract class NetUtils {
     /**
      * Converts a 4 bytes array into an integer number
      *
-     * @param ba       the 4 bytes long byte array
-     * @return     the integer number
+     * @param ba    the 4 bytes long byte array
+     * @return      the integer number
      */
     public static int byteArray4ToInt(byte[] ba) {
         if (ba == null || ba.length != 4)
@@ -62,8 +62,8 @@ public abstract class NetUtils {
      * Converts an IP address passed as integer value into the
      * respective InetAddress object
      *
-     * @param address  the IP address in integer form
-     * @return                 the IP address in InetAddress form
+     * @param address   the IP address in integer form
+     * @return          the IP address in InetAddress form
      */
     public static InetAddress getInetAddress(int address) {
         InetAddress ip = null;
@@ -80,8 +80,8 @@ public abstract class NetUtils {
      * The prefix bit mask indicates the contiguous leading bits that are NOT masked out.
      * Example: A prefix bit mask length of 8 will give an InetAddress Network Mask of 255.0.0.0
      *
-     * @param prefixMaskLength integer representing the length of the prefix network mask
-     * @param isV6                             boolean representing the IP version of the returned address
+     * @param prefixMaskLength  integer representing the length of the prefix network mask
+     * @param isV6              boolean representing the IP version of the returned address
      * @return
      */
     public static InetAddress getInetNetworkMask(int prefixMaskLength,
@@ -121,8 +121,8 @@ public abstract class NetUtils {
      * while ff.00.00.00 will return a subnet mask length of 24.
      * If the passed prefixMask object is null, 0 is returned
      *
-     * @param prefixMask       the prefix mask as byte array
-     * @return                         the length of the prefix network mask
+     * @param prefixMask    the prefix mask as byte array
+     * @return              the length of the prefix network mask
      */
     public static int getSubnetMaskLength(byte[] prefixMask) {
         int maskLength = 0;
@@ -149,8 +149,8 @@ public abstract class NetUtils {
      * while ff.00.00.00 will return a subnet mask length of 24
      * If the passed prefixMask object is null, 0 is returned
      *
-     * @param prefixMask       the prefix mask as InetAddress
-     * @return                         the length of the prefix network mask
+     * @param prefixMask    the prefix mask as InetAddress
+     * @return              the length of the prefix network mask
      */
     public static int getSubnetMaskLength(InetAddress prefixMask) {
         return (prefixMask == null) ? 0 : NetUtils
@@ -162,9 +162,9 @@ public abstract class NetUtils {
      * the equivalent subnet prefix IP address
      * Example: for ip = "172.28.30.254" and maskLen = 25 it will return "172.28.30.128"
      *
-     * @param ip               the IP address in InetAddress form
-     * @param maskLen  the length of the prefix network mask
-     * @return                 the subnet prefix IP address in InetAddress form
+     * @param ip        the IP address in InetAddress form
+     * @param maskLen   the length of the prefix network mask
+     * @return          the subnet prefix IP address in InetAddress form
      */
     public static InetAddress getSubnetPrefix(InetAddress ip, int maskLen) {
         int bytes = maskLen / 8;
@@ -219,13 +219,13 @@ public abstract class NetUtils {
         if (isAny(testAddress) || isAny(filterAddress)) {
             return false;
         }
-        
+
         int testMaskLen = (testMask != null) ? NetUtils.getSubnetMaskLength(testMask.getAddress()) : 0;
         int filterMaskLen = (filterMask != null) ? NetUtils.getSubnetMaskLength(filterMask.getAddress()) : 0;
-        
+
         int testPrefixLen = (testAddress instanceof Inet6Address) ? (128 - testMaskLen) : (32 - testMaskLen);
         int filterPrefixLen = (filterAddress instanceof Inet6Address) ? (128 - filterMaskLen) : (32 - filterMaskLen);
-        
+
         // Mask length check. Test mask has to be more specific than filter one
         if (testPrefixLen < filterPrefixLen) {
             return true;
@@ -240,8 +240,8 @@ public abstract class NetUtils {
     /**
      * Returns true if the passed MAC address is all zero
      *
-     * @param mac      the byte array representing the MAC address
-     * @return         true if all MAC bytes are zero
+     * @param mac   the byte array representing the MAC address
+     * @return      true if all MAC bytes are zero
      */
     public static boolean isZeroMAC(byte[] mac) {
         for (short i = 0; i < 6; i++) {
@@ -255,8 +255,8 @@ public abstract class NetUtils {
     /**
      * Returns true if the passed InetAddress contains all zero
      *
-     * @param ip       the IP address to test
-     * @return         true if the address is all zero
+     * @param ip    the IP address to test
+     * @return      true if the address is all zero
      */
     public static boolean isAny(InetAddress ip) {
         for (byte b : ip.getAddress()) {
@@ -341,29 +341,29 @@ public abstract class NetUtils {
         }
         return true;
     }
-    
+
     /*
-     * Following utilities are useful when you need to 
+     * Following utilities are useful when you need to
      * compare or bit shift java primitive type variable
      * which are inerently signed
      */
     /**
      * Returns the unsigned value of the passed byte variable
-     * 
-     * @param b        the byte value
+     *
+     * @param b the byte value
      * @return the int variable containing the unsigned byte value
      */
     public static int getUnsignedByte(byte b) {
-               return (b > 0)? (int)b : ((int)b & 0x7F | 0x80);
-       }
-       
+                return (b > 0)? (int)b : ((int)b & 0x7F | 0x80);
+        }
+
     /**
      * Return the unsigned value of the passed short variable
-     * 
+     *
      * @param s the short value
      * @return the int variable containing the unsigned short value
      */
-       public static int getUnsignedShort(short s) {
-               return (s > 0)? (int)s : ((int)s & 0x7FFF | 0x8000);
-       }
+        public static int getUnsignedShort(short s) {
+                return (s > 0)? (int)s : ((int)s & 0x7FFF | 0x8000);
+        }
 }
index 2fbb3e55f841eb80db4f5397b3913683cd77c5cc..1d7ce224b5620f438947eeb29139309cd865b7f2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved. 
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -23,7 +23,7 @@ public class Status {
      * for internal API2 function calls. This constructor allows to specify,
      * beside the Status Code, a custom human readable description to add more
      * information about the status.
-     * 
+     *
      * @param errorCode
      *            The status code. If passed as null, code will be stored as
      *            {@code StatusCode.UNDEFINED}
@@ -42,7 +42,7 @@ public class Status {
      * Generates an instance of the Status class based on the passed StatusCode
      * only. The description field of the Status object will be inferred by the
      * status code.
-     * 
+     *
      * @param errorCode
      *            The status code. If passed as null, code will be stored as
      *            {@code StatusCode.UNDEFINED}
@@ -59,7 +59,7 @@ public class Status {
      * asynchronous call. It is supposed to be created by the underlying
      * infrastructure only when it was successful in allocating the asynchronous
      * request id, hence caller should expect StatusCode to be successful.
-     * 
+     *
      * @param errorCode
      *            The status code. If passed as null, code will be stored as
      *            {@code StatusCode.UNDEFINED}
@@ -76,7 +76,7 @@ public class Status {
 
     /**
      * Returns the status code
-     * 
+     *
      * @return the {@code StatusCode} representing the status code
      */
     public StatusCode getCode() {
@@ -85,7 +85,7 @@ public class Status {
 
     /**
      * Returns a human readable description of the failure if any
-     * 
+     *
      * @return a string representing the reason of failure
      */
     public String getDescription() {
@@ -94,7 +94,7 @@ public class Status {
 
     /**
      * Tells whether the status is successful
-     * 
+     *
      * @return true if the Status code is {@code StatusCode.SUCCESS}
      */
     public boolean isSuccess() {
@@ -105,7 +105,7 @@ public class Status {
      * Return the request id assigned by underlying infrastructure in case of
      * asynchronous request. In case of synchronous requests, the returned id
      * is expected to be 0
-     * 
+     *
      * @return The request id assigned for this asynchronous request
      */
     public long getRequestId() {
index 8500d6398de4f2b39f91c912dacc1ce2a4d8bbe2..ce91ff440d1f70f4dba814700e7d65c34c1873af 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved. 
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,39 +10,39 @@ package org.opendaylight.controller.sal.utils;
 
 /**
  * The enum which describes the generic error conditions.
- * Each enum value is associated with a minimal description string. 
+ * Each enum value is associated with a minimal description string.
  *
  */
 public enum StatusCode {
-       SUCCESS("Success"),
-
-       BADREQUEST("Bad Request"),
-       UNAUTHORIZED("UnAuthorized"),
-       FORBIDDEN("Forbidden"),
-       NOTFOUND("Not Found"),
-       NOTALLOWED("Method Not Allowed"),
-       NOTACCEPTABLE("Request Not Acceptable"),
-       TIMEOUT("Request Timeout"),
-       CONFLICT("Resource Conflict"),
-       GONE("Resource Gone"),
-       UNSUPPORTED("Unsupported"),
-
-       INTERNALERROR("Internal Error"), 
-       NOTIMPLEMENTED("Not Implemented"),
-       NOSERVICE("Service Not Available"),
-       
-       UNDEFINED("Undefined Error");
-       
-       private String description;
-       private StatusCode(String description) {
-               this.description = description; 
-       }
-       
-       /**
-        * Prints the description associated to the code value
-        */
-       public String toString() {
-               return description;
-       }
+        SUCCESS("Success"),
+
+        BADREQUEST("Bad Request"),
+        UNAUTHORIZED("UnAuthorized"),
+        FORBIDDEN("Forbidden"),
+        NOTFOUND("Not Found"),
+        NOTALLOWED("Method Not Allowed"),
+        NOTACCEPTABLE("Request Not Acceptable"),
+        TIMEOUT("Request Timeout"),
+        CONFLICT("Resource Conflict"),
+        GONE("Resource Gone"),
+        UNSUPPORTED("Unsupported"),
+
+        INTERNALERROR("Internal Error"),
+        NOTIMPLEMENTED("Not Implemented"),
+        NOSERVICE("Service Not Available"),
+
+        UNDEFINED("Undefined Error");
+
+        private String description;
+        private StatusCode(String description) {
+                this.description = description;
+        }
+
+        /**
+         * Prints the description associated to the code value
+         */
+        public String toString() {
+                return description;
+        }
 
 }
index 6858494283a2ec6cf0ee0e56e57d88d5a3ce5960..89e8ea2b5438bf1455b16ede425729d572d91e6e 100644 (file)
@@ -172,7 +172,7 @@ public class ActionTest {
 
         action = new SetNwTos(0x40);
         Assert.assertFalse(action.isValid());
-        
+
         action = new SetNwTos(0xff1);
         Assert.assertFalse(action.isValid());
 
index 55adfdac5173022579e65e96a272418dbfa3f299..869d7ff5203d53043d548e79dd04dca0110c1ef4 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 package org.opendaylight.controller.sal.authorization;
-               
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
@@ -19,59 +19,59 @@ import org.junit.Test;
 
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.utils.NodeCreator;
-       
-       public class AuthorizationTest {
-       
-       @Test
-       public void testResources () {
-       Privilege p = Privilege.WRITE;
-       ResourceGroup resourceGroup = new ResourceGroup("NodeGroup", p);
-       Map<ResourceGroup, ArrayList<Resource>> resourceMap = new HashMap<ResourceGroup, ArrayList<Resource>>();
-       ArrayList<Resource> resourceList = new ArrayList<Resource>();
-       
-               for (int i = 0; i < 5; i++) {
-                       Node node = NodeCreator.createOFNode((long)i);
-                       Resource resource = new Resource (node, p);     
-                       resourceList.add(resource);
-               }
-               
-               resourceMap.put(resourceGroup, resourceList);
-               
-               ArrayList<Resource> retrievedResourceList = resourceMap.get(resourceGroup);
-               for (Entry<ResourceGroup, ArrayList<Resource>> entry : resourceMap.entrySet()) {
-                       ResourceGroup rGroup = entry.getKey();
-                       Assert.assertTrue(rGroup.getGroupName().equals(resourceGroup.getGroupName()));
-                       for (int i = 0; i < 5; i++) {
-                               Resource resource = retrievedResourceList.get(i);
-                               Assert.assertTrue(resource.getPrivilege().equals(Privilege.WRITE));
-                               Assert.assertTrue(((Long)((Node)resource.getResource()).getID()).equals((long)i));
-                       }
-               }
-       }
-       
-       @Test
-       public void testAppRoleLevel() {
-               AppRoleLevel appRoleLevel = AppRoleLevel.APPOPERATOR;
-               Assert.assertTrue(appRoleLevel.toString().equals("App-Operator"));
-               Assert.assertTrue(appRoleLevel.toNumber() == 2);
-               Assert.assertTrue(appRoleLevel.toStringPretty().equals("Application Operator"));
-       }
-       
-       @Test
-       public void testUserLevel() {
-               UserLevel userLevel = UserLevel.SYSTEMADMIN;
-               Assert.assertTrue(userLevel.toString().equals("System-Admin"));
-               Assert.assertTrue(userLevel.toNumber() == 0);
-               Assert.assertTrue(userLevel.toStringPretty().equals("System Administrator"));
-       }
-       
-       @Test
-       public void testAppRoleLevelFromString() {
-               Assert.assertTrue(AppRoleLevel.fromString("App-Admin") == AppRoleLevel.APPADMIN);
-               Assert.assertTrue(AppRoleLevel.fromString("App-User") == AppRoleLevel.APPUSER);
-               Assert.assertTrue(AppRoleLevel.fromString("App-Operator") == AppRoleLevel.APPOPERATOR);
-               Assert.assertTrue(AppRoleLevel.fromString(" ") == null);
-               Assert.assertTrue(AppRoleLevel.fromString("") == null);
-               Assert.assertTrue(AppRoleLevel.fromString("App-Admini") == null);               
-       }
+
+        public class AuthorizationTest {
+
+        @Test
+        public void testResources () {
+        Privilege p = Privilege.WRITE;
+        ResourceGroup resourceGroup = new ResourceGroup("NodeGroup", p);
+        Map<ResourceGroup, ArrayList<Resource>> resourceMap = new HashMap<ResourceGroup, ArrayList<Resource>>();
+        ArrayList<Resource> resourceList = new ArrayList<Resource>();
+
+                for (int i = 0; i < 5; i++) {
+                        Node node = NodeCreator.createOFNode((long)i);
+                        Resource resource = new Resource (node, p);
+                        resourceList.add(resource);
+                }
+
+                resourceMap.put(resourceGroup, resourceList);
+
+                ArrayList<Resource> retrievedResourceList = resourceMap.get(resourceGroup);
+                for (Entry<ResourceGroup, ArrayList<Resource>> entry : resourceMap.entrySet()) {
+                        ResourceGroup rGroup = entry.getKey();
+                        Assert.assertTrue(rGroup.getGroupName().equals(resourceGroup.getGroupName()));
+                        for (int i = 0; i < 5; i++) {
+                                Resource resource = retrievedResourceList.get(i);
+                                Assert.assertTrue(resource.getPrivilege().equals(Privilege.WRITE));
+                                Assert.assertTrue(((Long)((Node)resource.getResource()).getID()).equals((long)i));
+                        }
+                }
+        }
+
+        @Test
+        public void testAppRoleLevel() {
+                AppRoleLevel appRoleLevel = AppRoleLevel.APPOPERATOR;
+                Assert.assertTrue(appRoleLevel.toString().equals("App-Operator"));
+                Assert.assertTrue(appRoleLevel.toNumber() == 2);
+                Assert.assertTrue(appRoleLevel.toStringPretty().equals("Application Operator"));
+        }
+
+        @Test
+        public void testUserLevel() {
+                UserLevel userLevel = UserLevel.SYSTEMADMIN;
+                Assert.assertTrue(userLevel.toString().equals("System-Admin"));
+                Assert.assertTrue(userLevel.toNumber() == 0);
+                Assert.assertTrue(userLevel.toStringPretty().equals("System Administrator"));
+        }
+
+        @Test
+        public void testAppRoleLevelFromString() {
+                Assert.assertTrue(AppRoleLevel.fromString("App-Admin") == AppRoleLevel.APPADMIN);
+                Assert.assertTrue(AppRoleLevel.fromString("App-User") == AppRoleLevel.APPUSER);
+                Assert.assertTrue(AppRoleLevel.fromString("App-Operator") == AppRoleLevel.APPOPERATOR);
+                Assert.assertTrue(AppRoleLevel.fromString(" ") == null);
+                Assert.assertTrue(AppRoleLevel.fromString("") == null);
+                Assert.assertTrue(AppRoleLevel.fromString("App-Admini") == null);
+        }
 }
index c081e10645b6a1d2ff1f55dc942b47d932310344..c6697196d479f0764309c7906d3c5a97f0ccf8a8 100644 (file)
@@ -396,7 +396,7 @@ public class NodeTest {
     public void testExtensibleNode() {
         // Add a new ID type
         Assert.assertTrue(Node.NodeIDType.registerIDType("FOO", Integer.class));
-        
+
         // Trying to re-register the node must fail
         Assert.assertFalse(Node.NodeIDType.registerIDType("FOO",
                                                           Integer.class));
@@ -408,7 +408,7 @@ public class NodeTest {
             // Got an unexpected exception
             Assert.assertTrue(false);
         }
-        
+
         // Now unregister the type and make sure the node doesn't get
         // created
         Node.NodeIDType.unRegisterIDType("FOO");
index f257befd3c3d64ed15f8dcc76cd87b501135f49d..5ec7d089b68dc6a257df8a4cd6bd08edc27d44c0 100644 (file)
@@ -313,13 +313,13 @@ public class MatchTest {
         InetAddress ipMask2 = null;
         short ethertype = EtherTypes.IPv4.shortValue();
         short ethertype2 = EtherTypes.IPv4.shortValue();
-       
+
         /*
          * Create a SAL Flow aFlow
          */
         Match match1 = new Match();
         Match match2 = new Match();
-        
+
         match1.setField(MatchType.DL_TYPE, ethertype);
         match1.setField(MatchType.NW_SRC, srcIP, ipMask);
 
@@ -327,7 +327,7 @@ public class MatchTest {
         match2.setField(MatchType.NW_SRC, srcIP2, ipMask2);
 
         Assert.assertTrue(match1.equals(match2));
-        
+
         ipMask2 = InetAddress.getByName("255.255.255.255");
         match2.setField(MatchType.NW_SRC, srcIP2, ipMask2);
 
@@ -337,7 +337,7 @@ public class MatchTest {
         ipMask2 = InetAddress.getByName("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff");
         ethertype = EtherTypes.IPv6.shortValue();
         ethertype2 = EtherTypes.IPv6.shortValue();
+
         match1.setField(MatchType.DL_TYPE, ethertype);
         match1.setField(MatchType.NW_SRC, srcIP, ipMask);
 
@@ -346,7 +346,7 @@ public class MatchTest {
 
         Assert.assertTrue(match1.equals(match2));
     }
-    
+
     @Test
     public void testCloning() throws Exception {
         Node node = NodeCreator.createOFNode(7l);
index b1c5e945d69aa8c76e53f2de9f936eac1967bf5c..9f74fcab9e40b93601dd72ee8b0ed2f10a57e6e5 100644 (file)
@@ -374,7 +374,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data2[3] == 80);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [10100000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               // OUTPUT: [01001011] [01101000] = {75, 104}
+        // [01001011] [01101110] [01101011] [10100000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        // OUTPUT: [01001011] [01101000] = {75, 104}
         byte data10[] = new byte[2];
         startOffset = 0;
         numBits = 13;
@@ -383,7 +383,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data10[1] == 104);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [10100000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               // OUTPUT: [01001000] = {72}
+        // [01001011] [01101110] [01101011] [10100000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        // OUTPUT: [01001000] = {72}
         byte data11[] = new byte[4];
         startOffset = 8;
         numBits = 6;
@@ -391,7 +391,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data11[1] == 72);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [10100000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [01001011] [01101110] [01101000] = {75, 110, 105}
+        // [01001011] [01101110] [01101011] [10100000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [01001011] [01101110] [01101000] = {75, 110, 105}
         byte data12[] = new byte[4];
         startOffset = 0;
         numBits = 23;
@@ -401,7 +401,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data12[2] == 106);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [10100000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [01001011] [01101110] [01100000] = {75, 110, 96}
+        // [01001011] [01101110] [01101011] [10100000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [01001011] [01101110] [01100000] = {75, 110, 96}
         byte data13[] = new byte[4];
         startOffset = 8;
         numBits = 20;
@@ -411,7 +411,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data13[3] == 96);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [10100000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [01001011] [01101110] [01101011] [10100000]= {75, 110, 107, 80}
+        // [01001011] [01101110] [01101011] [10100000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [01001011] [01101110] [01101011] [10100000]= {75, 110, 107, 80}
         byte data14[] = new byte[4];
         startOffset = 0;
         numBits = 30;
@@ -423,7 +423,7 @@ public class BitBufferHelperTest {
 
         //CASE 3: startOffset%8 != 0, numBits%8 = 0
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [10100000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [00001001] [11000000] = {72, 96}
+        // [01001011] [01101110] [01101011] [10100000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [00001001] [11000000] = {72, 96}
         byte data16[] = new byte[5];
         startOffset = 3;
         numBits = 8;
@@ -433,7 +433,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data16[2] == 0);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
+        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
         // OUTPUT: [00000100] [1011 0110] [1110 0000] = {4, -54, -96}
 
         startOffset = 3;
@@ -458,7 +458,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data18[2] == -64);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
+        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
         // OUTPUT: [0000 1001] [0110 1101] [1100 1101] [0110 1010] [0000 0001] = {9, 109, -51, 106, 0}
 
         startOffset = 3;
@@ -472,7 +472,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data19[4] == 0);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
+        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
         // OUTPUT: data[4, 5, 6] = [0 010 0101] [1 011 0111] [0 000 0000] = {37, -73, 0}
         startOffset = 33;
         numBits = 16;
@@ -484,7 +484,7 @@ public class BitBufferHelperTest {
 
         //CASE 4: extranumBits != 0 AND extraOffsetBits != 0
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
+        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
         // OUTPUT: [0000 1001] [0100 0000]  = {9, 96}
         startOffset = 3;
         numBits = 7;
@@ -495,7 +495,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data21[2] == 0);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
+        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
         // OUTPUT: data = [00000 010] [01011 011] [01110 000] = {37, -73, 0}
         startOffset = 5;
         numBits = 17;
@@ -506,7 +506,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data22[2] == 112);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
+        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
         // OUTPUT: [0000 1001] [0110 1101] [110 01101] [01 00000] = {9, 109, -51, 64}
         startOffset = 3;
         numBits = 23;
@@ -518,7 +518,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data23[3] == 64);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
+        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
         // OUTPUT: [0000 1001] [0110 1101]  = {9, 109}
         startOffset = 3;
         numBits = 13;
@@ -529,7 +529,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data24[2] == 0);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
+        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
         // OUTPUT: [0000 0100] [1011 0110] [1110 0110]  = {4, -74, -26}
         startOffset = 4;
         numBits = 20;
@@ -541,7 +541,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data25[3] == -0);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
+        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
         // OUTPUT: [0000 0010] [0101 1011]   = {0, 2, 91, 0}
         startOffset = 13;
         numBits = 11;
@@ -553,7 +553,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data26[3] == 0);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
+        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
         // OUTPUT: [000 01001] [011 01101] [110 0 0000]   = {9, 109, -64, 0}
         startOffset = 3;
         numBits = 17;
@@ -565,7 +565,7 @@ public class BitBufferHelperTest {
         Assert.assertTrue(data27[3] == 0);
 
         // INPUT: {75, 110, 107, 80, 10, 12, 35, 100, 125, 65} =
-        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]               //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
+        // [01001011] [01101110] [01101011] [01010000] [00001010] [00001100] [00100011] [01100100] [11111101] [01000001]        //OUTPUT: [00000000] [00000100] [10110110] [11100000]= {0, 4, -54, -96}
         // OUTPUT: [00 000000] [00 000000] [00 010010] [11 011011] [10 011010] [11 010100] [0000 0000] = {0, 0, 18, -37,-102,-44,0}
         startOffset = 18;
         numBits = 34;
index 8d856b08cdcafda4f9e89f2c78b0c87b33a7f8ce..8049000fa7d866d6b98abbaff5f4a7958952b642 100644 (file)
@@ -59,29 +59,29 @@ public class PacketTest {
         Assert.assertTrue(sMAC[5] == -97);
 
         Assert.assertTrue(etherType == 0x806);
-        
+
         ARP arpPacket = (ARP) eth.getPayload();
-        
+
         Assert.assertTrue(arpPacket.getHardwareType() == (byte)0x1);
         Assert.assertTrue(arpPacket.getProtocolType() == 2048);
         Assert.assertTrue(arpPacket.getHardwareAddressLength() == (byte)0x6);
         Assert.assertTrue(arpPacket.getProtocolAddressLength() == (byte)0x4);
         Assert.assertTrue(arpPacket.getOpCode() == 1);
-        
+
         byte[] senderHwAddress = arpPacket.getSenderHardwareAddress();
-        byte[] senderProtocolAddress = arpPacket.getSenderProtocolAddress(); 
-        
+        byte[] senderProtocolAddress = arpPacket.getSenderProtocolAddress();
+
         byte[] targetHwAddress = arpPacket.getTargetHardwareAddress();
-        byte[] targetProtocolAddress = arpPacket.getTargetProtocolAddress(); 
+        byte[] targetProtocolAddress = arpPacket.getTargetProtocolAddress();
+
 
-        
         Assert.assertTrue(senderHwAddress[0] == (byte)0xA6);
         Assert.assertTrue(senderHwAddress[1] == (byte)0xEC);
         Assert.assertTrue(senderHwAddress[2] == (byte)0x9C);
         Assert.assertTrue(senderHwAddress[3] == (byte)0xAE);
         Assert.assertTrue(senderHwAddress[4] == (byte)0xB2);
         Assert.assertTrue(senderHwAddress[5] == (byte)0x9F);
-        
+
         Assert.assertTrue(senderProtocolAddress[0] == (byte)0x9);
         Assert.assertTrue(senderProtocolAddress[1] == (byte)0x9);
         Assert.assertTrue(senderProtocolAddress[2] == (byte)0x9);
@@ -102,7 +102,7 @@ public class PacketTest {
         Assert.assertTrue(targetProtocolAddress[0] == (byte)0x9);
         Assert.assertTrue(targetProtocolAddress[1] == (byte)0x9);
         Assert.assertTrue(targetProtocolAddress[2] == (byte)0x9);
-        Assert.assertTrue(targetProtocolAddress[3] == (byte)0xFE);      
+        Assert.assertTrue(targetProtocolAddress[3] == (byte)0xFE);
     }
 
     @Test
index 61f34aa63a479b0f6ac5d9b2457c1ae226efb21a..21377be8538ffe2e0594438df2c8e0afdb1418a3 100644 (file)
@@ -22,38 +22,38 @@ import org.opendaylight.controller.sal.reader.FlowOnNode;
 import org.opendaylight.controller.sal.utils.EtherTypes;
 import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
 import org.opendaylight.controller.sal.utils.NodeCreator;
-       
+
 public class FlowOnNodeTest {
 
-               @Test
-               public void testFlowOnNodeMethods () {
-               Match match = new Match();
-               NodeConnector inNC = NodeConnectorCreator.createNodeConnector((short)10, NodeCreator.createOFNode((long)10));
-               NodeConnector outNC = NodeConnectorCreator.createNodeConnector((short)20, NodeCreator.createOFNode((long)20));
-                       
-               match.setField(MatchType.DL_TYPE, EtherTypes.IPv4.shortValue());
-               match.setField(MatchType.IN_PORT, inNC);
-                       
-               Output output = new Output(outNC);
-               ArrayList<Action> action = new ArrayList<Action>();
-               action.add(output);
-                       
-               Flow flow = new Flow (match, action);
-               
-               FlowOnNode flowOnNode = new FlowOnNode (flow);
-       
-               Assert.assertTrue(flowOnNode.getFlow().equals(flow));
-               
-               flowOnNode.setPacketCount((long)100);
-               flowOnNode.setByteCount((long)800);
-               flowOnNode.setTableId((byte)0x55);
-               flowOnNode.setDurationNanoseconds(40);
-               flowOnNode.setDurationSeconds(45);
-                       
-               Assert.assertTrue(flowOnNode.getPacketCount() == 100);
-               Assert.assertTrue(flowOnNode.getByteCount() == 800);
-               Assert.assertTrue(flowOnNode.getDurationNanoseconds() == 40);
-               Assert.assertTrue(flowOnNode.getDurationSeconds() == 45);
-               Assert.assertTrue(flowOnNode.getTableId() == (byte)0x55);               
-       }
+                @Test
+                public void testFlowOnNodeMethods () {
+                Match match = new Match();
+                NodeConnector inNC = NodeConnectorCreator.createNodeConnector((short)10, NodeCreator.createOFNode((long)10));
+                NodeConnector outNC = NodeConnectorCreator.createNodeConnector((short)20, NodeCreator.createOFNode((long)20));
+
+                match.setField(MatchType.DL_TYPE, EtherTypes.IPv4.shortValue());
+                match.setField(MatchType.IN_PORT, inNC);
+
+                Output output = new Output(outNC);
+                ArrayList<Action> action = new ArrayList<Action>();
+                action.add(output);
+
+                Flow flow = new Flow (match, action);
+
+                FlowOnNode flowOnNode = new FlowOnNode (flow);
+
+                Assert.assertTrue(flowOnNode.getFlow().equals(flow));
+
+                flowOnNode.setPacketCount((long)100);
+                flowOnNode.setByteCount((long)800);
+                flowOnNode.setTableId((byte)0x55);
+                flowOnNode.setDurationNanoseconds(40);
+                flowOnNode.setDurationSeconds(45);
+
+                Assert.assertTrue(flowOnNode.getPacketCount() == 100);
+                Assert.assertTrue(flowOnNode.getByteCount() == 800);
+                Assert.assertTrue(flowOnNode.getDurationNanoseconds() == 40);
+                Assert.assertTrue(flowOnNode.getDurationSeconds() == 45);
+                Assert.assertTrue(flowOnNode.getTableId() == (byte)0x55);
+        }
 }
\ No newline at end of file
index 8c2d2e6e34cfa755ca1d6e91e15fce705c3784d2..c123e4e7c7f444e1e0e7cabfeef862a442b6d71c 100644 (file)
@@ -18,35 +18,34 @@ import org.junit.Assert;
 
 public class NodeConnectorStatisticsTest {
 
-       @Test
-       public void testNodeConnectorStatisticsMethods() {
-               NodeConnector nc = NodeConnectorCreator.createNodeConnector((short)20, NodeCreator.createOFNode((long)20));
-               NodeConnectorStatistics ncStats = new NodeConnectorStatistics();
-               ncStats.setNodeConnector(nc);
-               ncStats.setReceiveByteCount(800);
-               ncStats.setReceiveCRCErrorCount(10);
-               ncStats.setReceiveDropCount(5);
-               ncStats.setReceiveErrorCount(20);
-               ncStats.setReceiveFrameErrorCount(25);
-               ncStats.setReceiveOverRunErrorCount(30);
-               ncStats.setReceivePacketCount(100);
-               ncStats.setTransmitByteCount(400);
-               ncStats.setTransmitDropCount(15);
-               ncStats.setTransmitErrorCount(18);
-               ncStats.setTransmitPacketCount(50);
-               ncStats.setCollisionCount(2);
-               
-               Assert.assertTrue(ncStats.getCollisionCount() == 2);
-               Assert.assertTrue(ncStats.getTransmitPacketCount() == 50);
-               Assert.assertTrue(ncStats.getTransmitErrorCount() == 18);
-               Assert.assertTrue(ncStats.getTransmitDropCount() == 15);
-               Assert.assertTrue(ncStats.getReceivePacketCount() == 100);
-               Assert.assertTrue(ncStats.getReceiveOverRunErrorCount() == 30);
-               Assert.assertTrue(ncStats.getReceiveFrameErrorCount() == 25);
-               Assert.assertTrue(ncStats.getReceiveDropCount() == 5);
-               Assert.assertTrue(ncStats.getReceiveCRCErrorCount() == 10);
-               Assert.assertTrue(ncStats.getReceiveByteCount() == 800);
-               Assert.assertTrue(ncStats.getNodeConnector().equals(nc));
-       }
-}
+        @Test
+        public void testNodeConnectorStatisticsMethods() {
+                NodeConnector nc = NodeConnectorCreator.createNodeConnector((short)20, NodeCreator.createOFNode((long)20));
+                NodeConnectorStatistics ncStats = new NodeConnectorStatistics();
+                ncStats.setNodeConnector(nc);
+                ncStats.setReceiveByteCount(800);
+                ncStats.setReceiveCRCErrorCount(10);
+                ncStats.setReceiveDropCount(5);
+                ncStats.setReceiveErrorCount(20);
+                ncStats.setReceiveFrameErrorCount(25);
+                ncStats.setReceiveOverRunErrorCount(30);
+                ncStats.setReceivePacketCount(100);
+                ncStats.setTransmitByteCount(400);
+                ncStats.setTransmitDropCount(15);
+                ncStats.setTransmitErrorCount(18);
+                ncStats.setTransmitPacketCount(50);
+                ncStats.setCollisionCount(2);
 
+                Assert.assertTrue(ncStats.getCollisionCount() == 2);
+                Assert.assertTrue(ncStats.getTransmitPacketCount() == 50);
+                Assert.assertTrue(ncStats.getTransmitErrorCount() == 18);
+                Assert.assertTrue(ncStats.getTransmitDropCount() == 15);
+                Assert.assertTrue(ncStats.getReceivePacketCount() == 100);
+                Assert.assertTrue(ncStats.getReceiveOverRunErrorCount() == 30);
+                Assert.assertTrue(ncStats.getReceiveFrameErrorCount() == 25);
+                Assert.assertTrue(ncStats.getReceiveDropCount() == 5);
+                Assert.assertTrue(ncStats.getReceiveCRCErrorCount() == 10);
+                Assert.assertTrue(ncStats.getReceiveByteCount() == 800);
+                Assert.assertTrue(ncStats.getNodeConnector().equals(nc));
+        }
+}
index a720bdf680d16672e55b9269fa9fdb4ccacbdc5d..d4b1f8c25d2477d1fd5d9e741b376e744cec956c 100644 (file)
@@ -14,30 +14,27 @@ import org.junit.Test;
 import org.opendaylight.controller.sal.reader.NodeDescription;
 
 public class NodeDescriptionTest {
-       
-       @Test
-       public void testNodeDescriptionMethods() {
-               NodeDescription ncDesc = new NodeDescription();
-               ncDesc.setHardware("Hardware1");
-               ncDesc.setManufacturer("Manufacturer1");
-               ncDesc.setDescription("SDNProtocol1");
-               ncDesc.setSerialNumber("serialNumber1");
-               ncDesc.setSoftware("Software1");
-               
-               Assert.assertTrue(ncDesc.getHardware().equals("Hardware1"));
-               Assert.assertTrue(ncDesc.getManufacturer().equals("Manufacturer1"));
-               Assert.assertTrue(ncDesc.getDescription().equals("SDNProtocol1"));
-               Assert.assertTrue(ncDesc.getSerialNumber().equals("serialNumber1"));
-               Assert.assertTrue(ncDesc.getSoftware().equals("Software1"));
-               
-               Assert.assertFalse(ncDesc.getHardware().equals("Hardware2"));
-               Assert.assertFalse(ncDesc.getManufacturer().equals("Manufacturer2"));
-               Assert.assertFalse(ncDesc.getDescription().equals("SDNProtocol2"));
-               Assert.assertFalse(ncDesc.getSerialNumber().equals("serialNumber2"));
-               Assert.assertFalse(ncDesc.getSoftware().equals("Software2"));
-
-       }
-}
-
-
 
+        @Test
+        public void testNodeDescriptionMethods() {
+                NodeDescription ncDesc = new NodeDescription();
+                ncDesc.setHardware("Hardware1");
+                ncDesc.setManufacturer("Manufacturer1");
+                ncDesc.setDescription("SDNProtocol1");
+                ncDesc.setSerialNumber("serialNumber1");
+                ncDesc.setSoftware("Software1");
+
+                Assert.assertTrue(ncDesc.getHardware().equals("Hardware1"));
+                Assert.assertTrue(ncDesc.getManufacturer().equals("Manufacturer1"));
+                Assert.assertTrue(ncDesc.getDescription().equals("SDNProtocol1"));
+                Assert.assertTrue(ncDesc.getSerialNumber().equals("serialNumber1"));
+                Assert.assertTrue(ncDesc.getSoftware().equals("Software1"));
+
+                Assert.assertFalse(ncDesc.getHardware().equals("Hardware2"));
+                Assert.assertFalse(ncDesc.getManufacturer().equals("Manufacturer2"));
+                Assert.assertFalse(ncDesc.getDescription().equals("SDNProtocol2"));
+                Assert.assertFalse(ncDesc.getSerialNumber().equals("serialNumber2"));
+                Assert.assertFalse(ncDesc.getSoftware().equals("Software2"));
+
+        }
+}
index 117da55de89c4d74844a8ed7d80e17e61276eff6..5beb8713f9e91eb400e75ec7fa685ec51be870f8 100644 (file)
@@ -12,63 +12,60 @@ package org.opendaylight.controller.sal.utils;
 import java.util.ArrayList;
 import org.junit.Assert;
 import org.junit.Test;
-       
+
 public class EtherTypesTest {
-               
-       @Test
-       public void testEthertypesCreation() {
-               
-               EtherTypes arp = EtherTypes.ARP;
-               
-               Assert.assertTrue(arp.toString().equals("ARP"));
-               Assert.assertTrue(arp.intValue() == 2054);
-               Assert.assertTrue(arp.shortValue() == (short)2054);
-       }
-       
-       @Test
-       public void testGetEtherTypesString() {
-               
-               Assert.assertTrue(EtherTypes.getEtherTypeName(34984).equals("QINQ"));
-               Assert.assertTrue(EtherTypes.getEtherTypeName((short)2048).equals("IPv4"));
-               Assert.assertTrue(EtherTypes.getEtherTypeName(0x010B).equals("PVSTP"));
-               
-               Assert.assertFalse(EtherTypes.getEtherTypeName(0x800).equals("ARP"));
-       }
-       
-       @Test
-       public void testGetEtherTypesNumber() {
-               Assert.assertTrue(EtherTypes.getEtherTypeNumberInt("VLAN Tagged") == 33024);
-               Assert.assertTrue(EtherTypes.getEtherTypeNumberShort("ARP") == 2054);
-               
-               Assert.assertFalse(EtherTypes.getEtherTypeNumberInt("CDP") == 1000);
-       }
-       
-       @Test
-       public void testGetEtherTypesList() {
-               ArrayList<String> etherTypeNames = (ArrayList<String>) EtherTypes.getEtherTypesNameList();
-               Assert.assertTrue(etherTypeNames.get(0).equals("PVSTP"));
-               Assert.assertTrue(etherTypeNames.get(1).equals("CDP"));
-               Assert.assertTrue(etherTypeNames.get(2).equals("VTP"));
-               Assert.assertTrue(etherTypeNames.get(3).equals("IPv4"));
-               Assert.assertTrue(etherTypeNames.get(4).equals("ARP"));
-               Assert.assertTrue(etherTypeNames.get(5).equals("Reverse ARP"));
-               Assert.assertTrue(etherTypeNames.get(6).equals("VLAN Tagged"));
-               Assert.assertTrue(etherTypeNames.get(7).equals("IPv6"));
-               Assert.assertTrue(etherTypeNames.get(8).equals("MPLS Unicast"));
-               Assert.assertTrue(etherTypeNames.get(9).equals("MPLS Multicast"));
-               Assert.assertTrue(etherTypeNames.get(10).equals("QINQ"));
-               Assert.assertTrue(etherTypeNames.get(11).equals("LLDP"));
-               Assert.assertTrue(etherTypeNames.get(12).equals("Old QINQ"));
-               Assert.assertTrue(etherTypeNames.get(13).equals("Cisco QINQ"));         
-       }
-       
-       @Test
-       public void testGetEtherTypesloadFromString() {
-               Assert.assertTrue(EtherTypes.loadFromString("37376").equals(EtherTypes.CISCOQINQ));
-               Assert.assertTrue(EtherTypes.loadFromString("100") == null);
-       }
 
-}
+        @Test
+        public void testEthertypesCreation() {
+
+                EtherTypes arp = EtherTypes.ARP;
+
+                Assert.assertTrue(arp.toString().equals("ARP"));
+                Assert.assertTrue(arp.intValue() == 2054);
+                Assert.assertTrue(arp.shortValue() == (short)2054);
+        }
+
+        @Test
+        public void testGetEtherTypesString() {
 
+                Assert.assertTrue(EtherTypes.getEtherTypeName(34984).equals("QINQ"));
+                Assert.assertTrue(EtherTypes.getEtherTypeName((short)2048).equals("IPv4"));
+                Assert.assertTrue(EtherTypes.getEtherTypeName(0x010B).equals("PVSTP"));
 
+                Assert.assertFalse(EtherTypes.getEtherTypeName(0x800).equals("ARP"));
+        }
 
+        @Test
+        public void testGetEtherTypesNumber() {
+                Assert.assertTrue(EtherTypes.getEtherTypeNumberInt("VLAN Tagged") == 33024);
+                Assert.assertTrue(EtherTypes.getEtherTypeNumberShort("ARP") == 2054);
+
+                Assert.assertFalse(EtherTypes.getEtherTypeNumberInt("CDP") == 1000);
+        }
+
+        @Test
+        public void testGetEtherTypesList() {
+                ArrayList<String> etherTypeNames = (ArrayList<String>) EtherTypes.getEtherTypesNameList();
+                Assert.assertTrue(etherTypeNames.get(0).equals("PVSTP"));
+                Assert.assertTrue(etherTypeNames.get(1).equals("CDP"));
+                Assert.assertTrue(etherTypeNames.get(2).equals("VTP"));
+                Assert.assertTrue(etherTypeNames.get(3).equals("IPv4"));
+                Assert.assertTrue(etherTypeNames.get(4).equals("ARP"));
+                Assert.assertTrue(etherTypeNames.get(5).equals("Reverse ARP"));
+                Assert.assertTrue(etherTypeNames.get(6).equals("VLAN Tagged"));
+                Assert.assertTrue(etherTypeNames.get(7).equals("IPv6"));
+                Assert.assertTrue(etherTypeNames.get(8).equals("MPLS Unicast"));
+                Assert.assertTrue(etherTypeNames.get(9).equals("MPLS Multicast"));
+                Assert.assertTrue(etherTypeNames.get(10).equals("QINQ"));
+                Assert.assertTrue(etherTypeNames.get(11).equals("LLDP"));
+                Assert.assertTrue(etherTypeNames.get(12).equals("Old QINQ"));
+                Assert.assertTrue(etherTypeNames.get(13).equals("Cisco QINQ"));
+        }
+
+        @Test
+        public void testGetEtherTypesloadFromString() {
+                Assert.assertTrue(EtherTypes.loadFromString("37376").equals(EtherTypes.CISCOQINQ));
+                Assert.assertTrue(EtherTypes.loadFromString("100") == null);
+        }
+
+}
index b9b5f459274bd63c8ed804237a97749f36a7cf39..3cfa747be5c5288b5008d7e5a32419d7af08ce08 100644 (file)
@@ -8,63 +8,60 @@
  */
 
 package org.opendaylight.controller.sal.utils;
-               
+
 import org.junit.Assert;
 import org.junit.Test;
-       
+
 public class HexEncodeTest {
-               
-       @Test
-       public void testbytesToHexString() {
-               byte[] bytes1 = {(byte)0x01, (byte)0x02, (byte)0x03};           
-               String str1 = HexEncode.bytesToHexString(bytes1);
-               Assert.assertTrue(str1.equals("010203"));
-       
-               byte[] bytes2 = {(byte)0x11, (byte)0x22, (byte)0x33};           
-               String str2 = HexEncode.bytesToHexString(bytes2);
-               Assert.assertFalse(str2.equals("010203"));
-
-       }
-
-       @Test
-       public void testLongToHexString() {
-               long value1 = 12345678L;
-               String str1 = HexEncode.longToHexString(value1);
-               Assert.assertTrue(str1.equals("00:00:00:00:00:bc:61:4e"));
-               
-               long value2 = 98765432L;
-               String str2 = HexEncode.longToHexString(value2);
-               Assert.assertFalse(str2.equals("00:44:33:22:11:bc:61:4e"));
-
-       }
-       
-       @Test
-       public void testBytesFromHexString() {
-               String byteStr1 = "00:11:22:33:44:55";
-               byte byteArray1[] = new byte[(byteStr1.length() + 1)/3];
-               byteArray1 = HexEncode.bytesFromHexString(byteStr1);
-               
-               Assert.assertTrue(byteArray1[0] == (byte)0x0);
-               Assert.assertTrue(byteArray1[1] == (byte)0x11);
-               Assert.assertTrue(byteArray1[2] == (byte)0x22);
-               Assert.assertTrue(byteArray1[3] == (byte)0x33);
-               Assert.assertTrue(byteArray1[4] == (byte)0x44);
-               Assert.assertTrue(byteArray1[5] == (byte)0x55);
-               
-               String byteStr2 = "00:11:22:33:44:55";
-               byte byteArray2[] = new byte[(byteStr2.length() + 1)/3];
-               byteArray2 = HexEncode.bytesFromHexString(byteStr2);
-               
-               Assert.assertFalse(byteArray2[0] == (byte)0x55);
-               Assert.assertFalse(byteArray2[1] == (byte)0x44);
-               Assert.assertFalse(byteArray2[2] == (byte)0x33);
-               Assert.assertFalse(byteArray2[3] == (byte)0x22);
-               Assert.assertFalse(byteArray2[4] == (byte)0x11);
-               Assert.assertFalse(byteArray2[5] == (byte)0x0);
-
-       }
-                       
-}
 
+        @Test
+        public void testbytesToHexString() {
+                byte[] bytes1 = {(byte)0x01, (byte)0x02, (byte)0x03};
+                String str1 = HexEncode.bytesToHexString(bytes1);
+                Assert.assertTrue(str1.equals("010203"));
+
+                byte[] bytes2 = {(byte)0x11, (byte)0x22, (byte)0x33};
+                String str2 = HexEncode.bytesToHexString(bytes2);
+                Assert.assertFalse(str2.equals("010203"));
+
+        }
+
+        @Test
+        public void testLongToHexString() {
+                long value1 = 12345678L;
+                String str1 = HexEncode.longToHexString(value1);
+                Assert.assertTrue(str1.equals("00:00:00:00:00:bc:61:4e"));
+
+                long value2 = 98765432L;
+                String str2 = HexEncode.longToHexString(value2);
+                Assert.assertFalse(str2.equals("00:44:33:22:11:bc:61:4e"));
 
+        }
 
+        @Test
+        public void testBytesFromHexString() {
+                String byteStr1 = "00:11:22:33:44:55";
+                byte byteArray1[] = new byte[(byteStr1.length() + 1)/3];
+                byteArray1 = HexEncode.bytesFromHexString(byteStr1);
+
+                Assert.assertTrue(byteArray1[0] == (byte)0x0);
+                Assert.assertTrue(byteArray1[1] == (byte)0x11);
+                Assert.assertTrue(byteArray1[2] == (byte)0x22);
+                Assert.assertTrue(byteArray1[3] == (byte)0x33);
+                Assert.assertTrue(byteArray1[4] == (byte)0x44);
+                Assert.assertTrue(byteArray1[5] == (byte)0x55);
+
+                String byteStr2 = "00:11:22:33:44:55";
+                byte byteArray2[] = new byte[(byteStr2.length() + 1)/3];
+                byteArray2 = HexEncode.bytesFromHexString(byteStr2);
+
+                Assert.assertFalse(byteArray2[0] == (byte)0x55);
+                Assert.assertFalse(byteArray2[1] == (byte)0x44);
+                Assert.assertFalse(byteArray2[2] == (byte)0x33);
+                Assert.assertFalse(byteArray2[3] == (byte)0x22);
+                Assert.assertFalse(byteArray2[4] == (byte)0x11);
+                Assert.assertFalse(byteArray2[5] == (byte)0x0);
+
+        }
+
+}
index 2d16afbd3d8fd6161922c092c212ae84722f9920..e16612759caebe9083efb17d38495b4a462de662 100644 (file)
@@ -273,7 +273,7 @@ public class NetUtilsTest {
                 .isIPv6AddressValid("fe80:::0:0:0:204:61ff:fe9d/-1")); //not valid both
 
     }
-    
+
     @Test
     public void testInetAddressConflict() throws UnknownHostException {
 
index 99690802e3cdd5e9539c8e0a5c33a18ccec7b3d6..41e4d2a7fcb30247bdb9a95c5f8c014bfd69389a 100644 (file)
@@ -38,7 +38,7 @@ public class Activator extends ComponentActivatorAbstractBase {
     /**
      * Function called when the activator starts just after some initializations
      * are done by the ComponentActivatorAbstractBase.
-     * 
+     *
      */
     public void init() {
 
@@ -47,7 +47,7 @@ public class Activator extends ComponentActivatorAbstractBase {
     /**
      * Function called when the activator stops just before the cleanup done by
      * ComponentActivatorAbstractBase
-     * 
+     *
      */
     public void destroy() {
 
@@ -56,8 +56,8 @@ public class Activator extends ComponentActivatorAbstractBase {
     /**
      * Function that is used to communicate to dependency manager the list of
      * known implementations for services inside a container
-     * 
-     * 
+     *
+     *
      * @return An array containing all the CLASS objects that will be
      *         instantiated in order to get an fully working implementation
      *         Object
@@ -72,7 +72,7 @@ public class Activator extends ComponentActivatorAbstractBase {
     /**
      * Function that is called when configuration of the dependencies is
      * required.
-     * 
+     *
      * @param c
      *            dependency manager Component object, used for configuring the
      *            dependencies exported and imported
index 6bea30666925ddaf4991f819597fde625766026f..d6feebd4a3067a057af0a7991dcf82613f2f5995 100644 (file)
@@ -75,7 +75,7 @@ public class FlowProgrammerService implements IFlowProgrammerService,
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
-     * 
+     *
      */
     void init() {
         logger.debug("INIT called!");
@@ -85,7 +85,7 @@ public class FlowProgrammerService implements IFlowProgrammerService,
      * Function called by the dependency manager when at least one dependency
      * become unsatisfied or when the component is shutting down because for
      * example bundle is being stopped.
-     * 
+     *
      */
     void destroy() {
         // Clear previous registration to avoid they are left hanging
@@ -96,7 +96,7 @@ public class FlowProgrammerService implements IFlowProgrammerService,
     /**
      * Function called by dependency manager after "init ()" is called and after
      * the services provided by the class are registered in the service registry
-     * 
+     *
      */
     void start() {
         logger.debug("START called!");
@@ -108,7 +108,7 @@ public class FlowProgrammerService implements IFlowProgrammerService,
      * Function called by the dependency manager before the services exported by
      * the component are unregistered, this will be followed by a "destroy ()"
      * calls
-     * 
+     *
      */
     void stop() {
         logger.debug("STOP called!");
@@ -305,7 +305,7 @@ public class FlowProgrammerService implements IFlowProgrammerService,
         }
         ci.println(this.addFlow(node, getSampleFlow(node)));
     }
-    
+
     public void _modifyflow(CommandInterpreter ci) throws UnknownHostException {
         Node node = null;
         String nodeId = ci.nextArgument();
@@ -494,7 +494,7 @@ public class FlowProgrammerService implements IFlowProgrammerService,
     /**
      * This Request ID generator starts with 1. Each aysnc message is
      * associated with an unique Request ID (!= 0).
-     * 
+     *
      * @return Request ID
      */
     private long getNextRid() {
index f965d7f2c402e21d6cf920f15ad0413ef7bd6785..2f517488a955ccbd7af16f05249114d9aa8e19fb 100644 (file)
@@ -60,7 +60,7 @@ public class Topology implements IPluginOutTopologyService, ITopologyService {
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
-     * 
+     *
      */
     void init() {
     }
@@ -69,7 +69,7 @@ public class Topology implements IPluginOutTopologyService, ITopologyService {
      * Function called by the dependency manager when at least one dependency
      * become unsatisfied or when the component is shutting down because for
      * example bundle is being stopped.
-     * 
+     *
      */
     void destroy() {
         // Make sure to clear all the data structure we use to track
index 730764a24e5bfc688008d980c02b3038c5b951e4..3a07288a9f9d9473c4dc8bba02410e4c81dd2238 100644 (file)
@@ -20,14 +20,14 @@ import org.opendaylight.controller.sal.packet.RawPacket;
 
 public class DataPacketServiceTest {
 
-       @Test
-       public void DataPacketServiceDecodeTest() throws ConstructionException, InstantiationException, IllegalAccessException {
-               
-               DataPacketService dService = new DataPacketService();
-               RawPacket rawPkt = null;
-               
-               Assert.assertTrue(dService.decodeDataPacket(rawPkt) == null);
-               
+        @Test
+        public void DataPacketServiceDecodeTest() throws ConstructionException, InstantiationException, IllegalAccessException {
+
+                DataPacketService dService = new DataPacketService();
+                RawPacket rawPkt = null;
+
+                Assert.assertTrue(dService.decodeDataPacket(rawPkt) == null);
+
         byte[] data = { 10, 12, 14, 20, 55, 69, //DMAC
                 -90, -20, -100, -82, -78, -97, //SMAC
                 8, 6, //ethype
@@ -40,35 +40,35 @@ public class DataPacketServiceTest {
                 9, 9, 9, 1, // src proto
                 0, 0, 0, 0, 0, 0, // target hw addr
                 9, 9, 9, -2 }; // target proto
-        
+
         rawPkt = new RawPacket(data);
-        
+
         Packet decodedPkt = dService.decodeDataPacket(rawPkt);
         Class<? extends Packet> payloadClass = ARP.class;
         Assert.assertTrue(payloadClass == decodedPkt.getPayload().getClass());
-                
+
         ARP arpPacket = (ARP) decodedPkt.getPayload();
-        
+
         Assert.assertTrue(arpPacket.getHardwareType() == (byte)0x1);
         Assert.assertTrue(arpPacket.getProtocolType() == 2048);
         Assert.assertTrue(arpPacket.getHardwareAddressLength() == (byte)0x6);
         Assert.assertTrue(arpPacket.getProtocolAddressLength() == (byte)0x4);
         Assert.assertTrue(arpPacket.getOpCode() == 1);
-        
+
         byte[] senderHwAddress = arpPacket.getSenderHardwareAddress();
-        byte[] senderProtocolAddress = arpPacket.getSenderProtocolAddress(); 
-        
+        byte[] senderProtocolAddress = arpPacket.getSenderProtocolAddress();
+
         byte[] targetHwAddress = arpPacket.getTargetHardwareAddress();
-        byte[] targetProtocolAddress = arpPacket.getTargetProtocolAddress(); 
+        byte[] targetProtocolAddress = arpPacket.getTargetProtocolAddress();
+
 
-        
         Assert.assertTrue(senderHwAddress[0] == (byte)0xA6);
         Assert.assertTrue(senderHwAddress[1] == (byte)0xEC);
         Assert.assertTrue(senderHwAddress[2] == (byte)0x9C);
         Assert.assertTrue(senderHwAddress[3] == (byte)0xAE);
         Assert.assertTrue(senderHwAddress[4] == (byte)0xB2);
         Assert.assertTrue(senderHwAddress[5] == (byte)0x9F);
-        
+
         Assert.assertTrue(senderProtocolAddress[0] == (byte)0x9);
         Assert.assertTrue(senderProtocolAddress[1] == (byte)0x9);
         Assert.assertTrue(senderProtocolAddress[2] == (byte)0x9);
@@ -89,36 +89,36 @@ public class DataPacketServiceTest {
         Assert.assertTrue(targetProtocolAddress[0] == (byte)0x9);
         Assert.assertTrue(targetProtocolAddress[1] == (byte)0x9);
         Assert.assertTrue(targetProtocolAddress[2] == (byte)0x9);
-        Assert.assertTrue(targetProtocolAddress[3] == (byte)0xFE);      
-       }
-       
-       @Test
-       public void DataPacketServiceEncodeTest() throws ConstructionException, InstantiationException, IllegalAccessException {
-               
-               DataPacketService dService = new DataPacketService();
-               Ethernet eth = new Ethernet();
+        Assert.assertTrue(targetProtocolAddress[3] == (byte)0xFE);
+        }
+
+        @Test
+        public void DataPacketServiceEncodeTest() throws ConstructionException, InstantiationException, IllegalAccessException {
+
+                DataPacketService dService = new DataPacketService();
+                Ethernet eth = new Ethernet();
         ARP arp = new ARP();
 
-               byte[] data = null;
-               RawPacket rawPkt;
+                byte[] data = null;
+                RawPacket rawPkt;
 
 
         byte[] dMAC = { 10, 12, 14, 20, 55, 69 };
         byte[] sMAC = { 82, 97, 109, 117, 127, -50 };
         short etherType = 2054;
-        
+
         eth.setDestinationMACAddress(dMAC);
         eth.setSourceMACAddress(sMAC);
         eth.setEtherType(etherType);
-               
+
         arp.setHardwareType((short)1);
         arp.setProtocolType((short)2048);
         arp.setHardwareAddressLength((byte)0x6);
         arp.setProtocolAddressLength((byte)0x4);
         arp.setOpCode((byte)0x1);
-        
+
         byte[] senderHardwareAddress = {(byte)0xA6, (byte)0xEC, (byte)0x9C, (byte)0xAE,
-                                                                       (byte)0xB2, (byte)0x9F};
+                                                                        (byte)0xB2, (byte)0x9F};
         byte[] senderProtocolAddress = {(byte)0x09, (byte)0x09, (byte)0x09, (byte)0x01};
         byte[] targetProtocolAddress = {(byte)0x09, (byte)0x09, (byte)0x09, (byte)0xFE};
         byte[] targetHardwareAddress = {(byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0};
@@ -126,13 +126,13 @@ public class DataPacketServiceTest {
         arp.setSenderProtocolAddress(senderProtocolAddress);
         arp.setTargetHardwareAddress(targetHardwareAddress);
         arp.setTargetProtocolAddress(targetProtocolAddress);
-                
+
         arp.setParent(eth);
         eth.setPayload(arp);
-        
+
         rawPkt = dService.encodeDataPacket(eth);
         data = rawPkt.getPacketData();
-        
+
         Assert.assertTrue(data[0] == (byte)0x0A);//Destination MAC
         Assert.assertTrue(data[1] == (byte)0x0C);
         Assert.assertTrue(data[2] == (byte)0x0E);
@@ -174,7 +174,7 @@ public class DataPacketServiceTest {
         Assert.assertTrue(data[38] == (byte)0x09);//Target Protocol Address
         Assert.assertTrue(data[39] == (byte)0x09);
         Assert.assertTrue(data[40] == (byte)0x09);
-        Assert.assertTrue(data[41] == (byte)0xFE);    
-       }
+        Assert.assertTrue(data[41] == (byte)0xFE);
+        }
 
 }
index 3cacab784663a66919a06ec0bdbb099c68ac709f..ff91e93f58c97e8b4bf234a8b1a601bb05094700 100644 (file)
@@ -19,36 +19,36 @@ import org.slf4j.LoggerFactory;
 
 /**
  * This class represents a configuration manager for the Load Balancer service.
- * This class is responsible for managing(store/update/delete) the load balancer 
+ * This class is responsible for managing(store/update/delete) the load balancer
  * configuration that it receives through REST APIs or from any other applications
  * present in the controller.
  *
  */
 public class ConfigManager implements IConfigManager{
-    
+
     /*
      * Logger instance
      */
     private static final Logger cmLogger = LoggerFactory.getLogger(ConfigManager.class);
-    
+
     /*
-     * All the available VIPs 
+     * All the available VIPs
      */
     private HashMap<String,VIP> vips = new HashMap<String,VIP>();
-    
+
     /*
      * All the available Pools
      */
     private HashMap<String,Pool> pools = new HashMap<String,Pool>();
-    
+
     public ConfigManager(){
     }
-    
+
     @Override
     public boolean vipExists(String name) {
         return this.vips.containsKey(name);
     }
-    
+
     @Override
     public boolean vipExists(VIP vip){
         if(vip.getName()==null){
@@ -64,80 +64,80 @@ public class ConfigManager implements IConfigManager{
         }
         return true;
     }
-    
+
     @Override
     public boolean vipExists(String name,String ip,String protocol,short protocolPort,String poolName){
-        
+
         VIP vip = new VIP(name,ip,protocol,protocolPort,poolName);
-        
+
         //Check VIP with the same name
-        
+
         if(!vips.containsKey(name)){
             //Check VIP with the same ip, protocol and protocolPort
             if(!vips.containsValue(vip)){
-                
+
                 //if you reach here, means this VIP don't exist
                 return false;
             }
         }
-        
+
         //Yeah, i have it.
-       return true;
+        return true;
     }
-    
+
     @Override
     public Set<VIP> getAllVIPs(){
         return new HashSet<VIP>(this.vips.values());
     }
-    
+
     public VIP getVIPWithPoolName(VIP vip){
         cmLogger.info("Search a VIP with name:{}",vip);
         for(VIP vipTemp: this.vips.values()){
             if(vipTemp.equals(vip)){
-                
+
                 cmLogger.info("Found VIP with pool detail : {}",vipTemp);
                 return vipTemp;
             }
         }
-        
+
         cmLogger.info("VIP with pool detail not found ");
         return null;
     }
-    
+
     @Override
     public VIP createVIP(String name,String ip,String protocol,short protocolPort,String poolName){
-        
+
         cmLogger.info("Create VIP with the following details :[ name : "+name
                                                                     +" ip : "+ip
                                                                     +" protocol : "+protocol
                                                                     +" protocol_port : "+protocolPort
                                                                     +" pool name : "+poolName);
-        
+
         VIP vip = new VIP(name,ip,protocol,protocolPort,poolName);
-        
+
         if(poolName !=null && !poolName.isEmpty()){
             if(pools.containsKey(poolName)){
                 pools.get(poolName).addVIP(vip);
             }
         }
-        
+
         vip.setStatus(LBConst.STATUS_ACTIVE);
         this.vips.put(name, vip);
-        
+
         cmLogger.info("New VIP created : "+vip.toString());
         return vip;
     }
-    
+
     @Override
     public String getVIPAttachedPool(String name) {
         return this.vips.get(name).getPoolName();
     }
-    
+
     @Override
     public VIP updateVIP(String name, String poolName){
-        
+
         cmLogger.info("Updating VIP : "+name+" pool name  to "+poolName);
-        
+
         if(vips.containsKey(name)){
             VIP vip = vips.get(name);
             if(vip.getPoolName() == null){
@@ -150,30 +150,30 @@ public class ConfigManager implements IConfigManager{
         cmLogger.error("VIP with name: "+name+" does not exist");
         return null;
     }
-    
+
     @Override
     public VIP deleteVIP(String name){
-        
+
         cmLogger.info("Deleting VIP : "+name);
-        
+
         VIP vip = vips.get(name);
-        
+
         String poolName = vip.getPoolName();
-        
+
         if(poolName != null){
             if(pools.containsKey(poolName)){
                 Pool pool = pools.get(poolName);
                 pool.removeVIP(vip.getName());
             }
         }
-        
+
         cmLogger.info("VIP removed : "+vip.toString());
-        
+
         vips.remove(vip.getName());
-        
+
         return vip;
     }
-    
+
     @Override
     public boolean memberExists(String name, String poolName) {
         if(this.pools.containsKey(poolName)){
@@ -182,89 +182,89 @@ public class ConfigManager implements IConfigManager{
         }
         return false;
     }
-    
+
     @Override
     public boolean memberExists(String name, String memberIP,String poolName){
         if(!this.pools.containsKey(poolName))
             return false;
-        
+
         return this.pools.get(poolName).poolMemberExists(new PoolMember(name, memberIP, poolName));
     }
-    
+
     @Override
     public PoolMember addPoolMember(String name, String memberIP, String poolName){
-        
+
         PoolMember pm = new PoolMember(name,memberIP,poolName);
-        
+
         cmLogger.info("Adding pool member : "+pm.toString());
-        
+
         pools.get(poolName).addMember(pm);
-        
+
         return pm;
     }
-    
+
     @Override
     public PoolMember removePoolMember(String name, String poolName){
-        
+
         cmLogger.info("Removing pool member : {} from pool {}",name, poolName);
-        
+
         Pool pool = pools.get(poolName);
-        
+
         PoolMember pm = pool.getMember(name);
-        
+
         pool.removeMember(name);
-        
+
         cmLogger.info("Pool member {} removed from {} ",name,poolName);
-        
+
         return pm;
     }
-    
+
     @Override
     public Set<Pool> getAllPools(){
         return new HashSet<Pool>(this.pools.values());
     }
-    
+
     @Override
     public boolean poolExists(String name) {
         return this.pools.containsKey(name);
     }
-    
+
     @Override
     public boolean poolExists(String name, String lbMethod){
-        
+
         return pools.containsValue(new Pool(name,lbMethod));
     }
-    
+
     @Override
     public Pool createPool(String name, String lbMethod){
-        
+
         Pool newPool = new Pool(name,lbMethod);
-        
+
         cmLogger.info("New pool created : " + newPool.toString());
-        
+
         pools.put(name, newPool);
-        
+
         return newPool;
     }
-    
+
     @Override
     public Pool deletePool(String poolName){
-        
+
         Pool pool = pools.get(poolName);
-        
+
         for(VIP vip:pool.getAllVip()){
-            
+
             vip.setPoolName(null);
-            
+
         }
-        
+
         cmLogger.info("Pool removed : "+pool.toString());
-        
+
         pools.remove(poolName);
-        
+
         return pool;
     }
-    
+
     @Override
     public Pool getPool( String poolName){
         if(pools.containsKey(poolName)){
@@ -272,16 +272,16 @@ public class ConfigManager implements IConfigManager{
         }
         return null;
     }
-    
+
     @Override
     public Set<PoolMember> getAllPoolMembers(String poolName) {
-        
+
         if(pools.containsKey(poolName)){
             return new HashSet<PoolMember>(pools.get(poolName).getAllMembers());
         }
         return null;
     }
-    
+
     /* (non-Javadoc)
      * @see java.lang.Object#toString()
      */
index df35b0ae1f7f4803b63473dccc200f7a588c6195..5e55b2a3dd3513d1b83956eefb83526a8d655369 100644 (file)
@@ -18,164 +18,164 @@ import org.opendaylight.controller.samples.loadbalancer.entities.VIP;
  *
  */
 public interface IConfigManager {
-    
+
     /**
      * Return all existing VIPs
      * @return Set of VIP's
      * if there is no VIP, it will return empty set.
      */
     public Set<VIP> getAllVIPs();
-    
+
     /**
      * Check if VIP with the 'name' exists
-     * @param name     Name of the VIP 
-     * @return true    if exists
-     *                         false   else
+     * @param name  Name of the VIP
+     * @return  true    if exists
+     *                  false   else
      */
     public boolean vipExists(String name);
 
     /**
-     * Check if VIP exists with the details 'VIP' 
-     * @param vip Search for this VIP 
-     * @return true    if exists
-     *                         false   else
+     * Check if VIP exists with the details 'VIP'
+     * @param vip Search for this VIP
+     * @return  true    if exists
+     *                  false   else
      */
     public boolean vipExists(VIP vip);
 
     /**
      * Check if VIP with the provided details exists
-     * @param name     Name of the VIP
-     * @param ip       IP of the VIP
-     * @param protocol IP Protocol of the VIP (TCP/UDP)
-     * @param protocolPort     Transport port of the VIP (e.g 5550)
-     * @param poolName Name of the pool attached with the VIP
-     * @return true    if exists
-     *                         false   else
+     * @param name  Name of the VIP
+     * @param ip    IP of the VIP
+     * @param protocol  IP Protocol of the VIP (TCP/UDP)
+     * @param protocolPort  Transport port of the VIP (e.g 5550)
+     * @param poolName  Name of the pool attached with the VIP
+     * @return  true    if exists
+     *                  false   else
      */
     public boolean vipExists(String name,String ip,String protocol,short protocolPort,String poolName);
-    
+
     /**
      * Add VIP to the configuration
-     * @param name     Name of the VIP
-     * @param ip       IP of the VIP
-     * @param protocol IP Protocol of the VIP (TCP/UDP)
-     * @param protocolPort     Transport port of the VIP
-     * @param poolName Name of the pool that VIP will use for load balancing its traffic
-     * @return Newly created VIP
+     * @param name  Name of the VIP
+     * @param ip    IP of the VIP
+     * @param protocol  IP Protocol of the VIP (TCP/UDP)
+     * @param protocolPort  Transport port of the VIP
+     * @param poolName  Name of the pool that VIP will use for load balancing its traffic
+     * @return  Newly created VIP
      */
     public VIP createVIP(String name,String ip,String protocol,short protocolPort,String poolName);
-    
+
     /**
      * Return pool attached to VIP
      * @param name Name of the VIP
-     * @return Name of the pool attached to VIP
-     *                         else null
+     * @return  Name of the pool attached to VIP
+     *                  else null
      */
     public String getVIPAttachedPool(String name);
     /**
      * Update pool name of the VIP.
-     * @param name     Name of the VIP
-     * @param poolName Attach this pool to VIP
-     * @return Updated VIP     If successful
-     *                         null                    If this VIP is already attached to any existing pool.
-     */                        
+     * @param name  Name of the VIP
+     * @param poolName  Attach this pool to VIP
+     * @return  Updated VIP     If successful
+     *                  null            If this VIP is already attached to any existing pool.
+     */
     public VIP updateVIP(String name, String poolName);
-    
+
     /**
      * Delete the VIP
-     * @param name     Delete VIP with this name
-     * @return Details of the deleted VIP
+     * @param name  Delete VIP with this name
+     * @return  Details of the deleted VIP
      */
     public VIP deleteVIP(String name);
 
     /**
-     * Check if pool member with the 'name' present in the pool with name 'poolName' 
-     * @param name     Name of the pool member 
-     * @param poolName Name of the pool, you want to search for pool member
-     * @return true    If exist
-     *                         false   else
+     * Check if pool member with the 'name' present in the pool with name 'poolName'
+     * @param name  Name of the pool member
+     * @param poolName  Name of the pool, you want to search for pool member
+     * @return  true    If exist
+     *                  false   else
      */
     public boolean memberExists(String name, String poolName);
 
     /**
      * Check if pool member with name 'name' and IP 'memberIP' exist in the pool 'poolName'
-     * @param name     Name of the pool member
-     * @param memberIP IP of the pool member
-     * @param poolName Name of the pool member you want to search
-     * @return true    If Exist
-     *                         false   else
+     * @param name  Name of the pool member
+     * @param memberIP  IP of the pool member
+     * @param poolName  Name of the pool member you want to search
+     * @return  true    If Exist
+     *                  false   else
      */
     public boolean memberExists(String name, String memberIP,String poolName);
-    
+
     /**
      * Return all  pool members of the pool 'poolName'
-     * @param poolName Name of the pool
-     * @return Set of all the pool members             if pool with the name present in the configuration
-     *                         null                                                    else
-     *                         
+     * @param poolName  Name of the pool
+     * @return  Set of all the pool members     if pool with the name present in the configuration
+     *                  null                            else
+     *
      */
     public Set<PoolMember> getAllPoolMembers(String poolName);
-    
+
     /**
      * Add new pool member to the configuration
-     * @param name     Name of the pool
-     * @param memberIP IP of the pool
-     * @param poolName Attach pool member to this pool
-     * @return Newly created pool member 
+     * @param name  Name of the pool
+     * @param memberIP  IP of the pool
+     * @param poolName  Attach pool member to this pool
+     * @return  Newly created pool member
      */
     public PoolMember addPoolMember(String name, String memberIP, String poolName);
-    
+
     /**
      * Remove pool member from the pool
-     * @param name     Name of the pool member
-     * @param poolName Name of the pool
-     * @return Details of the removed pool member 
+     * @param name  Name of the pool member
+     * @param poolName  Name of the pool
+     * @return  Details of the removed pool member
      */
     public PoolMember removePoolMember(String name, String poolName);
 
     /**
      * Return all the existing pools
-     * @return Set of Pools
+     * @return  Set of Pools
      */
     public Set<Pool> getAllPools();
-    
+
     /**
      * Return pool with input name
-     * @param poolName Name of the pool
-     * @return Details of the pool     if pool exist
-     *                         null                                    else
+     * @param poolName  Name of the pool
+     * @return  Details of the pool     if pool exist
+     *                  null                    else
      */
     public Pool getPool(String poolName);
-    
+
     /**
-     * Check if pool exists with the input name 
-     * @param name     Name of the pool
-     * @return true    If exists
-     *                         false   else
+     * Check if pool exists with the input name
+     * @param name  Name of the pool
+     * @return  true    If exists
+     *                  false   else
      */
     public boolean poolExists(String name);
 
     /**
      * Check if pool exists with the input name and loadbalancing method.
-     * @param name     Name of the pool 
-     * @param lbMethod Load balancing method name
-     * @return true    If exists
-     *                         false   else
+     * @param name  Name of the pool
+     * @param lbMethod  Load balancing method name
+     * @return  true    If exists
+     *                  false   else
      */
     public boolean poolExists(String name, String lbMethod);
-    
+
     /**
      * Create new pool with the provided details
-     * @param name     Name of the pool
-     * @param lbMethod Load balancing method this pool will use
-     * @return Details of the newly created pool
+     * @param name  Name of the pool
+     * @param lbMethod  Load balancing method this pool will use
+     * @return  Details of the newly created pool
      */
     public Pool createPool(String name, String lbMethod);
-    
+
     /**
      * Delete pool with the provided name
-     * @param poolName Name of the pool
-     * @return Details of the deleted pool
+     * @param poolName  Name of the pool
+     * @return  Details of the deleted pool
      */
     public Pool deletePool(String poolName);
 
index 7e93304de10b2294e060b72494febe943e93e683..bd6fb473c1adcaaa098eb7f1e76f624b0fb7f691 100644 (file)
@@ -12,22 +12,21 @@ package org.opendaylight.controller.samples.loadbalancer;
  *
  */
 public class LBConst {
-    
+
     public static final int FORWARD_DIRECTION_LB_FLOW = 0;
-    
+
     public static final int REVERSE_DIRECTION_LB_FLOW = 1;
-    
+
     public static final String ROUND_ROBIN_LB_METHOD = "roundrobin";
-    
+
     public static final String RANDOM_LB_METHOD = "random";
-    
+
     public static final String STATUS_ACTIVE="active";
-    
+
     public static final String STATUS_INACTIVE="inactive";
-    
+
     public static final String STATUS_PENDING="pending";
-    
+
     public static final String STATUS_ERROR="error";
-       
-}
 
+}
index c320250084150ddaac6f4337430b33eea8c9940f..aa195a34e9ceb9487291e4e9f020f8b1acec7244 100644 (file)
@@ -19,36 +19,36 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Class defines utilty methods that will be used by different components 
- * of the load balancer service 
+ * Class defines utilty methods that will be used by different components
+ * of the load balancer service
  *
  */
 public class LBUtil {
-    
+
     private static final Logger lbuLogger = LoggerFactory.getLogger(LBUtil.class);
-    
+
     public LBUtil(){}
-    
+
     /**
-     * Extract the details of the source machine that sent this packet 'inPkt'  
-     * @param inPkt    Packet that is received by the controller
-     * @return Details of the source machine in Client object.
+     * Extract the details of the source machine that sent this packet 'inPkt'
+     * @param inPkt Packet that is received by the controller
+     * @return  Details of the source machine in Client object.
      */
     public Client getClientFromPacket(IPv4 inPkt){
         lbuLogger.info("Find client information from packet : {}",inPkt.toString());
-        
+
         String ip = NetUtils.getInetAddress(inPkt.getSourceAddress()).getHostAddress();
-        
+
         String protocol = IPProtocols.getProtocolName(inPkt.getProtocol());
-        
+
         lbuLogger.info("client ip {} and protocl {}",ip,protocol);
-        
+
         Packet tpFrame= inPkt.getPayload();
-        
+
         lbuLogger.info("Get protocol layer {}",tpFrame.toString());
-        
+
         short port = 0;
-        
+
         if(protocol.equals(IPProtocols.TCP.toString())){
             TCP tcpFrame = (TCP)tpFrame;
             port = tcpFrame.getSourcePort();
@@ -56,47 +56,47 @@ public class LBUtil {
             UDP udpFrame = (UDP)tpFrame;
             port = udpFrame.getSourcePort();
         }
-        
+
         lbuLogger.info("Found port {}",port);
-        
+
         Client source = new Client(ip, protocol,port);
-        
+
         lbuLogger.info("Client information : {}",source.toString());
-        
+
         return source;
     }
-    
+
     /**
      * Extract the details of the destination machine where this packet 'inPkt' need
      * to be delivered
      * @param inPkt Packet that is received by controller for forwarding
-     * @return Details of the destination machine packet in VIP
+     * @return  Details of the destination machine packet in VIP
      */
     public VIP getVIPFromPacket(IPv4 inPkt){
-        
+
         lbuLogger.info("Find VIP information from packet : {}",inPkt.toString());
-        
+
         String ip = NetUtils.getInetAddress(inPkt.getDestinationAddress()).getHostAddress();
-        
+
         String protocol = IPProtocols.getProtocolName(inPkt.getProtocol());
-        
+
         Packet tpFrame= inPkt.getPayload();
-        
+
         short port = 0;
-        
+
         if(protocol.equals(IPProtocols.TCP.toString())){
             TCP tcpFrame = (TCP)tpFrame;
             port = tcpFrame.getDestinationPort();
         }else{
-            
+
             UDP udpFrame = (UDP)tpFrame;
             port = udpFrame.getDestinationPort();
         }
-        
+
         VIP dest = new VIP(null,ip, protocol,port,null);
-        
+
         lbuLogger.info("VIP information : {}",dest.toString());
-        
+
         return dest;
     }
 }
\ No newline at end of file
index 4d7cf4928a6b8684a162e49e29dc00e5e04a3bed..a16582d532dcf145b394c7ff73e86d39d7d7f845 100644 (file)
@@ -17,73 +17,73 @@ package org.opendaylight.controller.samples.loadbalancer.entities;
  * e.g TCP traffic from two different ports from the same host to a given VIP will be considered
  * as two different clients by this service. Similarly, traffic using two different protocols
  * (TCP, UDP) from the same host will be considered as two different clients.
- * 
+ *
  */
 public class Client {
-    
+
     /*
      * IP address of the client (source address)
      */
     private String ip;
-    
+
     /*
      * Network protocol of the traffic sent by client
      */
     private String protocol;
-    
+
     /*
      * Port used to send network traffic (source port)
      */
     private short port;
-    
+
     public Client(String ip, String protocol, short port){
         this.ip = ip;
         this.protocol = protocol;
         this.port = port;
     }
-    
+
     /**
      * @return the client IP
      */
     public String getIp() {
         return ip;
     }
-    
+
     /**
      * @param ip the IP to set
      */
     public void setIp(String ip) {
         this.ip = ip;
     }
-    
+
     /**
      * @return the client network protocol
      */
     public String getProtocol() {
         return protocol;
     }
-    
+
     /**
      * @param protocol the protocol to set
      */
     public void setProtocol(String protocol) {
         this.protocol = protocol;
     }
-    
+
     /**
      * @return the client port
      */
     public short getPort() {
         return port;
     }
-    
+
     /**
      * @param port the port to set
      */
     public void setPort(short port) {
         this.port = port;
     }
-    
+
     /* (non-Javadoc)
      * @see java.lang.Object#hashCode()
      */
@@ -96,7 +96,7 @@ public class Client {
         result = prime * result+ ((protocol == null) ? 0 : protocol.hashCode());
         return result;
     }
-    
+
     /* (non-Javadoc)
      * @see java.lang.Object#equals(java.lang.Object)
      */
@@ -131,7 +131,7 @@ public class Client {
         }
         return true;
     }
-    
+
     /* (non-Javadoc)
      * @see java.lang.Object#toString()
      */
index bbf31162aaf993ed6ea2fd09836e06559c9e8185..ae48a3a45118533785f5c3175a68df107d9c7c0a 100644 (file)
@@ -16,12 +16,12 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 /**
  * This class represents the pool of hosts among which incoming traffic
- * will be load balanced. Each pool will load balance the traffic among its pool members 
- * based on the loadbalancing policy set for the pool. 
+ * will be load balanced. Each pool will load balance the traffic among its pool members
+ * based on the loadbalancing policy set for the pool.
  * Currently, the pool supports two load balancing policies:
  * 1. Round Robin Policy{@link org.opendaylight.controller.samples.loadbalancer.policies.RoundRobinLBPolicy}
  * 2. Random Policy {@link org.opendaylight.controller.samples.loadbalancer.policies.RandomLBPolicy}
- * 
+ *
  * NOTE: After creation of the pool, user can't update (change) its load balancing policy.
  * NOTE: Each Pool should have a unique name.
  */
@@ -29,124 +29,124 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement(name="pool")
 @XmlAccessorType(XmlAccessType.NONE)
 public class Pool {
-    
+
     /*
      * Unique name of the pool
      */
     @XmlElement
     private String name;
-    
+
     /*
      * Associated load balancing policy
      */
     @XmlElement(name="lbmethod")
     private String lbMethod;
-    
+
     /*
      * Status of the pool (active/inactive)
      */
     @XmlElement
     private String status;
-    
+
     /*
      * List of all the VIPs using this pool for load balancing their traffic - more than
      * one VIP can be mapped to each pool.
      */
     @XmlElement
     private ArrayList<VIP> vips = new ArrayList<VIP>();
-    
+
     /*
      * List of all the pool members used for load balancing the traffic
      */
     @XmlElement
     private ArrayList<PoolMember> members = new ArrayList<PoolMember>();
-    
+
     /*
      * Private constructor used for JAXB mapping
      */
     @SuppressWarnings("unused")
     private Pool() {}
-    
+
     /**
      * Getter/ Setter methods
      */
-    
+
     public Pool(String name,
                     String lbMethod) {
         this.name = name;
         this.lbMethod = lbMethod;
     }
-    
+
     /**
      * @return the name
      */
     public String getName() {
         return name;
     }
-    
+
     /**
      * @param name the name to set
      */
     public void setName(String name) {
         this.name = name;
     }
-    
+
     /**
      * @return the lbMethod
      */
     public String getLbMethod() {
         return lbMethod;
     }
-    
+
     /**
      * @param lbMethod the lbMethod to set
      */
     public void setLbMethod(String lbMethod) {
         this.lbMethod = lbMethod;
     }
-    
+
     /**
      * @return the status
      */
     public String getStatus() {
         return status;
     }
-    
+
     /**
      * @param status the status to set
      */
     public void setStatus(String status) {
         this.status = status;
     }
-    
+
     /**
      * @return the vip
      */
     public ArrayList<VIP> getAllVip() {
         return vips;
     }
-    
+
     /**
      * @param vip the vip to set
      */
     public void setVips(ArrayList<VIP> vips) {
         this.vips = vips;
     }
-    
+
     /**
      * @return the members
      */
     public ArrayList<PoolMember> getAllMembers() {
         return members;
     }
-    
+
     /**
      * @param members the members to set
      */
     public void setMembers(ArrayList<PoolMember> members) {
         this.members = members;
     }
-    
+
     /**
      * Add new VIP to the VIP list
      * @param vip       new VIP to add
@@ -154,11 +154,11 @@ public class Pool {
     public void addVIP(VIP vip){
         this.vips.add(vip);
     }
-    
+
     /**
      * Remove VIP with given name from the VIP list of the pool
      * @param name      Name of the VIP
-     * @return true     If VIP was using this pool and removed
+     * @return  true     If VIP was using this pool and removed
      *          false   IF VIP is not using this pool
      */
     public boolean removeVIP(String name){
@@ -170,25 +170,25 @@ public class Pool {
         }
         return false;
     }
-    
+
     /**
      * Check if the given pool member is part of this pool
      * @param pm        Search for this pool member
-     * @return true     If pool member is attached to this pool
+     * @return  true     If pool member is attached to this pool
      *          false   else
      */
     public boolean poolMemberExists(PoolMember pm){
         return this.members.contains(pm);
     }
-    
+
     /**
      * Returns the pool member with the given name
      * @param name      Search for this pool member
-     * @return PoolMember       If pool member is attached to this pool
+     * @return  PoolMember       If pool member is attached to this pool
      *          null            else
      */
     public PoolMember getMember(String name){
-        
+
         for(PoolMember pm: this.members){
             if(pm.getName().equals(name)){
                 return pm;
@@ -196,7 +196,7 @@ public class Pool {
         }
         return null;
     }
-    
+
     /**
      * Add new pool member to the pool
      * @param pm        Add this new pool
@@ -204,12 +204,12 @@ public class Pool {
     public void addMember(PoolMember pm){
         this.members.add(pm);
     }
-    
+
     /**
      * Remove pool member from the pool list
      * @param name Remove this pool member
-     * @return true    If pool member was attached to this pool and successfully removed
-     *          false  If pool member is not attached to this pool
+     * @return  true    If pool member was attached to this pool and successfully removed
+     *          false   If pool member is not attached to this pool
      */
     public boolean removeMember(String name){
         for(PoolMember pm: this.members){
@@ -220,7 +220,7 @@ public class Pool {
         }
         return false;
     }
-    
+
     /* (non-Javadoc)
      * @see java.lang.Object#hashCode()
      */
@@ -232,7 +232,7 @@ public class Pool {
         result = prime * result + ((name == null) ? 0 : name.hashCode());
         return result;
     }
-    
+
     /* (non-Javadoc)
      * @see java.lang.Object#equals(java.lang.Object)
      */
@@ -264,7 +264,7 @@ public class Pool {
         }
         return true;
     }
-    
+
     /* (non-Javadoc)
      * @see java.lang.Object#toString()
      */
index 31297ebcce8f27b27a8cf9bea1ab3ddfd333b4f2..31949b43d48311c52f884ee262a0131ead4b3ee6 100644 (file)
@@ -17,111 +17,111 @@ import javax.xml.bind.annotation.XmlRootElement;
  * This class represents the host where load balancing service will
  * redirect VIP traffic for load balancing. All these hosts have to
  * register with a pool to be a part of traffic load balancing.
- * This entity is referred to as a 'PoolMember'. 
- * Load balancer service differentiates each pool member based on its 
+ * This entity is referred to as a 'PoolMember'.
+ * Load balancer service differentiates each pool member based on its
  * two properties { ip address, attached pool }.
  * A host (IP) can be attached to two different pools through creation of two
  * different pool member objects.
- * 
+ *
  * NOTE: Each pool member should have a unique name.
  *
  */
 @XmlRootElement(name="poolmember")
 @XmlAccessorType(XmlAccessType.NONE)
 public class PoolMember {
-    
+
     /*
      * Unique name of the pool member
      */
     @XmlElement
     private String name;
-    
+
     /*
      * IP address of the pool member
      */
     @XmlElement
     private String ip;
-    
+
     /*
      * Name of the pool this member is attached to.
      */
     @XmlElement(name="poolname")
     private String poolName;
-    
+
     /*
      * Status (active/inactive)
      */
     @XmlElement
     private String status;
-    
+
     /**
      * Private constructor used for JAXB mapping
      */
     @SuppressWarnings("unused")
     private PoolMember() {}
-    
+
     public PoolMember(String name, String memberIP, String poolName){
         this.name = name;
         this.ip = memberIP;
         this.poolName = poolName;
     }
-    
+
     /**
      * @return the name
      */
     public String getName() {
         return name;
     }
-    
+
     /**
      * @param name the name to set
      */
     public void setName(String name) {
         this.name = name;
     }
-    
+
     /**
      * @return the ip
      */
     public String getIp() {
         return ip;
     }
-    
+
     /**
      * @param ip the ip to set
      */
     public void setIp(String ip) {
         this.ip = ip;
     }
-    
+
     /**
      * @return the poolName
      */
     public String getPoolName() {
         return poolName;
     }
-    
+
     /**
      * @param poolName the poolName to set
      */
     public void setPoolName(String poolName) {
         this.poolName = poolName;
     }
-    
+
     /**
      * @return the status
      */
     public String getStatus() {
         return status;
     }
-    
+
     /**
      * @param status the status to set
      */
     public void setStatus(String status) {
         this.status = status;
     }
-    
+
     /* (non-Javadoc)
      * @see java.lang.Object#hashCode()
      */
@@ -134,7 +134,7 @@ public class PoolMember {
                 + ((poolName == null) ? 0 : poolName.hashCode());
         return result;
     }
-    
+
     /* (non-Javadoc)
      * @see java.lang.Object#equals(java.lang.Object)
      */
index 6f866fe23f0b2521739ec56f7e7afdff6f062df5..22a7109f59c87c027f7da8d084d52872995e2180 100644 (file)
@@ -18,47 +18,47 @@ import javax.xml.bind.annotation.XmlRootElement;
  * 1. IP address of the VIP exposed by the application
  * 2. Protocol of the network traffic (TCP/UDP)
  * 3. Port to which incoming traffic is destined
- * 
- * User is allowed to create mutliple VIPs with the same IP, but all such VIPs (with the same IP) 
+ *
+ * User is allowed to create mutliple VIPs with the same IP, but all such VIPs (with the same IP)
  * should differ at least in the protocol or port or both.
- * 
+ *
  * NOTE: Each VIP should have a unique name.
  */
 @XmlRootElement(name="vip")
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class VIP {
-    
+
     /*
      * Unique name of the VIP
      */
     @XmlElement
     private String name;
-    
+
     /*
-     * Virtual IP address of the VIP 
+     * Virtual IP address of the VIP
      */
     @XmlElement
     private String ip;
-    
+
     /*
-     * Network traffic protocol 
+     *  Network traffic protocol
      */
     @XmlElement
     private String protocol;
-    
+
     /*
      * Port where network traffic is destined (destination port)
      */
     @XmlElement
     private short port;
-    
+
     /*
      * Name of the pool attached to the VIP for load balancing its traffic
      */
     @XmlElement(name="poolname")
     private String poolName;
-    
+
     /*
      * Status (Active/inactive)
      */
@@ -70,7 +70,7 @@ public class VIP {
      */
     @SuppressWarnings("unused")
     private VIP() {}
-    
+
     public VIP(String name,
                 String ip,
                 String protocol,
@@ -82,61 +82,61 @@ public class VIP {
         this.port = port;
         this.poolName = poolName;
     }
-    
+
     public String getName() {
         return name;
     }
-    
+
     public void setName(String name) {
         this.name = name;
     }
-    
+
     public String getIp() {
         return ip;
     }
-    
+
     public void setIp(String ip) {
         this.ip = ip;
     }
-    
+
     public String getProtocol() {
         return protocol;
     }
-    
+
     public void setProtocol(String protocol) {
         this.protocol = protocol;
     }
-    
+
     public short getPort() {
         return port;
     }
-    
+
     public void setPort(short port) {
         this.port = port;
     }
-    
+
     public String getPoolName() {
         return poolName;
     }
-    
+
     public void setPoolName(String poolName) {
         this.poolName = poolName;
     }
-    
+
     /**
      * @return the status
      */
     public String getStatus() {
         return status;
     }
-    
+
     /**
      * @param status the status to set
      */
     public void setStatus(String status) {
         this.status = status;
     }
-    
+
     /* (non-Javadoc)
      * @see java.lang.Object#hashCode()
      */
@@ -150,7 +150,7 @@ public class VIP {
                 + ((protocol == null) ? 0 : protocol.hashCode());
         return result;
     }
-    
+
     /* (non-Javadoc)
      * @see java.lang.Object#equals(java.lang.Object)
      */
@@ -158,7 +158,7 @@ public class VIP {
     public boolean equals(Object obj) {
         if (this == obj) {
             return true;
-            
+
         }
         if (obj == null) {
             return false;
@@ -166,7 +166,7 @@ public class VIP {
         if (!(obj instanceof VIP)) {
             return false;
         }
-        
+
         VIP other = (VIP) obj;
         if (ip == null) {
             if (other.ip != null) {
@@ -187,7 +187,7 @@ public class VIP {
         }
         return true;
     }
-    
+
     /* (non-Javadoc)
      * @see java.lang.Object#toString()
      */
index 0568fced6ea4faa9534684d7b9fa8a9d7b7c6aa0..fc78a72eaf0ff08b9b8a1010a04a9dc76b2a82e0 100644 (file)
@@ -23,13 +23,13 @@ import org.opendaylight.controller.sal.routing.IRouting;
 import org.opendaylight.controller.samples.loadbalancer.IConfigManager;
 
 /**
- * Main application activator class for registering the dependencies and 
+ * Main application activator class for registering the dependencies and
  * initialising the load balancer application.
  *
  */
 
 public class Activator extends ComponentActivatorAbstractBase {
-    
+
     /*
      * Logger instance
      */
@@ -86,13 +86,13 @@ public class Activator extends ComponentActivatorAbstractBase {
             props.put("salListenerName", "loadbalancer");
 
             c.setInterface(new String[] { IListenDataPacket.class.getName(),
-                       IConfigManager.class.getName()}, props);
+                        IConfigManager.class.getName()}, props);
 
             c.add(createContainerServiceDependency(containerName).setService(
                     IDataPacketService.class).setCallbacks(
                     "setDataPacketService", "unsetDataPacketService")
                     .setRequired(true));
-            
+
             c.add(createContainerServiceDependency(containerName).setService(
                     IRouting.class).setCallbacks("setRouting", "unsetRouting")
                     .setRequired(false));
index ddfde38931f5db3544ef323dab11ec8222cd629d..7eaa8b4ec03377cf429c67d670341dd74d20aa57 100644 (file)
@@ -56,78 +56,78 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * This class is the main class that represents the load balancer service. 
- * This is a sample load balancer application that balances traffic to backend servers 
- * based on the source address and source port on each incoming packet.  The service 
+ * This class is the main class that represents the load balancer service.
+ * This is a sample load balancer application that balances traffic to backend servers
+ * based on the source address and source port on each incoming packet.  The service
  * reactively installs OpenFlow rules to direct all packets with a specific source address
- * and source port to one of the appropriate backend servers.  The servers may be chosen 
- * using a round robin policy or a random policy. This service can be configured via a 
+ * and source port to one of the appropriate backend servers.  The servers may be chosen
+ * using a round robin policy or a random policy. This service can be configured via a
  * REST APIs which are similar to the OpenStack Quantum LBaaS (Load-balancer-as-a-Service)
  * v1.0 API proposal (http://wiki.openstack.org/Quantum/LBaaS)
- * 
+ *
  * To use this service, a virtual IP (or VIP) should be exposed to the clients of this service
  * and used as the destination address. A VIP is a entity that comprises of a virtual IP, port
  * and protocol (TCP or UDP).
  * Assumptions:
  *      1. One or more VIPs may be mapped to the same server pool. All VIPs that share the same
  *      pool must also share the same load balancing policy (random or round robin).
- *      
+ *
  *      2. Only one server pool can be be assigned to a VIP.
- *      
+ *
  *      3. All flow rules are installed with an idle timeout of 5 seconds.
- *      
+ *
  *      4. Packets to a VIP must leave the OpenFlow  cluster from the same switch from where
  *      it entered it.
- *      
+ *
  *      5. When you delete a VIP or a server pool or a server from a pool, the service does not
  *      delete the flow rules it has already installed. The flow rules should automatically
- *      time out after the idle timeout of 5 seconds. 
+ *      time out after the idle timeout of 5 seconds.
  *
  */
 public class LoadBalancerService implements IListenDataPacket, IConfigManager{
-    
+
     /*
      * Logger instance
      */
     private static Logger lbsLogger = LoggerFactory.getLogger(LoadBalancerService.class);
-    
+
     /*
      * Single instance of the configuration manager. Application passes this reference to all
      * the new policies implemented for load balancing.
      */
     private static ConfigManager configManager = new ConfigManager();
-    
+
     /*
      * Round robing policy instance. Need to implement factory patterns to get
      * policy instance.
      */
     private static RoundRobinLBPolicy rrLBMethod= new RoundRobinLBPolicy(configManager);
-    
+
     /*
      * Random policy instance.
      */
     private static RandomLBPolicy ranLBMethod= new RandomLBPolicy(configManager);
-    
+
     /*
      * Reference to the data packet service
      */
     private IDataPacketService dataPacketService = null;
-    
+
     /*
      * Reference to the host tracker service
      */
     private IfIptoHost hostTracker;
-    
+
     /*
      * Reference to the forwarding manager
      */
     private IForwardingRulesManager ruleManager;
-    
+
     /*
      * Reference to the routing service
      */
     private IRouting routing;
-    
+
     /*
      * Load balancer application installs all flows with priority 2.
      */
@@ -139,7 +139,7 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager{
     private String containerName = null;
 
     /*
-     * Set/unset methods for the service instance that load balancer 
+     * Set/unset methods for the service instance that load balancer
      * service requires
      */
     public String getContainerName() {
@@ -147,7 +147,7 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager{
             return GlobalConstants.DEFAULT.toString();
         return containerName;
     }
-    
+
     void setDataPacketService(IDataPacketService s) {
         this.dataPacketService = s;
     }
@@ -157,7 +157,7 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager{
             this.dataPacketService = null;
         }
     }
-    
+
     public void setRouting(IRouting routing) {
         this.routing = routing;
     }
@@ -169,7 +169,7 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager{
     }
 
     public void setHostTracker(IfIptoHost hostTracker) {
-       lbsLogger.debug("Setting HostTracker");
+        lbsLogger.debug("Setting HostTracker");
         this.hostTracker = hostTracker;
     }
 
@@ -181,7 +181,7 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager{
 
     public void setForwardingRulesManager(
             IForwardingRulesManager forwardingRulesManager) {
-       lbsLogger.debug("Setting ForwardingRulesManager");
+        lbsLogger.debug("Setting ForwardingRulesManager");
         this.ruleManager = forwardingRulesManager;
     }
 
@@ -194,68 +194,68 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager{
 
     /**
      * This method receives first packet of flows for which there is no
-     * matching flow rule installed on the switch. IP addresses used for VIPs 
+     * matching flow rule installed on the switch. IP addresses used for VIPs
      * are not supposed to be used by any real/virtual host in the network.
      * Hence, any forwarding/routing service will not install any flows rules matching
      * these VIPs. This ensures that all the flows destined for VIPs will not find a match
      * in the switch and will be forwarded to the load balancing service.
-     * Service will decide where to route this traffic based on the load balancing 
-     * policy of the VIP's attached pool and will install appropriate flow rules 
-     * in a reactive manner. 
+     * Service will decide where to route this traffic based on the load balancing
+     * policy of the VIP's attached pool and will install appropriate flow rules
+     * in a reactive manner.
      */
     @Override
     public PacketResult receiveDataPacket(RawPacket inPkt){
-        
+
         if (inPkt == null) {
             return PacketResult.IGNORED;
         }
-        
+
         Packet formattedPak = this.dataPacketService.decodeDataPacket(inPkt);
-        
+
         if (formattedPak instanceof Ethernet) {
             byte[] vipMacAddr = ((Ethernet) formattedPak).getDestinationMACAddress();
             Object ipPkt = formattedPak.getPayload();
-            
+
             if (ipPkt instanceof IPv4) {
-                
+
                 lbsLogger.debug("Packet recieved from switch : {}",inPkt.getIncomingNodeConnector().getNode().toString());
                 IPv4 ipv4Pkt = (IPv4)ipPkt;
                 if(IPProtocols.getProtocolName(ipv4Pkt.getProtocol()).equals(IPProtocols.TCP.toString())
                         || IPProtocols.getProtocolName(ipv4Pkt.getProtocol()).equals(IPProtocols.UDP.toString())){
-                    
+
                     lbsLogger.debug("Packet protocol : {}",IPProtocols.getProtocolName(ipv4Pkt.getProtocol()));
                     Client client = new LBUtil().getClientFromPacket(ipv4Pkt);
                     VIP vip = new LBUtil().getVIPFromPacket(ipv4Pkt);
-                    
+
                     if(configManager.vipExists(vip)){
                         VIP vipWithPoolName = configManager.getVIPWithPoolName(vip);
                         String poolMemberIp = null;
                         if(configManager.getPool(vipWithPoolName.getPoolName()).getLbMethod().equalsIgnoreCase(LBConst.ROUND_ROBIN_LB_METHOD)){
-                            
+
                             poolMemberIp = rrLBMethod.getPoolMemberForClient(client,vipWithPoolName);
                         }
-                        
+
                         if(configManager.getPool(vipWithPoolName.getPoolName()).getLbMethod().equalsIgnoreCase(LBConst.RANDOM_LB_METHOD)){
                             poolMemberIp = ranLBMethod.getPoolMemberForClient(client,vipWithPoolName);
                         }
-                        
+
                         try {
-                            
+
                             Node clientNode = inPkt.getIncomingNodeConnector().getNode();
                             HostNodeConnector hnConnector = this.hostTracker.hostFind(InetAddress.getByName(poolMemberIp));
-                            
+
                             Node destNode = hnConnector.getnodeconnectorNode();
-                            
+
                             lbsLogger.debug("Client is connected to switch : {}",clientNode.toString());
                             lbsLogger.debug("Destination pool machine is connected to switch : {}",destNode.toString());
-                            
+
                             //Get path between both the nodes
                             Path route = this.routing.getRoute(clientNode, destNode);
-                            
+
                             lbsLogger.info("Path between source (client) and destination switch nodes : {}",route.toString());
-                            
+
                             NodeConnector forwardPort = route.getEdges().get(0).getTailNodeConnector();
-                            
+
                             if(installLoadBalancerFlow(client,
                                                             vip,
                                                             clientNode,
@@ -268,7 +268,7 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager{
                             }else{
                                 lbsLogger.error("Not able to route traffic from client : {}",client );
                             }
-                            
+
                             if(installLoadBalancerFlow(client,
                                                             vip,
                                                             clientNode,
@@ -291,7 +291,7 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager{
         }
         return PacketResult.IGNORED;
     }
-    
+
     /*
      * This method installs the flow rule for routing the traffic between two hosts.
      * @param source    Traffic is sent by this source
@@ -301,21 +301,21 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager{
      * @param destMachineMac    MAC address of the pool member where traffic needs to be routed
      * @param outport   Use this port to send out traffic
      * @param flowDirection     FORWARD_DIRECTION_LB_FLOW or REVERSE_DIRECTION_LB_FLOW
-     * @return true     If flow installation was successful
-     *          false  else
+     * @return  true     If flow installation was successful
+     *          false   else
      *          @throws UnknownHostException
      */
     private boolean installLoadBalancerFlow(Client source,
                                             VIP dest,
                                             Node sourceSwitch,
                                             String destMachineIp,
-                                            byte[] destMachineMac, 
+                                            byte[] destMachineMac,
                                             NodeConnector outport,
                                             int flowDirection) throws UnknownHostException{
-        
+
         Match match = new Match();
         List<Action> actions = new ArrayList<Action>();
-        
+
         if(flowDirection == LBConst.FORWARD_DIRECTION_LB_FLOW){
             match.setField(MatchType.DL_TYPE, EtherTypes.IPv4.shortValue());
             match.setField(MatchType.NW_SRC, InetAddress.getByName(source.getIp()));
@@ -323,11 +323,11 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager{
             match.setField(MatchType.NW_PROTO, IPProtocols.getProtocolNumberByte(dest.getProtocol()));
             match.setField(MatchType.TP_SRC, source.getPort());
             match.setField(MatchType.TP_DST, dest.getPort());
-            
+
             actions.add(new SetNwDst(InetAddress.getByName(destMachineIp)));
             actions.add(new SetDlDst(destMachineMac));
         }
-        
+
         if(flowDirection == LBConst.REVERSE_DIRECTION_LB_FLOW){
             match.setField(MatchType.DL_TYPE, EtherTypes.IPv4.shortValue());
             match.setField(MatchType.NW_SRC, InetAddress.getByName(destMachineIp));
@@ -335,37 +335,37 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager{
             match.setField(MatchType.NW_PROTO, IPProtocols.getProtocolNumberByte(source.getProtocol()));
             match.setField(MatchType.TP_SRC, dest.getPort());
             match.setField(MatchType.TP_DST,source.getPort());
-            
+
             actions.add(new SetNwSrc(InetAddress.getByName(dest.getIp())));
             actions.add(new SetDlSrc(destMachineMac));
         }
-        
+
         actions.add(new Output(outport));
-        
+
         // Make sure the priority for IP switch entries is
         // set to a level just above default drop entries
-        
+
         Flow flow = new Flow(match, actions);
         flow.setIdleTimeout((short) 5);
         flow.setHardTimeout((short) 0);
         flow.setPriority(LB_IPSWITCH_PRIORITY);
-        
+
         String policyName = source.getIp()+":"+source.getProtocol()+":"+source.getPort();
         String flowName =null;
-        
+
         if(flowDirection == LBConst.FORWARD_DIRECTION_LB_FLOW){
             flowName = "["+policyName+":"+source.getIp() + ":"+dest.getIp()+"]";
         }
-        
+
         if(flowDirection == LBConst.REVERSE_DIRECTION_LB_FLOW){
-            
+
             flowName = "["+policyName+":"+dest.getIp() + ":"+source.getIp()+"]";
         }
-        
+
         FlowEntry fEntry = new FlowEntry(policyName, flowName, flow, sourceSwitch);
-        
+
         lbsLogger.info("Install flow entry {} on node {}",fEntry.toString(),sourceSwitch.toString());
-        
+
         if(!this.ruleManager.checkFlowEntryConflict(fEntry)){
             if(this.ruleManager.installFlowEntry(fEntry).isSuccess()){
                 return true;
@@ -377,7 +377,7 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager{
         }
         return false;
     }
-    
+
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
@@ -387,16 +387,16 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager{
         Dictionary<?, ?> props = c.getServiceProperties();
         if (props != null) {
             this.containerName = (String) props.get("containerName");
-            
+
             lbsLogger.info("Running container name:" + this.containerName);
         }else {
-            
+
             // In the Global instance case the containerName is empty
             this.containerName = "";
         }
         lbsLogger.info(configManager.toString());
     }
-    
+
     /**
      * Function called by the dependency manager when at least one
      * dependency become unsatisfied or when the component is shutting
@@ -426,106 +426,106 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager{
 
     /*
      * All the methods below are just proxy methods to direct the REST API requests to configuration
-     * manager. We need this redirection as currently, opendaylight supports only one 
-     * implementation of the service. 
+     * manager. We need this redirection as currently, opendaylight supports only one
+     * implementation of the service.
      */
     @Override
     public Set<VIP> getAllVIPs() {
         return configManager.getAllVIPs();
     }
-    
+
     @Override
     public boolean vipExists(String name, String ip, String protocol,
                                 short protocolPort, String poolName) {
         return configManager.vipExists(name, ip, protocol, protocolPort, poolName);
     }
-    
+
     @Override
     public boolean vipExists(VIP vip) {
         return configManager.vipExists(vip);
     }
-    
+
     @Override
     public VIP createVIP(String name, String ip, String protocol,
                             short protocolPort, String poolName) {
         return configManager.createVIP(name, ip, protocol, protocolPort, poolName);
     }
-    
+
     @Override
     public VIP updateVIP(String name, String poolName) {
         return configManager.updateVIP(name, poolName);
     }
-    
+
     @Override
     public VIP deleteVIP(String name) {
         return configManager.deleteVIP(name);
     }
-    
+
     @Override
     public boolean memberExists(String name, String memberIP, String poolName) {
         return configManager.memberExists(name, memberIP, poolName);
     }
-    
+
     @Override
     public Set<PoolMember> getAllPoolMembers(String poolName) {
-        
+
         return configManager.getAllPoolMembers(poolName);
     }
-    
+
     @Override
-    public PoolMember addPoolMember(String name, 
+    public PoolMember addPoolMember(String name,
                                     String memberIP,
                                     String poolName) {
         return configManager.addPoolMember(name, memberIP, poolName);
     }
-    
+
     @Override
     public PoolMember removePoolMember(String name, String poolName) {
-        
+
         return configManager.removePoolMember(name, poolName);
     }
-    
+
     @Override
     public Set<Pool> getAllPools() {
-        
+
         return configManager.getAllPools();
     }
-    
+
     @Override
     public Pool getPool(String poolName) {
         return configManager.getPool(poolName);
     }
-    
+
     @Override
     public boolean poolExists(String name, String lbMethod) {
         return configManager.poolExists(name, lbMethod);
     }
-    
+
     @Override
     public Pool createPool(String name, String lbMethod) {
         return configManager.createPool(name, lbMethod);
     }
-    
+
     @Override
     public Pool deletePool(String poolName) {
         return configManager.deletePool(poolName);
     }
-    
+
     @Override
     public boolean vipExists(String name) {
         return configManager.vipExists(name);
     }
-    
+
     @Override
     public boolean memberExists(String name, String poolName) {
         return configManager.memberExists(name, poolName);
     }
-    
+
     @Override
     public boolean poolExists(String name) {
         return configManager.poolExists(name);
     }
-    
+
     @Override
     public String getVIPAttachedPool(String name) {
         return configManager.getVIPAttachedPool(name);
index d69c63c20081a47e9c654bdeb29b3febccc0806e..f9562d6c523b10da5723f2a6efba3b2798be2a79 100644 (file)
@@ -14,16 +14,16 @@ import org.opendaylight.controller.samples.loadbalancer.entities.VIP;
  * All new load balancer policies must implement this interface.
  */
 public interface ILoadBalancingPolicy {
-    
+
     /**
      * Returns IP address of the next pool member from the pool
      * to which the load balancer service can direct incoming packets.
      * @param source    source on the packet
      * @param dest      virtual IP (VIP) that is used as destination on the packet
-     * @return IP address of the next pool member which will serve
+     * @return  IP address of the next pool member which will serve
      *          all incoming traffic destined for the given VIP and with the given source
      *          information
      */
     public String getPoolMemberForClient(Client source, VIP dest);
-    
+
 }
\ No newline at end of file
index b4b616f3a8027571ad173533b7c79a0b55bd7d82..ba5d5babb6d117e47fbb8413ae13e8e6c19c4cf2 100644 (file)
@@ -24,31 +24,31 @@ import org.slf4j.LoggerFactory;
  *
  */
 public class RandomLBPolicy implements ILoadBalancingPolicy {
-    
+
     /*
      * Instance logger
      */
     private static final Logger rLogger = LoggerFactory.getLogger(RandomLBPolicy.class);
-    
+
     /*
-     * Reference to the configuration manager. This reference is passed from load balancer 
+     * Reference to the configuration manager. This reference is passed from load balancer
      * class.
      */
     private ConfigManager cmgr;
-    
+
     /*
      * Mapping between the client and the pool member that serves all traffic for that client.
      */
     private HashMap<Client, PoolMember> clientMemberMap;
-    
+
     /*
      * Random generator
      */
     Random randomGenerator = null;
-    
+
     @SuppressWarnings("unused")
     private RandomLBPolicy(){}
-    
+
     public RandomLBPolicy(ConfigManager cmgr){
         this.cmgr = cmgr;
         this.clientMemberMap = new HashMap<Client, PoolMember>();
@@ -56,13 +56,13 @@ public class RandomLBPolicy implements ILoadBalancingPolicy {
     }
     @Override
     public String getPoolMemberForClient(Client source, VIP dest){
-        
+
         rLogger.info("Received traffic from client : {} for VIP : {} ",source, dest);
-        
+
         syncWithLoadBalancerData();
-        
+
         PoolMember pm= null;
-        
+
         if(this.clientMemberMap.containsKey(source)){
             pm= this.clientMemberMap.get(source);
             rLogger.info("Client {} had sent traffic before,new traffic will be routed to the same pool member {}",source,pm);
@@ -76,7 +76,7 @@ public class RandomLBPolicy implements ILoadBalancingPolicy {
         }
         return pm.getIp();
     }
-    
+
     /*
      * This method does the clean up. Whenever a new client packet arrives with a given VIP,
      * this method checks the current configuration to see if any pool members have been deleted and
@@ -84,25 +84,25 @@ public class RandomLBPolicy implements ILoadBalancingPolicy {
      */
     private void syncWithLoadBalancerData(){
         rLogger.debug("[Client - PoolMember] table before cleanup : {}",this.clientMemberMap.toString());
-        
+
         ArrayList<Client> removeClient = new ArrayList<Client>();
-        
+
         if(this.clientMemberMap.size() != 0){
             for(Client client : this.clientMemberMap.keySet()){
-                
+
                 if(!this.cmgr.memberExists(this.clientMemberMap.get(client).getName(),
                                                 this.clientMemberMap.get(client).getPoolName())){
                     removeClient.add(client);
                 }
             }
         }
-        
+
         for(Client client : removeClient){
             this.clientMemberMap.remove(client);
-            
+
             rLogger.debug("Removed client : {} ",client);
         }
         rLogger.debug("[Client - PoolMember] table after cleanup : {}",this.clientMemberMap.toString());
     }
-    
+
 }
index f1011dddc5fdf6f054db30603b1f60b0a7a35a50..c8687883e7e08cc0711a4d53a34762471fe06bb0 100644 (file)
@@ -23,23 +23,23 @@ import org.slf4j.LoggerFactory;
  *
  */
 public class RoundRobinLBPolicy implements ILoadBalancingPolicy{
-    
+
     /*
      * Logger instance
      */
     private static final Logger rrLogger = LoggerFactory.getLogger(RoundRobinLBPolicy.class);
-    
+
     /*
-     * Reference to the configuration manager. This reference is passed from load balancer 
+     * Reference to the configuration manager. This reference is passed from load balancer
      * class.
      */
     private ConfigManager cmgr;
-    
+
     /*
      * Mapping between the client and the pool member that serves all traffic for that client.
      */
     private HashMap<Client, PoolMember> clientMemberMap;
-    
+
     /*
      * Maintains the next pool member counter for the VIPs.
      * More than one VIP can be attached to one pool, so each VIP
@@ -47,34 +47,34 @@ public class RoundRobinLBPolicy implements ILoadBalancingPolicy{
      * the same pool.
      */
     private HashMap<VIP,Integer> nextItemFromPool;
-    
+
     @SuppressWarnings("unused")
     private RoundRobinLBPolicy(){}
-    
+
     public RoundRobinLBPolicy(ConfigManager cmgr){
         this.cmgr = cmgr;
         this.clientMemberMap = new HashMap<Client, PoolMember>();
         this.nextItemFromPool = new HashMap<VIP, Integer>();
     }
-    
+
     @Override
     public String getPoolMemberForClient(Client source, VIP dest){
-        
+
         rrLogger.info("Received traffic from client : {} for VIP : {} ",source, dest);
-        
+
         syncWithLoadBalancerData();
-        
+
         PoolMember pm= null;
-        
+
         if(this.clientMemberMap.containsKey(source)){
-            
+
             pm= this.clientMemberMap.get(source);
             rrLogger.info("Client {} had sent traffic before,new traffic will be routed to the same pool member {}",source,pm);
         }else{
-            
+
             Pool pool = null;
             if(nextItemFromPool.containsKey(dest)){
-                
+
                 int memberNum = nextItemFromPool.get(dest).intValue();
                 rrLogger.debug("Packet is from new client for VIP {}",dest);
                 pool = this.cmgr.getPool(dest.getPoolName());
@@ -82,19 +82,19 @@ public class RoundRobinLBPolicy implements ILoadBalancingPolicy{
                 this.clientMemberMap.put(source, pm );
                 rrLogger.info("New client's packet will be directed to pool member {}",pm);
                 memberNum++;
-                
+
                 if(memberNum > pool.getAllMembers().size()-1){
                     memberNum = 0;
                 }
                 rrLogger.debug("Next pool member for new client of VIP is set to {}",pool.getAllMembers().get(memberNum));
-                
+
                 this.nextItemFromPool.put(dest, new Integer(memberNum));
             }else{
                 rrLogger.debug("Network traffic for VIP : {} has appeared first time from client {}",dest,source);
                 pool = this.cmgr.getPool(dest.getPoolName());
                 pm = pool.getAllMembers().get(0);
                 this.clientMemberMap.put(source, pm);
-                
+
                 rrLogger.info("Network traffic from client {} will be directed to pool member {}",pm);
                 this.nextItemFromPool.put(dest, new Integer(1));
                 rrLogger.debug("Next pool member for new client of VIP is set to {}",pool.getAllMembers().get(1));
@@ -102,7 +102,7 @@ public class RoundRobinLBPolicy implements ILoadBalancingPolicy{
         }
         return pm.getIp();
     }
-    
+
     /*
      * This method does the clean up. Whenever a new client packet arrives with a given VIP,
      * this method checks the current configuration to see if any pool members have been deleted and
@@ -111,43 +111,43 @@ public class RoundRobinLBPolicy implements ILoadBalancingPolicy{
     private void syncWithLoadBalancerData(){
         rrLogger.debug("[Client - PoolMember] table before cleanup : {}",this.clientMemberMap.toString());
         ArrayList<Client> removeClient = new ArrayList<Client>();
-        
+
         if(this.clientMemberMap.size() != 0){
             for(Client client : this.clientMemberMap.keySet()){
                 if(!this.cmgr.memberExists(this.clientMemberMap.get(client).getName(),
                                             this.clientMemberMap.get(client).getPoolName())){
-                    
+
                     removeClient.add(client);
                 }
             }
         }
-        
+
         for(Client client : removeClient){
             this.clientMemberMap.remove(client);
-            
+
             rrLogger.debug("Removed client : {} ",client);
         }
         rrLogger.debug("[Client - PoolMember] table after cleanup : {}",this.clientMemberMap.toString());
-        
+
         rrLogger.debug("[VIP- NextMember] table before cleanup : {}",this.nextItemFromPool.toString());
-        
+
         ArrayList<VIP> resetVIPPoolMemberCount= new ArrayList<VIP>();
-        
+
         if(this.nextItemFromPool.size() != 0){
-            
+
             for(VIP vip:this.nextItemFromPool.keySet()){
                 if(this.nextItemFromPool.get(vip).intValue() > this.cmgr.getPool(vip.getPoolName()).getAllMembers().size()-1){
-                    
+
                     resetVIPPoolMemberCount.add(vip);
                 }
             }
         }
-        
+
         for(VIP vip:resetVIPPoolMemberCount){
             rrLogger.debug("VIP next pool member counter reset to 0");
             this.nextItemFromPool.put(vip, new Integer(0));
         }
-        
+
         rrLogger.debug("[VIP- NextMember] table after cleanup : {}",this.nextItemFromPool.toString());
     }
 }
index f8633b9ef839d20ed8123e0f60b08481b79bef6f..45d041c3e1e02533251ff672da2f0908a4da46a9 100644 (file)
@@ -20,7 +20,7 @@ import org.opendaylight.controller.samples.loadbalancer.policies.RoundRobinLBPol
 import junit.framework.TestCase;\r
 \r
 /**\r
- * \r
+ *\r
  * Class to unit test the load balancing policies.\r
  *\r
  */\r
@@ -30,7 +30,7 @@ public class LoadBalancerTest extends TestCase {
         ConfigManager cm = null;\r
         cm = new ConfigManager();\r
         Assert.assertFalse(cm== null);\r
-        \r
+\r
         Pool pool = cm.createPool("TestPool","roundrobin");\r
         VIP vip = cm.createVIP("TestVIP","10.0.0.9","TCP",(short)5550,"TestPool");\r
         PoolMember host1 = new PoolMember("host1","10.0.0.1","TestPool");\r
@@ -40,7 +40,7 @@ public class LoadBalancerTest extends TestCase {
         PoolMember host5 = new PoolMember("host5","10.0.0.5","TestPool");\r
         PoolMember host6 = new PoolMember("host6","10.0.0.6","TestPool");\r
         PoolMember host7 = new PoolMember("host7","10.0.0.7","TestPool");\r
-        \r
+\r
         pool.addMember(host1);\r
         pool.addMember(host2);\r
         pool.addMember(host3);\r
@@ -49,20 +49,20 @@ public class LoadBalancerTest extends TestCase {
         pool.addMember(host6);\r
         pool.addMember(host7);\r
         pool.addVIP(vip);\r
-        \r
+\r
         Assert.assertTrue(cm.getAllPoolMembers("TestPool").size() == pool.getAllMembers().size());\r
-        \r
+\r
         RoundRobinLBPolicy rrp = new RoundRobinLBPolicy(cm);\r
-        \r
+\r
         Client c1 = new Client("10.0.0.1","TCP",(short)5000);\r
         Assert.assertTrue(rrp.getPoolMemberForClient(c1, vip).equals(host1.getIp()));\r
-        \r
+\r
         c1 = new Client("10.0.0.1","TCP",(short)5001);\r
         Assert.assertTrue(rrp.getPoolMemberForClient(c1, vip).equals(host2.getIp()));\r
-        \r
+\r
         c1 = new Client("10.0.0.1","TCP",(short)5002);\r
         Assert.assertTrue(rrp.getPoolMemberForClient(c1, vip).equals(host3.getIp()));\r
-        \r
+\r
         c1 = new Client("10.0.0.1","TCP",(short)5003);\r
         Assert.assertTrue(rrp.getPoolMemberForClient(c1, vip).equals(host4.getIp()));\r
     }\r
index 4ec567c95b5dff139b8713d06fb7a3997de8c838..8ea0d78360427f4b683a579d8ff117468e530941 100644 (file)
@@ -41,38 +41,38 @@ import org.opendaylight.controller.samples.loadbalancer.IConfigManager;
 /**
  * This class exposes North bound REST APIs for the Load Balancer Service.
  * Following APIs are exposed by the Load Balancer Service:
- * 
+ *
  * Data retrieval REST APIs::
- *     1. Get details of all existing pools
- *             Type : GET  
- *             URI : /one/nb/v2/lb/{container-name}/
- *     NOTE: Current implementation of the opendaylight usage 'default' as a container-name
- *     e.g : http://localhost:8080/one/nb/v2/lb/default will give you list of all the pools
- *     
- *     2. Get details of all the existing VIPs
- *             Type : GET
- *             URI:  /one/nb/v2/lb/{container-name}/vips
- * 
+ *      1. Get details of all existing pools
+ *              Type : GET
+ *              URI : /one/nb/v2/lb/{container-name}/
+ *      NOTE: Current implementation of the opendaylight usage 'default' as a container-name
+ *      e.g : http://localhost:8080/one/nb/v2/lb/default will give you list of all the pools
+ *
+ *      2. Get details of all the existing VIPs
+ *              Type : GET
+ *              URI:  /one/nb/v2/lb/{container-name}/vips
+ *
  * Pool related REST APIs::
- *     1. Create Pool : 
- *             Type : POST
- *             URI : /one/nb/v2/lb/{container-name}/create/pool
- *             Request body :
+ *      1. Create Pool :
+ *              Type : POST
+ *              URI : /one/nb/v2/lb/{container-name}/create/pool
+ *              Request body :
  *                      {
  *                              "name":"",
  *                              "lbmethod":""
  *                      }
- *             Currently, two load balancing policies are allowed {"roundrobin" and "random" }
- * 
- *     2. Delete Pool : 
- *             Type : DELETE
- *             URI : /one/nb/v2/lb/{container-name}/delete/pool/{pool-name}
- * 
+ *              Currently, two load balancing policies are allowed {"roundrobin" and "random" }
+ *
+ *      2. Delete Pool :
+ *              Type : DELETE
+ *              URI : /one/nb/v2/lb/{container-name}/delete/pool/{pool-name}
+ *
  * VIP related REST APIs::
- *     1. Create VIP: 
- *             Type : POST
- *             URI : /one/nb/v2/lb/{container-name}/create/vip
- *             Request body :
+ *      1. Create VIP:
+ *              Type : POST
+ *              URI : /one/nb/v2/lb/{container-name}/create/vip
+ *              Request body :
  *                      {
  *                              "name":"",
  *                              "ip":"ip in (xxx.xxx.xxx.xxx) format",
@@ -80,12 +80,12 @@ import org.opendaylight.controller.samples.loadbalancer.IConfigManager;
  *                              "port":"any valid port number",
  *                              "poolname":"" (optional)
  *                       }
- *             The pool name is optional and can be set up at a later stage (using the REST API given below).
- * 
- *     2. Update VIP: Update pool name of the VIP
- *             Type : PUT
- *             URI : /one/nb/v2/lb/{container-name}/update/vip
- *             Request body :
+ *              The pool name is optional and can be set up at a later stage (using the REST API given below).
+ *
+ *      2. Update VIP: Update pool name of the VIP
+ *              Type : PUT
+ *              URI : /one/nb/v2/lb/{container-name}/update/vip
+ *              Request body :
  *                      {
  *                              "name":"",
  *                              "poolname":""
@@ -94,34 +94,34 @@ import org.opendaylight.controller.samples.loadbalancer.IConfigManager;
  *              and not of the VIP name itself.
  *              The specified pool name must already exist. If the specified VIP is already attached to a pool, the update
  *              will fail.
- * 
- *     3. Delete VIP : 
- *             Type : DELETE
- *             URI : /one/nb/v2/lb/{container-name}/delete/vip/{vip-name} 
- * 
+ *
+ *      3. Delete VIP :
+ *              Type : DELETE
+ *              URI : /one/nb/v2/lb/{container-name}/delete/vip/{vip-name}
+ *
  * Pool member related REST APIs::
- *     1. Create pool member:
- *             Type : POST
- *             URI : /one/nb/v2/lb/default/create/poolmember
- *             Request body :
+ *      1. Create pool member:
+ *              Type : POST
+ *              URI : /one/nb/v2/lb/default/create/poolmember
+ *              Request body :
  *                      {
  *                              "name":"",
  *                              "ip":"ip in (xxx.xxx.xxx.xxx) format",
  *                              "poolname":"existing pool name"
  *                       }
- * 
- *     2. Delete pool member:
- *             Type : DELETE
- *             URI     : /one/nb/v2/lb/{container-name}/delete/poolmember/{pool-member-name}/{pool-name}
- *     
- *     NOTE: Property "name" of each individual entity must be unique. 
- *     All the above REST APIs throw appropriate response codes in case of error/success. 
- *     Please consult the respective methods to get details of various response codes.
+ *
+ *      2. Delete pool member:
+ *              Type : DELETE
+ *              URI : /one/nb/v2/lb/{container-name}/delete/poolmember/{pool-member-name}/{pool-name}
+ *
+ *  NOTE: Property "name" of each individual entity must be unique.
+ *  All the above REST APIs throw appropriate response codes in case of error/success.
+ *  Please consult the respective methods to get details of various response codes.
  */
 
 @Path("/")
 public class LoadBalancerNorthbound {
-    
+
     /*
      * Method returns the Load balancer service instance running within
      * 'default' container.
@@ -148,7 +148,7 @@ public class LoadBalancerNorthbound {
         }
 
         IConfigManager configManager = (IConfigManager) ServiceHelper.getInstance(
-                       IConfigManager.class, containerName, this);
+                        IConfigManager.class, containerName, this);
 
         if (configManager == null) {
             throw new ServiceUnavailableException("Load Balancer"
@@ -168,13 +168,13 @@ public class LoadBalancerNorthbound {
         @ResponseCode(code = 503, condition = "Load balancer service is unavailable") })
     public Pools getAllPools(
             @PathParam("containerName") String containerName) {
-        
+
         IConfigManager configManager = getConfigManagerService(containerName);
         if (configManager == null) {
             throw new ServiceUnavailableException("Load Balancer "
                                                     + RestMessages.SERVICEUNAVAILABLE.toString());
         }
-        
+
         return new Pools(configManager.getAllPools());
     }
 
@@ -188,7 +188,7 @@ public class LoadBalancerNorthbound {
         @ResponseCode(code = 503, condition = "Load balancer service is unavailable") })
     public VIPs getAllVIPs(
             @PathParam("containerName") String containerName) {
-        
+
         IConfigManager configManager = getConfigManagerService(containerName);
         if (configManager == null) {
             throw new ServiceUnavailableException("Load Balancer "
@@ -209,7 +209,7 @@ public class LoadBalancerNorthbound {
         @ResponseCode(code = 415, condition = "Invalid input data")})
     public Response addVIP(@PathParam("containerName") String containerName,
             @TypeHint(VIP.class) JAXBElement<VIP> inVIP){
-        
+
         VIP vipInput = inVIP.getValue();
         String name = vipInput.getName();
         String ip = vipInput.getIp();
@@ -222,16 +222,16 @@ public class LoadBalancerNorthbound {
                 protocolPort < 0 ){
             throw new UnsupportedMediaTypeException(RestMessages.INVALIDDATA.toString());
         }
-        
+
         IConfigManager configManager = getConfigManagerService(containerName);
-        
+
         if (configManager == null) {
             throw new ServiceUnavailableException("Load Balancer "
                     + RestMessages.SERVICEUNAVAILABLE.toString());
         }
-        
+
         if(!configManager.vipExists(name, ip, protocol, protocolPort, poolName)){
-            
+
             VIP vip = configManager.createVIP(name, ip, protocol, protocolPort, poolName);
             if ( vip != null){
                 return Response.status(Response.Status.CREATED).build();
@@ -254,7 +254,7 @@ public class LoadBalancerNorthbound {
         @ResponseCode(code = 415, condition = "Invalid input name")})
     public Response updateVIP(@PathParam("containerName") String containerName,
             @TypeHint(VIP.class) JAXBElement<VIP> inVIP) {
-        
+
         VIP vipInput = inVIP.getValue();
         String name = vipInput.getName();
         String poolName = vipInput.getPoolName();
@@ -262,25 +262,25 @@ public class LoadBalancerNorthbound {
                 poolName.isEmpty()){
             throw new UnsupportedMediaTypeException(RestMessages.INVALIDDATA.toString());
         }
-        
+
         IConfigManager configManager = getConfigManagerService(containerName);
         if (configManager == null) {
             throw new ServiceUnavailableException("Load Balancer "
                                                 + RestMessages.SERVICEUNAVAILABLE.toString());
         }
-        
+
         if(!configManager.poolExists(poolName))
             throw new ResourceNotFoundException(NBConst.RES_POOL_NOT_FOUND);
-        
+
         if(configManager.getVIPAttachedPool(name)!=null)
             throw new MethodNotAllowedException(NBConst.RES_VIP_POOL_EXIST);
-        
+
         if(configManager.updateVIP(name, poolName)!= null)
             return Response.status(Response.Status.ACCEPTED).build();
-        
+
         throw new InternalServerErrorException(NBConst.RES_VIP_UPDATE_FAILED);
     }
-    
+
     @Path("/{containerName}/delete/vip/{vipName}")
     @DELETE
     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@@ -293,19 +293,19 @@ public class LoadBalancerNorthbound {
     public Response deleteVIP(
             @PathParam(value = "containerName") String containerName,
             @PathParam(value = "vipName") String vipName) {
-        
+
         if(vipName.isEmpty())
             throw new UnsupportedMediaTypeException(RestMessages.INVALIDDATA.toString());
-        
+
         IConfigManager configManager = getConfigManagerService(containerName);
         if (configManager == null) {
             throw new ServiceUnavailableException("Load Balancer"
                                             + RestMessages.SERVICEUNAVAILABLE.toString());
         }
-        
+
         if(!configManager.vipExists(vipName))
             throw new ResourceNotFoundException(NBConst.RES_VIP_NOT_FOUND);
-        
+
         for(VIP vip : configManager.getAllVIPs()){
             if(vip.getName().equals(vipName)){
                 configManager.deleteVIP(vipName);
@@ -326,7 +326,7 @@ public class LoadBalancerNorthbound {
         @ResponseCode(code = 415, condition = "Invalid input data")})
     public Response addPool(@PathParam("containerName") String containerName,
             @TypeHint(Pool.class) JAXBElement<Pool> inPool) {
-        
+
         Pool poolInput = inPool.getValue();
         String name = poolInput.getName();
         String lbMethod =poolInput.getLbMethod();
@@ -334,15 +334,15 @@ public class LoadBalancerNorthbound {
                 lbMethod.isEmpty()){
             throw new UnsupportedMediaTypeException(RestMessages.INVALIDDATA.toString());
         }
-        
+
         IConfigManager configManager = getConfigManagerService(containerName);
         if (configManager == null) {
             throw new ServiceUnavailableException("Load Balancer "
                                             + RestMessages.SERVICEUNAVAILABLE.toString());
         }
-        
+
         if(!configManager.poolExists(name)){
-            
+
             Pool pool = configManager.createPool(name, lbMethod);
             if ( pool != null){
                 return Response.status(Response.Status.CREATED).build();
@@ -365,19 +365,19 @@ public class LoadBalancerNorthbound {
     public Response deletePool(
             @PathParam(value = "containerName") String containerName,
             @PathParam(value = "poolName") String poolName) {
-        
+
         if(poolName.isEmpty())
             throw new UnsupportedMediaTypeException(RestMessages.INVALIDDATA.toString());
-        
+
         IConfigManager configManager = getConfigManagerService(containerName);
         if (configManager == null) {
             throw new ServiceUnavailableException("Load Balancer"
                                         + RestMessages.SERVICEUNAVAILABLE.toString());
         }
-        
+
         if(!configManager.poolExists(poolName))
             throw new ResourceNotFoundException(NBConst.RES_POOL_NOT_FOUND);
-        
+
         for(Pool pool:configManager.getAllPools()){
             if(pool.getName().equals(poolName)){
                 configManager.deletePool(poolName);
@@ -399,37 +399,37 @@ public class LoadBalancerNorthbound {
         @ResponseCode(code = 415, condition = "Invalid input data")})
     public Response addPoolMember(@PathParam("containerName") String containerName,
             @TypeHint(PoolMember.class) JAXBElement<PoolMember> inPoolMember){
-        
+
         PoolMember pmInput = inPoolMember.getValue();
-       String name = pmInput.getName();
-       String memberIP = pmInput.getIp();
-       String poolName = pmInput.getPoolName();
-       
-       if(name.isEmpty() ||
-               memberIP.isEmpty()||
-               poolName.isEmpty()){
-           throw new UnsupportedMediaTypeException(RestMessages.INVALIDDATA.toString());
-       }
-       
-       IConfigManager configManager = getConfigManagerService(containerName);
-       if (configManager == null) {
-           throw new ServiceUnavailableException("Load Balancer "
-                                       + RestMessages.SERVICEUNAVAILABLE.toString());
-       }
-       
-       if(!configManager.poolExists(poolName))
-           throw new ResourceNotFoundException(NBConst.RES_POOL_NOT_FOUND);
-       
-       if(!configManager.memberExists(name, memberIP, poolName)){
-           
-           PoolMember poolMember = configManager.addPoolMember(name, memberIP, poolName);
-           if ( poolMember != null){
-               return Response.status(Response.Status.CREATED).build();
-           }
-       }else{
-           throw new ResourceConflictException(NBConst.RES_POOLMEMBER_ALREADY_EXIST);
-       }
-       throw new InternalServerErrorException(NBConst.RES_POOLMEMBER_CREATION_FAILED);
+        String name = pmInput.getName();
+        String memberIP = pmInput.getIp();
+        String poolName = pmInput.getPoolName();
+
+        if(name.isEmpty() ||
+                memberIP.isEmpty()||
+                poolName.isEmpty()){
+            throw new UnsupportedMediaTypeException(RestMessages.INVALIDDATA.toString());
+        }
+
+        IConfigManager configManager = getConfigManagerService(containerName);
+        if (configManager == null) {
+            throw new ServiceUnavailableException("Load Balancer "
+                                        + RestMessages.SERVICEUNAVAILABLE.toString());
+        }
+
+        if(!configManager.poolExists(poolName))
+            throw new ResourceNotFoundException(NBConst.RES_POOL_NOT_FOUND);
+
+        if(!configManager.memberExists(name, memberIP, poolName)){
+
+            PoolMember poolMember = configManager.addPoolMember(name, memberIP, poolName);
+            if ( poolMember != null){
+                return Response.status(Response.Status.CREATED).build();
+            }
+        }else{
+            throw new ResourceConflictException(NBConst.RES_POOLMEMBER_ALREADY_EXIST);
+        }
+        throw new InternalServerErrorException(NBConst.RES_POOLMEMBER_CREATION_FAILED);
     }
 
     @Path("/{containerName}/delete/poolmember/{poolMemberName}/{poolName}")
@@ -445,25 +445,25 @@ public class LoadBalancerNorthbound {
             @PathParam(value = "containerName") String containerName,
             @PathParam(value = "poolMemberName") String poolMemberName,
             @PathParam(value = "poolName") String poolName) {
-        
+
         if(poolMemberName.isEmpty()||
                 poolName.isEmpty())
             throw new UnsupportedMediaTypeException(RestMessages.INVALIDDATA.toString());
-        
+
         IConfigManager configManager = getConfigManagerService(containerName);
-        
+
         if (configManager == null) {
             throw new ServiceUnavailableException("Load Balancer"
                                         + RestMessages.SERVICEUNAVAILABLE.toString());
         }
-        
+
         if(!configManager.poolExists(poolName))
             throw new ResourceNotFoundException(NBConst.RES_POOL_NOT_FOUND);
-        
+
         if(configManager.memberExists(poolMemberName, poolName)){
-            
+
             configManager.removePoolMember(poolMemberName, poolName);
-            
+
             return Response.ok().build();
         }
         throw new ResourceNotFoundException(NBConst.RES_POOLMEMBER_NOT_FOUND);
index 4aa4705a53755407aa27709a94dc07d385b6cb84..a5d2091470b46aeae9a00e3f9790c06cfae25af2 100644 (file)
@@ -12,32 +12,32 @@ package org.opendaylight.controller.samples.loadbalancer.northbound;
  *
  */
 public class NBConst {
-    
+
     public static final String RES_VIP_ALREADY_EXIST= " VIP already exists";
-    
+
     public static final String RES_VIP_NOT_FOUND= " VIP not found";
-    
+
     public static final String RES_VIP_CREATION_FAILED = " Creation of VIP failed";
-    
+
     public static final String RES_VIP_DELETION_FAILED = " Deletion of VIP failed";
-    
+
     public static final String RES_VIP_UPDATE_FAILED = " Update of VIP failed";
-    
+
     public static final String RES_POOL_ALREADY_EXIST= " Pool already exists";
-    
+
     public static final String RES_POOL_NOT_FOUND= " Pool not found";
-    
+
     public static final String RES_POOL_CREATION_FAILED = " Creation of pool failed";
-    
+
     public static final String RES_POOL_DELETION_FAILED = " Deletion of pool failed";
-    
+
     public static final String RES_POOLMEMBER_ALREADY_EXIST= " Pool member already exists";
-    
+
     public static final String RES_POOLMEMBER_NOT_FOUND= " Pool member not found";
-    
+
     public static final String RES_POOLMEMBER_CREATION_FAILED = " Creation of pool member failed";
-    
+
     public static final String RES_POOLMEMBER_DELETION_FAILED = " Deletion of pool member failed";
-    
+
     public static final String RES_VIP_POOL_EXIST = "Pool already attached to a VIP";
 }
index abb5495cbf7c6d19c0209d510a42695bc9b95946..74be568018af3c5123f8b96c89ee73cd146940c9 100644 (file)
@@ -19,29 +19,29 @@ import org.opendaylight.controller.samples.loadbalancer.entities.Pool;
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 /**
- * JAX-RS resource for handling details of all the available pools 
+ * JAX-RS resource for handling details of all the available pools
  * in response to respective REST API requests.
  */
 
 public class Pools {
-    
+
     @XmlElement (name="pool")
     Set<Pool> loadBalancerPools;
-    
+
     public Pools() {
     }
-    
+
     public Pools (Set<Pool> loadBalancerPools) {
         this.loadBalancerPools = loadBalancerPools;
     }
-    
+
     /**
      * @return the loadBalancerPools
      */
     public Set<Pool> getLoadBalancerPools() {
         return loadBalancerPools;
     }
-    
+
     /**
      * @param loadBalancerPools the loadBalancerPools to set
      */
index f0af929b39aed15becefb996efe2a5806b398557..66a20338abffd2ef2ebd0ddfc440ccce2be6e3ba 100644 (file)
@@ -25,28 +25,28 @@ import org.opendaylight.controller.samples.loadbalancer.entities.VIP;
 @XmlAccessorType(XmlAccessType.NONE)
 
 public class VIPs {
-    
+
     @XmlElement (name="vip")
     Set<VIP> loadBalancerVIPs;
-    
+
     public VIPs() {}
-    
-    
+
+
     public VIPs (Set<VIP> loadBalancerVIPs) {
         this.loadBalancerVIPs = loadBalancerVIPs;
     }
-    
+
     /**
      * @return the loadBalancerVIPs
      */
     public Set<VIP> getLoadBalancerVIPs() {
         return loadBalancerVIPs;
     }
-    
+
     /**
      * @param loadBalancerVIPs the loadBalancerVIPs to set
      */
-    
+
     public void setLoadBalancerVIPs(Set<VIP> loadBalancerVIPs) {
         this.loadBalancerVIPs = loadBalancerVIPs;
     }
index c2fee970ac00c8354140de8318786cd0bfcac7c4..11056478dbf1742ec48e5cc6bbf9ec3bf01ad56a 100644 (file)
@@ -147,7 +147,7 @@ public class SimpleForwardingImpl implements IfNewHostNotify,
     }
 
     @SuppressWarnings("deprecation")
-       private void allocateCaches() {
+        private void allocateCaches() {
         if (this.clusterContainerService == null) {
             log.info("un-initialized clusterContainerService, can't create cache");
             return;
@@ -178,7 +178,7 @@ public class SimpleForwardingImpl implements IfNewHostNotify,
     }
 
     @SuppressWarnings("deprecation")
-       private void destroyCaches() {
+        private void destroyCaches() {
         if (this.clusterContainerService == null) {
             log.info("un-initialized clusterContainerService, can't destroy cache");
             return;
@@ -367,7 +367,7 @@ public class SimpleForwardingImpl implements IfNewHostNotify,
                 }
 
             } else {
-                log.debug("Adding policyMatch(DIP = {}) Action(outPort= {}) " + 
+                log.debug("Adding policyMatch(DIP = {}) Action(outPort= {}) " +
                         "to node {}", new Object[] {
                         host.getNetworkAddress().getHostAddress(), outPort,
                         currNode});
@@ -482,7 +482,7 @@ public class SimpleForwardingImpl implements IfNewHostNotify,
         updatePerHostRuleInSW(host, rootNode, rootNode, null, new HostNodePair(
                 host, rootNode), ports);
 
-        //             log.debug("Getting out at the end!");
+        //      log.debug("Getting out at the end!");
         return switchesToProgram;
     }
 
@@ -575,10 +575,10 @@ public class SimpleForwardingImpl implements IfNewHostNotify,
         // rest of the world
         // switchesToProgram.add(rootNode);
         //updatePerHostRuleInSW(host, rootNode,
-        //                                       rootNode, null,
-        //                                       new HostNodePair(host, rootNode),ports);
+        //                                        rootNode, null,
+        //                                        new HostNodePair(host, rootNode),ports);
 
-        //             log.debug("Getting out at the end!");
+        //      log.debug("Getting out at the end!");
         return switchesToProgram;
     }
 
@@ -617,7 +617,7 @@ public class SimpleForwardingImpl implements IfNewHostNotify,
                     Status poStatus = this.frm.installFlowEntry(po);
                     if (!poStatus.isSuccess()) {
                         log.error("Failed to install policy: "
-                                + po.getGroupName() + " (" 
+                                + po.getGroupName() + " ("
                                 + poStatus.getDescription() + ")");
 
                         retCode = RulesProgrammingReturnCode.FAILED_FEW_SWITCHES;
@@ -632,8 +632,8 @@ public class SimpleForwardingImpl implements IfNewHostNotify,
                               swId, host);
                     /* // Now dump every single rule */
                     /* for (HostNodePair dumpkey : this.rulesDB.keySet()) { */
-                    /*         po = this.rulesDB.get(dumpkey); */
-                    /*         log.debug("Dumping entry H{" + dumpkey.getHost() + "} S{" + dumpkey.getSwitchId() + "} = {" + (po == null ? "null policy" : po)); */
+                    /*  po = this.rulesDB.get(dumpkey); */
+                    /*  log.debug("Dumping entry H{" + dumpkey.getHost() + "} S{" + dumpkey.getSwitchId() + "} = {" + (po == null ? "null policy" : po)); */
                     /* } */
                 }
             }
index 98977f6e91d15b6eee512d941365133cdb387697..a2ab07ac7b6bc7249f44ca1c66415c731faf738c 100644 (file)
@@ -31,7 +31,7 @@ public interface IStatisticsManager {
      * If the context is the default container, the returned statistics are for all the flows installed on the node,
      * regardless of the container they belong to
      *
-     * @param node     the network node
+     * @param node  the network node
      * @return the list of flows installed on the network node
      */
     List<FlowOnNode> getFlows(Node node);
@@ -40,7 +40,7 @@ public interface IStatisticsManager {
      * Returns the statistics for the flows specified in the list
      *
      * @param flows
-     * @return the list of flows installed on the network node
+     * @return  the list of flows installed on the network node
      */
     Map<Node, List<FlowOnNode>> getFlowStatisticsForFlowList(
             List<FlowEntry> flows);
index e7b8c59dffe896824e8862a6fd0ba723fb565ee9..29d0a42f85722d43707f166188809680fc81f04c 100644 (file)
@@ -23,11 +23,11 @@ public interface IInventoryListener {
     /**
      * This method is called when some properties of a node are added/deleted/changed.
      *
-     * @param node                     {@link org.opendaylight.controller.sal.core.Node} being updated
-     * @param type             {@link org.opendaylight.controller.sal.core.UpdateType}
-     * @param propMap          map of {@link org.opendaylight.controller.sal.core.Property} such as
-     *                                                 {@link org.opendaylight.controller.sal.core.Description} and/or
-     *                                                 {@link org.opendaylight.controller.sal.core.Tier} etc.
+     * @param node                      {@link org.opendaylight.controller.sal.core.Node} being updated
+     * @param type              {@link org.opendaylight.controller.sal.core.UpdateType}
+     * @param propMap           map of {@link org.opendaylight.controller.sal.core.Property} such as
+     *                                          {@link org.opendaylight.controller.sal.core.Description} and/or
+     *                                          {@link org.opendaylight.controller.sal.core.Tier} etc.
      */
     public void notifyNode(Node node, UpdateType type,
             Map<String, Property> propMap);
@@ -35,11 +35,11 @@ public interface IInventoryListener {
     /**
      * This method is called when some properties of a node connector are added/deleted/changed.
      *
-     * @param nodeConnector    {@link org.opendaylight.controller.sal.core.NodeConnector} being updated
-     * @param type             {@link org.opendaylight.controller.sal.core.UpdateType}
-     * @param propMap          map of {@link org.opendaylight.controller.sal.core.Property} such as
-     *                                                 {@link org.opendaylight.controller.sal.core.Description} and/or
-     *                                                 {@link org.opendaylight.controller.sal.core.State} etc.
+     * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector} being updated
+     * @param type              {@link org.opendaylight.controller.sal.core.UpdateType}
+     * @param propMap           map of {@link org.opendaylight.controller.sal.core.Property} such as
+     *                                          {@link org.opendaylight.controller.sal.core.Description} and/or
+     *                                          {@link org.opendaylight.controller.sal.core.State} etc.
      */
     public void notifyNodeConnector(NodeConnector nodeConnector,
             UpdateType type, Map<String, Property> propMap);
index af1ab1cc7bfad197eb42e3575a033681357fc049..1e4a79fcc00a147a0b31a29bc08b5c07540705fb 100644 (file)
@@ -22,9 +22,9 @@ public interface ISpanAware {
     /**
      * This method is called when list of ports in a node are added/deleted as span ports.
      *
-     * @param node             {@link org.opendaylight.controller.sal.core.Node} being updated
-     * @param portList list of span {@link org.opendaylight.controller.sal.core.NodeConnector}
-     * @param add              true if add; false if delete.
+     * @param node      {@link org.opendaylight.controller.sal.core.Node} being updated
+     * @param portList  list of span {@link org.opendaylight.controller.sal.core.NodeConnector}
+     * @param add       true if add; false if delete.
      */
     public void spanUpdate(Node node, List<NodeConnector> portList, boolean add);
 }
\ No newline at end of file
index ddc5f8ffee2777cd098148e05abe0c2ee741e7ea..48f5aa48f61c579127fc1d5229dbd116e57cd70e 100644 (file)
@@ -44,7 +44,7 @@ public interface ISwitchManager {
     /**
      * Remove a subnet configuration
      *
-     * @param  configObject    refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
+     * @param  configObject refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
      * @return "Success" or failure reason
      */
     public Status removeSubnet(SubnetConfig configObject);
@@ -53,14 +53,14 @@ public interface ISwitchManager {
      * Remove a subnet configuration given the name
      *
      * @param   name      subnet name
-     * @return "Success" or failure reason
+     * @return  "Success" or failure reason
      */
     public Status removeSubnet(String name);
 
     /**
      * Return a list of all known devices in the system
      *
-     * @return returns a list of {@link org.opendaylight.controller.switchmanager.Switch}
+     * @return  returns a list of {@link org.opendaylight.controller.switchmanager.Switch}
      */
     public List<Switch> getNetworkDevices();
 
@@ -82,8 +82,8 @@ public interface ISwitchManager {
     /**
      * Return a subnet configuration given the network address
      *
-     * @param networkAddress   the ip address in long format
-     * @return                                         the {@link org.opendaylight.controller.switchmanager.Subnet}
+     * @param networkAddress    the ip address in long format
+     * @return                                  the {@link org.opendaylight.controller.switchmanager.Subnet}
      */
     public Subnet getSubnetByNetworkAddress(InetAddress networkAddress);
 
@@ -98,7 +98,7 @@ public interface ISwitchManager {
      * Add a span port configuration
      *
      * @param SpanConfig refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SpanConfig}
-     * @return                         status code
+     * @return              status code
      */
     public Status addSpanConfig(SpanConfig configObject);
 
@@ -106,7 +106,7 @@ public interface ISwitchManager {
      * Remove a span port configuration
      *
      * @param SpanConfig refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SpanConfig}
-     * @return                         status code
+     * @return              status code
      */
     public Status removeSpanConfig(SpanConfig cfgObject);
 
@@ -152,8 +152,8 @@ public interface ISwitchManager {
     /**
      * Remove node connectors from a subnet
      *
-     * @param name                             the subnet config name
-     * @param nodeConnectors   nodePorts string specified by {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
+     * @param name              the subnet config name
+     * @param nodeConnectors    nodePorts string specified by {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
      * @return "Success" or failure reason
      */
     public Status removePortsFromSubnet(String name, String nodeConnectors);
@@ -170,16 +170,16 @@ public interface ISwitchManager {
      *
      * @param node {@link org.opendaylight.controller.sal.core.Node}
      * @return map of {@link org.opendaylight.controller.sal.core.Property} such as
-     *            {@link org.opendaylight.controller.sal.core.Description} and/or
-     *                    {@link org.opendaylight.controller.sal.core.Tier} etc.
+     *             {@link org.opendaylight.controller.sal.core.Description} and/or
+     *             {@link org.opendaylight.controller.sal.core.Tier} etc.
      */
     public Map<String, Property> getNodeProps(Node node);
 
     /**
      * Return a specific property of a node given the property name
      *
-     * @param node             {@link org.opendaylight.controller.sal.core.Node}
-     * @param propName         the property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
+     * @param node              {@link org.opendaylight.controller.sal.core.Node}
+     * @param propName  the property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
      * @return {@link org.opendaylight.controller.sal.core.Property}
      */
     public Property getNodeProp(Node node, String propName);
@@ -187,23 +187,23 @@ public interface ISwitchManager {
     /**
      * Set a specific property of a node
      *
-     * @param node             {@link org.opendaylight.controller.sal.core.Node}
-     * @param prop             {@link org.opendaylight.controller.sal.core.Property}
+     * @param node              {@link org.opendaylight.controller.sal.core.Node}
+     * @param prop              {@link org.opendaylight.controller.sal.core.Property}
      */
     public void setNodeProp(Node node, Property prop);
 
     /**
      * Remove a property of a node
-     * 
-     * @param nc               {@link org.opendaylight.controller.sal.core.Node}
-     * @param propName         the property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
+     *
+     * @param nc                {@link org.opendaylight.controller.sal.core.Node}
+     * @param propName  the property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
      * @return success or failed reason
      */
     public Status removeNodeProp(Node node, String propName);
 
     /**
      * Remove all the properties of a node
-     * 
+     *
      * @param node {@link org.opendaylight.controller.sal.core.Node}
      * @return success or failed reason
      */
@@ -238,8 +238,8 @@ public interface ISwitchManager {
      *
      * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
      * @return map of {@link org.opendaylight.controller.sal.core.Property} such as
-     *                    {@link org.opendaylight.controller.sal.core.Description} and/or
-     *                    {@link org.opendaylight.controller.sal.core.State} etc.
+     *             {@link org.opendaylight.controller.sal.core.Description} and/or
+     *             {@link org.opendaylight.controller.sal.core.State} etc.
      */
     public Map<String, Property> getNodeConnectorProps(
             NodeConnector nodeConnector);
@@ -266,7 +266,7 @@ public interface ISwitchManager {
 
     /**
      * Remove a property of a node connector
-     * 
+     *
      * @param nc {@link org.opendaylight.controller.sal.core.NodeConnector}
      * @param propName property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
      * @return success or failed reason
@@ -275,7 +275,7 @@ public interface ISwitchManager {
 
     /**
      * Remove all the properties of a node connector
-     * 
+     *
      * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
      * @return success or failed reason
      */
@@ -284,7 +284,7 @@ public interface ISwitchManager {
     /**
      * Return the node connector given its name
      *
-     * @param node                             {@link org.opendaylight.controller.sal.core.Node}
+     * @param node                              {@link org.opendaylight.controller.sal.core.Node}
      * @param nodeConnectorName node connector identifier specified by {@link org.opendaylight.controller.sal.core.NodeConnector}
      * @return {@link org.opendaylight.controller.sal.core.NodeConnector}
      */
@@ -309,7 +309,7 @@ public interface ISwitchManager {
 
     /**
      * Return controller MAC address
-        *
+         *
      * @return MAC address in byte array
      */
     public byte[] getControllerMAC();
@@ -317,7 +317,7 @@ public interface ISwitchManager {
     /**
      * Return MAC address for a given node
      *
-     * @param node     {@link org.opendaylight.controller.sal.core.Node}
+     * @param node  {@link org.opendaylight.controller.sal.core.Node}
      * @return MAC address in byte array
      */
     public byte[] getNodeMAC(Node node);
@@ -338,22 +338,22 @@ public interface ISwitchManager {
      */
     public int getHostRetryCount();
 
-       /**
-        * Create a Name/Tier/Bandwidth Property object based on given property
-        * name and value. Other property types are not supported yet.
-        * 
+        /**
+         * Create a Name/Tier/Bandwidth Property object based on given property
+         * name and value. Other property types are not supported yet.
+         *
      * @param propName Name of the Property specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
      * @param propValue Value of the Property specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
-        * @return {@link org.opendaylight.controller.sal.core.Property}
-        */
+         * @return {@link org.opendaylight.controller.sal.core.Property}
+         */
     public Property createProperty(String propName, String propValue);
-    
+
     /**
-     * Returns the description for the specified node. It is either the one 
+     * Returns the description for the specified node. It is either the one
      * configured by user or the description advertised by the node.
-     * 
+     *
      * @param node the network node identifier
-     * @return the description of the specified node. If no description is 
+     * @return the description of the specified node. If no description is
      * configured and the network node does not provide its description,
      * an empty string is returned.
      */
index 778310e07ff6a4d7879ed8e26e33cf7e9976901b..253096edc34116ed4cc9474624f9711f90efa13a 100644 (file)
@@ -47,9 +47,9 @@ public class SwitchConfig implements Serializable {
     }
 
     public boolean isProactive() {
-       return Integer.parseInt(mode) != 0;
+        return Integer.parseInt(mode) != 0;
     }
-    
+
     public static long getSerialversionuid() {
         return serialVersionUID;
     }
index 1499f9e2ef345c3b5a39350c95eb23cb0f1e7262..18b3195372ff2f6f42a97c277b6d507be4d4dc33 100644 (file)
@@ -119,23 +119,23 @@ public class SwitchTest {
         Assert.assertTrue(sw.getSpanPorts().isEmpty());
 
     }
-    
+
     @Test
     public void testSwitchConfig(){
         SwitchConfig sc = new SwitchConfig(null, null, null, null);
         SwitchConfig sc2 = new SwitchConfig(null, null, null, null);
         Assert.assertTrue(sc.equals(sc2));
-        
+
         Assert.assertNull(sc.getMode());
         Assert.assertNull(sc.getNodeId());
         Assert.assertNull(sc.getTier());
         Assert.assertNull(sc.getNodeDescription());
-        
+
         SwitchConfig sc3 = new SwitchConfig("123", "name", "tier", "mode");
         SwitchConfig sc4 = new SwitchConfig("123", "name", "tier", "mode");
         Assert.assertFalse(sc.equals(sc3));
         Assert.assertTrue(sc3.equals(sc4));
-        
+
         Assert.assertTrue(sc3.getNodeId().equals("123"));
         Assert.assertTrue(sc3.getNodeDescription().equals("name"));
         Assert.assertTrue(sc3.getTier().equals("tier"));
index d5b499c42b9737cfac8783eb8ec4943180d75aad..b58ae286105981d7771f51800397fedb9eb9d67e 100644 (file)
@@ -94,10 +94,10 @@ public class TopologyUserLinkConfig implements Serializable {
         status = STATUS.LINKDOWN.toString();
     }
 
-       public TopologyUserLinkConfig(String name, String srcNodeIDType,
-                       String srcSwitchId, String srcNodeConnectorIDType, String srcPort,
-                       String dstNodeIDType, String dstSwitchId,
-                       String dstNodeConnectorIDType, String dstPort) {
+        public TopologyUserLinkConfig(String name, String srcNodeIDType,
+                        String srcSwitchId, String srcNodeConnectorIDType, String srcPort,
+                        String dstNodeIDType, String dstSwitchId,
+                        String dstNodeConnectorIDType, String dstPort) {
         super();
         this.name = name;
         this.srcNodeIDType = srcNodeIDType;
@@ -111,38 +111,38 @@ public class TopologyUserLinkConfig implements Serializable {
     }
 
     public String getSrcNodeIDType() {
-               return srcNodeIDType;
-       }
+                return srcNodeIDType;
+        }
 
-       public void setSrcNodeIDType(String srcNodeIDType) {
-               this.srcNodeIDType = srcNodeIDType;
-       }
+        public void setSrcNodeIDType(String srcNodeIDType) {
+                this.srcNodeIDType = srcNodeIDType;
+        }
 
-       public String getSrcNodeConnectorIDType() {
-               return srcNodeConnectorIDType;
-       }
+        public String getSrcNodeConnectorIDType() {
+                return srcNodeConnectorIDType;
+        }
 
-       public void setSrcNodeConnectorIDType(String srcNodeConnectorIDType) {
-               this.srcNodeConnectorIDType = srcNodeConnectorIDType;
-       }
+        public void setSrcNodeConnectorIDType(String srcNodeConnectorIDType) {
+                this.srcNodeConnectorIDType = srcNodeConnectorIDType;
+        }
 
-       public String getDstNodeIDType() {
-               return dstNodeIDType;
-       }
+        public String getDstNodeIDType() {
+                return dstNodeIDType;
+        }
 
-       public void setDstNodeIDType(String dstNodeIDType) {
-               this.dstNodeIDType = dstNodeIDType;
-       }
+        public void setDstNodeIDType(String dstNodeIDType) {
+                this.dstNodeIDType = dstNodeIDType;
+        }
 
-       public String getDstNodeConnectorIDType() {
-               return dstNodeConnectorIDType;
-       }
+        public String getDstNodeConnectorIDType() {
+                return dstNodeConnectorIDType;
+        }
 
-       public void setDstNodeConnectorIDType(String dstNodeConnectorIDType) {
-               this.dstNodeConnectorIDType = dstNodeConnectorIDType;
-       }
+        public void setDstNodeConnectorIDType(String dstNodeConnectorIDType) {
+                this.dstNodeConnectorIDType = dstNodeConnectorIDType;
+        }
 
-       public String getName() {
+        public String getName() {
         return name;
     }
 
@@ -206,24 +206,24 @@ public class TopologyUserLinkConfig implements Serializable {
     private boolean isValidSwitchId(String switchId, String typeStr) {
         if (typeStr.equals(NodeIDType.OPENFLOW)) {
             return isValidSwitchId(switchId);
-        } else if (typeStr.equals(NodeIDType.ONEPK) || 
-                          typeStr.equals(NodeIDType.PCEP) || 
-                          typeStr.equals(NodeIDType.PRODUCTION)) {
+        } else if (typeStr.equals(NodeIDType.ONEPK) ||
+                           typeStr.equals(NodeIDType.PCEP) ||
+                           typeStr.equals(NodeIDType.PRODUCTION)) {
             return true;
         } else {
-                       logger.warn("Invalid node id type {}", typeStr);
-               return false;
+                        logger.warn("Invalid node id type {}", typeStr);
+                return false;
         }
     }
 
     private boolean isValidPortId(String portId, String nodeConnectorType) {
-               if (NodeConnectorIDType.getClassType(nodeConnectorType) == null) {
-                       logger.warn("Invalid node connector id type {}", nodeConnectorType);
-                       return false; 
-               }
-               
-               return true;
-       }
+                if (NodeConnectorIDType.getClassType(nodeConnectorType) == null) {
+                        logger.warn("Invalid node connector id type {}", nodeConnectorType);
+                        return false;
+                }
+
+                return true;
+        }
 
     private long getSwitchIDLong(String switchId) {
         int radix = 16;
@@ -245,26 +245,26 @@ public class TopologyUserLinkConfig implements Serializable {
     }
 
     public boolean isValid() {
-               if (name == null || srcSwitchId == null || dstSwitchId == null
-                               || srcPort == null || dstPort == null || srcNodeIDType == null
-                               || dstNodeIDType == null || srcNodeConnectorIDType == null
-                               || dstNodeConnectorIDType == null) {
+                if (name == null || srcSwitchId == null || dstSwitchId == null
+                                || srcPort == null || dstPort == null || srcNodeIDType == null
+                                || dstNodeIDType == null || srcNodeConnectorIDType == null
+                                || dstNodeConnectorIDType == null) {
             return false;
-               }
-               
-               if (!isValidSwitchId(srcSwitchId, srcNodeIDType) || 
-                       !isValidSwitchId(dstSwitchId, dstNodeIDType)) {
-                       logger.warn("Invalid switch id");
-                       return false;
-               }
-               
-               if (!isValidPortId(srcPort, srcNodeConnectorIDType) || 
-                       !isValidPortId(dstPort, dstNodeConnectorIDType)) {
-                       logger.warn("Invalid port id");
-                       return false;
-               }
-                       
-               return true;
+                }
+
+                if (!isValidSwitchId(srcSwitchId, srcNodeIDType) ||
+                        !isValidSwitchId(dstSwitchId, dstNodeIDType)) {
+                        logger.warn("Invalid switch id");
+                        return false;
+                }
+
+                if (!isValidPortId(srcPort, srcNodeConnectorIDType) ||
+                        !isValidPortId(dstPort, dstNodeConnectorIDType)) {
+                        logger.warn("Invalid port id");
+                        return false;
+                }
+
+                return true;
     }
 
     public boolean isSrcPortByName() {
@@ -295,13 +295,13 @@ public class TopologyUserLinkConfig implements Serializable {
 
     @Override
     public String toString() {
-               return "ITopologyUserLinkConfig [status=" + status + ", name=" + name
-                               + ", srcNodeIDType=" + srcNodeIDType + ", srcSwitchId="
-                               + srcSwitchId + ", srcNodeConnectorIDType="
-                               + srcNodeConnectorIDType + ", srcPort=" + srcPort
-                               + ", dstNodeIDType=" + dstNodeIDType + ", dstId="
-                               + dstSwitchId + ", dstNodeConnectorIDType="
-                               + dstNodeConnectorIDType + ", dstPort=" + dstPort + "]";
+                return "ITopologyUserLinkConfig [status=" + status + ", name=" + name
+                                + ", srcNodeIDType=" + srcNodeIDType + ", srcSwitchId="
+                                + srcSwitchId + ", srcNodeConnectorIDType="
+                                + srcNodeConnectorIDType + ", srcPort=" + srcPort
+                                + ", dstNodeIDType=" + dstNodeIDType + ", dstId="
+                                + dstSwitchId + ", dstNodeConnectorIDType="
+                                + dstNodeConnectorIDType + ", dstPort=" + dstPort + "]";
     }
 
     @Override
index c176cb2cf3e50ba3b878e5923efeafe108059851..bcc13a993369585d3fc3f5e6dfe6a3c748253354 100644 (file)
@@ -45,9 +45,9 @@ public class TopologyManagerImplTest {
      * NodeConnectorId> : <1:1>--><11:11>; <1:2>--><11:12>; <3:3>--><13:13>;
      * <3:4>--><13:14>; <5:5>--><15:15>; <5:6>--><15:16>; Method used by two
      * tests: testGetNodeEdges and testGetEdges
-     * 
+     *
      * @param topoManagerImpl
-     * 
+     *
      * @throws ConstructionException
      */
     public void setNodeEdges(TopologyManagerImpl topoManagerImpl)
index 0fb26a1a625ce21afb1c883c8f642e1baa0cba97..36a2c06bf6873118e58a3df90bd41652259ce776 100644 (file)
@@ -18,7 +18,7 @@ public interface IAAAProvider {
     /**
      * Authenticate user with AAA server and return authentication and
      * authorization info using the Provider's mechanism
-     * 
+     *
      * @param userName
      *            the username
      * @param password
@@ -35,7 +35,7 @@ public interface IAAAProvider {
 
     /**
      * Returns the Name of the Provider
-     * 
+     *
      * @return Name of the AAA provider
      */
     public String getName();
index 8149d7a5a2a8add3566eb4e2970a97769d03ec65..372462eaae1366a17b87bebbdb45ad21e9d20802 100644 (file)
@@ -11,14 +11,14 @@ package org.opendaylight.controller.usermanager;
 import javax.servlet.http.HttpSessionListener;
 
 /**
- * 
+ *
  * This interface defines method(s) to invalidate a session.
  */
 public interface ISessionManager extends HttpSessionListener {
 
     /**
      * Invalidates the session for a given user and a session Id
-     * 
+     *
      * @param username
      *            the username
      * @param sessionId
index 9766fd475af8ae85c4ad7cce05d795ab132db209..ca6000a9f59f10d7712a29527728c489f85e0b96 100644 (file)
@@ -13,8 +13,8 @@ import org.opendaylight.controller.sal.authorization.UserLevel;
 import org.springframework.security.core.GrantedAuthority;
 
 public class ODLUserLevel implements GrantedAuthority {
-       private static final long serialVersionUID = 1L;
-       UserLevel userLevel;
+        private static final long serialVersionUID = 1L;
+        UserLevel userLevel;
 
     public ODLUserLevel(UserLevel userLevel) {
         this.userLevel = userLevel;
index 2ad98aba68ff58cc64ea546e6db0fe689e000fa9..e1278e8aa4b4971a7d63bad9413c809070da7b75 100644 (file)
@@ -27,11 +27,11 @@ public class ServerConfig implements Serializable {
     }
 
     public ServerConfig(String ip, String secret, String protocol) {
-       this.ip = ip;
-       this.secret = secret;
-       this.protocol = protocol;
+        this.ip = ip;
+        this.secret = secret;
+        this.protocol = protocol;
     }
-    
+
     public String getAddress() {
         return ip;
     }
index 176af3a3e4d1d48ed9b8120f65b7bc5a6bca9ffb..c7ddd4a6ecfd2918508924fe0fc78be2339268eb 100644 (file)
@@ -49,7 +49,7 @@ public class UserConfig implements Serializable {
         this.roles = (roles == null) ? new ArrayList<String>()
                 : new ArrayList<String>(roles);
     }
-    
+
     public String getUser() {
         return user;
     }
@@ -161,24 +161,24 @@ public class UserConfig implements Serializable {
             return new Status(StatusCode.BADREQUEST,
                     "Current password is incorrect");
         }
-        
+
         // Create a new object with the proposed modifications
         UserConfig proposed = new UserConfig();
         proposed.user = this.user;
         proposed.password = (newPassword != null)? newPassword : this.password;
         proposed.roles = (newRoles != null)? newRoles : this.roles;
-        
+
         // Validate it
         Status status = proposed.validate();
         if (!status.isSuccess()) {
             return status;
         }
-        
+
         // Accept the modifications
         this.user = proposed.user;
         this.password = proposed.password;
         this.roles = new ArrayList<String>(proposed.roles);
-        
+
         return status;
     }
 
@@ -192,7 +192,7 @@ public class UserConfig implements Serializable {
         }
         return locResponse;
     }
-    
+
     protected String getRolesString() {
         StringBuffer buffer = new StringBuffer();
         if (!roles.isEmpty()) {
index 21d013784973a8c49457a20d171abbc3b38dace0..5201a6dc6d83be2f3f1f902dd5dfd89a6811feb2 100644 (file)
@@ -83,7 +83,7 @@ public class SessionManager implements ISessionManager {
                 while (sessIterator.hasNext()) {
                     HttpSession session = sessIterator.next();
                     if (session != null && sessionId != null && session.getId() != null && !session.getId().equals(sessionId)) {
-                        sessionsList.add(session);                                
+                        sessionsList.add(session);
                         sessIterator.remove();
                     }
                     else {
index cb4c75fecc604f09904e71435048b5e62bbb38a6..af68be6cef3125bc9758e954ac97dfc3ac7ac81d 100644 (file)
@@ -10,5 +10,5 @@
 package org.opendaylight.controller.usermanager;
 
 public class AuthResponseTest{
-       
+
 }
\ No newline at end of file
index 810500baa4151b40d17c182a11575d30d806343c..f4810c978f9c80422f2036f2531eafe47f3a1d0c 100644 (file)
@@ -20,53 +20,53 @@ import org.springframework.security.core.GrantedAuthority;
 
 public class AuthenticatedUserTest {
 
-       static String[] roleArray;
-       static AuthenticatedUser user;
-
-       @BeforeClass
-       public static void testSetup() {
-               roleArray = new String[] { UserLevel.NETWORKOPERATOR.toString(),
-                               UserLevel.APPUSER.toString() };
-       }
-
-       @Test
-       public void testAuthenticatedUser() {
-               user = new AuthenticatedUser("auser");
-
-               Assert.assertFalse(user.getAccessDate().isEmpty());
-               Assert.assertNull(user.getUserRoles());
-       }
-
-       @Test
-       public void testSetUserRoleList() {
-               List<String> retrievedRoleList = null;
-               List<String> roleList = Arrays.asList(roleArray);
-
-               // list arg
-               user = new AuthenticatedUser("auser");
-               user.setRoleList(roleList);
-               retrievedRoleList = user.getUserRoles();
-               Assert.assertTrue(roleList.equals(retrievedRoleList));
-
-               // array arg
-               user = new AuthenticatedUser("auser");
-               user.setRoleList(roleArray);
-               retrievedRoleList = user.getUserRoles();
-               for (int i = 0; i < roleArray.length; i++)
-                       Assert.assertTrue(roleArray[i].equals(retrievedRoleList.get(i)));
-
-               // test addUserRole
-               user.addUserRole("AnotherRole");
-               Assert.assertTrue(user.getUserRoles().lastIndexOf("AnotherRole") != -1);
-
-       }
-
-       @Test
-       public void testGetGrantedAuthorities() {
-               List<GrantedAuthority> gaList = user
-                               .getGrantedAuthorities(UserLevel.NETWORKOPERATOR);
-               Assert.assertTrue(gaList.get(0).getAuthority()
-                               .equals("ROLE_NETWORK-OPERATOR"));
-       }
+        static String[] roleArray;
+        static AuthenticatedUser user;
+
+        @BeforeClass
+        public static void testSetup() {
+                roleArray = new String[] { UserLevel.NETWORKOPERATOR.toString(),
+                                UserLevel.APPUSER.toString() };
+        }
+
+        @Test
+        public void testAuthenticatedUser() {
+                user = new AuthenticatedUser("auser");
+
+                Assert.assertFalse(user.getAccessDate().isEmpty());
+                Assert.assertNull(user.getUserRoles());
+        }
+
+        @Test
+        public void testSetUserRoleList() {
+                List<String> retrievedRoleList = null;
+                List<String> roleList = Arrays.asList(roleArray);
+
+                // list arg
+                user = new AuthenticatedUser("auser");
+                user.setRoleList(roleList);
+                retrievedRoleList = user.getUserRoles();
+                Assert.assertTrue(roleList.equals(retrievedRoleList));
+
+                // array arg
+                user = new AuthenticatedUser("auser");
+                user.setRoleList(roleArray);
+                retrievedRoleList = user.getUserRoles();
+                for (int i = 0; i < roleArray.length; i++)
+                        Assert.assertTrue(roleArray[i].equals(retrievedRoleList.get(i)));
+
+                // test addUserRole
+                user.addUserRole("AnotherRole");
+                Assert.assertTrue(user.getUserRoles().lastIndexOf("AnotherRole") != -1);
+
+        }
+
+        @Test
+        public void testGetGrantedAuthorities() {
+                List<GrantedAuthority> gaList = user
+                                .getGrantedAuthorities(UserLevel.NETWORKOPERATOR);
+                Assert.assertTrue(gaList.get(0).getAuthority()
+                                .equals("ROLE_NETWORK-OPERATOR"));
+        }
 
 }
index 7d28d23075ccdd7e434150422da7573b61a3bfd1..c7261d5ec265c8bd9e8ed0d163eed6d506fdac7b 100644 (file)
@@ -65,13 +65,13 @@ public class AuthorizationUserConfigTest {
         roles.clear();
         roles.add(UserLevel.NETWORKADMIN.toString());
         assertTrue(userConfig.update("ciscocisco", null, roles).isSuccess());
-        
+
         // Role change and same new password
         roles.clear();
         roles.add(UserLevel.NETWORKOPERATOR.toString());
         assertTrue(userConfig.update("ciscocisco", "ciscocisco", roles)
                 .isSuccess());
-        
+
         // New Password = null, No change in password
         assertTrue(userConfig.getPassword().equals("ciscocisco"));
 
index 33c11de0bae2e503ac90e9215e9cd21778c3b60e..d60d101cfb8614022acc2e4253d5970f1972508e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved. 
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
index 7cb2b3a054f679b435f5c0963a6d80469800e3e4..e1cfcc57087d4c1ca340f0fc13dccfd7d2ab5fb1 100644 (file)
@@ -76,7 +76,7 @@ public class Flows implements IDaylightWeb {
     @ResponseBody
     public Set<Map<String, Object>> getFlows(HttpServletRequest request, @RequestParam(required = false) String container) {
         String containerName = DaylightWebUtil.getAuthorizedContainer(request, container, this);
-        
+
         // fetch frm
         IForwardingRulesManager frm = (IForwardingRulesManager) ServiceHelper
                 .getInstance(IForwardingRulesManager.class, containerName, this);
@@ -113,7 +113,7 @@ public class Flows implements IDaylightWeb {
     @ResponseBody
     public Map<String, Object> getNodePorts(HttpServletRequest request, @RequestParam(required = false) String container) {
         String containerName = DaylightWebUtil.getAuthorizedContainer(request, container, this);
-        
+
         ISwitchManager switchManager = (ISwitchManager) ServiceHelper
                 .getInstance(ISwitchManager.class, containerName, this);
         if (switchManager == null) {
@@ -160,7 +160,7 @@ public class Flows implements IDaylightWeb {
     @ResponseBody
     public Map<String, Object> getNodeFlows(HttpServletRequest request, @RequestParam(required = false) String container) {
         String containerName = DaylightWebUtil.getAuthorizedContainer(request, container, this);
-        
+
         ISwitchManager switchManager = (ISwitchManager) ServiceHelper
                 .getInstance(ISwitchManager.class, containerName, this);
         if (switchManager == null) {
@@ -201,7 +201,7 @@ public class Flows implements IDaylightWeb {
         if (!isUserAuthorized(UserLevel.NETWORKADMIN, request)) {
             return "Operation not authorized";
         }
-        
+
         String containerName = DaylightWebUtil.getAuthorizedContainer(request, container, this);
 
         IForwardingRulesManager frm = (IForwardingRulesManager) ServiceHelper
@@ -232,7 +232,7 @@ public class Flows implements IDaylightWeb {
         if (!isUserAuthorized(UserLevel.NETWORKADMIN, request)) {
             return "Operation not authorized";
         }
-        
+
         String containerName = DaylightWebUtil.getAuthorizedContainer(request, container, this);
 
         IForwardingRulesManager frm = (IForwardingRulesManager) ServiceHelper
@@ -261,7 +261,7 @@ public class Flows implements IDaylightWeb {
     /**
      * Returns whether the current user's level is same or above the required
      * authorization level.
-     * 
+     *
      * @param requiredLevel
      *            the authorization level required
      */
index 46b8d4e0fe5e0329299a5671a6440ae801fbc853..c748171685ebcbe7886229987d1eda67c62d03ab 100644 (file)
@@ -95,7 +95,7 @@ public class DaylightWebAdmin {
 
         return userManager.removeLocalUser(userName).getDescription();
     }
-    
+
     @RequestMapping(value = "/users/password/{username}", method = RequestMethod.POST)
     @ResponseBody
     public Status changePassword(@PathVariable("username") String username, HttpServletRequest request,
@@ -105,23 +105,23 @@ public class DaylightWebAdmin {
         if (userManager == null) {
             return new Status(StatusCode.GONE, "User Manager not found");
         }
-        
+
         if (!authorize(userManager, UserLevel.NETWORKADMIN, request)) {
             return new Status(StatusCode.FORBIDDEN, "Operation not permitted");
         }
-        
+
         if (newPassword.isEmpty()) {
             return new Status(StatusCode.BADREQUEST, "Empty passwords not allowed");
         }
-        
+
         Status status = userManager.changeLocalUserPassword(username, currentPassword, newPassword);
-        
+
         return status;
     }
 
     /**
      * Is the operation permitted for the given level
-     * 
+     *
      * @param level
      */
     private boolean authorize(IUserManager userManager, UserLevel level,
index ee8284e8835e0d33f00c65ef89c484c812bbf302..a7f7133cb2a8b634d871f1ef53a550d2b0a1a15d 100644 (file)
@@ -11,11 +11,11 @@ import org.opendaylight.controller.sal.utils.ServiceHelper;
 
 public class DaylightWebUtil {
     private static String defaultName = GlobalConstants.DEFAULT.toString();
-    
+
     /**
      * Returns the container that this user is authorized to access. If the user is not authorized to the requested
      * container, then this method will return the default container.
-     * 
+     *
      * @param request - HttpServletRequest object to retrieve username
      * @param container - requested container
      * @param bundle - respective bundle
@@ -25,7 +25,7 @@ public class DaylightWebUtil {
         if (container == null) {
             return defaultName;
         }
-        
+
         String username = request.getUserPrincipal().getName();
         IContainerAuthorization containerAuthorization = (IContainerAuthorization)
                 ServiceHelper.getGlobalInstance(IContainerAuthorization.class, bundle);
index 55e3ee51103ffd8d88a7d1a1dc8969af270eba00..7421759d985086269e8b8dabfe4dcaf37bcf60c0 100644 (file)
@@ -14,31 +14,31 @@ public interface IDaylightWeb {
     /**
      * Returns the name of the bundle. In the GUI, this name will be displayed
      * on the tab.
-     * 
+     *
      * @return Name assigned to the bundle.
      */
     public String getWebName();
 
     /**
      * Returns the Id assigned to the web bundle.
-     * 
+     *
      * @return Id assigned to the web bundle.
      */
     public String getWebId();
 
     /**
      * Returns the position where the bundle tab will be placed in the GUI.
-     * 
+     *
      * @return Position number for the bundle tab.
      */
     public short getWebOrder();
 
     /**
      * This method checks if the user is authorized to access the bundle.
-     * 
+     *
      * @param userLevel
      *            user role level in the controller space.
-     * 
+     *
      * @return true, if user is authorized to access the bundle, else false.
      */
     public boolean isAuthorized(UserLevel userLevel);
index b4695defdb4468d5e3a1324e723e6bab169513ae..62b64a51849ea2ee08c4b9f43cffca8439bd5cad 100644 (file)
@@ -70,77 +70,77 @@ public class Topology implements IObjectReader, IConfigurationAware {
     protected Map<String, Map<String, Map<String, Object>>> metaCache = new HashMap<String, Map<String, Map<String, Object>>>();
     protected Map<String, Map<String, Object>> stagedNodes;
     protected Map<String, Map<String, Object>> newNodes;
-    
+
     protected Map<String, Integer> metaNodeHash = new HashMap<String, Integer>();
     protected Map<String, Integer> metaHostHash = new HashMap<String, Integer>();
     protected Map<String, Integer> metaNodeSingleHash = new HashMap<String, Integer>();
     protected Map<String, Integer> metaNodeConfigurationHash = new HashMap<String, Integer>();
-    
+
     public Topology() {
-       ServiceHelper.registerGlobalService(IConfigurationAware.class, this, null);
-       topologyWebFileName = ROOT + "topologyCache.sav";
-       loadConfiguration();
+        ServiceHelper.registerGlobalService(IConfigurationAware.class, this, null);
+        topologyWebFileName = ROOT + "topologyCache.sav";
+        loadConfiguration();
     }
-    
+
     /**
      * Topology of nodes and hosts in the network in JSON format.
-     * 
+     *
      * Mainly intended for consumption by the visual topology.
-     * 
+     *
      * @return - JSON output for visual topology
      */
     @RequestMapping(value = "/visual.json", method = RequestMethod.GET)
     @ResponseBody
     public Collection<Map<String, Object>> getLinkData(@RequestParam(required = false) String container, HttpServletRequest request) {
-       String containerName = DaylightWebUtil.getAuthorizedContainer(request, container, this);
-       
+        String containerName = DaylightWebUtil.getAuthorizedContainer(request, container, this);
+
         ITopologyManager topologyManager = (ITopologyManager) ServiceHelper
                 .getInstance(ITopologyManager.class, containerName, this);
         if (topologyManager == null) {
-               return null;
+                return null;
         }
         ISwitchManager switchManager = (ISwitchManager) ServiceHelper
                 .getInstance(ISwitchManager.class, containerName, this);
         if (switchManager == null) {
-               return null;
+                return null;
         }
-        
+
         Map<Node, Set<Edge>> nodeEdges = topologyManager.getNodeEdges();
         Map<Node, Set<NodeConnector>> hostEdges = topologyManager
                 .getNodesWithNodeConnectorHost();
         List<Switch> nodes = switchManager.getNetworkDevices();
-        
+
         List<SwitchConfig> switchConfigurations = new ArrayList<SwitchConfig>();
         for(Switch sw : nodes) {
-               Node n = sw.getNode();
-               SwitchConfig config = switchManager.getSwitchConfig(n.toString());
-               switchConfigurations.add(config);
+                Node n = sw.getNode();
+                SwitchConfig config = switchManager.getSwitchConfig(n.toString());
+                switchConfigurations.add(config);
         }
-        
+
         // initialize cache if needed
         if (!metaCache.containsKey(containerName)) {
-               metaCache.put(containerName, new HashMap<String, Map<String, Object>>());
-               // initialize hashes
-               metaNodeHash.put(containerName, null);
-               metaHostHash.put(containerName, null);
-               metaNodeSingleHash.put(containerName, null);
-               metaNodeConfigurationHash.put(containerName, null);
+                metaCache.put(containerName, new HashMap<String, Map<String, Object>>());
+                // initialize hashes
+                metaNodeHash.put(containerName, null);
+                metaHostHash.put(containerName, null);
+                metaNodeSingleHash.put(containerName, null);
+                metaNodeConfigurationHash.put(containerName, null);
         }
-        
+
         // return cache if topology hasn't changed
         if (
-               (metaNodeHash.get(containerName) != null && metaHostHash.get(containerName) != null && metaNodeSingleHash.get(containerName) != null && metaNodeConfigurationHash.get(containerName) != null) &&
-               metaNodeHash.get(containerName).equals(nodeEdges.hashCode()) && metaHostHash.get(containerName).equals(hostEdges.hashCode()) && metaNodeSingleHash.get(containerName).equals(nodes.hashCode()) && metaNodeConfigurationHash.get(containerName).equals(switchConfigurations.hashCode())
+                (metaNodeHash.get(containerName) != null && metaHostHash.get(containerName) != null && metaNodeSingleHash.get(containerName) != null && metaNodeConfigurationHash.get(containerName) != null) &&
+                metaNodeHash.get(containerName).equals(nodeEdges.hashCode()) && metaHostHash.get(containerName).equals(hostEdges.hashCode()) && metaNodeSingleHash.get(containerName).equals(nodes.hashCode()) && metaNodeConfigurationHash.get(containerName).equals(switchConfigurations.hashCode())
         ) {
-               return metaCache.get(containerName).values();
+                return metaCache.get(containerName).values();
         }
-        
+
         // cache has changed, we must assign the new values
         metaNodeHash.put(containerName, nodeEdges.hashCode());
         metaHostHash.put(containerName, hostEdges.hashCode());
         metaNodeSingleHash.put(containerName, nodes.hashCode());
         metaNodeConfigurationHash.put(containerName, switchConfigurations.hashCode());
-        
+
         stagedNodes = new HashMap<String, Map<String, Object>>();
         newNodes = new HashMap<String, Map<String, Object>>();
 
@@ -149,12 +149,12 @@ public class Topology implements IObjectReader, IConfigurationAware {
 
         // single nodes addition
         addSingleNodes(nodes, switchManager, containerName);
-        
+
         // hostNodes addition
         addHostNodes(hostEdges, topologyManager, containerName);
-        
+
         repositionTopology(containerName);
-        
+
         return metaCache.get(containerName).values();
     }
 
@@ -165,20 +165,20 @@ public class Topology implements IObjectReader, IConfigurationAware {
      * @param topology - the topology instance
      */
     private void addNodes(Map<Node, Set<Edge>> nodeEdges,
-            ITopologyManager topology, ISwitchManager switchManager, String containerName) {           
+            ITopologyManager topology, ISwitchManager switchManager, String containerName) {
         Bandwidth bandwidth = new Bandwidth(0);
         Map<Edge, Set<Property>> properties = topology.getEdges();
-        
+
         for (Map.Entry<Node, Set<Edge>> e : nodeEdges.entrySet()) {
             Node n = e.getKey();
             String description = switchManager.getNodeDescription(n);
             NodeBean node = createNodeBean(description, n);
-            
+
             // skip production node
             if (nodeIgnore(n)) {
                 continue;
             }
-            
+
             List<Map<String, Object>> adjacencies = new LinkedList<Map<String, Object>>();
             Set<Edge> links = e.getValue();
             for (Edge link : links) {
@@ -187,53 +187,53 @@ public class Topology implements IObjectReader, IConfigurationAware {
                 }
                 for (Property p : properties.get(link)) {
                     if (p instanceof Bandwidth) {
-                       bandwidth = (Bandwidth) p;
+                        bandwidth = (Bandwidth) p;
                         break;
                     }
                 }
                 EdgeBean edge = new EdgeBean(link, bandwidth);
                 adjacencies.add(edge.out());
             }
-            
+
             node.setLinks(adjacencies);
             if (metaCache.get(containerName).containsKey(node.id())) {
-               // retrieve node from cache
-               Map<String, Object> nodeEntry = metaCache.get(containerName).get(node.id());
-
-                       Map<String, String> data = (Map<String, String>) nodeEntry.get("data");
-                       data.put("$desc", description);
-                       nodeEntry.put("data", data);
-                       
-               // always update adjacencies
-               nodeEntry.put("adjacencies", adjacencies);
-               // stage this cached node (with position)
-               stagedNodes.put(node.id(), nodeEntry);
+                // retrieve node from cache
+                Map<String, Object> nodeEntry = metaCache.get(containerName).get(node.id());
+
+                        Map<String, String> data = (Map<String, String>) nodeEntry.get("data");
+                        data.put("$desc", description);
+                        nodeEntry.put("data", data);
+
+                // always update adjacencies
+                nodeEntry.put("adjacencies", adjacencies);
+                // stage this cached node (with position)
+                stagedNodes.put(node.id(), nodeEntry);
             } else {
-               newNodes.put(node.id(), node.out());
+                newNodes.put(node.id(), node.out());
             }
         }
     }
-    
+
     /**
      * Check if this node shouldn't appear in the visual topology
-     * 
+     *
      * @param node
      * @return
      */
     private boolean nodeIgnore(Node node) {
         String nodeType = node.getType();
-        
+
         // add other node types to ignore later
         if (nodeType.equals(NodeIDType.PRODUCTION)) {
             return true;
         }
-        
+
         return false;
     }
-    
+
     /**
      * Check if this edge shouldn't appear in the visual topology
-     * 
+     *
      * @param edge
      * @return
      */
@@ -243,57 +243,57 @@ public class Topology implements IObjectReader, IConfigurationAware {
         if (nodeIgnore(headNode)) {
             return true;
         }
-        
+
         NodeConnector tailNodeConnector = edge.getTailNodeConnector();
         Node tailNode = tailNodeConnector.getNode();
         if (nodeIgnore(tailNode)) {
             return true;
         }
-        
+
         return false;
     }
-    
+
     protected NodeBean createNodeBean(String description, Node node) {
-       String name = (description == null || 
-                       description.trim().isEmpty() ||
-                       description.equalsIgnoreCase("none"))?
-                                       node.toString() : description;
-               return  new NodeBean(node.toString(), name, NodeType.NODE);
+        String name = (description == null ||
+                        description.trim().isEmpty() ||
+                        description.equalsIgnoreCase("none"))?
+                                        node.toString() : description;
+                return  new NodeBean(node.toString(), name, NodeType.NODE);
     }
-    
+
     @SuppressWarnings("unchecked")
-       private void addSingleNodes(List<Switch> nodes, ISwitchManager switchManager, String containerName) {
-       if (nodes == null) {
-               return;
-       }
-       for (Switch sw : nodes) {
-               Node n = sw.getNode();
-               
-               // skip production node
-               if (nodeIgnore(n)) {
-                   continue;
-               }
-
-               String description = switchManager.getNodeDescription(n);
-               
-               if ((stagedNodes.containsKey(n.toString()) && metaCache.get(containerName).containsKey(n.toString())) || newNodes.containsKey(n.toString())) {
-                       continue;
-               }
-               NodeBean node = createNodeBean(description, n);
-               
-               // FIXME still doesn't display standalone node when last remaining link is removed
-               if (metaCache.get(containerName).containsKey(node.id()) && !stagedNodes.containsKey(node.id())) {
-                       Map<String, Object> nodeEntry = metaCache.get(containerName).get(node.id());
-                               Map<String, String> data = (Map<String, String>) nodeEntry.get("data");
-                       data.put("$desc", description);
-                       nodeEntry.put("data", data);
-                       // clear adjacencies since this is now a single node
-                       nodeEntry.put("adjacencies", new LinkedList<Map<String, Object>>());
-               stagedNodes.put(node.id(), nodeEntry);
+        private void addSingleNodes(List<Switch> nodes, ISwitchManager switchManager, String containerName) {
+        if (nodes == null) {
+                return;
+        }
+        for (Switch sw : nodes) {
+                Node n = sw.getNode();
+
+                // skip production node
+                if (nodeIgnore(n)) {
+                    continue;
+                }
+
+                String description = switchManager.getNodeDescription(n);
+
+                if ((stagedNodes.containsKey(n.toString()) && metaCache.get(containerName).containsKey(n.toString())) || newNodes.containsKey(n.toString())) {
+                        continue;
+                }
+                NodeBean node = createNodeBean(description, n);
+
+                // FIXME still doesn't display standalone node when last remaining link is removed
+                if (metaCache.get(containerName).containsKey(node.id()) && !stagedNodes.containsKey(node.id())) {
+                        Map<String, Object> nodeEntry = metaCache.get(containerName).get(node.id());
+                                Map<String, String> data = (Map<String, String>) nodeEntry.get("data");
+                        data.put("$desc", description);
+                        nodeEntry.put("data", data);
+                        // clear adjacencies since this is now a single node
+                        nodeEntry.put("adjacencies", new LinkedList<Map<String, Object>>());
+                stagedNodes.put(node.id(), nodeEntry);
             } else {
-               newNodes.put(node.id(), node.out());
+                newNodes.put(node.id(), node.out());
             }
-       }
+        }
     }
 
     /**
@@ -313,22 +313,22 @@ public class Topology implements IObjectReader, IConfigurationAware {
                 addressByteBuffer.putShort((short) 0);
                 addressByteBuffer.put(dmac.getValue());
                 addressByteBuffer.rewind();
-                
+
                 long hid = addressByteBuffer.getLong();
                 String hostId = String.valueOf(hid);
-                
+
                 NodeBean hostBean = new NodeBean(hostId, host.getNetworkAddressAsString(), NodeType.HOST);
                 List<Map<String, Object>> adjacencies = new LinkedList<Map<String, Object>>();
                 EdgeBean edge = new EdgeBean(connector, hid);
                 adjacencies.add(edge.out());
                 hostBean.setLinks(adjacencies);
-                
+
                 if (metaCache.get(containerName).containsKey(hostId)) {
-                       Map<String, Object> hostEntry = metaCache.get(containerName).get(hostId);
-                       hostEntry.put("adjacencies", adjacencies);
-                       stagedNodes.put(hostId, hostEntry);
+                        Map<String, Object> hostEntry = metaCache.get(containerName).get(hostId);
+                        hostEntry.put("adjacencies", adjacencies);
+                        stagedNodes.put(hostId, hostEntry);
                 } else {
-                       newNodes.put(String.valueOf(hid), hostBean.out());
+                        newNodes.put(String.valueOf(hid), hostBean.out());
                 }
             }
         }
@@ -339,24 +339,24 @@ public class Topology implements IObjectReader, IConfigurationAware {
      */
     private void repositionTopology(String containerName) {
         Graph<String, String> graph = new SparseMultigraph<String, String>();
-        
+
         metaCache.get(containerName).clear();
         metaCache.get(containerName).putAll(stagedNodes);
         metaCache.get(containerName).putAll(newNodes);
-        
+
         for (Map<String, Object> on : metaCache.get(containerName).values()) {
             graph.addVertex(on.toString());
 
             List<Map<String, Object>> adjacencies = (List<Map<String, Object>>) on.get("adjacencies");
-            
+
             for (Map<String, Object> adj : adjacencies) {
                 graph.addEdge(
-                       adj.toString(), adj.get("nodeFrom").toString(),
-                       adj.get("nodeTo").toString()
+                        adj.toString(), adj.get("nodeFrom").toString(),
+                        adj.get("nodeTo").toString()
                 );
             }
         }
-        
+
         CircleLayout<String, String> layout = new CircleLayout<String, String>(graph);
         layout.setSize(new Dimension(1200, 365));
         for (Map.Entry<String, Map<String, Object>> v : newNodes.entrySet()) {
@@ -373,7 +373,7 @@ public class Topology implements IObjectReader, IConfigurationAware {
 
     /**
      * Update node position
-     * 
+     *
      * This method is mainly used by the visual topology
      *
      * @param nodeId - The node to update
@@ -382,16 +382,16 @@ public class Topology implements IObjectReader, IConfigurationAware {
     @RequestMapping(value = "/node/{nodeId}", method = RequestMethod.POST)
     @ResponseBody
     public Map<String, Object> post(@PathVariable String nodeId, @RequestParam(required = true) String x,
-               @RequestParam(required = true) String y, @RequestParam(required = false) String container, 
-               HttpServletRequest request) {
-       if (!authorize(UserLevel.NETWORKADMIN, request)) {
-               return new HashMap<String, Object>(); // silently disregard new node position
-       }
-       
-       String containerName = getAuthorizedContainer(request, container);
-       
+                @RequestParam(required = true) String y, @RequestParam(required = false) String container,
+                HttpServletRequest request) {
+        if (!authorize(UserLevel.NETWORKADMIN, request)) {
+                return new HashMap<String, Object>(); // silently disregard new node position
+        }
+
+        String containerName = getAuthorizedContainer(request, container);
+
         String id = new String(nodeId);
-        
+
         if (!metaCache.get(containerName).containsKey(id)) {
             return null;
         }
@@ -403,123 +403,123 @@ public class Topology implements IObjectReader, IConfigurationAware {
         data.put("$y", y);
 
         node.put("data", data);
-        
+
         return node;
     }
-    
+
     /**
      * Node object for visual topology
      */
     protected class NodeBean {
-       protected String id;
-       protected String name;
-       protected Map<String, String> data;
-       protected List<Map<String, Object>> links;
-       
-       public NodeBean() {
-               data = new HashMap<String, String>();
-               links = new ArrayList<Map<String, Object>>();
-       }
-       
-       public NodeBean(String id, String name, String type) {
-               this();
-               this.id = id;
-               this.name = name;
-               data.put("$desc", name);
-               data.put("$type", type);
-       }
-       
-       public void setLinks(List<Map<String, Object>> links) {
-               this.links = links;
-       }
-       
-       public Map<String, Object> out() {
-               Map<String, Object> node = new HashMap<String, Object>();
-               node.put("id", this.id);
-               node.put("name", this.name);
-               node.put("data", this.data);
-               node.put("adjacencies", this.links);
-               
-               return node;
-       }
-       
-       public String name() {
-               return this.name;
-       }
-       
-       public String id() {
-               return this.id;
-       }
+        protected String id;
+        protected String name;
+        protected Map<String, String> data;
+        protected List<Map<String, Object>> links;
+
+        public NodeBean() {
+                data = new HashMap<String, String>();
+                links = new ArrayList<Map<String, Object>>();
+        }
+
+        public NodeBean(String id, String name, String type) {
+                this();
+                this.id = id;
+                this.name = name;
+                data.put("$desc", name);
+                data.put("$type", type);
+        }
+
+        public void setLinks(List<Map<String, Object>> links) {
+                this.links = links;
+        }
+
+        public Map<String, Object> out() {
+                Map<String, Object> node = new HashMap<String, Object>();
+                node.put("id", this.id);
+                node.put("name", this.name);
+                node.put("data", this.data);
+                node.put("adjacencies", this.links);
+
+                return node;
+        }
+
+        public String name() {
+                return this.name;
+        }
+
+        public String id() {
+                return this.id;
+        }
     }
-    
+
     /**
      * Edge object for visual topology
      */
     protected class EdgeBean {
-       protected NodeConnector source;
-       protected NodeConnector destination;
-       protected Map<String, String> data;
-       protected Long hostId;
-       
-       public EdgeBean() {
-               data = new HashMap<String, String>();
-       }
-       
-       public EdgeBean(Edge link, Bandwidth bandwidth) {
-               this();
-               this.source = link.getHeadNodeConnector();
-               this.destination = link.getTailNodeConnector();
-               
-               // data
-               data.put("$bandwidth", bandwidth.toString());
-               data.put("$color", bandwidthColor(bandwidth));
-               data.put("$nodeToPort", destination.getID().toString());
-               data.put("$nodeFromPort", source.getID().toString());
-               data.put("$descFrom", source.getNode().toString());
-               data.put("$descTo", destination.getNode().toString());
-               data.put("$nodeFromPortName", source.toString());
-               data.put("$nodeToPortName", destination.toString());
-       }
-       
-       public EdgeBean(NodeConnector connector, Long hostId) {
-               this();
-               this.source = null;
-               this.destination = connector;
-               this.hostId = hostId;
-               
-               data.put("$bandwidth", "N/A");
-               data.put("$color", bandwidthColor(new Bandwidth(0)));
-               data.put("$nodeToPort", connector.getNodeConnectorIDString());
-               data.put("$nodeFromPort", connector.getNodeConnectorIDString());
-               data.put("$descTo", "");
-               data.put("$descFrom", "");
-               data.put("$nodeToPortName", "");
-               data.put("$nodeFromPortName", "");
-       }
-       
-       public Map<String, Object> out() {
-               Map<String, Object> edge = new HashMap<String, Object>();
-               
-               edge.put("data", data);
-               if (source == null) {
-                       edge.put("nodeFrom", String.valueOf(this.hostId));
-               } else {
-                       edge.put("nodeFrom", source.getNode().toString());
-               }
-               edge.put("nodeTo", destination.getNode().toString());
-               
-               
-               return edge;
-       }
-       
-       private String bandwidthColor(Bandwidth bandwidth) {
-               String color = null;
-               long bandwidthValue = bandwidth.getValue();
-               
-               if (bandwidthValue == 0) {
+        protected NodeConnector source;
+        protected NodeConnector destination;
+        protected Map<String, String> data;
+        protected Long hostId;
+
+        public EdgeBean() {
+                data = new HashMap<String, String>();
+        }
+
+        public EdgeBean(Edge link, Bandwidth bandwidth) {
+                this();
+                this.source = link.getHeadNodeConnector();
+                this.destination = link.getTailNodeConnector();
+
+                // data
+                data.put("$bandwidth", bandwidth.toString());
+                data.put("$color", bandwidthColor(bandwidth));
+                data.put("$nodeToPort", destination.getID().toString());
+                data.put("$nodeFromPort", source.getID().toString());
+                data.put("$descFrom", source.getNode().toString());
+                data.put("$descTo", destination.getNode().toString());
+                data.put("$nodeFromPortName", source.toString());
+                data.put("$nodeToPortName", destination.toString());
+        }
+
+        public EdgeBean(NodeConnector connector, Long hostId) {
+                this();
+                this.source = null;
+                this.destination = connector;
+                this.hostId = hostId;
+
+                data.put("$bandwidth", "N/A");
+                data.put("$color", bandwidthColor(new Bandwidth(0)));
+                data.put("$nodeToPort", connector.getNodeConnectorIDString());
+                data.put("$nodeFromPort", connector.getNodeConnectorIDString());
+                data.put("$descTo", "");
+                data.put("$descFrom", "");
+                data.put("$nodeToPortName", "");
+                data.put("$nodeFromPortName", "");
+        }
+
+        public Map<String, Object> out() {
+                Map<String, Object> edge = new HashMap<String, Object>();
+
+                edge.put("data", data);
+                if (source == null) {
+                        edge.put("nodeFrom", String.valueOf(this.hostId));
+                } else {
+                        edge.put("nodeFrom", source.getNode().toString());
+                }
+                edge.put("nodeTo", destination.getNode().toString());
+
+
+                return edge;
+        }
+
+        private String bandwidthColor(Bandwidth bandwidth) {
+                String color = null;
+                long bandwidthValue = bandwidth.getValue();
+
+                if (bandwidthValue == 0) {
                 color = "#000";
             } else if (bandwidthValue < Bandwidth.BW1Kbps) {
-               color = "#148AC6";
+                color = "#148AC6";
             } else if (bandwidthValue < Bandwidth.BW1Mbps) {
                 color = "#2858A0";
             } else if (bandwidthValue < Bandwidth.BW1Gbps) {
@@ -529,58 +529,58 @@ public class Topology implements IObjectReader, IConfigurationAware {
             } else if (bandwidthValue < Bandwidth.BW1Pbps) {
                 color = "#F9F464";
             }
-               
-               return color;
+
+                return color;
         }
     }
-    
+
     protected class NodeType {
-       public static final String NODE = "swtch";
-       public static final String HOST = "host";
+        public static final String NODE = "swtch";
+        public static final String HOST = "host";
     }
-    
+
     private boolean authorize(UserLevel level, HttpServletRequest request) {
-       IUserManager userManager = (IUserManager) ServiceHelper
+        IUserManager userManager = (IUserManager) ServiceHelper
                 .getGlobalInstance(IUserManager.class, this);
         if (userManager == null) {
-               return false;
+                return false;
         }
-        
+
         String username = request.getUserPrincipal().getName();
         UserLevel userLevel = userManager.getUserLevel(username);
         if (userLevel.toNumber() <= level.toNumber()) {
-               return true;
+                return true;
         }
         return false;
     }
-    
+
     private String getAuthorizedContainer(HttpServletRequest request, String container) {
-       String username = request.getUserPrincipal().getName();
-       IContainerAuthorization containerAuthorization = (IContainerAuthorization) ServiceHelper.
-                       getGlobalInstance(IContainerAuthorization.class, this);
-       if (containerAuthorization != null) {
-               Set<Resource> resources = containerAuthorization.getAllResourcesforUser(username);
-               if (authorizeContainer(container, resources)) {
-                       return container;
-               }
-       }
-       
-       return GlobalConstants.DEFAULT.toString();
+        String username = request.getUserPrincipal().getName();
+        IContainerAuthorization containerAuthorization = (IContainerAuthorization) ServiceHelper.
+                        getGlobalInstance(IContainerAuthorization.class, this);
+        if (containerAuthorization != null) {
+                Set<Resource> resources = containerAuthorization.getAllResourcesforUser(username);
+                if (authorizeContainer(container, resources)) {
+                        return container;
+                }
+        }
+
+        return GlobalConstants.DEFAULT.toString();
     }
-    
+
     private boolean authorizeContainer(String container, Set<Resource> resources) {
-       for(Resource resource : resources) {
-               String containerName = (String) resource.getResource();
-               if (containerName.equals(container)) {
-                       return true;
-               }
-       }
-       
-       return false;
+        for(Resource resource : resources) {
+                String containerName = (String) resource.getResource();
+                if (containerName.equals(container)) {
+                        return true;
+                }
+        }
+
+        return false;
     }
 
     @SuppressWarnings("unchecked")
-       private void loadConfiguration() {
+        private void loadConfiguration() {
         ObjectReader objReader = new ObjectReader();
         metaCache = (Map<String, Map<String, Map<String, Object>>>) objReader.read(this, topologyWebFileName);
         if (metaCache == null) metaCache = new HashMap<String, Map<String, Map<String, Object>>>();
index e26e7c666b1a37a5ad1c3cf524162deb3548753c..e33af082b6f630b52e8c8bbed5211b5bcb082826 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved. 
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -16,32 +16,32 @@ import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.utils.NodeCreator;
 import org.opendaylight.controller.switchmanager.SwitchConfig;
 import org.opendaylight.controller.topology.web.Topology.NodeBean;
-               
+
 public class TopologyTest {
 
-       @Test
-       public void testCreateNodeBean() {
-               Topology topology = new Topology();
-               Node node = NodeCreator.createOFNode(new Long(3));
-               String description = "foo";
-               
-               NodeBean bean = topology.createNodeBean(description, node);
-               
-               assertNotNull(bean);
-               assertEquals(bean.id, node.toString());
-               assertEquals(bean.name, "foo");
-               
-               bean = topology.createNodeBean(null, node);
-               
-               assertNotNull(bean);
-               assertEquals(bean.id, node.toString());
-               assertEquals(bean.name, bean.id);
-               
-               bean = topology.createNodeBean("   ", node);
-               
-               assertNotNull(bean);
-               assertEquals(bean.id, node.toString());
-               assertEquals(bean.name, bean.id);
-       }
+        @Test
+        public void testCreateNodeBean() {
+                Topology topology = new Topology();
+                Node node = NodeCreator.createOFNode(new Long(3));
+                String description = "foo";
+
+                NodeBean bean = topology.createNodeBean(description, node);
+
+                assertNotNull(bean);
+                assertEquals(bean.id, node.toString());
+                assertEquals(bean.name, "foo");
+
+                bean = topology.createNodeBean(null, node);
+
+                assertNotNull(bean);
+                assertEquals(bean.id, node.toString());
+                assertEquals(bean.name, bean.id);
+
+                bean = topology.createNodeBean("   ", node);
+
+                assertNotNull(bean);
+                assertEquals(bean.id, node.toString());
+                assertEquals(bean.name, bean.id);
+        }
 
 }
index f145c568b58b18bf62efdda84eadbadefb5934b7..bde4152f5bdfd59c3631a5a80fbaccfd5011343a 100644 (file)
@@ -231,10 +231,10 @@ public class Troubleshoot implements IDaylightWeb {
         Match match = flow.getMatch();
         ISwitchManager switchManager = (ISwitchManager) ServiceHelper
                 .getInstance(ISwitchManager.class, containerName, this);
-        String desc = (switchManager == null)? 
-                       "" : switchManager.getNodeDescription(node);
-        desc = (desc.isEmpty() || desc.equalsIgnoreCase("none"))? 
-                       node.toString(): desc;
+        String desc = (switchManager == null)?
+                        "" : switchManager.getNodeDescription(node);
+        desc = (desc.isEmpty() || desc.equalsIgnoreCase("none"))?
+                        node.toString(): desc;
         row.put("nodeName", desc);
         if (match.isPresent(MatchType.IN_PORT)) {
             row.put(MatchType.IN_PORT.id(), ((NodeConnector) flow.getMatch()
@@ -300,7 +300,7 @@ public class Troubleshoot implements IDaylightWeb {
             Short tpSrc = (Short) (flow.getMatch().getField(MatchType.TP_SRC)
                     .getValue());
             row.put(MatchType.TP_SRC.id(),
-                       String.valueOf(NetUtils.getUnsignedShort(tpSrc)));
+                        String.valueOf(NetUtils.getUnsignedShort(tpSrc)));
         } else {
             row.put(MatchType.TP_SRC.id(), "*");
         }
@@ -308,7 +308,7 @@ public class Troubleshoot implements IDaylightWeb {
             Short tpDst = (Short) (flow.getMatch().getField(MatchType.TP_DST)
                     .getValue());
             row.put(MatchType.TP_DST.id(),
-                       String.valueOf(NetUtils.getUnsignedShort(tpDst)));
+                        String.valueOf(NetUtils.getUnsignedShort(tpDst)));
         } else {
             row.put(MatchType.TP_DST.id(), "*");
         }