Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.measurement.shared
Class MeasTabManagerUtil

java.lang.Object
  extended by org.hyperic.hq.measurement.shared.MeasTabManagerUtil

public class MeasTabManagerUtil
extends java.lang.Object


Field Summary
static java.lang.String MEAS_TABLE
           
static java.lang.String MEAS_VIEW
           
static int NUMBER_OF_TABLES
           
static int NUMBER_OF_TABLES_PER_DAY
           
static java.lang.String OLD_MEAS_TABLE
           
 
Constructor Summary
MeasTabManagerUtil()
           
 
Method Summary
static long getBaseTime()
           
static java.util.List getMeasIds(java.sql.Connection conn, java.lang.Integer[] tids, java.lang.Integer[] iids)
           
static java.util.List getMeasIdsFromTemplateIds(java.sql.Connection conn, java.lang.Integer[] tids)
           
static java.lang.String getMeasInStmt(java.lang.Integer[] measIds, boolean prependAnd)
           
static long getMeasTabEndTime(java.util.Calendar cal, long timems)
           
static long getMeasTabEndTime(long timems)
           
static java.lang.String getMeasTabname(java.util.Calendar cal, long timems)
           
static java.lang.String getMeasTabname(long timems)
           
static long getMeasTabStartTime(java.util.Calendar cal, long timems)
           
static long getMeasTabStartTime(long timems)
           
static java.lang.String[] getMetricTables(long begin, long end)
          Get the array of tables that fall in the time range
static long getPrevMeasTabTime(java.util.Calendar cal, long timems)
           
static long getPrevMeasTabTime(long timems)
           
static java.lang.String getUnionStatement(java.lang.Integer[] measIds, long timestamp)
          Get the UNION statement from the detailed measurement tables based on the beginning of the time range.
static java.lang.String getUnionStatement(long millisBack)
           
static java.lang.String getUnionStatement(long millisBack, int measId)
           
static java.lang.String getUnionStatement(long millisBack, java.lang.Integer[] measIds)
           
static java.lang.String getUnionStatement(long begin, long end)
          Get the UNION statement from the detailed measurement tables based on the beginning of the time range.
static java.lang.String getUnionStatement(long begin, long end, int measId)
          Get the UNION statement from the detailed measurement tables based on the beginning of the time range.
static java.lang.String getUnionStatement(long begin, long end, java.lang.Integer[] measIds)
          Get the UNION statement from the detailed measurement tables based on the beginning of the time range.
static void main(java.lang.String[] args)
          This is meant to be a regression test for the measurement rollover scheme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUMBER_OF_TABLES

public static final int NUMBER_OF_TABLES
See Also:
Constant Field Values

NUMBER_OF_TABLES_PER_DAY

public static final int NUMBER_OF_TABLES_PER_DAY
See Also:
Constant Field Values

MEAS_TABLE

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

MEAS_VIEW

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

OLD_MEAS_TABLE

public static final java.lang.String OLD_MEAS_TABLE
See Also:
Constant Field Values
Constructor Detail

MeasTabManagerUtil

public MeasTabManagerUtil()
Method Detail

getBaseTime

public static long getBaseTime()

getUnionStatement

public static final java.lang.String getUnionStatement(long begin,
                                                       long end)
Get the UNION statement from the detailed measurement tables based on the beginning of the time range.

Parameters:
begin - The beginning of the time range.
end - The end of the time range
Returns:
The UNION SQL statement.

getMetricTables

public static java.lang.String[] getMetricTables(long begin,
                                                 long end)
Get the array of tables that fall in the time range


getUnionStatement

public static final java.lang.String getUnionStatement(long begin,
                                                       long end,
                                                       java.lang.Integer[] measIds)
Get the UNION statement from the detailed measurement tables based on the beginning of the time range.

Parameters:
begin - The beginning of the time range.
end - The end of the time range
measId - The array of measurement ids to set the where clause against
Returns:
The UNION SQL statement.

getUnionStatement

public static java.lang.String getUnionStatement(java.lang.Integer[] measIds,
                                                 long timestamp)
Get the UNION statement from the detailed measurement tables based on the beginning of the time range.

Parameters:
begin - The beginning of the time range.
end - The end of the time range
measId - The array of measurement ids to set the where clause against
Returns:
The UNION SQL statement.

getMeasInStmt

public static java.lang.String getMeasInStmt(java.lang.Integer[] measIds,
                                             boolean prependAnd)

getMeasTabname

public static java.lang.String getMeasTabname(long timems)

getMeasTabname

public static java.lang.String getMeasTabname(java.util.Calendar cal,
                                              long timems)

getMeasTabEndTime

public static long getMeasTabEndTime(java.util.Calendar cal,
                                     long timems)

getMeasTabEndTime

public static long getMeasTabEndTime(long timems)

getMeasTabStartTime

public static long getMeasTabStartTime(java.util.Calendar cal,
                                       long timems)

getMeasTabStartTime

public static long getMeasTabStartTime(long timems)

getPrevMeasTabTime

public static long getPrevMeasTabTime(long timems)

getPrevMeasTabTime

public static long getPrevMeasTabTime(java.util.Calendar cal,
                                      long timems)

getUnionStatement

public static java.lang.String getUnionStatement(long begin,
                                                 long end,
                                                 int measId)
Get the UNION statement from the detailed measurement tables based on the beginning of the time range.

Parameters:
begin - The beginning of the time range.
end - The end of the time range
measId - The measurement id to set the where clause against
Returns:
The UNION SQL statement.

getUnionStatement

public static java.lang.String getUnionStatement(long millisBack)

getUnionStatement

public static java.lang.String getUnionStatement(long millisBack,
                                                 java.lang.Integer[] measIds)

getUnionStatement

public static java.lang.String getUnionStatement(long millisBack,
                                                 int measId)

getMeasIdsFromTemplateIds

public static java.util.List getMeasIdsFromTemplateIds(java.sql.Connection conn,
                                                       java.lang.Integer[] tids)
                                                throws java.sql.SQLException
Throws:
java.sql.SQLException

getMeasIds

public static java.util.List getMeasIds(java.sql.Connection conn,
                                        java.lang.Integer[] tids,
                                        java.lang.Integer[] iids)
                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

main

public static void main(java.lang.String[] args)
This is meant to be a regression test for the measurement rollover scheme


Hyperic HQ Plugin API v. 4.4.0.2

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.