|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.rmi.server.RemoteObject java.rmi.server.RemoteServer java.rmi.server.UnicastRemoteObject edu.northwestern.at.wordhoard.server.WordHoardSessionImpl
public class WordHoardSessionImpl
Session remote object implementation.
Field Summary |
---|
Fields inherited from class java.rmi.server.RemoteObject |
---|
ref |
Constructor Summary | |
---|---|
WordHoardSessionImpl()
Creates a new session. |
Method Summary | |
---|---|
java.lang.Long |
createOrUpdateAccount(Account account)
Creates or updates an account. |
java.lang.Long |
createUserDataObject(UserDataObject userDataObject)
Creates a user data object. |
void |
deleteAccount(java.lang.Long id)
Deletes an account. |
void |
deleteUserDataObject(java.lang.Class udoClass,
java.lang.Long id)
Deletes a user data object. |
void |
deleteWordSet(WordSet wordSet)
Deletes a word set. |
void |
endSession()
Ends the session. |
java.util.List |
getAccounts()
Gets all the accounts. |
(package private) static void |
initialize()
Initializes the class. |
protected int |
insertViaSQL(java.lang.String insertString,
org.hibernate.Session session)
Insert data via SQL. |
Account |
login(java.lang.String username,
java.lang.String password)
Logs in. |
void |
logMessage(int level,
java.lang.String msg)
Logs a message. |
void |
logout()
Logs out. |
int |
performBatchInserts(java.lang.String[] insertStatements)
Performs batch inserts using prepared MySQL insert statements. |
void |
tickle()
Tickles the session. |
java.lang.String |
toString()
Returns a string representation of the session. |
java.lang.Long |
updateUserDataObject(UserDataObject userDataObject,
UserDataObjectUpdater userDataObjectUpdater)
Updates a user data object. |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
---|
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
---|
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
---|
equals, getRef, hashCode, toStub |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
WordHoardSessionImpl() throws java.rmi.RemoteException
java.rmi.RemoteException
Method Detail |
---|
public void endSession() throws java.rmi.RemoteException
endSession
in interface WordHoardSession
java.rmi.RemoteException
public void tickle() throws java.rmi.RemoteException
Clients should tickle their sessions every 30 minutes. Sessions which go untickled for 2 hours are considered to be dead and are timed out and terminated.
tickle
in interface WordHoardSession
java.rmi.RemoteException
public void logMessage(int level, java.lang.String msg) throws java.rmi.RemoteException
logMessage
in interface WordHoardSession
level
- Log message level.msg
- Log message.
java.rmi.RemoteException
public Account login(java.lang.String username, java.lang.String password) throws java.rmi.RemoteException
Logins are not permitted using the special "system" account.
login
in interface WordHoardSession
username
- Username.password
- Password.
java.rmi.RemoteException
public void logout() throws java.rmi.RemoteException
logout
in interface WordHoardSession
java.rmi.RemoteException
public java.util.List getAccounts() throws java.rmi.RemoteException, WordHoardError
getAccounts
in interface WordHoardSession
java.rmi.RemoteException
WordHoardError
public java.lang.Long createOrUpdateAccount(Account account) throws java.rmi.RemoteException, WordHoardError
createOrUpdateAccount
in interface WordHoardSession
account
- Account.
java.rmi.RemoteException
WordHoardError
public void deleteAccount(java.lang.Long id) throws java.rmi.RemoteException, WordHoardError
deleteAccount
in interface WordHoardSession
id
- Account id.
java.rmi.RemoteException
WordHoardError
public java.lang.String toString()
toString
in class java.rmi.server.RemoteObject
static void initialize() throws java.lang.Exception
java.lang.Exception
public java.lang.Long createUserDataObject(UserDataObject userDataObject) throws java.rmi.RemoteException, WordHoardError, BadOwnerException, PersistenceException
createUserDataObject
in interface WordHoardSession
userDataObject
- User data object.
java.rmi.RemoteException
WordHoardError
BadOwnerException
PersistenceException
public java.lang.Long updateUserDataObject(UserDataObject userDataObject, UserDataObjectUpdater userDataObjectUpdater) throws java.rmi.RemoteException, WordHoardError, BadOwnerException, PersistenceException
updateUserDataObject
in interface WordHoardSession
userDataObject
- The user data object to update.userDataObjectUpdater
- Method which updates fields of
user data object.
BadOwnerException
- if user is not
logged in or is not the owner of the
user data object.
java.rmi.RemoteException
WordHoardError
PersistenceException
public void deleteUserDataObject(java.lang.Class udoClass, java.lang.Long id) throws java.rmi.RemoteException, WordHoardError, PersistenceException
deleteUserDataObject
in interface WordHoardSession
udoClass
- Class of user data object to delete.id
- ID of user data object to delete.
PersistenceException
java.rmi.RemoteException
WordHoardError
public void deleteWordSet(WordSet wordSet) throws java.rmi.RemoteException, WordHoardError, PersistenceException
deleteWordSet
in interface WordHoardSession
wordSet
- The word set to delete.
PersistenceException
java.rmi.RemoteException
WordHoardError
protected int insertViaSQL(java.lang.String insertString, org.hibernate.Session session) throws PersistenceException
insertString
- The SQL insert string.session
- Persistence manager session.
PersistenceException
- This method provides for executing a MySQL batch insert query. This is much faster than using standard Hibernate facilities for batch inserts.
public int performBatchInserts(java.lang.String[] insertStatements) throws java.rmi.RemoteException, WordHoardError, PersistenceException
performBatchInserts
in interface WordHoardSession
insertStatements
- String array of MySQL insert statements.
PersistenceException
java.rmi.RemoteException
WordHoardError
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |