org.sakaiproject.service.legacy.digest
Interface DigestService

All Known Implementing Classes:
BaseDigestService

public interface DigestService

The DigestService collects sets of messages for different users, and sends them out periodically.

Version:
$Revision: 2371 $
Author:
University of Michigan, CHEF Software Development Team

Field Summary
static String REFERENCE_ROOT
          This string starts the references to resources in this service.
static String SECURE_ADD_DIGEST
          Securiy / Event for adding a digest.
static String SECURE_EDIT_DIGEST
          Securiy / Event for updating a digest.
static String SECURE_REMOVE_DIGEST
          Securiy / Event for removing a digest.
static String SERVICE_NAME
          This string can be used to find the service in the service manager.
 
Method Summary
 DigestEdit add(String id)
          Add a new digest with this id.
 void cancel(DigestEdit edit)
          Cancel the changes made to a DigestEdit object, and release the lock.
 void commit(DigestEdit edit)
          Commit the changes made to a DigestEdit object, and release the lock.
 void digest(DigestMessage message)
          Add a new message to a digest, creating one if needed.
 DigestEdit edit(String id)
          Get a locked Digest object for editing.
 Digest getDigest(String id)
          Access a digest associated with this id.
 List getDigests()
          Access all digest objects.
 void remove(DigestEdit edit)
          Remove this DigestEdit - it must be locked from edit().
 

Field Detail

SERVICE_NAME

public static final String SERVICE_NAME
This string can be used to find the service in the service manager.


REFERENCE_ROOT

public static final String REFERENCE_ROOT
This string starts the references to resources in this service.

See Also:
Constant Field Values

SECURE_ADD_DIGEST

public static final String SECURE_ADD_DIGEST
Securiy / Event for adding a digest.

See Also:
Constant Field Values

SECURE_EDIT_DIGEST

public static final String SECURE_EDIT_DIGEST
Securiy / Event for updating a digest.

See Also:
Constant Field Values

SECURE_REMOVE_DIGEST

public static final String SECURE_REMOVE_DIGEST
Securiy / Event for removing a digest.

See Also:
Constant Field Values
Method Detail

getDigest

public Digest getDigest(String id)
                 throws IdUnusedException
Access a digest associated with this id.

Parameters:
id - The digest id.
Returns:
The Digest object.
Throws:
IdUnusedException - if there is not digest object with this id.

getDigests

public List getDigests()
Access all digest objects.

Returns:
A List (Digest) of all defined digests.

digest

public void digest(DigestMessage message)
Add a new message to a digest, creating one if needed. This returns right away; the digest will be added as soon as possible.

Parameters:
message - The message to digest.

add

public DigestEdit add(String id)
               throws IdUsedException
Add a new digest with this id. Must commit(), remove() or cancel() when done.

Parameters:
id - The digest id.
Returns:
A new DigestEdit object for editing.
Throws:
IdUsedException - if these digest already exist.

edit

public DigestEdit edit(String id)
                throws InUseException
Get a locked Digest object for editing. May be new. Must commit(), cancel() or remove() when done.

Parameters:
id - The digest id.
Returns:
A DigestEdit object for editing.
Throws:
InUseException - if the digest object is locked by someone else.

commit

public void commit(DigestEdit edit)
Commit the changes made to a DigestEdit object, and release the lock. The DigestEdit is disabled, and not to be used after this call.


cancel

public void cancel(DigestEdit edit)
Cancel the changes made to a DigestEdit object, and release the lock. The DigestEdit is disabled, and not to be used after this call.


remove

public void remove(DigestEdit edit)
Remove this DigestEdit - it must be locked from edit(). The DigestEdit is disabled, and not to be used after this call.