OBEROn SDK

com.oberon.ooql.sdk
Class Framework

java.lang.Object
  extended by com.oberon.ooql.sdk.Framework
All Implemented Interfaces:
java.io.Serializable

public class Framework
extends java.lang.Object
implements java.io.Serializable

Defines the OBEROn session parameters and status.

Version:
5.0
See Also:
Serialized Form

Field Summary
static int MESSAGE_ALL
          Undefined message type
static int MESSAGE_ERROR
          Error message type
static int MESSAGE_INFO
          Info message type
static int MESSAGE_WARNING
          Warning message type
 
Constructor Summary
Framework(Framework framework)
          Create (clone) the new OBEROn session from another Framework.
Framework(java.lang.String text)
          Generate a new OBEROn session from a text String
Framework(java.lang.String userName, java.lang.String password)
          Create a new OBEROn session for a given User account
 
Method Summary
 void abortTrans()
          Abort a opened OBEROn transaction
 void appendResult(java.lang.String text)
          Append a text to the console output
 void appendResultLog(java.lang.String text)
          Append a text to the console output
 void changePassword(java.lang.String newPassword, java.lang.String oldPassword)
          Change the User password on database.
 void clearResult()
          Set the console output text
 void clearResultLog()
          Set the console output text
 void commitTrans()
          Commit a opened OBEROn transaction
 void emptyEnv()
          Remove all environment variables.
 void errorMsg(java.lang.String message)
          Add a session error message.
 java.util.BitSet getAdminAccess()
          Return the User administrative accesses
 java.util.Hashtable<java.lang.String,java.lang.Integer> getAdminCounters()
          Get the administrative object synch counters
 java.util.BitSet getBasicAccess()
          Return the User basic accesses
 java.lang.String getBuildVersion()
          Get Build version
 int getConnectionId()
          Get SQL connection ID
 int getDataBaseId()
          Get SQL database ID
 java.lang.String getEnv(java.lang.String varName)
          Get an environment variable value.
 java.util.Enumeration<java.lang.String> getEnvKeys()
          Get the list of defined environment variables or null if it is empty
 int getID()
          Return the Framework ID
 java.lang.String getLanguage()
          Get the user language.
 java.util.Vector<java.lang.String> getMessages()
          Get the session messages
 java.lang.String getMessages(int msgType, java.lang.String indent)
          Get session messages
 java.lang.String getPassword()
          Return the settled User password
 Framework getPreviousFramework()
          Return the previous framework from the Framework stack
 java.lang.String getRenderingEngine()
          Return the rendering engine for user interface
 java.lang.String getResult()
          Return the console output.
 java.lang.String getResultLog()
          Return the console output.
 java.util.BitSet getSystemAccess()
          Return the User system accesses
 java.lang.String getTransportFormat()
          Convert the Framework parameters to a text String for HTTP transport
 java.util.Hashtable<java.lang.String,java.lang.Integer> getUserCounters(java.lang.String userName)
          Get the administrative user-object synch counters
 int getUserId()
          Return the User administrative object ID
 java.lang.String getUserName()
          Return the User name
 void infoMsg(java.lang.String message)
          Add a session information message.
 boolean isActiveTrans()
          Check if there is an opened transaction
 boolean isFieldValueConversion()
          Check if the field values are converted according to the user Metric System
 boolean isFilterHidden()
          Check if the filter hidden mode is active
 boolean isLinked()
          Check if the session is opened
 boolean isSQLTrace()
          Check if the sql-trace mode is active
 boolean isSuperUser()
          Check if the current User is defined as SuperUser
 boolean isTriggersActive()
          Check if the event triggers are active or not
 boolean isUserEnabled(int accessType, int operation)
          Check if the current User is enabled to perform a specific operation
 boolean isVerbose()
          Check if the verbose mode is active
 void link()
          Open the session and read User properties from the database
 void listActivity(java.lang.String application, java.lang.String processID, java.lang.String stepName, Selector selector, java.io.DataOutputStream outStream)
          List the user activities (to-do list) for the running processes
 java.lang.String listEnv()
          Get the list of defined environment variables with their values.
 java.lang.String listEnv(java.lang.String indent)
          Get the list of defined environment variables with their values.
 void openTrans()
          Open an OBEROn transaction
 void removeMessages(int msgType)
          Delete session messages
 void resetFrom(Framework framework)
          Copy the new OBEROn session properties from another Framework instance
 Framework restore()
          Close the current Framework and return to the previous extracted from the Framework stack.
 void setConnectionId(int connectionID)
          Set SQL connection ID
 void setDataBaseId(int databaseID)
          Set SQL database ID
 void setEnv(java.lang.String varName, java.lang.String value)
          Set a session environment variable.
 java.util.Hashtable<java.lang.String,java.lang.String> setEnvFromRequest(ApplicationRequest request, boolean fields)
          Set a session environment variable.
 void setFieldValueConversion(boolean convertValues)
          Set if the field values must be converted according to the user Metric System
 void setFilterHidden(boolean filter)
          Set the filter hidden mode.
 void setLanguage(java.lang.String language)
          Set the Framework language
 void setMessages(java.util.Vector<java.lang.String> messages)
          Set messages.
 void setPassword(java.lang.String password)
          Set the User password.
 void setRenderingEngine(java.lang.String engineName)
          Set the rendering engine for user interface
 void setResult(java.lang.String text)
          Set the output text
 void setSQLTrace(boolean sqlTrace)
          Set the sql-trace mode.
 void setTriggersActive(boolean triggers)
          Turn on/off the event triggers
 void setUserName(java.lang.String userName)
          Set the User name.
 void setVerbose(boolean verbose)
          Set the verbose mode.
 Framework switchTo(java.lang.String userName, java.lang.String password)
          Generate a new Framework for another User and copy the session status.
 java.lang.String toString()
          Return the Framework properties as a single String
 void undefineEnv(java.lang.String varName)
          Remove a session environment variable.
 void unlink()
          Close the session
 void warningMsg(java.lang.String message)
          Add a session warning message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MESSAGE_ALL

public static final int MESSAGE_ALL
Undefined message type

See Also:
Constant Field Values

MESSAGE_ERROR

public static final int MESSAGE_ERROR
Error message type

See Also:
Constant Field Values

MESSAGE_WARNING

public static final int MESSAGE_WARNING
Warning message type

See Also:
Constant Field Values

MESSAGE_INFO

public static final int MESSAGE_INFO
Info message type

See Also:
Constant Field Values
Constructor Detail

Framework

public Framework(java.lang.String userName,
                 java.lang.String password)
          throws OberonException
Create a new OBEROn session for a given User account

Parameters:
userName - the User name
password - the User password
Throws:
OberonException - if the session cannot be opened

Framework

public Framework(Framework framework)
          throws OberonException
Create (clone) the new OBEROn session from another Framework. If the reference Framework is linked, also the new instance will be linked

Throws:
OberonException - if the session cannot be opened

Framework

public Framework(java.lang.String text)
          throws OberonException
Generate a new OBEROn session from a text String

Throws:
OberonException
Method Detail

resetFrom

public void resetFrom(Framework framework)
               throws OberonException
Copy the new OBEROn session properties from another Framework instance

Throws:
OberonException

getID

public int getID()
Return the Framework ID


setUserName

public void setUserName(java.lang.String userName)
Set the User name.

Parameters:
userName - the User name

getUserName

public java.lang.String getUserName()
Return the User name


setPassword

public void setPassword(java.lang.String password)
Set the User password.

Parameters:
password - the User password

getPassword

public java.lang.String getPassword()
Return the settled User password


changePassword

public void changePassword(java.lang.String newPassword,
                           java.lang.String oldPassword)
                    throws OberonException
Change the User password on database.

Parameters:
newPassword - the new password
oldPassword - the old password
Throws:
OberonException
See Also:
User.setPassword(String)

setRenderingEngine

public void setRenderingEngine(java.lang.String engineName)
Set the rendering engine for user interface

Parameters:
engineName - the rendering engine name
Since:
4.1

getRenderingEngine

public java.lang.String getRenderingEngine()
Return the rendering engine for user interface

Since:
4.1

setDataBaseId

public void setDataBaseId(int databaseID)
Set SQL database ID

Parameters:
databaseID - the SQL database ID (identifies the SQL database)

getDataBaseId

public int getDataBaseId()
Get SQL database ID


setConnectionId

public void setConnectionId(int connectionID)
Set SQL connection ID

Parameters:
connectionID - the SQL connection ID (identifies the SQL channel)

getConnectionId

public int getConnectionId()
Get SQL connection ID


getBuildVersion

public java.lang.String getBuildVersion()
Get Build version


setLanguage

public void setLanguage(java.lang.String language)
Set the Framework language


getLanguage

public java.lang.String getLanguage()
Get the user language.


getUserId

public int getUserId()
Return the User administrative object ID


getBasicAccess

public java.util.BitSet getBasicAccess()
Return the User basic accesses

See Also:
User.getBasicAccess()

getAdminAccess

public java.util.BitSet getAdminAccess()
Return the User administrative accesses

See Also:
User.getAdminAccess()

getSystemAccess

public java.util.BitSet getSystemAccess()
Return the User system accesses

See Also:
User.getSystemAccess()

isSuperUser

public boolean isSuperUser()
Check if the current User is defined as SuperUser

See Also:
User.isSuperUser()

isUserEnabled

public boolean isUserEnabled(int accessType,
                             int operation)
                      throws OberonException
Check if the current User is enabled to perform a specific operation

Parameters:
accessType - the access type (one of User.BASIC User.SYSTEM User.ADMIN )
operation - the operation id ( see User access constants )
Throws:
OberonException

link

public void link()
          throws OberonException
Open the session and read User properties from the database

Throws:
OberonException - usually due to DB SQL exceptions or wrong userName / password

unlink

public void unlink()
            throws OberonException
Close the session

Throws:
OberonException

isLinked

public boolean isLinked()
Check if the session is opened


openTrans

public void openTrans()
               throws OberonException
Open an OBEROn transaction

Throws:
OberonException - when the session is not opened

commitTrans

public void commitTrans()
                 throws OberonException
Commit a opened OBEROn transaction

Throws:
OberonException - when the session is not opened

abortTrans

public void abortTrans()
                throws OberonException
Abort a opened OBEROn transaction

Throws:
OberonException - when the session is not opened

isActiveTrans

public boolean isActiveTrans()
Check if there is an opened transaction


setFieldValueConversion

public void setFieldValueConversion(boolean convertValues)
Set if the field values must be converted according to the user Metric System


isFieldValueConversion

public boolean isFieldValueConversion()
Check if the field values are converted according to the user Metric System


setVerbose

public void setVerbose(boolean verbose)
Set the verbose mode. When it is active, each query produces a more detailed output


isVerbose

public boolean isVerbose()
Check if the verbose mode is active


setSQLTrace

public void setSQLTrace(boolean sqlTrace)
Set the sql-trace mode. When it is active, the relative SQL commands are showed for each OOQL command


isSQLTrace

public boolean isSQLTrace()
Check if the sql-trace mode is active


setTriggersActive

public void setTriggersActive(boolean triggers)
Turn on/off the event triggers

Parameters:
triggers - true to active the triggers

isTriggersActive

public boolean isTriggersActive()
Check if the event triggers are active or not


setFilterHidden

public void setFilterHidden(boolean filter)
Set the filter hidden mode.

Parameters:
filter - if true skip the hidden objects for all administrative queries

isFilterHidden

public boolean isFilterHidden()
Check if the filter hidden mode is active


getPreviousFramework

public Framework getPreviousFramework()
Return the previous framework from the Framework stack

See Also:
switchTo(String, String)

switchTo

public Framework switchTo(java.lang.String userName,
                          java.lang.String password)
                   throws OberonException
Generate a new Framework for another User and copy the session status. The new Framework is pushed into a Framework stack.

Parameters:
userName - the User name
password - the User password
Returns:
the new Framework
Throws:
OberonException

restore

public Framework restore()
                  throws OberonException
Close the current Framework and return to the previous extracted from the Framework stack. Environment variables will be lost.

Returns:
the previous Framework if exists or itself otherwise
Throws:
OberonException

listActivity

public void listActivity(java.lang.String application,
                         java.lang.String processID,
                         java.lang.String stepName,
                         Selector selector,
                         java.io.DataOutputStream outStream)
                  throws java.io.IOException,
                         OberonException
List the user activities (to-do list) for the running processes

Parameters:
application - filter activities for a specific application
processID - return only activities for a specific process (ID)
stepName - return only activities for a specific Step
selector - selection parameters for the activities (Step)
outStream - the stream for the results (if null the result is stored into the framework)
Throws:
java.io.IOException
OberonException
See Also:
getResult()

getAdminCounters

public java.util.Hashtable<java.lang.String,java.lang.Integer> getAdminCounters()
                                                                         throws OberonException
Get the administrative object synch counters

Throws:
OberonException

getUserCounters

public java.util.Hashtable<java.lang.String,java.lang.Integer> getUserCounters(java.lang.String userName)
                                                                        throws OberonException
Get the administrative user-object synch counters

Throws:
OberonException

setEnv

public void setEnv(java.lang.String varName,
                   java.lang.String value)
Set a session environment variable.

Parameters:
varName - the variable name
value - its value

undefineEnv

public void undefineEnv(java.lang.String varName)
Remove a session environment variable.

Parameters:
varName - the variable name

emptyEnv

public void emptyEnv()
Remove all environment variables.


getEnv

public java.lang.String getEnv(java.lang.String varName)
Get an environment variable value.

Returns:
the variable value or null is it is not defined

getEnvKeys

public java.util.Enumeration<java.lang.String> getEnvKeys()
Get the list of defined environment variables or null if it is empty


listEnv

public java.lang.String listEnv()
Get the list of defined environment variables with their values.


listEnv

public java.lang.String listEnv(java.lang.String indent)
Get the list of defined environment variables with their values.

Parameters:
indent - indentation string

setEnvFromRequest

public java.util.Hashtable<java.lang.String,java.lang.String> setEnvFromRequest(ApplicationRequest request,
                                                                                boolean fields)
Set a session environment variable.

Parameters:
request - the Application request
fields - if true returns table of fields

errorMsg

public void errorMsg(java.lang.String message)
Add a session error message.

Parameters:
message - the message text

warningMsg

public void warningMsg(java.lang.String message)
Add a session warning message.

Parameters:
message - the message text

infoMsg

public void infoMsg(java.lang.String message)
Add a session information message.

Parameters:
message - the message text

setMessages

public void setMessages(java.util.Vector<java.lang.String> messages)
Set messages.

Parameters:
messages - Vector of the message texts formatted as: <MessageType>[<MessageText>]

removeMessages

public void removeMessages(int msgType)
Delete session messages

Parameters:
msgType - the type of message to remove

getMessages

public java.util.Vector<java.lang.String> getMessages()
Get the session messages

Returns:
a Vector of messages formatted as: <MessageType>[<MessageText>] where MessageType is one of "ERROR" , "WARNING" , "INFO"

getMessages

public java.lang.String getMessages(int msgType,
                                    java.lang.String indent)
Get session messages

Parameters:
msgType - the type of message

clearResult

public void clearResult()
Set the console output text


appendResult

public void appendResult(java.lang.String text)
Append a text to the console output


setResult

public void setResult(java.lang.String text)
Set the output text


getResult

public java.lang.String getResult()
Return the console output. Contains the verbose messages


clearResultLog

public void clearResultLog()
Set the console output text


appendResultLog

public void appendResultLog(java.lang.String text)
Append a text to the console output


getResultLog

public java.lang.String getResultLog()
Return the console output. Contains the verbose messages


toString

public java.lang.String toString()
Return the Framework properties as a single String

Overrides:
toString in class java.lang.Object

getTransportFormat

public java.lang.String getTransportFormat()
Convert the Framework parameters to a text String for HTTP transport


OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.