15 CertificateCacheTtl::CertificateCacheTtl(shared_ptr<boost::asio::io_service> io,
16 const time::seconds& defaultTtl)
17 : m_defaultTtl(defaultTtl)
29 time::milliseconds expire = (certificate->getFreshnessPeriod() >= time::seconds::zero() ?
33 EventTracker::iterator it =
m_tracker.find(trackerIndex);
38 bind(&CertificateCacheTtl::insert,
this, certificate));
40 bind(&CertificateCacheTtl::remove,
41 this, certificate->getName()));
45 CertificateCacheTtl::insert(shared_ptr<const IdentityCertificate> certificate)
52 CertificateCacheTtl::remove(
const Name& certificateName)
55 Cache::iterator it =
m_cache.find(name);
60 shared_ptr<const IdentityCertificate>
63 Cache::iterator it =
m_cache.find(certificateName);
67 return shared_ptr<IdentityCertificate>();
virtual void insertCertificate(shared_ptr< const IdentityCertificate > certificate)
Name getPrefix(int nComponents) const
Return a new Name with the first nComponents components of this Name.
EventId scheduleEvent(const time::nanoseconds &after, const Event &event)
Schedule one time event after the specified delay.
virtual ~CertificateCacheTtl()
A Name holds an array of Name::Component and represents an NDN name.
virtual shared_ptr< const IdentityCertificate > getCertificate(const Name &certificateNameWithoutVersion)
void cancelEvent(const EventId &eventId)
Cancel scheduled event.
time::seconds m_defaultTtl