|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdist1.acb.CBL.DBExplorer
Database Explorer
| Method Summary | |
void |
clearSnapshotDir()
Clears the directory for snapshots |
void |
clearUsersState()
Set to null ip, port and cbl of user |
void |
connect()
Connects to the database |
void |
createAtLeastOneAdmin()
Checks number of administrators in the system and if there is no administrators, creates one |
java.util.LinkedList |
getAliveCBLs()
Returns the list of CBLs from the database |
Response |
getBalance(java.lang.String login,
Request request)
Handler for request GetBalance |
Response |
getCashFlows(java.lang.String login,
Request request)
Handler for request Cash Flow |
java.util.LinkedList |
getCBLs()
Returns the list of CBLs from the database |
java.util.LinkedList |
getCBLsInfo()
Returns the list of CBLs from the database with addition Information (ResponseCBLsInfo.) |
static DBExplorer |
getInstance()
getInstance |
java.util.LinkedList |
getLog(long afterId)
Returns the list of Logs from the database |
Response |
getPeersLocation(RequestGetPeersLocation request)
Handles peer's location |
ResponseTopics |
getTopics(Request request)
Returns a list of Topics in the database |
User |
getUser(java.lang.String login)
given a login returns User object |
Response |
hBeginSellTransaction(java.lang.String login,
RequestUpdate request)
Handler for request insert register |
Response |
hCloseSession(java.lang.String login,
RequestUpdate request)
Handler for request CloseSession |
Response |
hDeleteOldUsers(java.lang.String login,
RequestUpdate request)
Delete Old users |
Response |
hEndSellTransaction(java.lang.String login,
RequestUpdate request)
Handler for request BeginSellTransaction |
Response |
hInitCBLTable(java.lang.String login,
RequestUpdate request)
Handler for request InitCBLTable (Clears (sets to 0) state of all CBLs in the table and updates Primary's record) |
Response |
hInsertLog(java.lang.String login,
RequestUpdate request)
Handler for request insert log |
Response |
hLogin(java.lang.String login,
RequestUpdate request)
Handler for request Login |
Response |
hMoneyFromAccount(java.lang.String login,
RequestUpdate request)
Handler for request MoneyFromAccount |
Response |
hMoneyToAccount(java.lang.String login,
RequestUpdate request)
Handler for request MoneyToAccount |
Response |
hRegister(java.lang.String login,
RequestUpdate request)
Handler for request Register |
Response |
hRemoveCBL(java.lang.String login,
RequestUpdate request)
Delete CBLs |
Response |
hRemoveFiles(java.lang.String login,
RequestUpdate request)
Handler for request RemoveFiles |
Response |
hShare(java.lang.String login,
RequestUpdate request)
Handler for request Share |
Response |
hUpdateCBL(java.lang.String login,
RequestUpdate request)
Handler for request update a CBL |
Response |
hUpdateUser(java.lang.String login,
RequestUpdate request)
Handler for request update a user |
void |
loadSnapshot()
Clear the database and load the snapshot from directory \dbsnapshot |
void |
lockTables()
Flushs and Locks all tables with read lock |
Response |
search(RequestSearch request)
Search for files |
void |
storeSnapshot()
Makes snapshot of database and put it to the \dbsnapshot directory. |
void |
unlockTables()
Unlocks all tables previosly locked by lockTables() method |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static DBExplorer getInstance()
public java.util.LinkedList getAliveCBLs()
throws java.sql.SQLException
java.sql.SQLException - if something is wrong
public Response getBalance(java.lang.String login,
Request request)
login - request -
public java.util.LinkedList getCBLs()
throws java.sql.SQLException
java.sql.SQLException - if something is wrong
public java.util.LinkedList getCBLsInfo()
throws java.sql.SQLException,
java.lang.CloneNotSupportedException
java.sql.SQLException - if something is wrong
java.lang.CloneNotSupportedException - if CBL is not clonable
public Response getCashFlows(java.lang.String login,
Request request)
login - User's loginrequest - The request
public java.util.LinkedList getLog(long afterId)
throws java.sql.SQLException
afterId - DOCUMENT ME!
java.sql.SQLException - if something is wrongpublic Response getPeersLocation(RequestGetPeersLocation request)
request - DOCUMENT ME!
public ResponseTopics getTopics(Request request)
throws java.sql.SQLException
request - Request for topics
java.sql.SQLException
public User getUser(java.lang.String login)
throws java.sql.SQLException,
java.lang.RuntimeException
login -
java.sql.SQLException
java.lang.RuntimeException - if user was not foundpublic void clearSnapshotDir()
public void clearUsersState()
public void connect()
throws java.lang.Throwable
java.lang.Throwable - if something wrong
java.sql.SQLException - error in SQL
public void createAtLeastOneAdmin()
throws java.sql.SQLException
java.sql.SQLException - if something wrong
public Response hBeginSellTransaction(java.lang.String login,
RequestUpdate request)
hBeginSellTransaction in interface UpdatesExecutorlogin - Urer's loginrequest - The request
public Response hCloseSession(java.lang.String login,
RequestUpdate request)
hCloseSession in interface UpdatesExecutorlogin - Urer's loginrequest - The request
public Response hDeleteOldUsers(java.lang.String login,
RequestUpdate request)
hDeleteOldUsers in interface UpdatesExecutorlogin - Urer's loginrequest - The request
public Response hRemoveCBL(java.lang.String login,
RequestUpdate request)
hRemoveCBL in interface UpdatesExecutorlogin - Urer's loginrequest - The request
public Response hEndSellTransaction(java.lang.String login,
RequestUpdate request)
hEndSellTransaction in interface UpdatesExecutorlogin - Urer's loginrequest - The request
public Response hInitCBLTable(java.lang.String login,
RequestUpdate request)
hInitCBLTable in interface UpdatesExecutorlogin - Urer's loginrequest - The request
public Response hInsertLog(java.lang.String login,
RequestUpdate request)
hInsertLog in interface UpdatesExecutorlogin - Urer's loginrequest - The request
public Response hLogin(java.lang.String login,
RequestUpdate request)
hLogin in interface UpdatesExecutorlogin - A user loginrequest - The request
public Response hMoneyFromAccount(java.lang.String login,
RequestUpdate request)
hMoneyFromAccount in interface UpdatesExecutorlogin - Urer's loginrequest - The request
public Response hMoneyToAccount(java.lang.String login,
RequestUpdate request)
hMoneyToAccount in interface UpdatesExecutorlogin - Urer's loginrequest - The request
public Response hRegister(java.lang.String login,
RequestUpdate request)
hRegister in interface UpdatesExecutorlogin - Urer's loginrequest - The request
java.lang.RuntimeException - internal exception
public Response hRemoveFiles(java.lang.String login,
RequestUpdate request)
hRemoveFiles in interface UpdatesExecutorlogin - Urer's loginrequest - The request
public Response hShare(java.lang.String login,
RequestUpdate request)
hShare in interface UpdatesExecutorlogin - Urer's loginrequest - The request
public Response hUpdateCBL(java.lang.String login,
RequestUpdate request)
hUpdateCBL in interface UpdatesExecutorlogin - Urer's loginrequest - The request
public Response hUpdateUser(java.lang.String login,
RequestUpdate request)
hUpdateUser in interface UpdatesExecutorlogin - Urer's loginrequest - The request
public void loadSnapshot()
throws java.lang.Exception
java.lang.Exception - is something wrong
public void lockTables()
throws java.sql.SQLException
java.sql.SQLException - is something wrongpublic Response search(RequestSearch request)
request -
public void storeSnapshot()
throws java.sql.SQLException
java.sql.SQLException - if something wrong
public void unlockTables()
throws java.sql.SQLException
java.sql.SQLException - if something wrong
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||