<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic HP VAN SDN Controller v2.4.5 - Can't use internal services in Software Defined Networking</title>
    <link>https://community.hpe.com/t5/software-defined-networking/hp-van-sdn-controller-v2-4-5-can-t-use-internal-services/m-p/6712492#M1717</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm developing an aplication on Java as well for the HP VAN SDN Controller v2.4.5 and I'm interested in using it's internal services as you did. (NodeService, TopologyService, and so on). But I haven't been able to do that, the program runs normally until it reaches an instruction like&amp;nbsp;&lt;SPAN&gt;Set&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;Node&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;nodes&lt;/SPAN&gt;&lt;SPAN&gt; = nodeService.getNodes(IpAddress.ip(ipAddress)); and it stops running.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't know what's missing so I can use such services. I'm going to leave a sample of code that I'm working on so you can see where it stops:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public class trffcmngrManager implements trffcmngrService {&lt;BR /&gt;&lt;BR /&gt;//@SuppressWarnings("unused")&lt;BR /&gt;@Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.MANDATORY_UNARY)&lt;BR /&gt;&lt;BR /&gt;private volatile ControllerService controllerService; // This Service works perfectly&amp;nbsp;&lt;BR /&gt;private volatile TopologyService topoService; //This is the Service that I want to use and I can't&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;private static final Logger LOG = LoggerFactory.getLogger( trffcmngrService.class );&lt;BR /&gt;&lt;BR /&gt;private SwitchListener switchListener;&lt;BR /&gt;private PacketListener packetListener; // This is the class where I want to use Topology Service&lt;BR /&gt;&lt;BR /&gt;@Activate&lt;BR /&gt;protected void activate()&lt;BR /&gt;{&lt;BR /&gt;LOG.info( "MySdnLab: Activated" );&lt;BR /&gt;LOG.info( "MySdnLab: I'm Alive!!!!!" );&lt;BR /&gt;switchListener = new SwitchListener();&lt;BR /&gt;switchListener.init(controllerService);&lt;BR /&gt;switchListener.startup();&lt;BR /&gt;&lt;BR /&gt;packetListener = new PacketListener();&lt;BR /&gt;packetListener.init(controllerService, topoService);&lt;BR /&gt;packetListener.startup();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@Deactivate&lt;BR /&gt;protected void deactivate()&lt;BR /&gt;{&lt;BR /&gt;LOG.info( "MySdnLab: Deactivated" );&lt;BR /&gt;LOG.info( "MySdnLab: Ok.. I'm dead" );&lt;BR /&gt;switchListener.shutdown();&lt;BR /&gt;packetListener.shutdown();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;///-------------------------------//-------------------------------------------------//&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;public class IpPacketHandler {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ControllerService mControllerService;&lt;BR /&gt;TopologyService mTopoService;&lt;BR /&gt;&lt;BR /&gt;private static final Logger LOG = LoggerFactory.getLogger(IpPacketHandler.class);&lt;BR /&gt;private static final ProtocolVersion PV = ProtocolVersion.V_1_3;&lt;BR /&gt;&lt;BR /&gt;public IpPacketHandler(ControllerService controllerservice, TopologyService topoService) {&lt;BR /&gt;mControllerService = controllerservice;&lt;BR /&gt;mTopoService = topoService;&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/*&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;*There is some code here that will call the next function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;private DataPathId FindDestination (MessageContext messageContext, MacAddress destAdd){&lt;BR /&gt;LOG.info("MySdnLab: IpPacketHandler: FindDestination Activated");&lt;BR /&gt;Topology topology = mTopoService.getTopology(); //This is where the program stops&lt;BR /&gt;LOG.info("MySdnLab: IpPacketHandler: topogia {}", topology.toString());&lt;BR /&gt;return null;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate your help in advance.&lt;/P&gt;&lt;P&gt;PM&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Feb 2015 15:56:08 GMT</pubDate>
    <dc:creator>PaMartins</dc:creator>
    <dc:date>2015-02-24T15:56:08Z</dc:date>
    <item>
      <title>HP VAN SDN Controller v2.4.5 - Can't use internal services</title>
      <link>https://community.hpe.com/t5/software-defined-networking/hp-van-sdn-controller-v2-4-5-can-t-use-internal-services/m-p/6712492#M1717</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm developing an aplication on Java as well for the HP VAN SDN Controller v2.4.5 and I'm interested in using it's internal services as you did. (NodeService, TopologyService, and so on). But I haven't been able to do that, the program runs normally until it reaches an instruction like&amp;nbsp;&lt;SPAN&gt;Set&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;Node&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;nodes&lt;/SPAN&gt;&lt;SPAN&gt; = nodeService.getNodes(IpAddress.ip(ipAddress)); and it stops running.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't know what's missing so I can use such services. I'm going to leave a sample of code that I'm working on so you can see where it stops:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public class trffcmngrManager implements trffcmngrService {&lt;BR /&gt;&lt;BR /&gt;//@SuppressWarnings("unused")&lt;BR /&gt;@Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.MANDATORY_UNARY)&lt;BR /&gt;&lt;BR /&gt;private volatile ControllerService controllerService; // This Service works perfectly&amp;nbsp;&lt;BR /&gt;private volatile TopologyService topoService; //This is the Service that I want to use and I can't&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;private static final Logger LOG = LoggerFactory.getLogger( trffcmngrService.class );&lt;BR /&gt;&lt;BR /&gt;private SwitchListener switchListener;&lt;BR /&gt;private PacketListener packetListener; // This is the class where I want to use Topology Service&lt;BR /&gt;&lt;BR /&gt;@Activate&lt;BR /&gt;protected void activate()&lt;BR /&gt;{&lt;BR /&gt;LOG.info( "MySdnLab: Activated" );&lt;BR /&gt;LOG.info( "MySdnLab: I'm Alive!!!!!" );&lt;BR /&gt;switchListener = new SwitchListener();&lt;BR /&gt;switchListener.init(controllerService);&lt;BR /&gt;switchListener.startup();&lt;BR /&gt;&lt;BR /&gt;packetListener = new PacketListener();&lt;BR /&gt;packetListener.init(controllerService, topoService);&lt;BR /&gt;packetListener.startup();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@Deactivate&lt;BR /&gt;protected void deactivate()&lt;BR /&gt;{&lt;BR /&gt;LOG.info( "MySdnLab: Deactivated" );&lt;BR /&gt;LOG.info( "MySdnLab: Ok.. I'm dead" );&lt;BR /&gt;switchListener.shutdown();&lt;BR /&gt;packetListener.shutdown();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;///-------------------------------//-------------------------------------------------//&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;public class IpPacketHandler {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ControllerService mControllerService;&lt;BR /&gt;TopologyService mTopoService;&lt;BR /&gt;&lt;BR /&gt;private static final Logger LOG = LoggerFactory.getLogger(IpPacketHandler.class);&lt;BR /&gt;private static final ProtocolVersion PV = ProtocolVersion.V_1_3;&lt;BR /&gt;&lt;BR /&gt;public IpPacketHandler(ControllerService controllerservice, TopologyService topoService) {&lt;BR /&gt;mControllerService = controllerservice;&lt;BR /&gt;mTopoService = topoService;&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/*&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;*There is some code here that will call the next function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;private DataPathId FindDestination (MessageContext messageContext, MacAddress destAdd){&lt;BR /&gt;LOG.info("MySdnLab: IpPacketHandler: FindDestination Activated");&lt;BR /&gt;Topology topology = mTopoService.getTopology(); //This is where the program stops&lt;BR /&gt;LOG.info("MySdnLab: IpPacketHandler: topogia {}", topology.toString());&lt;BR /&gt;return null;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate your help in advance.&lt;/P&gt;&lt;P&gt;PM&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 15:56:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-defined-networking/hp-van-sdn-controller-v2-4-5-can-t-use-internal-services/m-p/6712492#M1717</guid>
      <dc:creator>PaMartins</dc:creator>
      <dc:date>2015-02-24T15:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: HP VAN SDN Controller v2.4.5 - Can't use internal services</title>
      <link>https://community.hpe.com/t5/software-defined-networking/hp-van-sdn-controller-v2-4-5-can-t-use-internal-services/m-p/6712952#M1718</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it seems I just found the problem, when we request a service to the controller it has to have a reference like this one:&amp;nbsp;&lt;SPAN&gt;@Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.MANDATORY_UNARY)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So what I did was justo copy this intruction to all other Services and they are working perfectly:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;//@SuppressWarnings("unused")&lt;BR /&gt;@Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.MANDATORY_UNARY)&lt;BR /&gt;private volatile ControllerService controllerService;&lt;BR /&gt;@Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.MANDATORY_UNARY)&lt;BR /&gt;private volatile TopologyService topoService;&lt;BR /&gt;@Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.MANDATORY_UNARY)&lt;BR /&gt;private volatile NodeService nodeService;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I guess it's problem soved then ;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just want to ask another question, what is exacly that reference? How does it work?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;PM&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 15:04:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-defined-networking/hp-van-sdn-controller-v2-4-5-can-t-use-internal-services/m-p/6712952#M1718</guid>
      <dc:creator>PaMartins</dc:creator>
      <dc:date>2015-02-25T15:04:47Z</dc:date>
    </item>
  </channel>
</rss>

