OpenDDS::Security::AccessControlBuiltInImpl::RevokePermissionsTimer Class Reference

Inheritance diagram for OpenDDS::Security::AccessControlBuiltInImpl::RevokePermissionsTimer:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::Security::AccessControlBuiltInImpl::RevokePermissionsTimer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RevokePermissionsTimer (AccessControlBuiltInImpl &impl)
virtual ~RevokePermissionsTimer ()
bool start_timer (const ACE_Time_Value length,::DDS::Security::PermissionsHandle pm_handle)
virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg)
bool is_scheduled ()

Protected Member Functions

ACE_Time_Value interval () const

Protected Attributes

AccessControlBuiltInImplimpl_

Private Attributes

ACE_Time_Value interval_
bool scheduled_
long timer_id_
ACE_Thread_Mutex lock_
ACE_Reactor_Timer_Interfacereactor_

Detailed Description

Definition at line 252 of file AccessControlBuiltInImpl.h.


Constructor & Destructor Documentation

OpenDDS::Security::AccessControlBuiltInImpl::RevokePermissionsTimer::RevokePermissionsTimer ( AccessControlBuiltInImpl impl  ) 

Definition at line 1919 of file AccessControlBuiltInImpl.cpp.

01920     : impl_(impl)
01921     , scheduled_(false)
01922     , timer_id_(0)
01923     , reactor_(0)
01924 { }

OpenDDS::Security::AccessControlBuiltInImpl::RevokePermissionsTimer::~RevokePermissionsTimer (  )  [virtual]

Definition at line 1926 of file AccessControlBuiltInImpl.cpp.

References ACE_Reactor_Timer_Interface::cancel_timer(), reactor_, and scheduled_.

01927 {
01928   if (scheduled_) {
01929       reactor_->cancel_timer(this);
01930   }
01931 }

Here is the call graph for this function:


Member Function Documentation

int OpenDDS::Security::AccessControlBuiltInImpl::RevokePermissionsTimer::handle_timeout ( const ACE_Time_Value tv,
const void *  arg 
) [virtual]

Reimplemented from ACE_Event_Handler.

Definition at line 1960 of file AccessControlBuiltInImpl.cpp.

References ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, impl_, OpenDDS::Security::AccessControlBuiltInImpl::listener_ptr_, LM_DEBUG, LM_ERROR, OpenDDS::Security::AccessControlBuiltInImpl::local_ac_perms_, lock_, and scheduled_.

01961 {
01962   ACE_UNUSED_ARG(tv);
01963   ACE_GUARD_RETURN(ACE_Thread_Mutex,
01964       guard,
01965       this->lock_,
01966       -1);
01967 
01968   ::DDS::Security::PermissionsHandle *pm_handle = (::DDS::Security::PermissionsHandle *)arg;
01969 
01970   scheduled_ = false;
01971 
01972   ACPermsMap::iterator iter = impl_.local_ac_perms_.find(*pm_handle);
01973 
01974   if (iter == impl_.local_ac_perms_.end()) {
01975     ACE_DEBUG((LM_ERROR, ACE_TEXT(
01976         "(%P|%t) AccessControlBuiltInImpl::Revoke_Permissions_Timer::handle_timeout: pm_handle %d not found!\n"), *pm_handle));
01977     return -1;
01978   }
01979 
01980   impl_.local_ac_perms_.erase(iter);
01981 
01982   // If a listener exists, call on_revoke_permissions
01983   if (impl_.listener_ptr_ != NULL) {
01984     if (!impl_.listener_ptr_->on_revoke_permissions(&impl_, *pm_handle)) {
01985       ACE_DEBUG((LM_ERROR, ACE_TEXT(
01986           "(%P|%t) AccessControlBuiltInImpl::Revoke_Permissions_Timer::handle_timeout: on_revoke_permissions failed for pm_handle %d!\n"), *pm_handle));
01987       return -1;
01988     }
01989   }
01990 
01991   if (OpenDDS::DCPS::DCPS_debug_level > 0) {
01992     ACE_DEBUG((LM_DEBUG, ACE_TEXT(
01993       "(%P|%t) AccessControlBuiltInImpl::Revoke_Permissions_Timer::handle_timeout: Completed...\n")));
01994   }
01995 
01996   return 0;
01997 }

Here is the call graph for this function:

ACE_Time_Value OpenDDS::Security::AccessControlBuiltInImpl::RevokePermissionsTimer::interval ( void   )  const [inline, protected]

Definition at line 263 of file AccessControlBuiltInImpl.h.

References interval_.

00263 { return interval_; }

bool OpenDDS::Security::AccessControlBuiltInImpl::RevokePermissionsTimer::is_scheduled (  )  [inline]
bool OpenDDS::Security::AccessControlBuiltInImpl::RevokePermissionsTimer::start_timer ( const ACE_Time_Value  length,
::DDS::Security::PermissionsHandle  pm_handle 
)

Definition at line 1933 of file AccessControlBuiltInImpl.cpp.

References lock_, reactor_, ACE_Reactor_Timer_Interface::schedule_timer(), scheduled_, TheServiceParticipant, and timer_id_.

Referenced by OpenDDS::Security::AccessControlBuiltInImpl::check_create_datareader(), OpenDDS::Security::AccessControlBuiltInImpl::check_create_datawriter(), OpenDDS::Security::AccessControlBuiltInImpl::check_remote_datareader(), and OpenDDS::Security::AccessControlBuiltInImpl::check_remote_datawriter().

01934 {
01935   ACE_GUARD_RETURN(ACE_Thread_Mutex,
01936       guard,
01937       this->lock_,
01938       false);
01939 
01940   ::DDS::Security::PermissionsHandle *eh_params_ptr =
01941       new ::DDS::Security::PermissionsHandle(pm_handle);
01942 
01943   reactor_ = TheServiceParticipant->timer();
01944 
01945   if (reactor_ != NULL) {
01946     timer_id_ = reactor_->schedule_timer(this, eh_params_ptr, length);
01947 
01948     if (timer_id_ != -1) {
01949       scheduled_ = true;
01950       delete eh_params_ptr;
01951       return true;
01952     }
01953 
01954   }
01955 
01956   delete eh_params_ptr;
01957   return false;
01958 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 261 of file AccessControlBuiltInImpl.h.

Referenced by handle_timeout().

Definition at line 266 of file AccessControlBuiltInImpl.h.

Definition at line 269 of file AccessControlBuiltInImpl.h.

Referenced by handle_timeout(), and start_timer().

Reimplemented from ACE_Event_Handler.

Definition at line 270 of file AccessControlBuiltInImpl.h.

Referenced by start_timer(), and ~RevokePermissionsTimer().

Definition at line 268 of file AccessControlBuiltInImpl.h.

Referenced by start_timer().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1