- Community Home
- >
- Networking
- >
- Software Defined Networking
- >
- Re: HP VAN SDN Controller v2.4.5 - Can't use inter...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2015 07:56 AM
02-24-2015 07:56 AM
HP VAN SDN Controller v2.4.5 - Can't use internal services
Hello,
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 Set<Node> nodes = nodeService.getNodes(IpAddress.ip(ipAddress)); and it stops running.
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:
public class trffcmngrManager implements trffcmngrService {
//@SuppressWarnings("unused")
@Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.MANDATORY_UNARY)
private volatile ControllerService controllerService; // This Service works perfectly
private volatile TopologyService topoService; //This is the Service that I want to use and I can't
private static final Logger LOG = LoggerFactory.getLogger( trffcmngrService.class );
private SwitchListener switchListener;
private PacketListener packetListener; // This is the class where I want to use Topology Service
@Activate
protected void activate()
{
LOG.info( "MySdnLab: Activated" );
LOG.info( "MySdnLab: I'm Alive!!!!!" );
switchListener = new SwitchListener();
switchListener.init(controllerService);
switchListener.startup();
packetListener = new PacketListener();
packetListener.init(controllerService, topoService);
packetListener.startup();
}
@Deactivate
protected void deactivate()
{
LOG.info( "MySdnLab: Deactivated" );
LOG.info( "MySdnLab: Ok.. I'm dead" );
switchListener.shutdown();
packetListener.shutdown();
}
}
///-------------------------------//-------------------------------------------------//
public class IpPacketHandler {
ControllerService mControllerService;
TopologyService mTopoService;
private static final Logger LOG = LoggerFactory.getLogger(IpPacketHandler.class);
private static final ProtocolVersion PV = ProtocolVersion.V_1_3;
public IpPacketHandler(ControllerService controllerservice, TopologyService topoService) {
mControllerService = controllerservice;
mTopoService = topoService;
}
/*
*There is some code here that will call the next function
*/
private DataPathId FindDestination (MessageContext messageContext, MacAddress destAdd){
LOG.info("MySdnLab: IpPacketHandler: FindDestination Activated");
Topology topology = mTopoService.getTopology(); //This is where the program stops
LOG.info("MySdnLab: IpPacketHandler: topogia {}", topology.toString());
return null;
}
}
I really appreciate your help in advance.
PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2015 07:04 AM
02-25-2015 07:04 AM
Re: HP VAN SDN Controller v2.4.5 - Can't use internal services
Hello,
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: @Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.MANDATORY_UNARY)
So what I did was justo copy this intruction to all other Services and they are working perfectly:
//@SuppressWarnings("unused")
@Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.MANDATORY_UNARY)
private volatile ControllerService controllerService;
@Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.MANDATORY_UNARY)
private volatile TopologyService topoService;
@Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.MANDATORY_UNARY)
private volatile NodeService nodeService;
So I guess it's problem soved then ;)
I just want to ask another question, what is exacly that reference? How does it work?
Thank you!
Cheers
PM