001: /***
002: * jwma Java WebMail
003: * Copyright (c) 2000-2003 jwma team
004: *
005: * jwma is free software; you can distribute and use this source
006: * under the terms of the BSD-style license received along with
007: * the distribution.
008: ***/package dtw.webmail.model;
009:
010: /**
011: * An interface defining the contract for interaction with
012: * the JwmaContacts model.
013: * <p>
014: * The JwmaContacts allows a view programmer to obtain
015: * information about the contact database to display
016: * items for reading or editing.
017: *
018: * @author Dieter Wimberger
019: * @version 0.9.7 07/02/2003
020: *
021: */
022: public interface JwmaContacts {
023:
024: /**
025: * Returns the unique identifier of this <tt>JwmaContacts</tt>.
026: *
027: * @return the unique identifier as <tt>String</tt>.
028: */
029: public String getUID();
030:
031: /**
032: * Returns an array of available contact categories.
033: *
034: * @return an array of <tt>String</tt>'s.
035: */
036: public String[] listContactCategories();
037:
038: /**
039: * Returns an array of contacts containing all contacts
040: * in this contact database.
041: * <p>
042: * If this contact database does not contain any contacts,
043: * then this method returns an empty array.
044: *
045: * Otherwise it contains one <tt>JwmaContact</tt> for
046: * each entry in this contact database.
047: *
048: * @return an array of <tt>JwmaContact</tt>'s.
049: */
050: public JwmaContact[] listContacts();
051:
052: /**
053: * Returns an array of contacts containing all frequent recipient
054: * contacts.
055: * <p>
056: * If the contact database does not contain any frequent recipient
057: * contacts, then this method returns an empty array.
058: *
059: * Otherwise it contains one <tt>JwmaContact</tt> for
060: * each entry in this contact database.
061: *
062: * @return an array of <tt>JwmaContact</tt>'s.
063: */
064: public JwmaContact[] listFrequentRecipients();
065:
066: /**
067: * Returns an array of contact groups containing all
068: * groups of this contact database.
069: * <p>
070: * If this contact database does not contain any groups,
071: * then this method returns an empty array.
072: *
073: * Otherwise it contains one <tt>JwmaContactGroup</tt> for
074: * each group entry in this contact database.
075: *
076: * @return an array of <tt>JwmaContactGroup</tt>'s.
077: */
078: public JwmaContactGroup[] listContactGroups();
079:
080: /**
081: * Returns an <tt>JwmaContact</tt> representing the
082: * contact with the given unique identifier.
083: * <p>
084: * If the contact database does not contain any contact with
085: * the given identifier, it returns null. Otherwise it returns
086: * the associated contact.
087: *
088: * @return the contact associated with the given identifier,
089: * or null.
090: */
091: public JwmaContact getContact(String uid);
092:
093: /**
094: * Returns an <tt>JwmaContactGroup</tt> representing the
095: * contact group with the given unique identifier.
096: * <p>
097: * If the contact database does not contain any contact group with
098: * the given identifier, it returns null. Otherwise it returns
099: * the associated contact group.
100: *
101: * @return the contact group associated with the given identifier,
102: * or null.
103: */
104: public JwmaContactGroup getContactGroup(String uid);
105:
106: }//JwmaContacts
|