public final class Context extends Object
Modifier and Type | Field and Description |
---|---|
ClientBlocker |
blocker
Blocked clients.
|
DBNodes |
copied
Copied nodes.
|
Databases |
databases
Databases list.
|
Datas |
datas
Opened databases.
|
Events |
events
Event pool.
|
int |
focused
Focused node.
|
ClientListener |
listener
Client listener.
|
Log |
log
Log.
|
DBNodes |
marked
Marked nodes.
|
MainOptions |
options
Options.
|
Repo |
repo
Package repository.
|
Sessions |
sessions
Client sessions.
|
StaticOptions |
soptions
Static options.
|
Users |
users
Users.
|
Constructor and Description |
---|
Context()
Default constructor, which is usually called once in the lifetime of a project.
|
Context(boolean file)
Default constructor, which is usually called once in the lifetime of a project.
|
Context(Context ctx,
ClientListener listener)
Constructor, called by clients, and adopting the variables of the main process.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the database context.
|
void |
closeDB()
Closes the current database context.
|
DBNodes |
current()
Returns the current node context.
|
void |
current(DBNodes curr)
Sets the current node context.
|
Data |
data()
Returns the current data reference.
|
StringList |
filter(Perm perm,
StringList dbs)
Filters databases to the ones that have the specified permission.
|
void |
invalidate()
Invalidates the current node set.
|
void |
openDB(Data dt)
Sets the specified data instance as current database.
|
boolean |
perm(Perm perm,
String db)
Checks if the current user has the specified permission.
|
boolean |
pinned(String db)
Checks if the specified database is pinned.
|
void |
register(Proc pr)
Locks the specified process and starts a timeout thread.
|
boolean |
root()
Returns
true if a data reference exists and if the current node set contains
all documents. |
void |
set(DBNodes curr,
DBNodes mark)
Sets the current context and marked node set and resets the focus.
|
void |
unregister(Proc pr)
Unlocks the process and stops the timeout.
|
User |
user()
Returns the user of this context.
|
void |
user(User us)
Sets the user of this context.
|
public final ClientListener listener
null
in standalone/server mode.public final ClientBlocker blocker
public final MainOptions options
public final StaticOptions soptions
public final Sessions sessions
public final Events events
public final Datas datas
public final Users users
public final Repo repo
public final Databases databases
public final Log log
public DBNodes marked
public DBNodes copied
public int focused
public Context()
public Context(boolean file)
file
- retrieve options from diskpublic Context(Context ctx, ClientListener listener)
user
reference must be set after calling this method.ctx
- context of the main processlistener
- client listenerpublic User user()
public void user(User us)
us
- userpublic void close()
public boolean root()
true
if a data reference exists and if the current node set contains
all documents.public Data data()
public DBNodes current()
public void current(DBNodes curr)
curr
- node setpublic void openDB(Data dt)
dt
- data referencepublic void closeDB()
public void set(DBNodes curr, DBNodes mark)
curr
- context setmark
- marked nodespublic void invalidate()
public boolean pinned(String db)
db
- name of databasepublic boolean perm(Perm perm, String db)
perm
- requested permissiondb
- database (can be null
)public StringList filter(Perm perm, StringList dbs)
perm
- requested permissiondbs
- list of databasespublic void register(Proc pr)
pr
- processpublic void unregister(Proc pr)
pr
- processCopyright © 2005–2015 BaseX Team. All rights reserved.