package org.mxchange.addressbook.database.frontend.contact;
import java.io.IOException;
+import java.text.MessageFormat;
import java.util.Iterator;
import java.util.List;
-import org.mxchange.addressbook.exceptions.BadTokenException;
import org.mxchange.addressbook.contact.Contact;
import org.mxchange.addressbook.database.backend.csv.CsvBackend;
import org.mxchange.addressbook.database.frontend.BaseDatabaseFrontend;
import org.mxchange.addressbook.database.storage.Storeable;
+import org.mxchange.addressbook.exceptions.BadTokenException;
import org.mxchange.addressbook.manager.contact.ContactManager;
/**
// Call own constructor
this();
+ // Trace message
+ this.getLogger().trace(MessageFormat.format("manager={0} - CALLED!", manager)); //NOI18N
+
+ // Manager instance must not be null
+ if (manager == null) {
+ // Abort here
+ throw new NullPointerException("manager is null"); //NOI18N
+ }
+
// Set contact manager
this.setContactManager(manager);
}
protected ContactDatabaseFrontend () {
super();
+ // Trace message
+ this.getLogger().trace("CALLED!"); //NOI18N
+
// Set "table" name
- this.setTableName("contacts");
+ this.setTableName("contacts"); //NOI18N
// Initalize backend
this.initBackend();
*/
@Override
public void doShutdown () {
+ // Trace message
+ this.getLogger().trace("CALLED!"); //NOI18N
+
// Shutdown backend
this.getBackend().doShutdown();
+
+ // Trace message
+ this.getLogger().trace("EXIT!"); //NOI18N
}
/**
*/
@Override
public void flushAllContacts () {
+ // Trace message
+ this.getLogger().trace("CALLED!"); //NOI18N
+
// Get full list
List<Contact> contacts = this.getContactManager().getList();
System.exit(1);
}
}
+
+ // Trace message
+ this.getLogger().trace("EXIT!"); //NOI18N
}
/**
*/
@Override
public void readAllContacts () {
+ // Trace message
+ this.getLogger().trace("CALLED!"); //NOI18N
+
// Get iterator and case it
CsvBackend backend = (CsvBackend) this.getBackend();
// Add contact instance to manager
this.getContactManager().addContact(contact);
}
+
+ // Trace message
+ this.getLogger().trace("EXIT!"); //NOI18N
}
}