function _getAssociation($endpoint)
{
if (!$this->_use_assocs) {
return null;
}
$assoc = $this->store->getAssociation($endpoint->server_url);
if ($assoc === null || $assoc->getExpiresIn() <= 0) {
$assoc = $this->_negotiateAssociation($endpoint);
if ($assoc !== null) {
$this->store->storeAssociation($endpoint->server_url, $assoc);
}
}
return $assoc;
}