diff --git a/livesupport/src/modules/authentication/include/LiveSupport/Authentication/AuthenticationClientInterface.h b/livesupport/src/modules/authentication/include/LiveSupport/Authentication/AuthenticationClientInterface.h index 48306f4fe..b4d2b4d5d 100644 --- a/livesupport/src/modules/authentication/include/LiveSupport/Authentication/AuthenticationClientInterface.h +++ b/livesupport/src/modules/authentication/include/LiveSupport/Authentication/AuthenticationClientInterface.h @@ -203,6 +203,18 @@ class AuthenticationClientInterface throw (XmlRpcException) = 0; + /** + * Reset the authentication client. + * Invalidates all active session IDs, and resets the list of + * preferences to its initial (empty) state. + * + * @exception XmlRpcException if the server returns an error. + */ + virtual void + reset(void) + throw (XmlRpcException) + = 0; + /** * A virtual destructor, as this class has virtual functions. */ diff --git a/livesupport/src/modules/authentication/src/AuthenticationClientFactoryTest.cxx b/livesupport/src/modules/authentication/src/AuthenticationClientFactoryTest.cxx index 067fd27a4..36ac29ccc 100644 --- a/livesupport/src/modules/authentication/src/AuthenticationClientFactoryTest.cxx +++ b/livesupport/src/modules/authentication/src/AuthenticationClientFactoryTest.cxx @@ -113,6 +113,10 @@ AuthenticationClientFactoryTest :: firstTest(void) acf = AuthenticationClientFactory::getInstance(); Ptr::Ref authentication = acf->getAuthenticationClient(); + + CPPUNIT_ASSERT_NO_THROW( + authentication->reset() + ); Ptr::Ref sessionId; @@ -143,6 +147,10 @@ AuthenticationClientFactoryTest :: preferencesTest(void) acf = AuthenticationClientFactory::getInstance(); Ptr::Ref authentication = acf->getAuthenticationClient(); + + CPPUNIT_ASSERT_NO_THROW( + authentication->reset() + ); Ptr::Ref sessionId; Ptr::Ref prefValue; diff --git a/livesupport/src/modules/authentication/src/TestAuthenticationClient.cxx b/livesupport/src/modules/authentication/src/TestAuthenticationClient.cxx index b81b78dd2..e96498465 100644 --- a/livesupport/src/modules/authentication/src/TestAuthenticationClient.cxx +++ b/livesupport/src/modules/authentication/src/TestAuthenticationClient.cxx @@ -280,3 +280,17 @@ TestAuthenticationClient :: deletePreferencesItem( preferences.erase(it); } + +/*------------------------------------------------------------------------------ + * Reset the list of preferences to its initial (empty) state. + *----------------------------------------------------------------------------*/ +void +TestAuthenticationClient :: reset(void) + throw (XmlRpcException) +{ + sessionIdList.clear(); + sessionCounter = 0; + + preferences.clear(); +} + diff --git a/livesupport/src/modules/authentication/src/TestAuthenticationClient.h b/livesupport/src/modules/authentication/src/TestAuthenticationClient.h index 239761e78..375789a9a 100644 --- a/livesupport/src/modules/authentication/src/TestAuthenticationClient.h +++ b/livesupport/src/modules/authentication/src/TestAuthenticationClient.h @@ -261,6 +261,17 @@ class TestAuthenticationClient : deletePreferencesItem(Ptr::Ref sessionId, const Glib::ustring & key) throw (XmlRpcException); + + /** + * Reset the authentication client. + * Invalidates all active session IDs, and resets the list of + * preferences to its initial (empty) state. + * + * @exception XmlRpcException if the server returns an error. + */ + virtual void + reset(void) + throw (XmlRpcException); }; diff --git a/livesupport/src/modules/authentication/src/WebAuthenticationClient.h b/livesupport/src/modules/authentication/src/WebAuthenticationClient.h index f2f23d97a..2c5439239 100644 --- a/livesupport/src/modules/authentication/src/WebAuthenticationClient.h +++ b/livesupport/src/modules/authentication/src/WebAuthenticationClient.h @@ -272,11 +272,13 @@ class WebAuthenticationClient : throw (XmlRpcException); /** - * Reset the list of preferences to its initial (empty) state. + * Reset the authentication client. + * Invalidates all active session IDs, and resets the list of + * preferences to its initial (empty) state. * * @exception XmlRpcException if the server returns an error. */ - void + virtual void reset(void) throw (XmlRpcException); };