// Return the prepared instance
return $discoveryInstance;
}
+
+ /**
+ * "Discovers" an instance of a LocateableNode class for given NodeHelper class
+ *
+ * @param $nodeInstance An instance of a NodeHelper class
+ * @return $unlInstance An instance of a LocateableNode class
+ */
+ public function discoverUniversalNodeLocatorByNode (NodeHelper $nodeInstance) {
+ /*
+ * First get an instance from the configured hub communication protocol
+ * type (which is mostly TCP, so you get a TcpProtocolResolver here).
+ */
+ $resolverInstance = ProtocolResolverFactory::createResolverFromConfiguredProtocol();
+
+ // Then resolve the node instance into an UNL instance
+ $unlInstance = $resolverInstance->resolveUniversalResourceLocatorFromNodeHelper($nodeInstance);
+ die(__METHOD__ . ':unlInstance=' . print_r($unlInstance, TRUE));
+ }
}
// [EOF]