|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--dtw.webmail.plugin.std.CastorXMLContactManagement
A ContactManagementPlugin implementation based on Castor XML marshalling/unmarshalling.
Stores the contacts as XML files.
Field Summary | |
static java.lang.String |
TYPE_VCARD2
|
static java.lang.String |
TYPE_VCARD3
|
Fields inherited from interface dtw.webmail.plugin.ContactManagementPlugin |
CONTACT_EXPORT, CONTACT_IMPORT, DATABASE_EXPORT, DATABASE_IMPORT |
Constructor Summary | |
CastorXMLContactManagement()
|
Method Summary | |
void |
activate()
Activates the plugin for subsequent use. |
JwmaContactsImpl |
createContacts()
Creates a new contact databse instance. |
void |
deactivate()
Deactivates the plugin. |
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 class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String TYPE_VCARD3
public static final java.lang.String TYPE_VCARD2
Constructor Detail |
public CastorXMLContactManagement()
Method Detail |
public JwmaContactsImpl loadContacts(java.lang.String cuid) throws JwmaException
ContactManagementPlugin
If contacts database with the given identity does not exist on the store, the method returns null.
loadContacts
in interface ContactManagementPlugin
cuid
- a String representing a unique
identifier for a contact database.
JwmaException
- if an I/O error occurs.JwmaContactsImpl
,
JwmaPreferencesImpl.getContactDatabaseID()
public void saveContacts(JwmaContactsImpl contacts) throws JwmaException
ContactManagementPlugin
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.
saveContacts
in interface ContactManagementPlugin
contacts
- the JwmaContactsImpl instance to
saved.
JwmaException
- if an I/O error occurs.JwmaContactsImpl
,
JwmaContacts.getUID()
public boolean isPersistent(java.lang.String cuid) throws JwmaException
ContactManagementPlugin
isPersistent
in interface ContactManagementPlugin
cuid
- a String representing a unique
identifier for a contact database.
JwmaException
- if an I/O error occurs.JwmaContactsImpl
,
JwmaPreferencesImpl.getContactDatabaseID()
public JwmaContactsImpl createContacts()
ContactManagementPlugin
createContacts
in interface ContactManagementPlugin
JwmaContactsImpl
public void activate() throws JwmaException
JwmaPlugin
This method is called during bootstrap to allow an implementation to initialize properly. If the plugin cannot perform it's task, it has to throw a JwmaException.
activate
in interface JwmaPlugin
JwmaException
- if initialization failed.public void deactivate()
JwmaPlugin
This method is called during shutdown or probably on dynamic implementation exchange, to allow an implementation to finalize properly.
deactivate
in interface JwmaPlugin
public java.lang.String exportContact(JwmaContact contact, java.lang.String TYPE) throws JwmaException
ContactManagementPlugin
exportContact
in interface ContactManagementPlugin
contact
- the JwmaContact to be exported.TYPE
- the type of the export.
JwmaException
ContactManagementPlugin.getSupportedTypes(int IMEX_TYPE)
,
ContactManagementPlugin.CONTACT_EXPORT
public JwmaContact importContact(java.io.InputStream in, java.lang.String TYPE) throws JwmaException
ContactManagementPlugin
importContact
in interface ContactManagementPlugin
in
- source for importing the contact in the given type.TYPE
- the type of the import source.
JwmaException
ContactManagementPlugin.getSupportedTypes(int IMEX_TYPE)
,
ContactManagementPlugin.CONTACT_IMPORT
public JwmaContact[] importDatabase(java.io.InputStream in, java.lang.String TYPE) throws JwmaException
ContactManagementPlugin
importDatabase
in interface ContactManagementPlugin
in
- source for importing the contacts in the given type.
JwmaException
ContactManagementPlugin.getSupportedTypes(int IMEX_TYPE)
,
ContactManagementPlugin.DATABASE_IMPORT
public void exportDatabase(java.io.OutputStream out, JwmaContacts db, java.lang.String TYPE) throws JwmaException
ContactManagementPlugin
exportDatabase
in interface ContactManagementPlugin
db
- the JwmaContacts database to be exported.TYPE
- the type of the export.
JwmaException
ContactManagementPlugin.getSupportedTypes(int IMEX_TYPE)
,
ContactManagementPlugin.DATABASE_EXPORT
public java.lang.String[] getSupportedTypes(int IMEX_TYPE)
ContactManagementPlugin
getSupportedTypes
in interface ContactManagementPlugin
public boolean isSupportedContactImportType(java.lang.String type)
ContactManagementPlugin
isSupportedContactImportType
in interface ContactManagementPlugin
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |