\FDBArchive
Network equipment FDB tables archive implementation
Synopsis
class FDBArchive
{
- // constants
- const PATH_CACHE = 'exports/';
- const OLT_PATH_CACHE = 'exports/pondata/fdb/';
- const EXT_SWITCHES = '_fdb';
- const EXT_SWITCHES_VLAN = '_vlan';
- const EXT_SWITCHES_PORTDESCR = '_portdescr';
- const EXT_OLTS = '_OLTFDB';
- const TABLE_ARCHIVE = 'fdbarchive';
- const URL_ME = '?module=fdbarchive';
- const URL_CACHE = '?module=switchpoller';
- const URL_SWITCHPROFILE = '?module=switches&edit=';
- const URL_USERPROFILE = '?module=userprofile&username=';
- const URL_ONUPROFILE = '?module=ponizer&editonu=';
- // members
- protected array $altCfg = ;
- protected array $allSwitches = ;
- protected array $allSwitchesMac = ;
- protected array $allUserData = ;
- protected array $allUsersMac = ;
- protected array $allOnuMac = ;
- protected array $allOnuUsers = ;
- protected $archive = '';
- protected $json = '';
- protected integer $daysRotate = 0;
- protected boolean $fdbExtenInfo = false;
- // methods
- public void __construct()
- protected void loadConfigs()
- protected void initArchive()
- protected void initJson()
- protected void loadSwitches()
- protected void loadUserData()
- protected void loadOnuData()
- protected string extractSwitchIP()
- protected int/void getSwitchId()
- protected int extractOltId()
- protected string getOltIp()
- protected void saveOltCache()
- protected void saveSwitchesCache()
- public void storeArchive()
- protected void rotateArchive()
- public string renderArchive()
- protected string getEntityControl()
- protected string getOnuHandle()
- protected void parseData()
- public void ajArchiveData()
- public static string renderNavigationPanel()
Constants
Name | Value |
---|---|
PATH_CACHE | 'exports/' |
OLT_PATH_CACHE | 'exports/pondata/fdb/' |
EXT_SWITCHES | '_fdb' |
EXT_SWITCHES_VLAN | '_vlan' |
EXT_SWITCHES_PORTDESCR | '_portdescr' |
EXT_OLTS | '_OLTFDB' |
TABLE_ARCHIVE | 'fdbarchive' |
URL_ME | '?module=fdbarchive' |
URL_CACHE | '?module=switchpoller' |
URL_SWITCHPROFILE | '?module=switches&edit=' |
URL_USERPROFILE | '?module=userprofile&username=' |
URL_ONUPROFILE | '?module=ponizer&editonu=' |
Members
protected
- $allOnuMac
—
array
Contains available ONU devices mac address as mac=>id - $allOnuUsers
—
array
Contains available ONU devices assigned users id=>login - $allSwitches
—
array
Contains all available switches devices as id=>data - $allSwitchesMac
—
array
Contains existing switches MAC addresses as mac=>id - $allUserData
—
array
Contains available users data from cache - $allUsersMac
—
array
Contains available users mac address as mac=>login - $altCfg
—
array
Contains system alter config as key=>value - $archive
—
Protected database model placeholder - $daysRotate
—
int
Days counter before automatic archive cleanup/rotation -
$fdbExtenInfo
Placeholder for SW_FDB_EXTEN_INFO alter.ini option - $json
—
Object wide json helper placeholder
Methods
protected
- extractOltId() — Extracts OLT id from cache record name
- extractSwitchIP() — Extracts IP address from switch cache record name
- getEntityControl() — Trying to detect is device switch/user or ONU by mac. Returns profile view control.
- getOltIp() — Trying to get OLT IP for existing device by its ID
- getOnuHandle() — Trying to detect ONU device by mac. Returns profile view control.
- getSwitchId() — Tryin to detect switch ID by its IP address
- initArchive() — Inits archive model as protected property for further usage
- initJson() — Inits archive model as protected property for further usage
- loadConfigs() — Preloads system configs into protected props for further usage
- loadOnuData() — Loads PON ONU devices data into protected properties for further usage
- loadSwitches() — Loads switches into protected property
- loadUserData() — Loads user data into protected properties for further usage
- parseData() — Parses archive raw data and stores data into instance json helper
- rotateArchive() — Performs automatic archived data rotation
- saveOltCache() — Performs cache scanning and saving into archive of current PON devices FDB cache
- saveSwitchesCache() — Performs cache scanning and saving into archive of current switches FDB cache
public
- __construct()
- ajArchiveData() — Renders JSON data for background ajax requests
- renderArchive() — Renders archive container
- storeArchive() — Performs cache scanning and storing into archive