Jwma

dtw.webmail.plugin
Interface ContactManagementPlugin

All Superinterfaces:
JwmaPlugin
All Known Implementing Classes:
CastorSQLContactManagement, CastorXMLContactManagement

public interface ContactManagementPlugin
extends JwmaPlugin

Interface for a plugin that manages user contact databases.

Version:
0.9.7 07/02/2003
Author:
Dieter Wimberger

Field Summary
static int CONTACT_EXPORT
           
static int CONTACT_IMPORT
           
static int DATABASE_EXPORT
           
static int DATABASE_IMPORT
           
 
Method Summary
 JwmaContactsImpl createContacts()
          Creates a new contact databse instance.
 java.lang.String exportContact(JwmaContact contact, java.lang.String TYPE)
          Exports a contact in the given type.
 void exportDatabase(java.io.OutputStream out, JwmaContacts db, java.lang.String TYPE)
          Exports the given contact database in the given type.
 java.lang.String[] getSupportedTypes(int IMEX_TYPE)
          Returns a list of types for the given import/export method.
 JwmaContact importContact(java.io.InputStream in, java.lang.String TYPE)
          Imports a contact of the given type.
 JwmaContact[] importDatabase(java.io.InputStream in, java.lang.String Type)
          Imports a database of contacts of the given type.
 boolean isPersistent(java.lang.String cuid)
          Tests if a given contact database exists on the store.
 boolean isSupportedContactImportType(java.lang.String type)
          Tests if the given contact type can be imported.
 JwmaContactsImpl loadContacts(java.lang.String cuid)
          Loads the given contacts database from the persistent store and returns them as a JwmaContactsImpl instance.
 void saveContacts(JwmaContactsImpl contacts)
          Saves the given contacts database to the persistent store.
 
Methods inherited from interface dtw.webmail.plugin.JwmaPlugin
activate, deactivate
 

Field Detail

CONTACT_EXPORT

public static final int CONTACT_EXPORT
See Also:
Constant Field Values

CONTACT_IMPORT

public static final int CONTACT_IMPORT
See Also:
Constant Field Values

DATABASE_EXPORT

public static final int DATABASE_EXPORT
See Also:
Constant Field Values

DATABASE_IMPORT

public static final int DATABASE_IMPORT
See Also:
Constant Field Values
Method Detail

loadContacts

public JwmaContactsImpl loadContacts(java.lang.String cuid)
                              throws JwmaException
Loads the given contacts database from the persistent store and returns them as a JwmaContactsImpl instance.

If contacts database with the given identity does not exist on the store, the method returns null.

Parameters:
cuid - a String representing a unique identifier for a contact database.
Returns:
the JwmaContactsImpl instance.
Throws:
JwmaException - if an I/O error occurs.
See Also:
JwmaContactsImpl, JwmaPreferencesImpl.getContactDatabaseID()

saveContacts

public void saveContacts(JwmaContactsImpl contacts)
                  throws JwmaException
Saves the given contacts database to the persistent store.

If the contacts database does not exist on the store, the method should create it, otherwise update the existing version.
The unique identity is retrieved using the getUID() method of the given JwmaContactsImpl instance.

Parameters:
contacts - the JwmaContactsImpl instance to saved.
Throws:
JwmaException - if an I/O error occurs.
See Also:
JwmaContactsImpl, JwmaContacts.getUID()

isPersistent

public boolean isPersistent(java.lang.String cuid)
                     throws JwmaException
Tests if a given contact database exists on the store.

Parameters:
cuid - a String representing a unique identifier for a contact database.
Throws:
JwmaException - if an I/O error occurs.
See Also:
JwmaContactsImpl, JwmaPreferencesImpl.getContactDatabaseID()

createContacts

public JwmaContactsImpl createContacts()
Creates a new contact databse instance.

Returns:
the JwmaContactsImpl instance.
See Also:
JwmaContactsImpl

exportContact

public java.lang.String exportContact(JwmaContact contact,
                                      java.lang.String TYPE)
                               throws JwmaException
Exports a contact in the given type.

Parameters:
contact - the JwmaContact to be exported.
TYPE - the type of the export.
Returns:
the exported contact as String.
JwmaException
See Also:
getSupportedTypes(int IMEX_TYPE), CONTACT_EXPORT

importContact

public JwmaContact importContact(java.io.InputStream in,
                                 java.lang.String TYPE)
                          throws JwmaException
Imports a contact of the given type.

Parameters:
in - source for importing the contact in the given type.
TYPE - the type of the import source.
Returns:
the imported contact as JwmaContact.
JwmaException
See Also:
getSupportedTypes(int IMEX_TYPE), CONTACT_IMPORT

exportDatabase

public void exportDatabase(java.io.OutputStream out,
                           JwmaContacts db,
                           java.lang.String TYPE)
                    throws JwmaException
Exports the given contact database in the given type.

Parameters:
db - the JwmaContacts database to be exported.
TYPE - the type of the export.
JwmaException
See Also:
getSupportedTypes(int IMEX_TYPE), DATABASE_EXPORT

importDatabase

public JwmaContact[] importDatabase(java.io.InputStream in,
                                    java.lang.String Type)
                             throws JwmaException
Imports a database of contacts of the given type.

Parameters:
in - source for importing the contacts in the given type.
Returns:
the imported contacts as JwmaContact[].
JwmaException
See Also:
getSupportedTypes(int IMEX_TYPE), DATABASE_IMPORT

getSupportedTypes

public java.lang.String[] getSupportedTypes(int IMEX_TYPE)
Returns a list of types for the given import/export method. The types from this array can be passed as parameters to the respective import/export method.

Returns:
an array of String's representing types.

isSupportedContactImportType

public boolean isSupportedContactImportType(java.lang.String type)
Tests if the given contact type can be imported.

Returns:
true if supported, false otherwise.

Jwma

Copyright © 2000-2003 jwma team (All Rights Reserved.)