Skip navigation links


com.essbase.eas.essbase.server
Class PrimitivesHelper

java.lang.Object
  extended by com.essbase.eas.essbase.server.PrimitivesHelper


public final class PrimitivesHelper
extends java.lang.Object

This class provides some basic primitive operations for MaxL interactions. In the current implementation, no instances of this class should ever be instantiated.

Since:
6.2.0
Version:
6.5.4
Author:
Hank Cox

Field Summary
static java.lang.String APPLICATION
           
static java.lang.String ARCHIVE
           
static int ARCHIVE_LIMIT
           
static java.lang.String ARCHIVES
           
static int CLIENT_NOT_ACCEPTING
           
static java.lang.String DATABASE
           
static int DEFAULT_ARCHIVE_LIMIT
           
static java.lang.String LOCATION
           
static int MAXL_MSGNO_ESSBASE_ERROR
           
static int MAXL_NOERR
           
static java.lang.String RETRY_LATER_KEY
           
static java.lang.String SERVER
           

 

Method Summary
static boolean cancelActiveRequest(EssSession session)
           
static void clearErrors(ISession session)
           
static void clearErrors(com.essbase.maxl.MaxlConnection conn)
           
static void closeConnection(java.lang.Object maxlConn)
           
static void closeResultSet(com.essbase.maxl.MaxlResultSet rs)
           
static java.lang.String convertColumnHeading(java.lang.String head)
           
static EssbaseTokenTimeoutException createTokenTimeoutException(ISession session, com.essbase.maxl.MaxlTokenTimeoutException ex)
           
static boolean execCommand(ISession session, java.lang.String command)
          executes a single command where the return value is expected to be an integer value and, possibly, a queue of messages.
static boolean getActive(EssSession session, java.lang.StringBuffer appName, java.lang.StringBuffer dbName)
          Returns the currently active application and cube
static ArchiveDetails[] getArchiveDetails()
           
static int getColumnIndex(javax.swing.table.TableModel model, java.lang.String columnName)
          Returns the column index corresponding to the column name
static int[] getColumnIndexes(javax.swing.table.TableModel model, java.lang.String[] columnNames)
           
static java.lang.Object[] getColumnObjects(javax.swing.table.TableModel model, int row, int[] columns)
          returns the array of column values from the currrent row
static boolean getColumnValues(ISession session, java.lang.String command, java.lang.String[] columnNames, java.util.List[] answers)
           
static boolean getColumnValues(ISession session, java.lang.String command, java.lang.String columnName, java.util.List answer)
          Creates a list of String objects that represent the results of a single column created by a single MaxL command.
static boolean getColumnValuesUsingTableModel(ISession session, java.lang.String command, java.lang.String columnName, java.util.List answer)
           
static com.essbase.maxl.MaxlConnection getConnection(java.lang.String user, java.lang.String pwd, java.lang.String server)
           
static java.util.List getConnectionMessages(ISession session, int status, int level)
           
static java.io.File getEASFileTableResult(java.lang.String command, java.util.List errors)
           
static java.util.List getErrors(ISession session)
           
static java.util.List getErrors(ISession session, java.util.ArrayList list)
           
static java.util.List getErrors(java.util.List msgList, java.lang.String user, java.lang.String server)
           
static java.util.List getErrors(MessageException e, java.lang.String user, java.lang.String server)
           
static java.util.List getErrorsAny(ISession session)
          Returns any errors, regardless of message number, message type or level
static java.lang.String getErrorText(EssSession session)
           
static EssSession getEssConnection(java.lang.String user, java.lang.String pwd, java.lang.String server)
           
static java.io.File getFileTableResult(com.essbase.maxl.MaxlConnection conn, java.lang.String command, CommandStatus status)
           
static MaxlResultListModel getMaxLResultModel(ISession session, java.lang.String command)
          creates a MaxLResultList model for the result of the command
static java.util.List getMessages(ISession session, int status, int level)
           
static boolean getRestrictedColumnValues(ISession session, java.lang.String command, java.lang.String columnName, java.lang.String columnRestrict, java.lang.String valueRestrict, java.util.List answer)
          Creates a list of String objects that represent the results of a single column created by a single MaxL command by restricting the selection based on a different column.
static boolean getRestrictedColumnValues(ISession session, java.lang.String command, java.lang.String columnName, java.lang.String columnRestrict1, java.lang.String valueRestrict1, java.lang.String columnRestrict2, java.lang.String valueRestrict2, java.util.List answer)
          Creates a list of String objects that represent the results of a single column created by a single MaxL command by restricting the selection based on a pair of other columns.
static com.essbase.maxl.MaxlResultSet getResultSet(ISession session, java.lang.String command)
           
static javax.swing.table.TableModel getTableResult(ISession session, java.lang.String command)
          creates a default table model for the result of the command
static javax.swing.table.TableModel getTableResult(com.essbase.maxl.MaxlStatement stmt)
           
static int intValue(java.lang.Object obj, int value)
          attempts to convert an object to an int value.
static boolean isCubeActive(EssSession session, java.lang.String appName, java.lang.String dbName)
           
static long longValue(java.lang.Object obj, long value)
          attempts to convert an object to a long value.
static boolean setActive(EssSession session, java.lang.String appName, java.lang.String dbName)
          Sets a database to active (required for some operations such as outline editing, calc script operations, and LRO management)
static boolean setKillRequest(EssSession session)
           
static short shortValue(java.lang.Object obj, short value)
          attempts to convert an object to an short value.
static java.lang.String specialCharacterFix(java.lang.String s)
          Adds the prefix '\' to these characters (\,') found in the given string so that MaxL can deal with them.
static java.lang.String specialCharacterFixQuote(java.lang.String s)
           
static java.lang.String specialCharacterFixUserGroup(java.lang.String s)
           
static void storeArchiveDetails(java.lang.String dbServer, java.lang.String appName, java.lang.String dbName, java.lang.String location)
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

MAXL_MSGNO_ESSBASE_ERROR

public static final int MAXL_MSGNO_ESSBASE_ERROR
See Also:
Constant Field Values

MAXL_NOERR

public static final int MAXL_NOERR
See Also:
Constant Field Values

CLIENT_NOT_ACCEPTING

public static final int CLIENT_NOT_ACCEPTING
See Also:
Constant Field Values

RETRY_LATER_KEY

public static final java.lang.String RETRY_LATER_KEY
See Also:
Constant Field Values

ARCHIVES

public static final java.lang.String ARCHIVES
See Also:
Constant Field Values

ARCHIVE

public static final java.lang.String ARCHIVE
See Also:
Constant Field Values

SERVER

public static final java.lang.String SERVER
See Also:
Constant Field Values

DATABASE

public static final java.lang.String DATABASE
See Also:
Constant Field Values

APPLICATION

public static final java.lang.String APPLICATION
See Also:
Constant Field Values

LOCATION

public static final java.lang.String LOCATION
See Also:
Constant Field Values

DEFAULT_ARCHIVE_LIMIT

public static final int DEFAULT_ARCHIVE_LIMIT
See Also:
Constant Field Values

ARCHIVE_LIMIT

public static int ARCHIVE_LIMIT

Method Detail

getMaxLResultModel

public static MaxlResultListModel getMaxLResultModel(ISession session,
                                                     java.lang.String command)
creates a MaxLResultList model for the result of the command
Parameters:
session - essbase session
command - command to execute
Returns:
the MaxLResultList model representation of the result

getTableResult

public static javax.swing.table.TableModel getTableResult(ISession session,
                                                          java.lang.String command)
creates a default table model for the result of the command
Parameters:
session - essbase session
command - command to execute
Returns:
the table model representation of the result

getResultSet

public static com.essbase.maxl.MaxlResultSet getResultSet(ISession session,
                                                          java.lang.String command)

getColumnIndex

public static int getColumnIndex(javax.swing.table.TableModel model,
                                 java.lang.String columnName)
Returns the column index corresponding to the column name
Parameters:
model - table model
columnName - column name
Returns:
the column position in the table model

getColumnIndexes

public static int[] getColumnIndexes(javax.swing.table.TableModel model,
                                     java.lang.String[] columnNames)
Parameters:
model -
columnNames -
Returns:

getColumnObjects

public static java.lang.Object[] getColumnObjects(javax.swing.table.TableModel model,
                                                  int row,
                                                  int[] columns)
returns the array of column values from the currrent row
Parameters:
model - table model
row - the current roe
columns - column indexes
Returns:
array of column values

getColumnValues

public static boolean getColumnValues(ISession session,
                                      java.lang.String command,
                                      java.lang.String columnName,
                                      java.util.List answer)
Creates a list of String objects that represent the results of a single column created by a single MaxL command. Can be used by different primitives to retrieve, say, a list of applications. Examples of usage (with the corresponding MaxL command) would be:

"display application all;"

"display database all;"

These commands go through almost the exact same steps. The differences are the command to be executed, which column to return.

Parameters:
session - object for this Essbase session.
command - to execute
columnName - to extract
answer - - list containing results.
Returns:
value from maxl.exec() function call.

closeResultSet

public static void closeResultSet(com.essbase.maxl.MaxlResultSet rs)

getColumnValuesUsingTableModel

public static boolean getColumnValuesUsingTableModel(ISession session,
                                                     java.lang.String command,
                                                     java.lang.String columnName,
                                                     java.util.List answer)
Parameters:
session - object for this Essbase session.
command - to execute
columnName - to extract
answer - - list containing results.
Returns:
value from maxl.exec() function call.

getColumnValues

public static boolean getColumnValues(ISession session,
                                      java.lang.String command,
                                      java.lang.String[] columnNames,
                                      java.util.List[] answers)
Parameters:
session -
command -
columnNames -
answers -
Returns:

getRestrictedColumnValues

public static boolean getRestrictedColumnValues(ISession session,
                                                java.lang.String command,
                                                java.lang.String columnName,
                                                java.lang.String columnRestrict,
                                                java.lang.String valueRestrict,
                                                java.util.List answer)
Creates a list of String objects that represent the results of a single column created by a single MaxL command by restricting the selection based on a different column.
Parameters:
session - - object for this Essbase session.
command - - execution string for maxl command. Note: the command should end with a semi-colon.
columnName - - the caption of the column to extract from the results.
columnRestrict - - column to base the restriction on.
valueRestrict - - value to restrict on.
answer - - list containing results.
Returns:
value from maxl.exec() function call.

getRestrictedColumnValues

public static boolean getRestrictedColumnValues(ISession session,
                                                java.lang.String command,
                                                java.lang.String columnName,
                                                java.lang.String columnRestrict1,
                                                java.lang.String valueRestrict1,
                                                java.lang.String columnRestrict2,
                                                java.lang.String valueRestrict2,
                                                java.util.List answer)
Creates a list of String objects that represent the results of a single column created by a single MaxL command by restricting the selection based on a pair of other columns.
Parameters:
session - - object for this Essbase session.
command - - execution string for maxl command. Note: the command should end with a semi-colon.
columnName - - the caption of the column to extract from the results.
columnRestrict1 - - first column to base the restriction on.
valueRestrict1 - - first column's value to restrict on.
columnRestrict2 - - second column to base the restriction on. (If null, only uses first restriction.)
valueRestrict2 - - second column's value to restrict on.
answer - - list containing results.
Returns:
value from maxl.exec() function call.

execCommand

public static boolean execCommand(ISession session,
                                  java.lang.String command)
executes a single command where the return value is expected to be an integer value and, possibly, a queue of messages. Warning: We don't currently handle the messages ...
Parameters:
session - - object for this Essbase session. Note: must be of type EssSession.
command - - command to execute.
Returns:
value from maxl.exec() function call.

longValue

public static long longValue(java.lang.Object obj,
                             long value)
attempts to convert an object to a long value.

shortValue

public static short shortValue(java.lang.Object obj,
                               short value)
attempts to convert an object to an short value.

intValue

public static int intValue(java.lang.Object obj,
                           int value)
attempts to convert an object to an int value.

getErrors

public static java.util.List getErrors(ISession session,
                                       java.util.ArrayList list)

getErrors

public static java.util.List getErrors(ISession session)

getErrors

public static java.util.List getErrors(java.util.List msgList,
                                       java.lang.String user,
                                       java.lang.String server)

getConnectionMessages

public static java.util.List getConnectionMessages(ISession session,
                                                   int status,
                                                   int level)

getMessages

public static java.util.List getMessages(ISession session,
                                         int status,
                                         int level)

getErrorsAny

public static java.util.List getErrorsAny(ISession session)
Returns any errors, regardless of message number, message type or level

getErrors

public static java.util.List getErrors(MessageException e,
                                       java.lang.String user,
                                       java.lang.String server)

clearErrors

public static void clearErrors(ISession session)

clearErrors

public static void clearErrors(com.essbase.maxl.MaxlConnection conn)

setActive

public static boolean setActive(EssSession session,
                                java.lang.String appName,
                                java.lang.String dbName)
Sets a database to active (required for some operations such as outline editing, calc script operations, and LRO management)

specialCharacterFix

public static java.lang.String specialCharacterFix(java.lang.String s)
Adds the prefix '\' to these characters (\,') found in the given string so that MaxL can deal with them.

specialCharacterFixUserGroup

public static java.lang.String specialCharacterFixUserGroup(java.lang.String s)

specialCharacterFixQuote

public static java.lang.String specialCharacterFixQuote(java.lang.String s)

getEssConnection

public static EssSession getEssConnection(java.lang.String user,
                                          java.lang.String pwd,
                                          java.lang.String server)

getConnection

public static com.essbase.maxl.MaxlConnection getConnection(java.lang.String user,
                                                            java.lang.String pwd,
                                                            java.lang.String server)

closeConnection

public static void closeConnection(java.lang.Object maxlConn)

getFileTableResult

public static java.io.File getFileTableResult(com.essbase.maxl.MaxlConnection conn,
                                              java.lang.String command,
                                              CommandStatus status)

convertColumnHeading

public static java.lang.String convertColumnHeading(java.lang.String head)

getTableResult

public static javax.swing.table.TableModel getTableResult(com.essbase.maxl.MaxlStatement stmt)

getErrorText

public static java.lang.String getErrorText(EssSession session)

cancelActiveRequest

public static boolean cancelActiveRequest(EssSession session)

setKillRequest

public static boolean setKillRequest(EssSession session)

getEASFileTableResult

public static java.io.File getEASFileTableResult(java.lang.String command,
                                                 java.util.List errors)

createTokenTimeoutException

public static EssbaseTokenTimeoutException createTokenTimeoutException(ISession session,
                                                                       com.essbase.maxl.MaxlTokenTimeoutException ex)

storeArchiveDetails

public static void storeArchiveDetails(java.lang.String dbServer,
                                       java.lang.String appName,
                                       java.lang.String dbName,
                                       java.lang.String location)

getArchiveDetails

public static ArchiveDetails[] getArchiveDetails()

isCubeActive

public static boolean isCubeActive(EssSession session,
                                   java.lang.String appName,
                                   java.lang.String dbName)

getActive

public static boolean getActive(EssSession session,
                                java.lang.StringBuffer appName,
                                java.lang.StringBuffer dbName)
Returns the currently active application and cube

Skip navigation links


Copyright © 2001, 2012, Oracle. All rights reserved.