* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class HubSelfConnectHelper extends BaseHubHelper {
+class HubSelfConnectHelper extends BaseHubHelper implements HelpableHub {
/**
* Protected constructor
*
return $helperInstance;
}
+ /**
+ * Loads the descriptor XML file
+ *
+ * @return void
+ */
+ public function loadDescriptorXml () {
+ $this->partialStub('Please implement this method.');
+ }
+
/**
* Do the self-connect attempt by delivering a package to ourselfs
*
* @return void
*/
- public function doSelfConnect () {
- $this->partialStub('Not yet finished.');
+ public function sendPackage () {
+ // Sanity check: Is the node in the approx. state? (active)
+ $this->getNodeInstance()->getStateInstance()->validateNodeStateIsActive();
+
+ // Compile the template, this inserts the loaded node data into the gaps.
+ $this->getTemplateInstance()->compileTemplate();
+
+ // Get a singleton network package instance
+ $packageInstance = NetworkPackageFactory::createNetworkPackageInstance();
+
+ // Next, feed the content in. The network package class is a pipe-through class.
+ $packageInstance->enqueueRawDataFromTemplate($this);
}
}