com.metamatrix.server.admin.apiimpl
Class RuntimeMetadataHelper

java.lang.Object
  extended by com.metamatrix.server.admin.apiimpl.RuntimeMetadataHelper

public class RuntimeMetadataHelper
extends java.lang.Object

A collection of static methods that facilitate the server-side remote class RuntimeMetadataAdminAPIImpl.


Field Summary
static char PATH_SEPERATOR_CHAR
           
static short VDB_STATE_ACTIVE
           
static short VDB_STATE_ACTIVE_DEFAULT
           
static short VDB_STATE_DELETED
           
static short VDB_STATE_INACTIVE
           
static short VDB_STATE_INCOMPLETE
           
 
Constructor Summary
RuntimeMetadataHelper()
           
 
Method Summary
static MaterializationLoadScripts createMaterializedViewLoadProperties(ModelInfo materializationModel, java.lang.String matURL, java.lang.String matDriver, java.lang.String materializationUserName, java.lang.String materializationUserPwd, java.lang.String mmHost, java.lang.String mmPort, java.lang.String mmDriver, boolean useSSL, java.lang.String metamatrixUserName, java.lang.String metamatrixPwd, java.lang.String vdbName, java.lang.String vdbVersion)
          Generate connection properties for materialization model in given VDB.
static MaterializationLoadScripts createMaterializedViewLoadPropertiesVersion(ModelInfo materializationModel, java.lang.String matURL, java.lang.String matDriver, java.lang.String materializationUserName, java.lang.String materializationUserPwd, java.lang.String mmHost, java.lang.String mmPort, java.lang.String mmDriver, boolean useSSL, java.lang.String metamatrixUserName, java.lang.String metamatrixPwd, java.lang.String vdbName, java.lang.String vdbVersion)
           
static java.util.List getAllDataNodeNames(java.lang.String vdbName, java.lang.String vdbVersion, java.util.Map modelNameToModelMap)
          Aquire all data node full names from the runtime catalog.
static java.util.List getAllDataNodeNames(VirtualDatabaseID vdbID, java.util.Map modelNameToModelMap)
          Aquire all data node full names from the runtime catalog.
static void getDataNodeNames(PermissionDataNodeImpl treeRoot, java.util.List nodeNames)
          A recursive method that gets the list of data node names from the given data node tree.
static PermissionDataNodeImpl getDataNodes(java.lang.String vdbName, java.lang.String vdbVersion)
          Get the tree of data nodes that make op a VDB.
static PermissionDataNode getPermissionDataNodes(AuthorizationRealm realm, AuthorizationPolicyID policyID, AuthorizationServiceInterface authSvcProxy)
          Method to provide the task of finding all data nodes in realm, finding any and all permissions assigned to them, uniting these and returning the united objects.
static VirtualDatabaseID getVDBID(java.lang.String vdbName, java.lang.String vdbVersion)
           
static short[] mapVDBStates(short stateFlag)
           
static EntitlementMigrationReport migrateEntitlements(VirtualDatabaseID tvdbID)
           
static EntitlementMigrationReport migrateEntitlements(VirtualDatabaseID tvdbID, char[] dataRoleContents, boolean overwriteExisting, SessionToken session)
           
static EntitlementMigrationReport migrateEntitlements(VirtualDatabase sourceVDB, VirtualDatabase targetVDB, SessionToken token)
           
protected static java.lang.String parseDatabaseType(java.lang.String url, java.lang.String driver)
           
protected static java.lang.String parseDatabaseType(java.lang.String url, java.lang.String driver, java.lang.String userName, java.lang.String pwd)
           
static void printTree(java.util.Map tree)
           
static VirtualDatabase walkBack(java.lang.String vdbName, int vers, short stateFlag)
          Given a VDB, get its previous version of a given state.

Note: The stateFlag paremeter is currently meaningless and has no effect on the algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATH_SEPERATOR_CHAR

public static final char PATH_SEPERATOR_CHAR
See Also:
Constant Field Values

VDB_STATE_INCOMPLETE

public static final short VDB_STATE_INCOMPLETE
See Also:
Constant Field Values

VDB_STATE_INACTIVE

public static final short VDB_STATE_INACTIVE
See Also:
Constant Field Values

VDB_STATE_ACTIVE

public static final short VDB_STATE_ACTIVE
See Also:
Constant Field Values

VDB_STATE_DELETED

public static final short VDB_STATE_DELETED
See Also:
Constant Field Values

VDB_STATE_ACTIVE_DEFAULT

public static final short VDB_STATE_ACTIVE_DEFAULT
See Also:
Constant Field Values
Constructor Detail

RuntimeMetadataHelper

public RuntimeMetadataHelper()
Method Detail

mapVDBStates

public static short[] mapVDBStates(short stateFlag)

walkBack

public static VirtualDatabase walkBack(java.lang.String vdbName,
                                       int vers,
                                       short stateFlag)
                                throws VirtualDatabaseException
Given a VDB, get its previous version of a given state.

Note: The stateFlag paremeter is currently meaningless and has no effect on the algorithm. All VDB ancesters of state INCOMPLETE, INACTIVE or ACTIVE will be returned.

Parameters:
vdbName - The VDB to get the previous version.
vers - The current version of the given VDB. We'll be looking for the one before this.
stateFlag - Only interested in VDBs of state(s).
Returns:
The given VDBs previos version or null if previous DNE.
Throws:
VirtualDatabaseException

getAllDataNodeNames

public static java.util.List getAllDataNodeNames(VirtualDatabaseID vdbID,
                                                 java.util.Map modelNameToModelMap)
                                          throws MetaMatrixComponentException
Aquire all data node full names from the runtime catalog.

Parameters:
vdbID - The VDB from which to get the node names.
Returns:
The sorted flat list of fully-qualified path names for all data nodes in the given VDB.
Throws:
MetaMatrixComponentException - if an error occurs in the runtime catalog.

getDataNodeNames

public static void getDataNodeNames(PermissionDataNodeImpl treeRoot,
                                    java.util.List nodeNames)
A recursive method that gets the list of data node names from the given data node tree.

Parameters:
treeRoot - The root of the data node (sub)tree.
nodeNames - The list of all data node names found in the tree collected during recursion.

getAllDataNodeNames

public static java.util.List getAllDataNodeNames(java.lang.String vdbName,
                                                 java.lang.String vdbVersion,
                                                 java.util.Map modelNameToModelMap)
                                          throws MetaMatrixComponentException
Aquire all data node full names from the runtime catalog.

Parameters:
vdbName - The VDB name from which to get the node names.
vdbVersion - The VDB version from which to get the node names.
Returns:
The sorted flat list of fully-qualified path names for all data nodes in the given VDB.
Throws:
MetaMatrixComponentException - if an error occurs in the runtime catalog.

getDataNodes

public static PermissionDataNodeImpl getDataNodes(java.lang.String vdbName,
                                                  java.lang.String vdbVersion)
                                           throws MetaMatrixComponentException
Get the tree of data nodes that make op a VDB. This tree represents just the data node hierarchy and does not contain authorization information.

Parameters:
vdbName - The name of the VDB for which data nodes are sought.
vdbVersion - The version of the VDB for which data nodes are sought.
Returns:
The root of the data node tree for the VDB and version.
Throws:
MetaMatrixComponentException

getPermissionDataNodes

public static PermissionDataNode getPermissionDataNodes(AuthorizationRealm realm,
                                                        AuthorizationPolicyID policyID,
                                                        AuthorizationServiceInterface authSvcProxy)
                                                 throws MetaMatrixComponentException
Method to provide the task of finding all data nodes in realm, finding any and all permissions assigned to them, uniting these and returning the united objects.

Parameters:
realm - The realm in which to look for data nodes and their permissions.
policyID - The AuthorizationPolicyID for which to check for permissions on data nodes.
authSvcProxy - A proxy to the AuthorizationService.
Returns:
The root of the permission tree for the given policy.
Throws:
MetaMatrixComponentException

printTree

public static void printTree(java.util.Map tree)

getVDBID

public static VirtualDatabaseID getVDBID(java.lang.String vdbName,
                                         java.lang.String vdbVersion)
                                  throws MetaMatrixComponentException
Throws:
MetaMatrixComponentException

migrateEntitlements

public static EntitlementMigrationReport migrateEntitlements(VirtualDatabaseID tvdbID)
                                                      throws MetaMatrixComponentException
Throws:
MetaMatrixComponentException

migrateEntitlements

public static EntitlementMigrationReport migrateEntitlements(VirtualDatabaseID tvdbID,
                                                             char[] dataRoleContents,
                                                             boolean overwriteExisting,
                                                             SessionToken session)
                                                      throws MetaMatrixComponentException
Throws:
MetaMatrixComponentException

migrateEntitlements

public static EntitlementMigrationReport migrateEntitlements(VirtualDatabase sourceVDB,
                                                             VirtualDatabase targetVDB,
                                                             SessionToken token)
                                                      throws MetaMatrixComponentException
Throws:
MetaMatrixComponentException

createMaterializedViewLoadProperties

public static MaterializationLoadScripts createMaterializedViewLoadProperties(ModelInfo materializationModel,
                                                                              java.lang.String matURL,
                                                                              java.lang.String matDriver,
                                                                              java.lang.String materializationUserName,
                                                                              java.lang.String materializationUserPwd,
                                                                              java.lang.String mmHost,
                                                                              java.lang.String mmPort,
                                                                              java.lang.String mmDriver,
                                                                              boolean useSSL,
                                                                              java.lang.String metamatrixUserName,
                                                                              java.lang.String metamatrixPwd,
                                                                              java.lang.String vdbName,
                                                                              java.lang.String vdbVersion)
Generate connection properties for materialization model in given VDB. Generated props will be inserted into scripts to be given back to Console admin to save.

Parameters:
vdbInfo - TODO
matURL -
matDriver -
materializationUserName -
materializationUserPwd -
mmHost -
mmPort -
mmDriver -
metamatrixUserName -
metamatrixPwd -
vdbName - TODO
vdbVersion - TODO
Returns:
TODO
Since:
4.2

createMaterializedViewLoadPropertiesVersion

public static MaterializationLoadScripts createMaterializedViewLoadPropertiesVersion(ModelInfo materializationModel,
                                                                                     java.lang.String matURL,
                                                                                     java.lang.String matDriver,
                                                                                     java.lang.String materializationUserName,
                                                                                     java.lang.String materializationUserPwd,
                                                                                     java.lang.String mmHost,
                                                                                     java.lang.String mmPort,
                                                                                     java.lang.String mmDriver,
                                                                                     boolean useSSL,
                                                                                     java.lang.String metamatrixUserName,
                                                                                     java.lang.String metamatrixPwd,
                                                                                     java.lang.String vdbName,
                                                                                     java.lang.String vdbVersion)

parseDatabaseType

protected static java.lang.String parseDatabaseType(java.lang.String url,
                                                    java.lang.String driver,
                                                    java.lang.String userName,
                                                    java.lang.String pwd)
                                             throws java.lang.Throwable
Parameters:
url -
Returns:
Throws:
java.lang.Throwable
Since:
4.2

parseDatabaseType

protected static java.lang.String parseDatabaseType(java.lang.String url,
                                                    java.lang.String driver)


Copyright © 2009. All Rights Reserved.