*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
}
/**
- * Creates an instance of a !!! command resolver with a given default command
+ * Creates an instance of a !!! protocol resolver
*
* @return $resolverInstance The prepared command resolver instance
*/
}
/**
- * Returns an command instance for a given request class or null if
- * it was not found
+ * Returns an instance of a LocateableNode class for a given NodeHelper
+ * instance or null if it was not found.
*
* @param $nodeInstance An instance of a NodeHelper class
* @return $unlInstance An instance of a LocateableNode class
* @todo 0% done
*/
- public function resolveUniversalResourceLocatorFromNodeHelper (NodeHelper $nodeInstance) {
- $this->partialStub('Please implement this method.');
+ public function resolveUniversalNodeLocatorFromNodeHelper (NodeHelper $nodeInstance) {
+ $this->partialStub('Please implement this method. nodeInstance=' . $nodeInstance->__toString());
+ }
+
+ /**
+ * Returns the UNL as string from given configuration key.
+ *
+ * @param $configKey Configuration key for UNL address (valid: internal,external)
+ * @return $unl Universal node locator
+ * @todo 90% done
+ */
+ public function resolveUniversalNodeLocatorFromConfigKey ($configKey) {
+ // Put all together
+ $unl = sprintf('%s://%s',
+ $this->getProtocolName(),
+ $this->getConfigInstance()->getConfigEntry($configKey . '_address')
+ );
+
+ /*
+ * And return it. Please note that e.g. a FaxProtocolResolver will
+ * return a different UNL and therefore all protocol resolvers must do
+ * it on their own way.
+ */
+ return $unl;
}
}