SDK  2.1.4
CloudBackend Software Development Kit - SDK API for C++
cbe::SubscribeManager Class Reference

For managing subscriptions. More...

#include <SubscribeManager.h>

Public Types

using GetSubscriptionsDelegatePtr = delegate::GetSubscriptionsDelegatePtr
 
using GetSubscriptionsException = delegate::GetSubscriptionsDelegate::Exception
 
using GetSubscriptionsError = delegate::GetSubscriptionsDelegate::ErrorInfo
 
using SubscribeDelegatePtr = delegate::SubscribeDelegatePtr
 
using SubscribeException = delegate::SubscribeDelegate::Exception
 
using SubscribeError = delegate::SubscribeDelegate::ErrorInfo
 

Public Member Functions

void getSubscriptions (GetSubscriptionsDelegatePtr subscribeDelegate)
 List your current subscriptions. More...
 
delegate::GetSubscriptionsDelegate::Success getSubscriptions ()
 Synchronous [exception] Synchronous version of getSubscriptions(GetSubscriptionsDelegatePtr) , and throws an exception, GetSubscriptionsException, in case of a failed call.
See getSubscriptions(GetSubscriptionsDelegatePtr) More...
 
cbe::util::Optional< delegate::GetSubscriptionsDelegate::SuccessgetSubscriptions (GetSubscriptionsError &error)
 Synchronous [non-throwing] Synchronous version of getSubscriptions(GetSubscriptionsDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See getSubscriptions(GetSubscriptionsDelegatePtr) More...
 
void subscribe (cbe::UserId sharingUserId, std::string sharingUserName, cbe::PublishId publishId, std::string publishName, std::string password, std::string subscribeName, SubscribeDelegatePtr subscribeDelegate)
 Subscribes to a Publish using all parameters. More...
 
delegate::SubscribeDelegate::Success subscribe (cbe::UserId sharingUserId, std::string sharingUserName, cbe::PublishId publishId, std::string publishName, std::string password, std::string subscribeName)
 Synchronous [exception] Synchronous version of subscribe(cbe::UserId, std::string, cbe::PublishId, std::string, std::string, std::string, SubscribeDelegatePtr) , and throws an exception, SubscribeException, in case of a failed call.
See subscribe(SubscribeDelegatePtr) More...
 
cbe::util::Optional< delegate::SubscribeDelegate::Success > subscribe (cbe::UserId sharingUserId, std::string sharingUserName, cbe::PublishId publishId, std::string publishName, std::string password, std::string subscribeName, SubscribeError &error)
 Synchronous [non-throwing] Synchronous version of subscribe(sharingUserId, sharingUserName, publishId, publishName, password, subscribeName, SubscribeDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See subscribe(sharingUserId, sharingUserName, publishId, publishName, password, subscribeName, SubscribeDelegatePtr) More...
 
void subscribe (std::string sharingUserName, std::string publishName, SubscribeDelegatePtr subscribeDelegate)
 Subscribes to a Publish using names. More...
 
void subscribe (cbe::UserId sharingUserId, cbe::PublishId publishId, std::string subscribeName, SubscribeDelegatePtr subscribeDelegate)
 Subscribes to a Publish using ids. More...
 
 SubscribeManager (cbe::DefaultCtor)
 
 operator bool () const
 

Friends

class CloudBackend
 

Detailed Description

For managing subscriptions.

Member Typedef Documentation

◆ GetSubscriptionsDelegatePtr

Pointer to GetSubscriptionsDelegate that is passed into asynchronous version of method:

◆ GetSubscriptionsException

Pointer to cbe::delegate::GetSubscriptionsDelegate that is passed into asynchronous version of method getSubscriptions() See delegate::object::GetSubscriptionsDelegate::Exception

◆ GetSubscriptionsError

◆ SubscribeDelegatePtr

Pointer to SubscribeDelegate that is passed into asynchronous version of method:

◆ SubscribeException

Pointer to cbe::delegate::SubscribeDelegate that is passed into asynchronous version of method subscribe() See delegate::object::SubscribeDelegate::Exception

◆ SubscribeError

Forms the type of the error return parameter for the synchronous version of method subscribe(sharingUserId, sharingUserName, publishId, publishName, password, subscribeName, SubscribeError&) "subscribe()"
See delegate::SubscribeDelegate::ErrorInfo

Member Function Documentation

◆ getSubscriptions() [1/3]

void cbe::SubscribeManager::getSubscriptions ( GetSubscriptionsDelegatePtr  subscribeDelegate)

List your current subscriptions.

Listing is done independently of where in the actual directory tree the files are located.

Parameters
subscribeDelegatePointer to a delegate::GetSubscriptionsDelegate instance that is implemented by the user.

◆ getSubscriptions() [2/3]

delegate::GetSubscriptionsDelegate::Success cbe::SubscribeManager::getSubscriptions ( )

Synchronous [exception] Synchronous version of getSubscriptions(GetSubscriptionsDelegatePtr) , and throws an exception, GetSubscriptionsException, in case of a failed call.
See getSubscriptions(GetSubscriptionsDelegatePtr)

Returns
Information about the getSubscriptions object — if the call was successful.
See cbe::delegate::GetSubscriptionsDelegate::Success
Exceptions
GetSubscriptionsException

◆ getSubscriptions() [3/3]

cbe::util::Optional<delegate::GetSubscriptionsDelegate::Success> cbe::SubscribeManager::getSubscriptions ( GetSubscriptionsError error)

Synchronous [non-throwing] Synchronous version of getSubscriptions(GetSubscriptionsDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See getSubscriptions(GetSubscriptionsDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the GetSubscriptionsError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ subscribe() [1/5]

void cbe::SubscribeManager::subscribe ( cbe::UserId  sharingUserId,
std::string  sharingUserName,
cbe::PublishId  publishId,
std::string  publishName,
std::string  password,
std::string  subscribeName,
SubscribeDelegatePtr  subscribeDelegate 
)

Subscribes to a Publish using all parameters.

Subscribe to a Publish that was issued by some other user (or yourself).

A Publish must not require a password, if required it should be provided by the publisher.

The retrieved subscription may be revoked with cbe::Object::unSubscribe() or cbe::Container::unSubscribe().

Subscribes to a publish shared by some other user (or yourself).

Parameters
sharingUserIdUser id of the owner of the publish or 0 if sharingUserName should be used instead
sharingUserNameUser name of the owner of the publish or empty if sharingUserId should be used instead
publishIdPublish id or 0 if publishName should be used instead
publishNamePublish name or empty if publishId should be used instead
passwordRequired password or an empty string if no password
subscribeNameName of created favorite (usually same as the publish)
subscribeDelegateGets notified of the result

◆ subscribe() [2/5]

delegate::SubscribeDelegate::Success cbe::SubscribeManager::subscribe ( cbe::UserId  sharingUserId,
std::string  sharingUserName,
cbe::PublishId  publishId,
std::string  publishName,
std::string  password,
std::string  subscribeName 
)

Synchronous [exception] Synchronous version of subscribe(cbe::UserId, std::string, cbe::PublishId, std::string, std::string, std::string, SubscribeDelegatePtr) , and throws an exception, SubscribeException, in case of a failed call.
See subscribe(SubscribeDelegatePtr)

Returns
Information about the subscribe object — if the call was successful.
See cbe::delegate::SubscribeDelegate::Success
Exceptions
SubscribeException

◆ subscribe() [3/5]

cbe::util::Optional<delegate::SubscribeDelegate::Success> cbe::SubscribeManager::subscribe ( cbe::UserId  sharingUserId,
std::string  sharingUserName,
cbe::PublishId  publishId,
std::string  publishName,
std::string  password,
std::string  subscribeName,
SubscribeError error 
)

Synchronous [non-throwing] Synchronous version of subscribe(sharingUserId, sharingUserName, publishId, publishName, password, subscribeName, SubscribeDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See subscribe(sharingUserId, sharingUserName, publishId, publishName, password, subscribeName, SubscribeDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the SubscribeError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ subscribe() [4/5]

void cbe::SubscribeManager::subscribe ( std::string  sharingUserName,
std::string  publishName,
SubscribeDelegatePtr  subscribeDelegate 
)
inline

Subscribes to a Publish using names.

Overload of subscribe()

Parameters
sharingUserNameUser name of the owner of the publish
publishNamePublish name that will also be the name of created favorite.
subscribeDelegateGets notified of the result

◆ subscribe() [5/5]

void cbe::SubscribeManager::subscribe ( cbe::UserId  sharingUserId,
cbe::PublishId  publishId,
std::string  subscribeName,
SubscribeDelegatePtr  subscribeDelegate 
)
inline

Subscribes to a Publish using ids.

Overload of subscribe()

Parameters
sharingUserIdUser id of the owner of the publish
publishIdpublish id (publish id)
subscribeNameName of created subscribe (usually same as the publish)
subscribeDelegateGets notified of the result

The documentation for this class was generated from the following file: