Interface PersistingResourceMBean

    • Field Detail

      • MBEAN_NAME

        static final String MBEAN_NAME

        The name of this MBean, equal to the string "PersistingResource".

        See Also:
        Constant Field Values
      • BASE_OBJECT_NAME

        static final String BASE_OBJECT_NAME

        The base JMX Object Name of all Persisting Resource MBeans. This string is equal to "com.opencloud.rhino:type=PersistingResource" and the string BASE_OBJECT_NAME + ",*" defines a JMX Object Name property pattern which matches with all Persisting Resource MBeans that are registered with the MBean Server. A Persisting Resource MBean is registered with the MBean Server using this base name in conjunction with properties whose keys are specified by the and {@link #RESOURCE_VARIANT_KEY}, and optionally the RESOURCE_NAME_KEY to identify a specific instance of the resource if there can be multiple resources of the same type and variant configured. <p/> A complete Object Name can be created easily using the getObjectName(String, String, String) method.

        See Also:
        Constant Field Values
      • RESOURCE_TYPE_KEY

        static final String RESOURCE_TYPE_KEY

        The JMX Object Name property key that identifies the specific resource that registered the MBean. This key is always present in the ObjectName of a PersistingResourceMBean and is equal to the string "resource".

        See Also:
        Constant Field Values
      • RESOURCE_VARIANT_KEY

        static final String RESOURCE_VARIANT_KEY

        The JMX Object Name property key that identifies the variant of the resource. The variant refers to the type of the backing database the resource uses, e.g. Cassandra, etc. This key is always present in the ObjectName of a PersistingResourceMBean and is equal to the string "variant".

        See Also:
        Constant Field Values
      • RESOURCE_NAME_KEY

        static final String RESOURCE_NAME_KEY

        The JMX Object Name property key that identifies the name of the resource. This key is equal to the string "resourceName" and is only present if there can be multiple resources of a given type present in Rhino. The value assigned to this key should be quoted using ObjectName.quote(String).

        See Also:
        Constant Field Values
    • Method Detail

      • getObjectName

        ObjectName getObjectName​(String resourceType,
                                 String resourceVariant,
                                 String resourceName)
                          throws MalformedObjectNameException

        Create an ObjectName for a PersistingResourceMBean with the specified resource type, variant, and optional name.

        Parameters:
        resourceType - the resource type.
        resourceVariant - the resource variant.
        resourceName - an optional name for the resource.
        Returns:
        an ObjectName for a PersistingResourceMBean with the specified attributes.
        Throws:
        NullPointerException - if resourceType or resourceName are null.
        MalformedObjectNameException - if an error occurs trying to create the ObjectName.
        Since:
        Rhino 3.2
      • getKeyspaces

        String[] getKeyspaces()
                       throws ManagementException

        Get the names of the database keyspaces that the resource is using.

        Returns:
        the names of the database keyspaces.
        Throws:
        ManagementException - if the operation could not be successfully completed due to a system-level failure.
        Since:
        Rhino 3.2
      • getDataDefinitions

        String[] getDataDefinitions​(String[] keyspaceNames)
                             throws NullPointerException,
                                    InvalidArgumentException,
                                    ManagementException

        Get an array of data definitions corresponding to an array of keyspace names.

        Parameters:
        keyspaceNames - the array of keyspace names.
        Returns:
        an array of data definitions. This array will be the same length as the supplied array, and if dataDefinitions = getDataDefinitions(keyspaceNames) then dataDefinitions[i] == getDataDefinitions(keyspaceNames[i]). Any unrecognized keyspace name present in keyspaceNames results in a null value at the corresponding array index in this array,
        Throws:
        NullPointerException - if keyspaceNames is null.
        InvalidArgumentException - if keyspaceNames is zero-length or contains null elements.
        ManagementException - if the operation could not be successfully completed due to a system-level failure.
        Since:
        Rhino 3.2
      • dumpTable

        TabularData dumpTable​(String keyspaceName,
                              String tableName,
                              long timeout,
                              int maxRows)
                       throws NullPointerException,
                              InvalidArgumentException,
                              UnrecognizedKeyspaceException,
                              UnrecognizedTableNameException,
                              TableDumpException,
                              ManagementException

        Return the content of the specified table as tabular data.

        Table columns will be converted to tabular data on a "best fit" basis. Where there is a corresponding JMX open type for a database column type, such as for numeric types and strings, column values will be mapped across directly. In other cases, some conversion may occur. For example, collections and maps may be converted to a simple flat string rendering, and binary data may be converted to a string of printable characters.

        Parameters:
        keyspaceName - the keyspace name. This must be one of the names returned by getKeyspaces().
        tableName - the table name. This must be one of the names returned by getTableNames(keyspaceName).
        timeout - the time to wait for results to be returned from the database. A timeout of 0 indicates no timeout.
        maxRows - the maximum number of table rows to return. A value less than or equal to 0 indicates no limit.
        Returns:
        the table rows converted to tabular data. The format of the tabular data is table dependent.
        Throws:
        NullPointerException - if keyspaceName or tableName is null.
        InvalidArgumentException - if timeout is less than 0.
        UnrecognizedKeyspaceException - if keyspaceName is not the name of a keyspace known by the resource.
        UnrecognizedTableNameException - if tableName is not the name of a table in the specified keyspace.
        TableDumpException - if a problem occurs obtaining the table data, such a no connection to the database or a read error.
        ManagementException - if the operation could not be successfully completed due to a system-level failure.
        Since:
        Rhino 3.2