Notification Session Pattern

Register callbacks for domain events — get notified when objects are created, updated, or deleted.

Overview

A notification session lets a caller register a receiver that is called back when objects in the catalog change. The caller registers interest in specific events — new objects, changes to a particular Id, or deletions — and the runtime delivers those events to the receiver asynchronously. Override the registration methods to hook your back-end's event stream.

Javadoc Reference

net.okapia.osid.jamocha.spi

Class Declaration Pattern

public abstract class AbstractNotificationOsidObjectSession
extends AbstractOsidSession
implements NotificationOsidObjectSession

Constructor Pattern

AbstractNotificationOsidObjectSession(OsidObjectManager manager, Id catalogId, OsidObjectReceiver receiver)
ParameterTypeDescription
manager OsidObjectManager the manager that opened this session
catalogId Id the catalog this session is scoped to
receiver OsidObjectReceiver the callback target for domain events

Key Override Pattern

public void registerForNewOsidObjects() throws OperationFailedException
public void registerForChangedOsidObject(Id osidObjectId) throws OperationFailedException
public void registerForDeletedOsidObject(Id osidObjectId) throws OperationFailedException