Class PortalContext
PortalContext
create and manage connections to
Portal.
A connection is made by opening an Portal context, which is a communication
channel between a client application and the Portal server. All data in the
Portal server is accessed by using an open context. You can open a context
through the class constructor by passing it login information, or by using
one of the open
or connect
methods. It's best to
create a default instance of PortalContext
and use one of these
methods to open the context:
connect()
connect(Properties uprops)
open(Flist flist)
- An
Infranet.properties
file in the application classpath. - A
java.util.Properties
object passed in. - An
FList
passed in.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic String
static final int
Opcode control flag.static final int
Opcode control flag.static final int
Opcode control flag.static final int
Opcode control flag.static final int
Opcode control flag.static final int
Opcode control flag.static final int
Opcode control flag.static final int
static final int
Opcode control flag.static final int
Opcode control flag.static final int
Opcode control flag.static final int
Opcode control flag.Used by CM to skip schema search and by DMTT to search Oracle DB.static final int
Opcode control flag.Used by DM to enforce local searchstatic final int
Opcode control flag.Used by DM to search including all logical partitions.static final int
Opcode control flag.static String
static final int
Flag used with thePCM_OP_TRANS_OPEN
opcode to open a multi-schema global transaction.static final int
Flag used with thePCM_OP_TRANS_OPEN
opcode to open a lock-object transaction.static final int
Flag used with thePCM_OP_TRANS_OPEN
opcode to open a read-only transaction.static final int
Flag used with thePCM_OP_TRANS_OPEN
opcode to open a read-write transaction. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates a default instance ofPortalContext
.PortalContext
(boolean sockKeepAlive) Creates a default instance ofPortalContext
.PortalContext
(FList login) Creates an instance ofPortalContext
, and opens a connection.PortalContext
(FList login, Properties uprops) Creates an instance ofPortalContext
, and opens a connection.PortalContext
(FList login, Properties props, Boolean pcpDebug) This constructor is added to pass PCP debug parameter outside properties file Applications which are not passing properties file can set debug_pcp flag to turn on the PCP level debuggingPortalContext
(com.portal.pcm.PCPContext ctx) PortalContext
(PCPSelector selector) ======================================================================== =================== NIO Constructors ====================================== =====================================================PortalContext
(PCPSelector selector, FList login, Properties uprops) protected
PortalContext
(PortalContext srcPortalCtx) Allow a subclass to create an instance of PortalContext using connection information from an existing PortalContext object.PortalContext
(Boolean pcpDebug, boolean sockKeepAlive) Creates a default instance ofPortalContext
.PortalContext
(Properties uprops) Creates an instance ofPortalContext
, and opens a connection. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a Listerner to the existing connection pool of listeners/** Clones this PortalContext.void
close
(boolean logout) Closes a connection context with the server.void
connect()
Opens a connection context with the server.void
connect
(Properties uprops) Opens a connection context with the server.void
Disconnects from server.void
enableOpcodeLogging
(boolean enable) Enables or disables opcode logging.static String
Generates the unique correlation for each opcode.static String
genCorrelationId
(int opcode) Generates the unique correlation for each opcode.static String
genCorrelationId
(int opcode, String ctxStr, long opcodeTimeout) Generates the unique correlation for each opcode.static String
genCorrelationId
(String pName, int opcode, int salt) Generates the unique correlation for each opcode.static String
genCorrelationId
(String pName, int opcode, int salt, String ctxStr, long opcodeTimeout) Generates the unique correlation for each opcode.com.portal.pcm.PCPContext
Initialize Context Info details of corrleation id.static String
long
Invoke this function to get the time when this PortalContext object is created.long
Retrieves the database number the current context is connected to.static ErrorLog
Retrieves the default error-log object.getHost()
Retrieves the host name from the current connection.int
getPort()
Retrieves the port number from the current connection.int
Retrieves the session ID from the current connection.int
int
int
Retrieves the user ID from the current connection.Retrieves the user name from the current connection.static String
getUserProperty
(String key) Retrieves a property value from theInfranet.properties
file.static void
initHostnameAndProgramName
(String pName) Initialize Hostname and Program name of corrleation id.boolean
Checks if the underlying PCP Context is valid or not Called from external programs to check if the PortalContext is useableboolean
Invoke this function to identify whether this PortalContext is invloved in transaction or not.boolean
Checks if opcode logging is enabled.boolean
boolean
boolean
Sends an opcode to the server with a control flag.Sends an opcode to the server.opcodeReceive
(long socketTimeOutVal) opcodeReceive
(long timeOutVal, long socketTimeOutVal) void
opcodeSend
(int op, int flags, FList in) void
opcodeSend
(int op, FList in) void
Opens a connection context with the server.static void
parseConnectString
(String cStr, FList into) Converts the connection string from URL format to flist format.static String[]
void
Reconnects a closed PortalContext with the same parameters as it was last opened with.void
Reconnects a closed PCPConnection with the same parameters as it was last opened with, but with new password.void
reconnectAfterUpdatePwd
(String tempPwd) Reconnects a closed PortalContext with the updated FldPasswdClear parameters.static boolean
recvCorrelation
(FList inFlist) void
Deletes a Listerner to the existing connection pool of listenersstatic void
sendCorrelation
(FList inFlist) serviceSearch
(int op, int flags, FList in) Performs a dual search.static void
setAppName
(String appName) Sets the application keyword to use when looking up properties.static void
setCorrelationId
(String correlation) static void
setLocalProperties
(Properties uprops) Deprecated.This method is public to insure operability.void
setSocketChannelListener
(SocketChannelListener channelListener) static void
setTimeout
(int timeout) Set global socket time-out, will be used when the infranet.properties does not have timeout entry.void
setTimeoutOverrideOriginal
(int timeout) Exposing a method that is required by JCAA to override the timeout value in case of commit and no_transaction modevoid
Aborts a transaction.void
Commits a transaction.void
transactionOpen
(int flags) Opens a transaction on the current database.void
transactionOpen
(int flags, long dbNumber) Opens a transaction on the database.
-
Field Details
-
OPFLG_NO_DESCEND
public static final int OPFLG_NO_DESCENDOpcode control flag. Used with thePCM_OP_READ_OBJECT
opcode. Only reads substructs or arrays that are explicitly given on the input filst. Use this flag when reading fields and objects.- See Also:
-
OPFLG_META_ONLY
public static final int OPFLG_META_ONLYOpcode control flag. Returns only "meta" data from buffer fields when fields or objects are read.- See Also:
-
OPFLG_REV_CHECK
public static final int OPFLG_REV_CHECKOpcode control flag. Checks the revision level of the object. If the revision is current, no data is returned when fields or objects are read.- See Also:
-
OPFLG_COUNT_ONLY
public static final int OPFLG_COUNT_ONLYOpcode control flag. Returns only the number of matching entries when a search is performed.- See Also:
-
OPFLG_ADD_ENTRY
public static final int OPFLG_ADD_ENTRYOpcode control flag. Adds an array element if it doesn't already exist. This flag is required if you are writing or incrementing array elements.- See Also:
-
OPFLG_USE_POID_GIVEN
public static final int OPFLG_USE_POID_GIVENOpcode control flag. Uses the POID ID that you specify. Use this flag when creating or reading objects that have audit trails.- See Also:
-
OPFLG_CALC_ONLY
public static final int OPFLG_CALC_ONLYOpcode control flag. Returns the results of an operation without changing the values stored in the database.- See Also:
-
OPFLG_READ_RESULT
public static final int OPFLG_READ_RESULTOpcode control flag. Returns the whole object instead of just the POID.- See Also:
-
OPFLG_NO_RESULTS
public static final int OPFLG_NO_RESULTSOpcode control flag. Performs operations without returning results. Use this flag when writing or incrementing fields and higher performance is needed.- See Also:
-
OPFLG_CHACHABLE
public static final int OPFLG_CHACHABLEOpcode control flag. Caches results in the Portal Connection Manager (CM). Use only when reading fields.- See Also:
-
OPFLG_READ_UNCOMMITTED
public static final int OPFLG_READ_UNCOMMITTEDOpcode control flag. Prevents blocking while reading from a table when a concurrent transaction updates the same record. Specially created for use with SQL servers.- See Also:
-
OPFLG_READ_READPAST
public static final int OPFLG_READ_READPAST- See Also:
-
OPFLG_SEARCH_DB
public static final int OPFLG_SEARCH_DBOpcode control flag.Used by CM to skip schema search and by DMTT to search Oracle DB. The use case is ACT_FIND for account lookup via search over /service- See Also:
-
OPFLG_SEARCH_PARTITIONS
public static final int OPFLG_SEARCH_PARTITIONSOpcode control flag.Used by DM to search including all logical partitions.- See Also:
-
OPFLG_SEARCH_ONE_PARTITION
public static final int OPFLG_SEARCH_ONE_PARTITIONOpcode control flag.Used by DM to enforce local search- See Also:
-
TRAN_OPEN_READONLY
public static final int TRAN_OPEN_READONLYFlag used with thePCM_OP_TRANS_OPEN
opcode to open a read-only transaction. Use this flag when the operation will not change any data in the transaction. Any number of read-only transactions can be opened against a database at once.- See Also:
-
TRAN_OPEN_READWRITE
public static final int TRAN_OPEN_READWRITEFlag used with thePCM_OP_TRANS_OPEN
opcode to open a read-write transaction. Use this flag when you write to the database. Changes made to the data set are not final until the transaction is committed. Any number of read-write transactions can be opened against a database at once.- See Also:
-
TRAN_OPEN_LOCK_OBJ
public static final int TRAN_OPEN_LOCK_OBJFlag used with thePCM_OP_TRANS_OPEN
opcode to open a lock-object transaction. This flag locks a storable object as part of the transaction. No changes can be made to the object by other transactions until the current transaction is closed. If this flag is specified, theTRANS_OPEN_READWRITE
flag must also be specified.- See Also:
-
TRAN_OPEN_GLOBALTRANSACTION
public static final int TRAN_OPEN_GLOBALTRANSACTIONFlag used with thePCM_OP_TRANS_OPEN
opcode to open a multi-schema global transaction. This flag is used to indicate that the transaction is executed in a multi-schema environment and must be considered as a global transaction.TRANS_OPEN_READWRITE
flag must also be specified.- See Also:
-
Hostname
-
ProgramName
-
-
Constructor Details
-
PortalContext
public PortalContext(com.portal.pcm.PCPContext ctx) -
PortalContext
Creates a default instance ofPortalContext
. This does not open a connection to the server. You must open a connection using one of theopen
orconnect
methods before any transactions can be performed.- Throws:
EBufException
- thrown if an error occurs.
-
PortalContext
Creates a default instance ofPortalContext
. This does not open a connection to the server. You must open a connection using one of theopen
orconnect
methods before any transactions can be performed.- Parameters:
sockKeepAlive
- A boolean value to enable socket level parameters.- Throws:
EBufException
- thrown if an error occurs.
-
PortalContext
Creates a default instance ofPortalContext
. This does not open a connection to the server. You must open a connection using one of theopen
orconnect
methods before any transactions can be performed.- Parameters:
pcpDebug
- - allows to pass a flag to turn on PCP debugsockKeepAlive
- - allows to pass a flag to turn on socket keepalive- Throws:
EBufException
- thrown if an error occurs.
-
PortalContext
Creates an instance ofPortalContext
, and opens a connection. Configuration settings for the context are defined in the flist passed in. The flist must be in the form:0 PIN_FLD_POID POID [0] 0.0.0.1 /service/pcm_client 0 0 0 PIN_FLD_TYPE ENUM [0] 1 0 PIN_FLD_LOGIN STR [0] "root.0.0.0.1" 0 PIN_FLD_PASSWD_CLEAR STR [0] "password" 0 PIN_FLD_TIMEOUT_IN_MS INT [0] 30000 0 PIN_FLD_CM_PTRS ARRAY [0] allocated 1, used 1 1 PIN_FLD_CM_PTR STR [0] "ip <<I>server_hostname</I>> 11960"
For an example of opening a context using an flist passed in, see Sample Programs in the Portal online documentation.
- Parameters:
login
- A loginFList
containing configuration settings for the context.- Throws:
EBufException
- thrown if an error occurs.
-
PortalContext
Creates an instance ofPortalContext
, and opens a connection. Configuration settings for the context are defined in theProperties
object passed in. TheProperties
object requires two key/value entries:infranet.connection=CONNECTION_STRING infranet.login.type=1
The connection requires login, password, host, port, service and login type. The format for the CONNECTION_STRING is:pcp://<login>:<password>@<hostname>:<port>/service/admin_client 1
- Parameters:
uprops
- AProperties
object containing configuration settings for the context.- Throws:
EBufException
- thrown if an error occurs.
-
PortalContext
This constructor is added to pass PCP debug parameter outside properties file Applications which are not passing properties file can set debug_pcp flag to turn on the PCP level debugging- Parameters:
login
-FList
with login infoprops
-Properties
object. This parameter is ignored in this override at the momentpcpDebug
-Boolean
value indicating to enable (true) or disable (false) PCP debug logs- Throws:
EBufException
- when an error occurs
-
PortalContext
Creates an instance ofPortalContext
, and opens a connection. Configuration settings for the context are taken from the flist passed in. The flist must be in the form:0 PIN_FLD_POID POID [0] 0.0.0.1 /service/pcm_client 0 0 0 PIN_FLD_TYPE ENUM [0] 1 0 PIN_FLD_LOGIN STR [0] "root.0.0.0.1" 0 PIN_FLD_PASSWD_CLEAR STR [0] "password" 0 PIN_FLD_TIMEOUT_IN_MS INT [0] 30000 0 PIN_FLD_CM_PTRS ARRAY [0] allocated 1, used 1 1 PIN_FLD_CM_PTR STR [0] "ip <<I>server_hostname</I>> 11960"
For an example of opening a context using an flist passed in, see the Sample Programs in the Portal online documentation.
- Parameters:
login
- A loginFList
containing configuration settings for the context.uprops
- AProperties
object for configuration settings. Its value can be null.NOTE:
uprops
is not implemented in this constructor; it is for future usability.- Throws:
EBufException
- thrown if an error occurs. Opcode and Flist Logging: To enable opcode and flist logging, you will need to add the following to your Infranet.properties file: infranet.log.opcodes.enabled=true infranet.log.opcodes.file=[opcode logfile] NOTE: [opcode logfile] is the name of your logfile. EXAMPLE: infranet.log.opcodes.file=d:/temp/opcode.log NOTE: you cannot use backslash "\" characters in your directory structure
-
PortalContext
Allow a subclass to create an instance of PortalContext using connection information from an existing PortalContext object. If the Portal connection for the source PortalContext has already been established (via the open() or connect() calls) the new connection will "adopt" the Portal connection. Otherwise, the created PortalContext will need to be connected explicitly.Important: The source PortalContext is reset do its initial state once it's used; it is no longer connected to Portal. Generally, you should refrain from using it, however, if you must, you need to reopen the connection.
- Parameters:
srcPortalCtx
- PortalContext whose Portal connected is adopted by the newly-created PortalContext. The source PortalContext is reset to its default values after being used.
-
PortalContext
======================================================================== =================== NIO Constructors ====================================== =====================================================- Throws:
EBufException
-
PortalContext
- Throws:
EBufException
-
-
Method Details
-
addConnectionListner
Adds a Listerner to the existing connection pool of listeners -
removeConnectionListener
Deletes a Listerner to the existing connection pool of listeners -
setTimeout
public static void setTimeout(int timeout) Set global socket time-out, will be used when the infranet.properties does not have timeout entry. -
setTimeoutOverrideOriginal
public void setTimeoutOverrideOriginal(int timeout) Exposing a method that is required by JCAA to override the timeout value in case of commit and no_transaction mode- Parameters:
timeout
-
-
cloneConnection
/** Clones this PortalContext. If the Portal connection for this PortalContext has been established via the open() or connect() calls, the cloned PortalContext will also have opened an Infraent connection.- Returns:
- the new PortalContext
- Throws:
EBufException
-
transactionOpen
Opens a transaction on the current database. This is a convenient method that calls thePCM_OP_TRANS_OPEN
opcode and keeps track of the transaction state. Only one transaction can be opened at a time on the context. If you want to execute another transaction, you must open another context.The type of transaction is determined by the
flags
parameter. For more information on transactions and the transaction flags, see thePCM_OP_TRANS_OPEN
opcode in the Portal online documentation.- Parameters:
flags
- Transaction flag that defines the type of transaction to open.- Throws:
EBufException
- is thrown if an error occurs.- See Also:
-
transactionOpen
Opens a transaction on the database. This is a convenient method that calls thePCM_OP_TRANS_OPEN
opcode and keeps track of the transaction state. Only one transaction can be opened at a time on the context. If you want to execute another transaction, you must open another context.The type of transaction is determined by the
flags
parameter. For more information on transactions and the transaction flags, see thePCM_OP_TRANS_OPEN
opcode in the Portal online documentation.- Parameters:
flags
- Transaction flag that defines the type of transaction to open.dbNumber
- The database number where transaction is being opened- Throws:
EBufException
- is thrown if an error occurs.- See Also:
-
transactionCommit
Commits a transaction. This method calls thePCM_OP_TRANS_COMMIT
opcode. Committing a transaction causes all data changes to take effect and closes the open transaction. For more information, seePCM_OP_TRANS_COMMIT
in the Portal online documentation.- Throws:
EBufException
- is thrown if an error occurs.- See Also:
-
transactionAbort
Aborts a transaction. This method calls thePCM_OP_TRANS_ABORT
opcode. When a transaction is aborted, all data changes made in the transaction are discarded and the transaction is closed. For more information, see thePCM_OP_TRANS_ABORT
opcode in the Portal online documentation.- Throws:
EBufException
- is thrown if an error occurs.- See Also:
-
open
Opens a connection context with the server. Configuration settings for the context are defined in the flist passed in. The flist must be in the form:0 PIN_FLD_POID POID [0] 0.0.0.1 /service/pcm_client 0 0 0 PIN_FLD_TYPE ENUM [0] 1 0 PIN_FLD_LOGIN STR [0] "root.0.0.0.1" 0 PIN_FLD_PASSWD_CLEAR STR [0] "password" 0 PIN_FLD_TIMEOUT_IN_MS INT [0] 30000 0 PIN_FLD_CM_PTRS ARRAY [0] allocated 1, used 1 1 PIN_FLD_CM_PTR STR [0] "ip <<I>server_hostname</I>> 11960"
For an example of opening a context using an flist passed in, see Sample Programs in the Portal online documentation.
- Parameters:
in
-FList
containing configuration settings for the context.- Throws:
EBufException
- is thrown if an error occurs.
-
close
Closes a connection context with the server. Always close the context when it is no longer needed. To ensure proper logout, passtrue
.- Parameters:
logout
-true
to logout from the server.- Throws:
EBufException
- is thrown if an error occurs.
-
isContextValid
public boolean isContextValid()Checks if the underlying PCP Context is valid or not Called from external programs to check if the PortalContext is useable- Returns:
true
if underlying pcp context is not null
-
disconnect
Disconnects from server. Does not reset the context and does not logout Currently used by JCA Adapter to disconnect when rollback is called for for an active transaction in a different thread.- Throws:
EBufException
- is thrown if an error occurs.
-
serviceSearch
Performs a dual search. Searches TT first. In case there is no result returned, the same search is fired for the Oracle database to fetch the response. This will work as is in the next releases of Timos since when union search would be supported, the first search call itself would fetch all the results.- Parameters:
op
- An opcode to perform. For a list of opcodes, see thePortalOp
class.flags
- Control flag for the opcode being called. See the individual opcode descriptions for information on the flags they take. NOTE: Most opcodes take no flags, which you enter as 0.in
- The opcode inputFList
. For a list of mandatory and optional fields for the input flist, see the relevant opcode description, which provides a link to input flist specifications.- Returns:
- The opcode output
FList
. For a list of mandatory and optional fields for the output flist, see the relevant opcode description, which provides a link to output flist specifications. - Throws:
EBufException
- is thrown if an error occurs.
-
reconnect
Reconnects a closed PortalContext with the same parameters as it was last opened with. If the PortalContext wasn't closed or if it had never been opened, then this does not do anything.- Throws:
EBufException
- is thrown if an error occurs.
-
reconnect
Reconnects a closed PCPConnection with the same parameters as it was last opened with, but with new password. If it had never been opened, then calling this generates an EBufException.- Throws:
EBufException
- is thrown if an error occurs.
-
reconnectAfterUpdatePwd
Reconnects a closed PortalContext with the updated FldPasswdClear parameters. If the PortalContext wasn't closed or if it had never been opened, then this does not do anything.- Throws:
EBufException
- is thrown if an error occurs.
-
connect
Opens a connection context with the server. Configuration settings for the context are retrieved from a defaultInfranet.properties
file. You must put a validInfranet.properties
file in your CLASSPATH. For information about setting properties in theInfranet.properties
file, see the Setting global options section of Creating Client Applications by Using Java PCM in the Portal online documentation.- Throws:
EBufException
- is thrown if an error occurs.
-
connect
Opens a connection context with the server. This method first checks the defaultInfranet.properties
file to see if it has been read. If the file has been read, it retrieves configuration settings from that file. If the file has not yet been read, it retrieves settings for the connection from theProperties
object passed in. TheProperties
object requires two key/value entries:infranet.connection=CONNECTION_STRING infranet.login.type=1
The connection requires login, password, host, port, service and login type. The format for the CONNECTION_STRING is:pcp://<login>:<password>@<hostname>:<port>/service/admin_client 1
- Parameters:
uprops
- A Properties object containing configuration settings for the context.- Throws:
EBufException
- is thrown if an error occurs.
-
enableOpcodeLogging
public void enableOpcodeLogging(boolean enable) Enables or disables opcode logging. The opcode log keeps track of opcodes called and logs the flists. If enabled,Infranet.properties
must have a filename entry to set the destination log. For example:infranet.log.opcodes.file = mylog.log
For more information, see the Setting global options section of Creating Client Applications by Using Java PCM in the Portal online documentation.
- Parameters:
enable
- Set to true to enable opcode logging.
-
isOpcodeLoggingEnabled
public boolean isOpcodeLoggingEnabled()Checks if opcode logging is enabled.- Returns:
true
if opcode logging is enabled.
-
opcode
Sends an opcode to the server with a control flag. This method performs a PCM Opcode operation on an open context. The operation is synchronous, so the calling process waits until the operation is complete and has the return flist immediately available for inspection. For more information, see thePCM_OP()
opcode in the Portal online documentation.- Parameters:
op
- An opcode to perform. For a list of opcodes, see thePortalOp
class.flags
- Control flag for the opcode being called. See the individual opcode descriptions for information on the flags they take. NOTE: Most opcodes take no flags, which you enter as 0.in
- The opcode inputFList
. For a list of mandatory and optional fields for the input flist, see the relevant opcode description, which provides a link to input flist specifications.- Returns:
- The opcode output
FList
. For a list of mandatory and optional fields for the output flist, see the relevant opcode description, which provides a link to output flist specifications. - Throws:
EBufException
- is thrown if an error occurs.
-
opcode
Sends an opcode to the server. You can use this method if you don't have an opcode control flag to pass in. This method performs a PCM Opcode operation on an open context. The operation is synchronous, so the calling process waits until the operation is complete and has the return flist immediately available for inspection. For more information, see thePCM_OP()
opcode in the Portal online documentation.- Parameters:
op
- An opcode to perform. For a list of opcodes, see thePortalOp
class.in
- The opcode inputFList
. For a list of mandatory and optional fields for the input flist, see the relevant opcode description, which provides a link to input flist specifications.- Returns:
- The opcode output flist. For a list of mandatory and optional fields for the output flist, see the relevant opcode description, which provides a link to output flist specifications.
- Throws:
EBufException
- is thrown if an error occurs.
-
opcodeSend
- Throws:
EBufException
-
opcodeSend
- Throws:
EBufException
-
isSocketChannelConnected
public boolean isSocketChannelConnected() -
isSocketChannelOpen
public boolean isSocketChannelOpen() -
isSocketChannelRegistered
public boolean isSocketChannelRegistered() -
getInetAddress
-
getLocalAddress
-
getLocalPort
public int getLocalPort() -
getSocketChannelPort
public int getSocketChannelPort() -
getSocketChannelHashCode
public int getSocketChannelHashCode() -
opcodeReceive
- Throws:
EBufException
-
opcodeReceive
- Throws:
EBufException
-
opcodeReceive
- Throws:
EBufException
-
getUserID
Retrieves the user ID from the current connection.- Returns:
- The user ID POID.
-
getSession
Retrieves the session ID from the current connection.- Returns:
- The session ID POID.
-
getUserName
Retrieves the user name from the current connection.- Returns:
- The user name.
-
getHost
Retrieves the host name from the current connection.- Returns:
- The host name.
-
getPort
Retrieves the port number from the current connection.- Returns:
- The port number.
-
getCurrentDB
public long getCurrentDB()Retrieves the database number the current context is connected to.- Returns:
- The database number currently connected to.
-
getDefaultLog
Retrieves the default error-log object.- Returns:
- An
ErrorLog
object representing the default log,javapcm.log
. - Throws:
EBufException
- is thrown if an error occurs.- See Also:
-
getUserProperty
Retrieves a property value from theInfranet.properties
file.- Parameters:
key
- The name of the property to look up.- Returns:
- Returns the value associated with the property name, if found.
-
setLocalProperties
Deprecated.This method is public to insure operability. It's for internal use only.Sets the configuration settings for the connection in aProperties
object.- Parameters:
uprops
- AProperties
object containing configuration settings for the context.- Throws:
EBufException
- thrown if an error occurs.
-
setAppName
Sets the application keyword to use when looking up properties. This is global for allPortalContext
s created in this VM.- Parameters:
appName
- New application keyword.
-
parseConnectString
Converts the connection string from URL format to flist format. A connection string is a string with Portal connection information in URL format. For example:'pcp://<username>:<password>@host:port/service/<service sub-type>'
This method can be used to convert the connection string in the
Infranet.properties
file before passing it as an flist to theopen
method.- Parameters:
cStr
- The connection string in URL format.into
- TheFList
to parse into.- Throws:
EBufException
- thrown if an error occurs.ParseException
- thrown if unable to parse the string.
-
initHostnameAndProgramName
Initialize Hostname and Program name of corrleation id. This function will initialize Hostname and program_name required for correlation id. Only program name needs to be provided, Hostname will be generated internally.- Parameters:
pName
- The programe name to be used in correlation id.
-
getContextInfoDetails
Initialize Context Info details of corrleation id. This function will initialize Context Info details required for correlation id. The string is of the format ":brmuser:apiUser:xuser:xCord" and is constructed from the "FldContextInfo" field of the input Flist.- Parameters:
in
- The input Flist passed to the function
-
genCorrelationId
Generates the unique correlation for each opcode. Assumes all parameters as default Internally calls genCorrelationId with default params.- Returns:
- CorrelationId - The unique correlation id
-
genCorrelationId
Generates the unique correlation for each opcode. Assumes all other parameters as default- Parameters:
opcode
- - The opcode for which correlation id is required- Returns:
- CorrelationId - The unique correlation id
-
genCorrelationId
Generates the unique correlation for each opcode. Assumes all other parameters as default- Parameters:
pName
- - The Program Name for which correlation id is requiredopcode
- - The opcode for which correlation id is requiredsalt
- - The salt value- Returns:
- CorrelationId - The unique correlation id
-
genCorrelationId
Generates the unique correlation for each opcode. Assumes all other parameters as default- Parameters:
opcode
- - The opcode for which correlation id is requiredctxStr
- - The context stringopcodeTimeout
- - The value of PcmOpcodeTimeoutinUsecs- Returns:
- CorrelationId - The unique correlation id
-
genCorrelationId
public static String genCorrelationId(String pName, int opcode, int salt, String ctxStr, long opcodeTimeout) Generates the unique correlation for each opcode.- Parameters:
pName
- - The Program Name for which correlation id is requiredopcode
- - The opcode for which correlation id is requiredsalt
- - The salt valuectxStr
- - The context stringopcodeTimeout
- - The value of PcmOpcodeTimeoutinUsecs- Returns:
- CorrelationId - The unique correlation id
-
getCorrelationId
-
setCorrelationId
-
sendCorrelation
-
getReasonCode
public int getReasonCode() -
recvCorrelation
-
getContext
public com.portal.pcm.PCPContext getContext() -
getTransState
public int getTransState() -
getSocketChannelListener
-
setSocketChannelListener
-
isInTransaction
public boolean isInTransaction()Invoke this function to identify whether this PortalContext is invloved in transaction or not.- Returns:
- true - if this PortalContext is involved in transaction
-
getCreatedTime
public long getCreatedTime()Invoke this function to get the time when this PortalContext object is created. pcm.jar's ConnectionPool.java utilizes this function to re-establish PortalContext connection after every specific time interval.- Returns:
- the time when this PortalContext object is created
-
readTLSVersionFromConfig
-