Class DatabaseContextHandler
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.analyticsmodeling.assets.DatabaseContextHandler
-
public class DatabaseContextHandler extends Object
The class builds data content of the Analytics Modeling OMAS responses.
This class contains logic about elements required to build responses and their relationships. Only methods used to build responses should be public.
Here is the exposed functionality:- Get databases
getDatabases(java.lang.String, java.lang.Integer, java.lang.Integer) - Get database schemas
getSchemaTables(java.lang.String, java.lang.String, java.lang.String) - Get schema tables
getSchemaTables(java.lang.String, java.lang.String, java.lang.String) - Get physical module
getModule(java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.odpi.openmetadata.accessservices.analyticsmodeling.model.ModuleTableFilter)
OMEntityDao
All repository logic should be handled there. - Get databases
-
-
Field Summary
Fields Modifier and Type Field Description static StringDATA_SOURCE_GUID
-
Constructor Summary
Constructors Constructor Description DatabaseContextHandler(RelationalDataHandler<Database,Schema,Object,Object,Object,Object> relationalDataHandler, OMEntityDao omEntityDao, ExecutionContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ResponseContainerDatabase>getDatabases(String userId, Integer startFrom, Integer pageSize)Get list of databases on the server.List<ResponseContainerDatabaseSchema>getDatabaseSchemas(String userId, String guidDatabase, Integer startFrom, Integer pageSize)Retrieve schemas for given database from repository.MessagesgetMessages()ResponseContainerModulegetModule(String userId, String databaseGuid, String catalog, String schema, ModuleTableFilter filter)Build Analytics Modeling module for database schemaResponseContainerSchemaTablesgetSchemaTables(String userId, String guidDataSource, String schema)Get tables for schema.
-
-
-
Field Detail
-
DATA_SOURCE_GUID
public static final String DATA_SOURCE_GUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DatabaseContextHandler
public DatabaseContextHandler(RelationalDataHandler<Database,Schema,Object,Object,Object,Object> relationalDataHandler, OMEntityDao omEntityDao, ExecutionContext ctx)
-
-
Method Detail
-
getDatabases
public List<ResponseContainerDatabase> getDatabases(String userId, Integer startFrom, Integer pageSize) throws AnalyticsModelingCheckedException, UserNotAuthorizedException
Get list of databases on the server.- Parameters:
userId- for the call.startFrom- starting element (used in paging through large result sets)pageSize- maximum number of results to return- Returns:
- list of database descriptors.
- Throws:
AnalyticsModelingCheckedException- in case of an repository operation failure.UserNotAuthorizedException- in case of an error.
-
getDatabaseSchemas
public List<ResponseContainerDatabaseSchema> getDatabaseSchemas(String userId, String guidDatabase, Integer startFrom, Integer pageSize) throws AnalyticsModelingCheckedException, InvalidParameterException, UserNotAuthorizedException
Retrieve schemas for given database from repository.- Parameters:
userId- for the call.guidDatabase- defines databasestartFrom- starting element (used in paging through large result sets)pageSize- maximum number of results to return- Returns:
- list of schemas attributes.
- Throws:
AnalyticsModelingCheckedException- in case of an repository operation failure.InvalidParameterException- if passed GUID is invalid.UserNotAuthorizedException- in case of an error.
-
getSchemaTables
public ResponseContainerSchemaTables getSchemaTables(String userId, String guidDataSource, String schema) throws AnalyticsModelingCheckedException, InvalidParameterException
Get tables for schema.- Parameters:
userId- of the request.guidDataSource- of the schema.schema- name.- Returns:
- list of table names.
- Throws:
AnalyticsModelingCheckedException- if failedInvalidParameterException- if passed GUID is invalid.
-
getModule
public ResponseContainerModule getModule(String userId, String databaseGuid, String catalog, String schema, ModuleTableFilter filter) throws AnalyticsModelingCheckedException, InvalidParameterException
Build Analytics Modeling module for database schema- Parameters:
userId- for the request.databaseGuid- of the modulecatalog- of the moduleschema- of the modulefilter- contains optional table filter- Returns:
- module built for defined schema
- Throws:
AnalyticsModelingCheckedException- in case of an repository operation failure.InvalidParameterException- if passed GUID is invalid.
-
getMessages
public Messages getMessages()
-
-