Docs Menu
Docs Home
/ /
Atlas Device SDKs
/ / /

Interface MutableSubscriptionSet

On this page

  • io.realm.mongodb.sync
  • Method Summary
  • Inherited Methods
  • Method Detail
  • add
  • addOrUpdate
  • remove
  • removeAll

Implemented interfaces:

  • io.realm.mongodb.sync.SubscriptionSet

  • java.lang.Iterable

A mutable subscription set is available when calling SubscriptionSet.update(UpdateCallback) This is the only way to modify a SubscriptionSet . Subscription s can be either

managed or unmanaged. Unmanaged subscriptions are those created by using Subscription.create(RealmQuery) or Subscription.create(String, RealmQuery) , while managed subscriptions are the ones being returned from the subscription set.

Tip

See also:

Modifier and Type
Method and Description
add (
Subscription subscription
)

Adds a new unmanaged subscription to the subscription set.

Subscription subscription
)

Add a new subscription or update an existing named subscription.

public boolean
String name
)

Remove a named subscription.

public boolean
Subscription subscription
)

Remove a managed subscription.

public boolean

Remove all current managed subscriptions.

public boolean

Remove all subscriptions with queries on a given given model class.

public boolean
String objectType
)

Remove all subscriptions on a given Subscription.getObjectType() .

public Subscription add (
Subscription subscription
)

Adds a new unmanaged subscription to the subscription set.

Parameters

  • subscription - unmanaged subscription to add.

Returns

the newly added managed subscription.

Throws

Subscription subscription
)

Add a new subscription or update an existing named subscription. It isn't possible to update an anonymous subscription. These must removed and re-inserted.

Parameters

  • subscription - anonymous or named subscription created via Subscription.create(...) , used to update a matching one within a specific set. It creates a new one in case there is no match..

Returns

the updated or inserted managed subscription.

public boolean remove (
String name
)

Remove a named subscription.

Parameters

  • name - name of managed subscription to remove.

Returns

true if the subscription was removed, false if not.

public boolean remove (
Subscription subscription
)

Remove a managed subscription.

Parameters

  • subscription - managed subscription to remove

Returns

true if the subscription was removed, false if not.

Throws

public boolean removeAll ()

Remove all current managed subscriptions.

Returns

true if 1 or more subscriptions were removed, false if no subscriptions were removed.

public boolean removeAll <T >(
)

Remove all subscriptions with queries on a given given model class.

Parameters

  • clazz - subscriptions on this type will be removed.

Returns

true if 1 or more subscriptions were removed, false if no subscriptions were removed.

public boolean removeAll (
String objectType
)

Remove all subscriptions on a given Subscription.getObjectType() .

Parameters

  • objectType - subscriptions on this object type will be removed.

Returns

true if 1 or more subscriptions were removed, false if no subscriptions were removed.

Back

ManuallyRecoverUnsyncedChangesStrategy