Package com.tailf.navu
Class NavuContextBase
Object
com.tailf.navu.NavuContextBase
- Direct Known Subclasses:
NavuContext
This class is the base class for
NavuContext
.
It many contains methods for handling CDB type contexts i.e contexts created
by the NavuContextBase(Cdb)
or
NavuContextBase(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)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The enumeration specifies the behavior when a case in a choice is not selected explicitly or implicitly. -
Field Summary
FieldsModifier and TypeFieldDescriptionDefault behavior for unset case in choice. -
Method Summary
Modifier and TypeMethodDescriptionGet the backing store Cdb instance.Get the backing store CdbSession in this context was based on this.getMaapi()
Getter for MAAPIint
Getter for MAAPI transaction handle.If the context is created withNavuContextBase(CdbSession)
this session will be returned.Retrieves a CdbSession for reading CDB_OPERATIONAL database with the default locks if not defined bysetReadOperLocks(EnumSet)
Retrieves a CdbSession for writing CDB_OPERATIONAL database with the default locks if not defined bysetWriteOperLocks(EnumSet)
boolean
boolean
isCdb()
boolean
boolean
isMaapi()
boolean
isOnline()
void
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
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)toString()
-
Field Details
-
unsetCaseInChoice
Default behavior for unset case in choice. print warn msg in the log.
-
-
Method Details
-
getMaapi
Getter for MAAPI- Returns:
- current Maapi object
-
getBackingStoreCdb
Get the backing store Cdb instance. The backing store Cdb is actually never used, instead it is used as primary for the internal NavuCdbSessionPool. The reason for this is that NAVU needs several CdbSessions concurrently and a Cdb instance can only hold one open CdbSession- Returns:
- backing store Cdb if applicable for this context
-
getBackingStoreCdbSession
Get the backing store CdbSession in this context was based on this. Otherwise this method returns null. Creating a context based on a CdbSession is an alternative to creating context based on a Cdb instance. If the CdbSession option is used, this session will be the backing store session and also its related Cdb instance is retrieved and stored as backing store Cdb instance. This CdbSession is never used by NAVU, instead it is primary for the internal NavuCdbSessionPool.- Returns:
- backing store CdbSession if applicable for this context
-
getMaapiHandle
public int getMaapiHandle()Getter for MAAPI transaction handle.- Returns:
- current maapi transaction handle
-
isMaapi
public boolean isMaapi()- Returns:
- true if the a Maapi context.
-
isCdbSession
public boolean isCdbSession() -
isCdb
public boolean isCdb() -
hasCdbSubscriber
public boolean hasCdbSubscriber() -
getCdbSubscriber
-
getNsList
- Returns:
- registered namespaces.
-
setReadOperLocks
Sets the locks for a read CDB operational data session Default is no locks.- Parameters:
locks
-
-
setReadConfLocks
Sets the locks for a read CDB configuration data session Default is no locks.- Parameters:
locks
-
-
setWriteOperLocks
Sets the locks for a write CDB operational data session Default is EnumSet.of(CdbLockType.LOCK_REQUEST,CdbLockType.LOCK_PARTIAL)- Parameters:
locks
-
-
getReadOperSession
Retrieves a CdbSession for reading CDB_OPERATIONAL database with the default locks if not defined bysetReadOperLocks(EnumSet)
- Returns:
- CdbSession
-
getReadConfSession
If the context is created withNavuContextBase(CdbSession)
this session will be returned. Otherwise retrieves a CdbSession for reading CDB_RUNNING database with the default locks if not defined bysetReadConfLocks(EnumSet)
- Returns:
- CdbSession
-
getWriteOperSession
Retrieves a CdbSession for writing CDB_OPERATIONAL database with the default locks if not defined bysetWriteOperLocks(EnumSet)
- Returns:
- CdbSession
-
removeCdbSessions
public void removeCdbSessions()Clears all the CDB sessions associates with the mapping between the the supplied Cdb socket and the ( in CDB mode ) -
isOnline
public boolean isOnline() -
toString