public class PersistenceDerby extends Object implements Persistence
Constructor and Description |
---|
PersistenceDerby() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkUser(String id)
Check if a user is already persisted with an associated password pair.
|
boolean |
checkUserPWD(String id,
String pwd)
Method that checks the proper authentication of a persisted user-password
pair.
|
void |
init(RemoteAPI remoteAPI,
ModuleContext context)
Sets up the underlying database, creating any tables if not present
before, and performing any mainenance operations.
|
void |
removeOlderThan(Long millis)
Maintenance method that removes all stored data from all tables that was
introduced more than @param millis ago.
|
void |
removeRegister(String id)
Eliminate all persisted info (node registration, subscribers and callees)
of a remote node
|
void |
restore()
Restore in the R-API implementation (and consequently in the MW) all the
persisted information (registration, subscribers and callees) for all
nodes.
|
void |
storeCallee(String id,
String profile)
Persist a request to have a service callee for a node
|
void |
storeRegister(String id,
String remote,
String v)
Persist a request to have a registration of a remote node
|
void |
storeSubscriber(String id,
String pattern)
Persist a request to have a context subscriber for a node
|
void |
storeUserPWD(String id,
String pwd)
Store a new user-password pair for later authentication.
|
public void init(RemoteAPI remoteAPI, ModuleContext context)
Persistence
init
in interface Persistence
remoteAPI
- The Remote API instance being used in the managercontext
- Module Context of universAALpublic void storeRegister(String id, String remote, String v)
Persistence
storeRegister
in interface Persistence
id
- The id used to uniquely identify the remote noderemote
- The remote access information for a remote nodev
- The version of client invoking the API. Descriptive only. Can
be null.public void storeSubscriber(String id, String pattern)
Persistence
storeSubscriber
in interface Persistence
id
- The id used to uniquely identify the remote nodepattern
- The serialized ContextEventPattern sent by the remote node in
the requestpublic void storeCallee(String id, String profile)
Persistence
storeCallee
in interface Persistence
id
- The id used to uniquely identify the remote nodeprofile
- The serialized ServiceProfile sent by the remote node in the
requestpublic void removeRegister(String id)
Persistence
removeRegister
in interface Persistence
id
- The id used to uniquely identify the remote nodepublic void restore()
Persistence
restore
in interface Persistence
public void removeOlderThan(Long millis)
millis
- Minimum age, in milliseconds, at which the data will be
removed (data older than this will be removed)public void storeUserPWD(String id, String pwd)
Persistence
storeUserPWD
in interface Persistence
id
- Userpwd
- Passwordpublic boolean checkUserPWD(String id, String pwd)
Persistence
checkUserPWD
in interface Persistence
id
- Userpwd
- Passwordpublic boolean checkUser(String id)
Persistence
checkUser
in interface Persistence
id
- to checkCopyright © 2018 universAAL Consortium. All rights reserved.