The LocalOwnerPresenceclass provides a number of methods and properties to enable a presentity to publish its presence information to Office Communications Server.

LocalOwnerPresence State Transitions

The LocalOwnerPresencestate transitions are shown in the following illustration. The state values are the members of the CollaborationSubscriptionStateenumerated type.

  1. The transition from Idleto Subscribingoccurs when the application calls BeginSubscribe.

  2. The transition from Subscribingto Subscribedoccurs when the subscription to the local presentity succeeds.

  3. The transition from Subscribingto Terminatingoccurs when the subscription to the local presentity fails. This is a non-recoverable error.

  4. The transition from Subscribingto WaitingForRetryoccurs when the subscription could not be successfully created, but the server requests UCMA 2.0 Core SDK to try subscribing to the cross-pool server, or to try subscribing at a later time because it is busy now.

  5. The transition from WaitingForRetryto Subscribingoccurs when another subscription to the local presentity is attempted for the reason given instep 4.

  6. The transition from WaitingForRetryto Terminatingoccurs when the subscription attempt to the local presentity fails.

  7. The transition from Subscribedto WaitingForRetryoccurs for one of the following reasons: when the server requests UCMA 2.0 Core SDK to close this subscription and create a new subscription. This action can happen at any time.

    • The server requests UCMA 2.0 Core SDK to close this subscription and to create a new subscription by sending a NOTIFY request with an Expires:0 parameter. The server can make this request at any time.

    • Route-set recovery begins.

    • The server sends a “481 Call leg unavailable” response.

  8. The transition from Subscribedto Terminatingoccurs when BeginUnsubscribeis called.

  9. The transition from Terminatingto Idleoccurs when the call to BeginUnsubscribeends successfully. The subscription can be reused; that is, an application can call BeginSubscribewhen the state is Idle.

LocalOwnerPresence Constructors

The LocalOwnerPresenceclass has no public constructors.

LocalOwnerPresence Properties

The following are the public properties on the LocalOwnerPresenceclass.

Copy Code
// Gets the state of the subscription.
public CollaborationSubscriptionState CurrentState {get;}

LocalOwnerPresence Methods

The following are the public methods on the LocalOwnerPresenceclass.

Copy Code
// Starts a service request to acknowledge the given list of
subscribers.
public IAsyncResult BeginAcknowledgeSubscriber(string subscriberId,
AsyncCallback userCallback, object state);

// Creates a service request to publish the given list of
categories to the server.
public IAsyncResult
BeginPublishPresence(ICollection<PresenceCategoryMetadata>
categories, AsyncCallback userCallback, object state);

// Creates a service request to publish the given list of
categories to the server.
public IAsyncResult
BeginPublishPresence(ICollection<PresenceCategory>
categoryItems, AsyncCallback userCallback, object state);

// Creates a service request to delete all nonempty publications
for the given category names.
public IAsyncResult
BeginDeletePresence(ICollection<PresenceCategory>
categoryItems, AsyncCallback userCallback, object state);

// Starts a service request to update container memberships.
public IAsyncResult
BeginUpdateContainerMembership(ICollection<ContainerUpdateOperation>
operations, AsyncCallback userCallback, object state);

// Completes the asynchronous operation initiated by
BeginAcknowledgeSubscriber.
public void EndAcknowledgeSubscriber(IAsyncResult result);

// Completes the asynchronous operation initiated by
BeginPublishPresence.
public void EndPublishPresence(IAsyncResult result);

// Completes the asynchronous operation initiated by
BeginDeleteCategories.
public void EndDeletePresence(IAsyncResult result);

// Completes the asynchronous operation initiated by
BeginUpdateContainerMembership.
public void EndUpdateContainerMembership(IAsyncResult result);

LocalOwnerPresence Events

The following are the public events on the LocalOwnerPresenceclass.

Copy Code
// Raised when there are changes in the pending watcher
(subscriber) list.
public event EventHandler<SubscriberNotificationEventArgs>
SubscriberNotificationReceived;

// Raised when there are changes in container membership.
public event EventHandler<ContainerNotificationEventArgs>
ContainerNotificationReceived;

// Raised when there are changes in the list presence category
items
public event EventHandler<CategoryNotificationEventArgs>
CategoryNotificationReceived;

// Raised when there are changes in the list of delegatees.
public event EventHandler<DelegatesNotificationEventArgs>
DelegateNotificationReceived;

// Raised when there are changes in the underlying subscription
state.
public event EventHandler<SubscriptionStateChangedEventArgs>
SubscriptionStateChange;