Class SubscriptionService

A subscription service that implements resource subscription operations supported by an activity streams system.

Inheritance
System.Object
SubscriptionService
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Social.ActivityStreams
Assembly: EPiServer.Social.ActivityStreams.dll
Version: 1.5.4
Syntax
public class SubscriptionService : ISubscriptionService

Constructors

SubscriptionService(ISubscriptionRepository)

Constructs and returns an instance of the SubscriptionService.

Declaration
public SubscriptionService(ISubscriptionRepository subscriptionRepository)
Parameters
Type Name Description
ISubscriptionRepository subscriptionRepository

An implementation of the ISubscriptionRepository that can communicate with the underlying data store.

Methods

Add(Subscription)

Adds a subscription, which registers the subscribing user to receive feed items in their activity stream regarding the activities on the followed resource.

Declaration
public Subscription Add(Subscription subscription)
Parameters
Type Name Description
Subscription subscription

The resource subscription information.

Returns
Type Description
Subscription
Exceptions
Type Condition
System.ArgumentNullException

Thrown when any of the parameters passed in are null.

System.ArgumentException

Thrown when any of the parameters passed in are invalid.

DuplicateSubscriptionException

Thrown when subscription for the specified target and subscriber combination already exists.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

AddAsync(Subscription)

Asynchronously adds a subscription, which registers the subscribing user to receive feed items in their activity stream regarding the activities on the followed resource.

Declaration
public Task<Subscription> AddAsync(Subscription subscription)
Parameters
Type Name Description
Subscription subscription

The resource subscription information.

Returns
Type Description
System.Threading.Tasks.Task<Subscription>
Exceptions
Type Condition
System.ArgumentNullException

Thrown when any of the parameters passed in are null.

System.ArgumentException

Thrown when any of the parameters passed in are invalid.

DuplicateSubscriptionException

Thrown when subscription for the specified target and subscriber combination already exists.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

Get(Criteria<SubscriptionFilter>)

Get a page of existing subscriptions by the given criteria.

Declaration
public ResultPage<Subscription> Get(Criteria<SubscriptionFilter> criteria)
Parameters
Type Name Description
Criteria<SubscriptionFilter> criteria

The criteria for retrieving subscriptions.

Returns
Type Description
ResultPage<Subscription>

A page of existing subscriptions.

Exceptions
Type Condition
System.ArgumentNullException

Thrown when any of the parameters passed in are null.

System.ArgumentException

Thrown when any of the parameters passed in are invalid.

InvalidPageInfoException

Thrown when the page info is invalid.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

GetAsync(Criteria<SubscriptionFilter>)

Asynchronously get a page of existing subscriptions by the given criteria.

Declaration
public Task<ResultPage<Subscription>> GetAsync(Criteria<SubscriptionFilter> criteria)
Parameters
Type Name Description
Criteria<SubscriptionFilter> criteria

The criteria for retrieving subscriptions.

Returns
Type Description
System.Threading.Tasks.Task<ResultPage<Subscription>>

A page of existing subscriptions.

Exceptions
Type Condition
System.ArgumentNullException

Thrown when any of the parameters passed in are null.

System.ArgumentException

Thrown when any of the parameters passed in are invalid.

InvalidPageInfoException

Thrown when the page info is invalid.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

Remove(SubscriptionId)

Removes subscriptions by the specified criteria from the social system.

Declaration
public void Remove(SubscriptionId id)
Parameters
Type Name Description
SubscriptionId id

Id of subscription to remove.

Exceptions
Type Condition
System.ArgumentNullException

Thrown when the subscription id passed in is null.

System.ArgumentException

Thrown when the subscription id passed in is empty.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

Remove(Criteria<SubscriptionFilter>)

Removes user subscriptions from the social system using the given criteria.

Declaration
public void Remove(Criteria<SubscriptionFilter> criteria)
Parameters
Type Name Description
Criteria<SubscriptionFilter> criteria

The criteria for removing subscriptions.

Exceptions
Type Condition
System.ArgumentNullException

Thrown when any of the parameters passed in are null.

System.ArgumentException

Thrown when any of the parameters passed in are invalid.

InvalidPageInfoException

Thrown when the page info is invalid.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

RemoveAsync(SubscriptionId)

Asynchronously removes subscriptions by the specified criteria from the social system.

Declaration
public Task RemoveAsync(SubscriptionId id)
Parameters
Type Name Description
SubscriptionId id

Id of subscription to remove.

Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
System.ArgumentNullException

Thrown when the subscription id passed in is null.

System.ArgumentException

Thrown when the subscription id passed in is empty.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

RemoveAsync(Criteria<SubscriptionFilter>)

Asynchronously removes user subscriptions from the social system using the given criteria.

Declaration
public Task RemoveAsync(Criteria<SubscriptionFilter> criteria)
Parameters
Type Name Description
Criteria<SubscriptionFilter> criteria

The criteria for removing subscriptions.

Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
System.ArgumentNullException

Thrown when any of the parameters passed in are null.

System.ArgumentException

Thrown when any of the parameters passed in are invalid.

InvalidPageInfoException

Thrown when the page info is invalid.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

Implements

arrow_upward