Oracle Enterprise Manager Application Developer's Guide
Release 1.4.0

A53701_01

Library

Product

Contents

Index

Prev Next

4
Repository Control Integration

This chapter covers the repository control interface. It describes:

Accessing the Repository

The repository control interface allows you to:

If an application needs to access the repository, you need to use the repository control interface to establish a connection. If you want, you can store information specific to an application in the repository. Before you do this, you need to create the tables that an application will use. This can be done in a SQL script run during installation of the application. To store or access information in the repository:

  1. Connect to the repository object. See Initializing and Disposing Dispatch Drivers on page 3-2.
  2. Request connection information from the Console.
  3. Make a connection to the repository.

Enterprise Manager maintains its own tables within the repository strictly for its private use. However, you may create your own tables within the repository to act as a persistent store for your application data. The advantages to doing this are:

Request Connection Information from the Console

Call GetRepLogonInfo to retrieve repository connection information from the Console. For an example of retrieving the information from the repository object, see the CRepLogonDlg::DoGetRepLogonInfo in the replogon.cpp file.

Connect to the Repository

After you have received the repository connect information from the Console, you can connect to the repository using the olog call of the Oracle Call Interface (OCI). When you have connected to the repository, you can execute any SQL or PL/SQL statements on the application's repository structures, such as tables or views.

Getting Preferred Credentials

Your application can also request a user's preferred credentials from the repository by calling GetPreferredCredentials. To retrieve the user's preferred credentials for a particular service you must do the following:

  1. Connect to the repository object.
  2. Request the user's preferred credentials for a particular service.

Request Preferred Credentials

Call GetPreferredCredentials to retrieve the preferred credentials for the indicated service. For an example illustrating how to retrieve the preferred credentials, see CGetPrefCredDlg::DoGetPreferredCredentials in the repprefc.cpp file.

Repository API Reference

This section describes the external interface calls for the repository service.

Common Parameters

These parameters are used in multiple API calls and are described in this section.

pConnectAs

The role that is used to connect to the database: SYSOPER, SYSDBA, or NORMAL. If the DestinationType is not a database, pConnectAs is NORMAL.

pUsername

The username of the user.

pPassword

The password of the user.

GetConsoleVerison

Purpose

This function returns the release version for the Console.

Syntax
VT_BOOL GetConsoleVersion(VTS_PBSTR pVersion, 
VTS_PBSTR pBanner)
Parameters

Name   Type   Mode  

pVersion  

VTS_PBSTR  

OUT  

pBanner  

VTS_PBSTR  

OUT  

pVersion

This identifies the console version, such as 1.2. It is used when programing.

pBanner

This is the NLS version banner string for display in the user interface (UI), such as the About box.

Comments

For an example illustrating GetConsoleVersion, see CGetVersionDlg::DoGetConsoleVersion in the repver.cpp file.

GetPreferredCredentials

Purpose

This function returns the preferred credentials for the Console user for a particular destination. If the user has not specifically set credentials for the destination, the Console username and password are returned.

Syntax
VT_BOOL GetPreferredCredentials(VTS_BSTR DestinationType, 
VTS_BSTR Destination,
VTS_PBSTR pUsername,
VTS_PBSTR pPassword
VTS_PBSTR pConnectAs)
Parameters

Name   Type   Mode  

DestinationType  

VTS_BSTR  

IN  

Destination  

VTS_BSTR  

IN  

pUsername  

VTS_PBSTR  

OUT  

pPassword  

VTS_PBSTR  

OUT  

pConnectAs  

VTS_PBSTR  

OUT  

See Common Parameters on page 4-3.

DestinationType

The service type of the destination. See Service Types on page 6-3.

Destination

The name of the destination, such as smpsun14.

Comments

An application would call the GetPreferredCredentials function when it wants to open a connection to a different service than the one it connected to when it was launched. This function returns a TRUE if it succeeds, otherwise it returns FALSE.

GetRepLogonInfo

Purpose

This function returns the username and password of the Console user, and the service name of the repository being used by the Console user.

Syntax
VT_BOOL GetRepLogonInfo(VTS_PBSTR pUsername, 
VTS_PBSTR pPassword,
VTS_PBSTR pService
VTS_PBSTR pConnectAs)
Parameters

Name   Type   Mode  

pUsername  

VTS_PBSTR  

OUT  

pPassword  

VTS_PBSTR  

OUT  

pService  

VTS_PBSTR  

OUT  

pConnectAs  

VTS_PBSTR  

OUT  

See Common Parameters on page 4-3.

pService

The Service name of the repository.

Comments

This function returns a TRUE if it succeeds, otherwise it returns FALSE.




Prev

Next
Oracle
Copyright © 1997 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index