public abstract class NavuContextBase extends Object
NavuContext
.
It many contains methods for handling CDB type contexts i.e contexts created
by the NavuContext(Cdb)
or
NavuContext(CdbSession)
constructors.
Note, that instead of using CDB type contexts it is possible to instead use
the 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.
|
CdbSubscription |
getCdbSubscriber() |
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(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
NavuContextBase.setReadOperLocks(EnumSet) |
CdbSession |
getWriteOperSession()
Retrieves a CdbSession for writing CDB_OPERATIONAL database with the
default locks if not defined by
NavuContextBase.setWriteOperLocks(EnumSet) |
boolean |
hasCdbSubscriber() |
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
public void setOption(NavuContextBase.UnSetCaseInChoice unSetChoiceInCase)
unSetChoiceInCase
- the specified option for behavior
of unset case in choicepublic 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
- public Maapi getMaapi()
public Cdb getBackingStoreCdb()
@Deprecated public Cdb getCdb()
public CdbSession getBackingStoreCdbSession()
@Deprecated public CdbSession currentCdbSession()
public int getMaapiHandle()
public boolean isMaapi()
public boolean isCdbSession()
public boolean isCdb()
public boolean hasCdbSubscriber()
public CdbSubscription getCdbSubscriber()
public ArrayList<ConfNamespace> getNsList()
@Deprecated public Maapi getReadOnlyMaapi()
@Deprecated public int getMaapiReadOnlyHandle()
public void setReadOperLocks(EnumSet<CdbLockType> locks)
locks
- public void setReadConfLocks(EnumSet<CdbLockType> locks)
locks
- public void setWriteOperLocks(EnumSet<CdbLockType> locks)
locks
- public CdbSession getReadOperSession()
NavuContextBase.setReadOperLocks(EnumSet)
public CdbSession getReadConfSession()
NavuContext(CdbSession)
this session will be returned.
Otherwise retrieves a CdbSession for reading CDB_RUNNING database with
the default locks if not defined by NavuContextBase.setReadConfLocks(EnumSet)
public CdbSession getWriteOperSession()
NavuContextBase.setWriteOperLocks(EnumSet)
@Deprecated public CdbSession getCdbSession(CdbDBType dbType)
NavuContextBase.getReadConfSession()
,
NavuContextBase.getReadConfSession()
or
NavuContextBase.getWriteOperSession()
instead.
Get Cdb session for the specified database for reading purposes.dbType
- @Deprecated public CdbSession getCdbSession(CdbDBType type, EnumSet<CdbLockType> lock)
NavuContextBase.getReadConfSession()
,
NavuContextBase.getReadConfSession()
or
NavuContextBase.getWriteOperSession()
instead.type
- lock
- @Deprecated public CdbSession getCdbOperSession()
NavuContextBase.getReadConfSession()
,
NavuContextBase.getReadConfSession()
or
NavuContextBase.getWriteOperSession()
instead.
Return a CDB oper session.@Deprecated public CdbSession getCdbOperSession(EnumSet<CdbLockType> lock)
NavuContextBase.getReadConfSession()
,
NavuContextBase.getReadConfSession()
or
NavuContextBase.getWriteOperSession()
instead.
Return a CDB oper session with a lock.lock
- The locktype for this cdb sessionpublic void removeCdbSessions()
public boolean isOnline()
@Deprecated public void setLockingMode(boolean enable)
NavuContextBase.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.