blueme.messenger.kernel
Class DB

java.lang.Object
  extended by blueme.messenger.kernel.DB
All Implemented Interfaces:
iConstants, iDB

public class DB
extends java.lang.Object
implements iDB, iConstants


Field Summary
 
Fields inherited from interface blueme.messenger.common.iConstants
ADMIN_UID, APP_TITLE, BLUETOOTH_INDEX, BLUETOOTH_LENGTH, BLUETOOTH_POSTFIX, BLUETOOTH_PREFIX, COM_OBJECTS, DISCOVERY_SLEEP, GPRS_INDEX, MAX_REDIRECTS, MSG_MAX_COUNT, MSG_MAX_LENGTH, NICK_MAX_LENGTH, PID_LENGTH, SMS_PUSH_PORT, UID_LENGTH
 
Constructor Summary
DB()
          Creates a new instance of DB
 
Method Summary
 boolean addMessages(iMSG message, java.lang.String uid)
          Adds one message to specified UID.
 void close()
          Used to notify the DB object that it is no longer of any use.
 boolean deleteProfile(java.lang.String uid)
          Deletes the profile saved on specified UID.
 iConfig getConfig()
          Get stored configuration, or "null" if there is no configuration saved.
 iMSG[] getMessages(java.lang.String uid)
          Get all messages stored on specified UID.
 blueme.messenger.common.iProfile getProfile(java.lang.String uid)
          Get profile for specified UID.
 iUserData getUserData()
          Get stored iUserData objects, or "null" if there are no stored iUserData objects.
 iUserList[] getUserList()
          Get the saved buddy list as an array of iUserList objects.
 boolean setConfig(iConfig config)
          Save specified configuration, and replace this with any possible existing configuration.
 boolean setMessages(iMSG[] messages, java.lang.String uid)
          Set specified messages on specified UID.
 boolean setProfile(blueme.messenger.common.iProfile profile, java.lang.String uid)
          Save specified profile on specified UID.
 boolean setUserData(iUserData userData)
          Saved specifed iUserData object, and delete possible existing iUserData object.
 boolean setUserList(iUserList[] userList)
          Save specified iUserList objects, and delete prossible existing array of iUserList objects.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DB

public DB()
Creates a new instance of DB

Method Detail

addMessages

public boolean addMessages(iMSG message,
                           java.lang.String uid)
Description copied from interface: iDB
Adds one message to specified UID. Returns "true" if the task could be completed, "false" otherwise.

Specified by:
addMessages in interface iDB

close

public void close()
Description copied from interface: iDB
Used to notify the DB object that it is no longer of any use. After this method have been utilized, no other DB access methodes will work.

Specified by:
close in interface iDB

getConfig

public iConfig getConfig()
Description copied from interface: iDB
Get stored configuration, or "null" if there is no configuration saved.

Specified by:
getConfig in interface iDB

getMessages

public iMSG[] getMessages(java.lang.String uid)
Description copied from interface: iDB
Get all messages stored on specified UID. If there are no messages stored on this UID, method will return "null". Messages are guaranteed to be sorted by oldest first.

Specified by:
getMessages in interface iDB

getProfile

public blueme.messenger.common.iProfile getProfile(java.lang.String uid)
Description copied from interface: iDB
Get profile for specified UID. If UID is "null", we get the prifle for this applications user. If there are no profile available, we return "null".

Specified by:
getProfile in interface iDB

getUserData

public iUserData getUserData()
Description copied from interface: iDB
Get stored iUserData objects, or "null" if there are no stored iUserData objects.

Specified by:
getUserData in interface iDB

getUserList

public iUserList[] getUserList()
Description copied from interface: iDB
Get the saved buddy list as an array of iUserList objects. If there are no saved buddy list, it will return "null".

Specified by:
getUserList in interface iDB

setConfig

public boolean setConfig(iConfig config)
Description copied from interface: iDB
Save specified configuration, and replace this with any possible existing configuration. Returns "true" if the configuration could be saved, "false" otherwise.

Specified by:
setConfig in interface iDB

setMessages

public boolean setMessages(iMSG[] messages,
                           java.lang.String uid)
Description copied from interface: iDB
Set specified messages on specified UID. If specified messages is "null" or an empty array, all previously messages on specified UID are deleted. Message to not need to be sorted in any particular order. Returns "true" if the task could be completed, "false" otherwise.

Specified by:
setMessages in interface iDB

setProfile

public boolean setProfile(blueme.messenger.common.iProfile profile,
                          java.lang.String uid)
Description copied from interface: iDB
Save specified profile on specified UID. If UID is "null", the specifed profile are for this applications user. Returns "true" if the profile could be saved, "false" otherwise.

Specified by:
setProfile in interface iDB

deleteProfile

public boolean deleteProfile(java.lang.String uid)
Description copied from interface: iDB
Deletes the profile saved on specified UID. If UID is "null", it's this applications users profile we want to delete. Returns "true" if the deletion could be completed, "false" otherwise. Method will also return "true" when there are no profile available on specified UID.

Specified by:
deleteProfile in interface iDB

setUserData

public boolean setUserData(iUserData userData)
Description copied from interface: iDB
Saved specifed iUserData object, and delete possible existing iUserData object. Returns "true" if the object could be saved, "false" otherwise.

Specified by:
setUserData in interface iDB

setUserList

public boolean setUserList(iUserList[] userList)
Description copied from interface: iDB
Save specified iUserList objects, and delete prossible existing array of iUserList objects. Returns "true" if objects could be saved, "false" otherwise.

Specified by:
setUserList in interface iDB