public abstract class NavuContextBase extends Object
NavuContext
.
It many contains methods for handling CDB type contexts i.e contexts created
by the NavuContext.NavuContext(Cdb)
or
NavuContext.NavuContext(CdbSession)
constructors.
Note, that instead of using CDB type contexts it is possible to instead use
the NavuContext.NavuContext(Maapi)
constructor followed by a call of
NavuContext.startOperationalTrans(int)
Modifier and Type | Class and Description |
---|---|
static class |
NavuContextBase.UnSetCaseInChoice
The enumeration specifies the behavior
when a case in a choice is not selected
explicitly or implicitly.
|
Modifier and Type | Field and Description |
---|---|
NavuContextBase.UnSetCaseInChoice |
unsetCaseInChoice
Default behavior for unset case in choice.
|
Modifier and Type | Method and Description |
---|---|
CdbSession |
currentCdbSession()
Deprecated.
|
Cdb |
getBackingStoreCdb()
Get the backing store Cdb instance.
|
CdbSession |
getBackingStoreCdbSession()
Get the backing store CdbSession in this context was based on this.
|
Cdb |
getCdb()
Deprecated.
|
CdbSession |
getCdbOperSession()
Deprecated.
|
CdbSession |
getCdbOperSession(EnumSet<CdbLockType> lock)
Deprecated.
|
CdbSession |
getCdbSession(CdbDBType dbType)
Deprecated.
|
CdbSession |
getCdbSession(CdbDBType type,
EnumSet<CdbLockType> lock)
Deprecated.
|
Maapi |
getMaapi()
Getter for MAAPI
|
int |
getMaapiHandle()
Getter for MAAPI transaction handle.
|
int |
getMaapiReadOnlyHandle()
Deprecated.
|
ArrayList<ConfNamespace> |
getNsList() |
CdbSession |
getReadConfSession()
If the context is created with
NavuContext.NavuContext(CdbSession)
this session will be returned. |
Maapi |
getReadOnlyMaapi()
Deprecated.
|
CdbSession |
getReadOperSession()
Retrieves a CdbSession for reading CDB_OPERATIONAL database with the
default locks if not defined by
setReadOperLocks(EnumSet) |
CdbSession |
getWriteOperSession()
Retrieves a CdbSession for writing CDB_OPERATIONAL database with the
default locks if not defined by
setWriteOperLocks(EnumSet) |
boolean |
isCdb() |
boolean |
isCdbSession() |
boolean |
isMaapi() |
boolean |
isOnline() |
void |
removeCdbSessions()
Clears all the CDB sessions associates with the mapping
between the the supplied Cdb socket and the ( in CDB mode )
|
void |
set(NavuContextBase context)
Set the context attributes using another context object.
|
void |
setLockingMode(boolean enable)
Deprecated.
|
void |
setOption(NavuContextBase.UnSetCaseInChoice unSetChoiceInCase)
Set the behavior of how a unset case in choice should be
treated.
|
void |
setReadConfLocks(EnumSet<CdbLockType> locks)
Sets the locks for a read CDB configuration data session
Default is no locks.
|
void |
setReadOperLocks(EnumSet<CdbLockType> locks)
Sets the locks for a read CDB operational data session
Default is no locks.
|
void |
setWriteOperLocks(EnumSet<CdbLockType> locks)
Sets the locks for a write CDB operational data session
Default is EnumSet.of(CdbLockType.LOCK_REQUEST,CdbLockType.LOCK_PARTIAL)
|
String |
toString() |
public NavuContextBase.UnSetCaseInChoice unsetCaseInChoice
@Deprecated public CdbSession currentCdbSession()
public Cdb getBackingStoreCdb()
public CdbSession getBackingStoreCdbSession()
@Deprecated public Cdb getCdb()
@Deprecated public CdbSession getCdbOperSession()
getReadConfSession()
,
getReadConfSession()
or
getWriteOperSession()
instead.
Return a CDB oper session.@Deprecated public CdbSession getCdbOperSession(EnumSet<CdbLockType> lock)
getReadConfSession()
,
getReadConfSession()
or
getWriteOperSession()
instead.
Return a CDB oper session with a lock.lock
- The locktype for this cdb session@Deprecated public CdbSession getCdbSession(CdbDBType dbType)
getReadConfSession()
,
getReadConfSession()
or
getWriteOperSession()
instead.
Get Cdb session for the specified database for reading purposes.dbType
- @Deprecated public CdbSession getCdbSession(CdbDBType type, EnumSet<CdbLockType> lock)
getReadConfSession()
,
getReadConfSession()
or
getWriteOperSession()
instead.type
- lock
- public Maapi getMaapi()
public int getMaapiHandle()
@Deprecated public int getMaapiReadOnlyHandle()
public ArrayList<ConfNamespace> getNsList()
public CdbSession getReadConfSession()
NavuContext.NavuContext(CdbSession)
this session will be returned.
Otherwise retrieves a CdbSession for reading CDB_RUNNING database with
the default locks if not defined by setReadConfLocks(EnumSet)
@Deprecated public Maapi getReadOnlyMaapi()
public CdbSession getReadOperSession()
setReadOperLocks(EnumSet)
public CdbSession getWriteOperSession()
setWriteOperLocks(EnumSet)
public boolean isCdb()
public boolean isCdbSession()
public boolean isMaapi()
public boolean isOnline()
public void removeCdbSessions()
public void set(NavuContextBase context)
This this operation will make an abrupt change in connection type, transactions etc. Therefore it is the responsibility of the user to handle open transactions, locks, socket or any other resources that otherwise will be left orphaned.
Note, that the context is normally set at the creation of the NAVU root node. The context is then shared between all child nodes and a change of context attributes will therefore affect all nodes in the current NAVU tree. This implies that data can become stale between maapi transactions or cdb locks and the it is the responsibility of the user to handle when and how stale data should be dismissed.
context
- @Deprecated public void setLockingMode(boolean enable)
setWriteOperLocks(EnumSet)
instead.
If enabled = true, this method will add CdbLockType.LOCK_WAIT
to
the lockset of an CDB Oper Sessions. If false it will remove
the same lock from the lockset.enable
- wait_lock if true.public void setOption(NavuContextBase.UnSetCaseInChoice unSetChoiceInCase)
unSetChoiceInCase
- the specified option for behavior
of unset case in choicepublic void setReadConfLocks(EnumSet<CdbLockType> locks)
locks
- public void setReadOperLocks(EnumSet<CdbLockType> locks)
locks
- public void setWriteOperLocks(EnumSet<CdbLockType> locks)
locks
-