]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/resolver/protocol/class_
Updated 'core'.
[hub.git] / application / hub / main / resolver / protocol / class_
index 8246fbca6f15bf195ed19c476ddd1466ef6d3992..ccc83ffcc6021ff24aab6763fc64a33d244a756c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @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
  *
@@ -33,7 +33,7 @@ class !!!ProtocolResolver extends BaseProtocolResolver implements ProtocolResolv
        }
 
        /**
-        * 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
         */
@@ -46,15 +46,37 @@ class !!!ProtocolResolver extends BaseProtocolResolver implements ProtocolResolv
        }
 
        /**
-        * 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;
        }
 }