$cfg->setConfigEntry('node_list_db_wrapper_class', 'NodeListDatabaseWrapper');
// CFG: PEER-LOOKUP-DB-WRAPPER-CLASS
-$cfg->setConfigEntry('peer_lookup_db_wrapper_class', 'PeerLookupDatabaseWrapper');
+$cfg->setConfigEntry('peer_state_lookup_db_wrapper_class', 'PeerStateLookupDatabaseWrapper');
// CFG: WEB-CONTENT-TYPE
$cfg->setConfigEntry('web_content_type', '');
*
* @return $wrapperInstance An instance of the created wrapper class
*/
- public final static function createPeerLookupDatabaseWrapper () {
+ public final static function createPeerStateLookupDatabaseWrapper () {
// Get a new instance
- $wrapperInstance = new PeerLookupDatabaseWrapper();
+ $wrapperInstance = new PeerStateLookupDatabaseWrapper();
// Set (primary!) table name
$wrapperInstance->setTableName(self::DB_TABLE_PEER_LOOKUP);
* Checks wether given 'sender' is a new peer
*
* @param $packageData Raw package data
- * @return $isNewPeer Wether 'sender' is a new peer to this node
+ * @return $isNewPeer Wether 'sender' is a new peer to this node
*/
public function isSenderNewPeer (array $packageData) {
// Get a search criteria instance
*
* @return $tableInstance An instance of a Lookupable class
*/
- public final static function createPeerLookupTable () {
+ public final static function createPeerStateLookupTable () {
// Get new instance
- $tableInstance = new PeerLookupTable();
+ $tableInstance = new PeerStateLookupTable();
// Get a database wrapper instance
$wrapperInstance = ObjectFactory::createObjectByConfiguredName('peer_state_lookup_db_wrapper_class');
// Set it for later re-use
- $tableInstance->setWrapperInstance($wrapperInstance);
+ $tableInstance->setDatabaseInstance($wrapperInstance);
// Return the prepared instance
return $tableInstance;
}
+
+ /**
+ * Checks wether given 'sender' is a new peer
+ *
+ * @param $packageData Raw package data
+ * @return $isNewPeer Wether 'sender' is a new peer to this node
+ */
+ public function isSenderNewPeer (array $packageData) {
+ // Get our wrapper instance and ask for it
+ $isNewPeer = $this->getDatabaseInstance()->isSenderNewPeer($packageData);
+
+ // Return it
+ return $isNewPeer;
+ }
}
// [EOF]