com.sun.im.provider
Class ArchiveProvider

java.lang.Object
  extended bycom.sun.im.provider.ArchiveProvider

public abstract class ArchiveProvider
extends java.lang.Object

Archive Provider base class. Archives are used to keep a log of messages and other information processed by the server. If an archive provider is configured, it is invoked any time a message is handled by the server. This includes conference messages, notifications, invites, news messages, requests to join or leave a conference. This class does nothing other than providing placeholder for methods. Methods need to be overwritten in order for archiving to work. All archive providers must extend this class or subclass thereof.


Constructor Summary
ArchiveProvider()
           
 
Method Summary
 void close()
          close the archive and dispose of held resources
 void onClose(java.lang.String conferenceAddress, java.lang.String uid)
          invoked when a private conference is terminated
 void onConferenceMessage(java.lang.String conferenceAddress, ReadOnlyMessage message)
          invoked when a message is added to a conference
 void onInvite(java.lang.String conferenceAddress, ReadOnlyMessage message)
          invoked when a user creates a private conference
 void onJoin(java.lang.String conferenceAddress, java.lang.String uid)
          invoked when a user joins a conference
 void onLeave(java.lang.String conferenceAddress, java.lang.String uid)
          invoked when a user leaves conference
 void onLogin(java.lang.String uid)
          invoked when a user signs on
 void onLogout(java.lang.String uid)
          invoked when a user signs off
 void onMessage(java.util.List accessList, ReadOnlyMessage message)
          invoked when a message is handled by the server.
 void onMessage(ReadOnlyMessage message)
          invoked when a message is handled by the server.
 void onSetup(java.lang.String conferenceAddress, java.lang.String uid)
          invoked when a user creates a private conference
 void open()
          open the archive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiveProvider

public ArchiveProvider()
Method Detail

onLogin

public void onLogin(java.lang.String uid)
invoked when a user signs on

Parameters:
uid - identifier of the authenticated user

onLogout

public void onLogout(java.lang.String uid)
invoked when a user signs off

Parameters:
uid - user identifier

onSetup

public void onSetup(java.lang.String conferenceAddress,
                    java.lang.String uid)
invoked when a user creates a private conference

Parameters:
conferenceAddress - address of the conference
uid - unique identifier of the user who setup the conference

onJoin

public void onJoin(java.lang.String conferenceAddress,
                   java.lang.String uid)
invoked when a user joins a conference

Parameters:
conferenceAddress - address of the conference
uid - unique identifier of the new participant

onLeave

public void onLeave(java.lang.String conferenceAddress,
                    java.lang.String uid)
invoked when a user leaves conference

Parameters:
conferenceAddress - address of the conference
uid - unique identifier of the leaving participant

onClose

public void onClose(java.lang.String conferenceAddress,
                    java.lang.String uid)
invoked when a private conference is terminated

Parameters:
conferenceAddress - address of the conference
uid - identifier of the user who closed the conference

onInvite

public void onInvite(java.lang.String conferenceAddress,
                     ReadOnlyMessage message)
invoked when a user creates a private conference

Parameters:
conferenceAddress - address of the conference
message - invite message

onMessage

public void onMessage(ReadOnlyMessage message)
invoked when a message is handled by the server. When a message is received within the context of a conference, onConferenceMessage is used instead. Once archived, the message is visible only to the originator and recipients of the message. The originator and recipients addresses, message identifier, message content, and other message attributes can be obtained using the methods in the com.sun.im.service.ReadOnlyMessage interface.

Parameters:
message - message
See Also:
Message

onMessage

public void onMessage(java.util.List accessList,
                      ReadOnlyMessage message)
invoked when a message is handled by the server. When a message is received within the context of a conference, onConferenceMessage is used instead. Once archived, the message is visible by all users listed in the access list. The originator and recipients addresses, message identifier, message content, and other message attributes can be obtained using the methods in the Message interface.

Parameters:
message - message
accessList - list of user or group identifiers that should have access to this archived message.
See Also:
Message

onConferenceMessage

public void onConferenceMessage(java.lang.String conferenceAddress,
                                ReadOnlyMessage message)
invoked when a message is added to a conference

Parameters:
conferenceAddress - address of the conference
message - message The originator address, message identifier, message content, and other message attributes can be obtained using the methods in the Message interface.
See Also:
Message

open

public void open()
          throws java.lang.Exception
open the archive

Throws:
java.lang.Exception - failure to open and initialize the archive.

close

public void close()
close the archive and dispose of held resources