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 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)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The enumeration specifies the behavior when a case in a choice is not selected explicitly or implicitly. -
Field Summary
Modifier and TypeFieldDescriptionDefault behavior for unset case in choice. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Get the backing store Cdb instance.Get the backing store CdbSession in this context was based on this.getCdb()
Deprecated.Deprecated.getCdbOperSession
(EnumSet<CdbLockType> lock) Deprecated.getCdbSession
(CdbDBType dbType) Deprecated.getCdbSession
(CdbDBType type, EnumSet<CdbLockType> lock) Deprecated.getMaapi()
Getter for MAAPIint
Getter for MAAPI transaction handle.int
Deprecated.If the context is created withNavuContext(CdbSession)
this session will be returned.Deprecated.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
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)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
-
getCdb
Deprecated.This method is deprecated, use getBackingStoreCdb() instead- 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
-
currentCdbSession
Deprecated.This method is deprecated, use getBackingStoreCdbSession() instead- Returns:
- backing store CdbSession if applicable
-
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.
-
getReadOnlyMaapi
Deprecated.This method is deprecated. The readOnly Maapi is not used and therefore obsolete.- Returns:
- the read only maapi.
-
getMaapiReadOnlyHandle
Deprecated.This method is deprecated. The readOnly Maapi transaction is not used and therefore obsolete.- Returns:
- the read only transaction id.
-
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 withNavuContext(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
-
getCdbSession
Deprecated.This method is deprecated. Use one ofgetReadConfSession()
,getReadConfSession()
orgetWriteOperSession()
instead. Get Cdb session for the specified database for reading purposes.- Parameters:
dbType
-- Returns:
- a CDB session.
-
getCdbSession
Deprecated.This method is deprecated. Use one ofgetReadConfSession()
,getReadConfSession()
orgetWriteOperSession()
instead.- Parameters:
type
-lock
-- Returns:
- a CDB session.
-
getCdbOperSession
Deprecated.This method is deprecated. Use one ofgetReadConfSession()
,getReadConfSession()
orgetWriteOperSession()
instead. Return a CDB oper session.- Returns:
- current Cdb oper session
-
getCdbOperSession
Deprecated.This method is deprecated. Use one ofgetReadConfSession()
,getReadConfSession()
orgetWriteOperSession()
instead. Return a CDB oper session with a lock.- Parameters:
lock
- The locktype for this cdb session- Returns:
- cdb oper session with lock of locktype
-
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() -
setLockingMode
Deprecated.This method is deprecated Use {linksetWriteOperLocks(EnumSet)
instead. If enabled = true, this method will addCdbLockType.LOCK_WAIT
to the lockset of an CDB Oper Sessions. If false it will remove the same lock from the lockset.- Parameters:
enable
- wait_lock if true.
-
toString