1 /******************************************************************************
2 * ContactsDao.java - Dao interface for the contacts. Store info about how a contact was built.
3 *
4 * PicMan - The BuckoSoft Picture Manager in Java
5 * Copyright(c) 2005 - Dick Balaska
6 *
7 */
8 package com.buckosoft.PicMan.db;
9
10 import java.util.Date;
11 import java.util.HashMap;
12
13 import com.buckosoft.PicMan.domain.Chain;
14 import com.buckosoft.PicMan.domain.Contact;
15
16 /** Dao interface for the {@link com.buckosoft.PicMan.domain.Contact}s
17 * @author Dick Balaska
18 * @since 2005/08/07
19 */
20 public interface ContactsDao {
21
22 /** Add this <code>Contact</code> to the database.
23 * @param contact
24 */
25 void addContact(Contact contact);
26
27 /** Fetch a Contact from the database
28 * @param cid The Chain Id of the Chain to query
29 * @param uuid The uuid of the contact i.e. G-100-02
30 * @return The contact found, or null
31 */
32 Contact getContact(int cid, String uuid);
33
34 /** Fetch a Contact from the database. This is used like to edit filters in an existing contact.
35 * @param cid The Chain Id of the Chain to query
36 * @param setName The name of the Set
37 * @param size The thumbnail size
38 * @param index which contact number in this series
39 * @return The contact found, or null
40 */
41 Contact getContact(int cid, String setName, int size, int index);
42
43 /** Fetch the newest contact we made
44 * @return The contact that was the last one made.
45 */
46 Contact getNewestContact();
47
48 /** Return a map of the oldest contacts in this chain. <br>
49 * Each set/size is a key "PG-100". The value is the date of the oldest contact in that set/size. <br>
50 * This is useful when processed against filter dates to determine which contacts need to be remade.
51 * @param chain The Chain to process
52 * @return The map of oldest contacts.
53 */
54 HashMap<String, Date> getContactOldestMap(Chain chain);
55 }