Skip to content

Commit

Permalink
Director: Controller and Model Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergkemper committed May 24, 2017
1 parent 3353497 commit 2709676
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 2 deletions.
30 changes: 29 additions & 1 deletion module/Director/src/Director/Controller/DirectorController.php
Expand Up @@ -5,7 +5,7 @@
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos-webui for the canonical source repository
* @copyright Copyright (c) 2013-2016 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @copyright Copyright (c) 2013-2017 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -31,6 +31,9 @@

class DirectorController extends AbstractActionController
{
/**
* Variables
*/
protected $directorModel = null;
protected $bsock = null;
protected $acl_alert = false;
Expand All @@ -42,6 +45,11 @@ class DirectorController extends AbstractActionController
"help"
);

/**
* Index Action
*
* @return object
*/
public function indexAction()
{
$this->RequestURIPlugin()->setRequestURI();
Expand Down Expand Up @@ -74,6 +82,11 @@ public function indexAction()
));
}

/**
* Message Action
*
* @return object
*/
public function messagesAction()
{
$this->RequestURIPlugin()->setRequestURI();
Expand All @@ -95,6 +108,11 @@ public function messagesAction()
return new ViewModel();
}

/**
* Console Action
*
* @return object
*/
public function consoleAction()
{
$this->RequestURIPlugin()->setRequestURI();
Expand All @@ -116,6 +134,11 @@ public function consoleAction()
return new ViewModel();
}

/**
* Get Data Action
*
* @return object
*/
public function getDataAction()
{
$this->RequestURIPlugin()->setRequestURI();
Expand Down Expand Up @@ -163,6 +186,11 @@ public function getDataAction()
return $response;
}

/**
* Get Director Model
*
* @return object
*/
public function getDirectorModel()
{
if(!$this->directorModel) {
Expand Down
41 changes: 40 additions & 1 deletion module/Director/src/Director/Model/DirectorModel.php
Expand Up @@ -5,7 +5,7 @@
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos-webui for the canonical source repository
* @copyright Copyright (c) 2013-2016 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @copyright Copyright (c) 2013-2017 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -27,6 +27,13 @@

class DirectorModel
{
/**
* Get Available Commands
*
* @param $bsock
*
* @return array
*/
public function getAvailableCommands(&$bsock=null)
{
if(isset($bsock)) {
Expand All @@ -40,6 +47,13 @@ public function getAvailableCommands(&$bsock=null)
}
}

/**
* Get Director Version
*
* @param $bsock
*
* @return array
*/
public function getDirectorVersion(&$bsock=null)
{
if(isset($bsock)) {
Expand All @@ -53,6 +67,13 @@ public function getDirectorVersion(&$bsock=null)
}
}

/**
* Get Director Status
*
* @param $bsock
*
* @return string
*/
public function getDirectorStatus(&$bsock=null)
{
if(isset($bsock)) {
Expand All @@ -65,6 +86,16 @@ public function getDirectorStatus(&$bsock=null)
}
}

/**
* Get Director Messages
*
* @param $bsock
* @param $limit
* @param $offset
* @param $reverse
*
* @return array
*/
public function getDirectorMessages(&$bsock=null, $limit=null, $offset=null, $reverse=null)
{
if(isset($bsock, $limit)) {
Expand All @@ -89,6 +120,14 @@ public function getDirectorMessages(&$bsock=null, $limit=null, $offset=null, $re
}
}

/**
* Send Director Command
*
* @param $bsock
* @param $cmd
*
* @return string
*/
public function sendDirectorCommand(&$bsock=null, $cmd=null)
{
if(isset($bsock, $cmd)) {
Expand Down

0 comments on commit 2709676

Please sign in to comment.