const DB_COLUMN_ACCEPTED_OBJECTS = 'accepted_object_types';
const DB_COLUMN_NODE_LIST = 'node_list';
const DB_COLUMN_PUBLICATION_STATUS = 'publication_status';
+ const DB_COLUMN_ANSWER_STATUS = 'answer_status';
// Publication status'
const PUBLICATION_STATUS_PENDING = 'PENDING';
$statusCode = $this->getTranslatedStatusFromLastException();
// Set it in configuration (temporarily)
- $this->getConfigInstance()->setConfigEntry('answer_status', $statusCode);
+ $this->getConfigInstance()->setConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS, $statusCode);
}
/**
$this->getConfigInstance()->unsetConfigEntry($configKey);
} // END - foreach
- // Remove 'answer_status' as well
- $this->getConfigInstance()->unsetConfigEntry('answer_status');
+ // Remove NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS as well
+ $this->getConfigInstance()->unsetConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS);
}
}
$statusCode = $this->getTranslatedStatusFromLastException();
// Set it in configuration (temporarily)
- $this->getConfigInstance()->setConfigEntry('answer_status', $statusCode);
+ $this->getConfigInstance()->setConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS, $statusCode);
}
/**
} // END - foreach
// Remove answer status/node list as well
- $this->getConfigInstance()->unsetConfigEntry('answer_status');
+ $this->getConfigInstance()->unsetConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS);
$this->getConfigInstance()->unsetConfigEntry('node_list');
}
}
* @param $packageData Valid package data array
* @return void
* @throws FrameworkException Could throw different exceptions depending on implementation
- * @todo 30% done
*/
public function resolveRecipient ($recipient, Listable $listInstance, array $packageData) {
// Make sure the recipient is valid
// "Discover" recipients by given package data
$recipients = $discoverInstance->resolveRecipientsByPackageData($packageData);
- $this->partialStub('Please implement this method. recipient=' . $recipient . ',recipients=' . print_r($recipients, TRUE));
+ // Now "walk" through all elements and add them to the list
+ foreach ($recipients as $recipient) {
+ // These array elements must exist for this loop:
+ assert(isset($recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_IP]));
+ assert(isset($recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_LISTEN_PORT]));
+
+ // Put ip and port both together
+ $ipPort = $recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_IP] . ':' . $recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_LISTEN_PORT];
+
+ // Add it to the list
+ $listInstance->addEntry('ip_port', $ipPort);
+ } // END - foreach
}
}