|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectsnifos.application.test.DummyApplication
This is simple implementation of Application interface. It's configuration should contain only one property named "userId" which value should be integer number. This application accepts user only when user id in user's communication module can be divided by "userId" without remainder.
| Constructor Summary | |
DummyApplication()
Just dummy constructor - does nothing. |
|
| Method Summary | |
void |
configure(java.util.Properties configuration,
boolean isUnique)
Configures instance of Application with given parameters. |
void |
receiveMessage(UserId userId,
org.dom4j.Document message)
Called by server to pass message from user to this instance of application. |
void |
registerUser(UserId userId,
org.dom4j.Document message)
This application accepts user only when user id in user's communication module can be divided by "userId" configuration parameter without remainder. |
void |
run()
Method not implemented. |
void |
setServer(Server server)
Sets instance of server which will be used to communicate with to users. |
void |
unregisterUser(UserId userId)
Unregisters user with given id (for example after user disconnects). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DummyApplication()
| Method Detail |
public void configure(java.util.Properties configuration,
boolean isUnique)
Application
configure in interface Applicationconfiguration - Configuration which will be used.isUnique - True if application is uniqe.Application.configure(Properties, boolean)public void setServer(Server server)
Application
setServer in interface Applicationserver - Server instance.Application.setServer(Server)public void unregisterUser(UserId userId)
Application
unregisterUser in interface ApplicationuserId - Id of user.Application.unregisterUser(UserId)
public void receiveMessage(UserId userId,
org.dom4j.Document message)
Application
receiveMessage in interface ApplicationuserId - Id of user which sends message.message - Received message.Application.receiveMessage(UserId, Document)public void run()
run in interface java.lang.RunnableRunnable.run()
public void registerUser(UserId userId,
org.dom4j.Document message)
throws InvalidUserException
registerUser in interface ApplicationuserId - Id of user to register.message - First message sent by user (can contain some
user specific informations)
InvalidUserException - Thrown when user cannot be registered
by given application instanceApplication.registerUser(UserId, Document)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||