Presence containers are access control list (ACL) buckets that a user can use to control who can subscribe to data published by the user, and to limit the information shown to watchers. Each container can specify a list of its members, the users who have subscribed to the presence of the publisher who owns these containers. An application can publish a specific presence object into one or more containers depending on the goal of publishing. When one user subscribes to the presence of another user, the server (Office Communications Server) determines the presence items that are given to the subscribing user based on the publisher's ACL setting for the subscriber and the presence items currently published. All container members in a given container can see all category instances published in that container. A container member can be an explicit user (described by a SIP URI), a SIP domain, all users in the same company, public-cloud users, or all federated users.

The ContainerUpdateOperationclass and the BeginUpdateContainerMembershipmethod on the LocalOwnerPresenceclass can be used to update container memberships and manage ACLs.

Copy Code
ContainerUpdateOperation operation = new
ContainerUpdateOperation(401);
operation.AddSourceNetwork(SourceNetwork.SameEnterprise); 

_AppEndpoint.LocalOwnerPresence.BeginUpdateContainerMembership(
				new ContainerUpdateOperation[] {operation},
				ContainerUpdateCompleted,
				_AppEndpoint.LocalOwnerPresence);

...

void ContainerUpdateCompleted(IAsyncResult result)
{
  LocalOwnerPresence lop = result.AsyncState as LocalOwnerPresence;

  lop.EndUpdateContainerMembership(result);
}

A given subscriber can be present in multiple containers owned by a publisher. Microsoft Office Communications Server determines a subscriber’s container for a particular category request using an algorithm similar to that shown in the following list.

  1. Find the container with the highest container ID that holds the category in question and that has the subscriber’s URI explicitly listed. If one such category is found, end the search.

  2. Find the container with the highest container ID that has the subscriber’s domain listed in any of its domain membership lists. If one such category is found, end the search.

  3. If the subscriber is in the same enterprise as the publisher, choose the container with the highest container ID that has the same-enterprise bit set and that contains the category in question. If one such category is found, end the search.

  4. If the subscriber is a federated user, select the container with the highest container ID that contains the category and has its federated-user bit set. If one such category is found, end the search.

  5. If the subscriber is a public-cloud user, select the container with the highest container ID that contains the category and has its public-cloud-users flag set. If one such category is found, end the search.

  6. If the default container contains the category, select that container.

For more information about subscriber container resolution, see [MS-PRES]: Presence Protocol Specification .