Skip Headers

Oracle9i Supplied Java Packages Reference
Release 2 (9.2)

Part Number A96609-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

1
AppCtxManager in Package oracle.security.rdbms.appctx

This chapter describes the public Java class AppCtxManager, which is exposed in package oracle.security.rdbms.appctx. The AppCtxManager and associated classes work only for CONTEXT that is created to be ACCESSED GLOBALLY and does not work for other types of CONTEXT like, for example, INITIALIZED GLOBALLY through LDAP (Lightweight Directory Access Protocol).

This API provides a centralized location to store the developer's application context, enabling applications to set up the user's contexts.

This chapter contains these sections:


AppCtxManager Description

AppCtxManager class manages the Application Context. All calls to methods in this class must be made by the Application-designated class that administers the globally accessed Application Context. The AppCtxManager class cannot be instantiated.

Specifically, AppCtxManager provides the Oracle Java API for handling the Application Context that can be accessed globally. This API specifies which user-defined Java classes are allowed to administer the globally accessible Application Context namespace. AppCtxManager supports Oracle Label Security labels. This feature enables the administrator to manage contexts for large numbers of users and databases in the enterprise.

The book Oracle9i Application Developer's Guide - Fundamentals provides detailed information about using globally accessed Application Context and about how it works.

See Also:

For more information about this feature, please refer to Oracle9i Application Developer's Guide - Fundamentals. Also refer to the documentation for the associated PL/SQL supplied package DBMS_APPCTX in Oracle9i Supplied PL/SQL Packages and Types Reference.

Class Hierarchy

public class AppCtxManager extends java.lang.Object
 
java.lang.Object
  |
  +--oracle.security.rdbms.server.AppCtx.AppCtxManager
       

AppCtxManager Methods

Table 1-1  Summary of AppCtxManager Methods
Method Description

clearContext(AppCtxPermit, String, String, String)

Checks the AppCtxPermit Object and lets the user do a clear Context

createAppCtxPermit()

Returns the AppCtxPermit Object.

setContext(AppCtxPermit, String, String, String, String, String)

Checks the AppCtxPermit Object and lets the user do a set Contex.

clearContext(AppCtxPermit, String, String, String)

Description

This method checks the AppCtxPermit Object and lets the user do a clear Context

Syntax

public static void clearContext(AppCtxPermit permit, java.lang.String namespace, 
java.lang.String client_id, java.lang.String attribute)

Parameters

permit - AppCtx object that stores information on the Class designed to administer the Application Context.

namespace - NameSpace

client_id - Client-identifier of the session

attribute - Attribute

username - Username of the user permitted to see the client

createAppCtxPermit()

Description

This method returns the AppCtxPermit Object.

A user can create a Globally Accessed Context as:

CREATE CONTEXT hr using HR.initclass ACCESSED GLOBALLY;

When a user intends to administer the HR application context using the Java API, the user is required to use an AppCtxPermit Object. The only Class that is authorized to create a valid AppCtxPermit Object is the HR.initclass Class in the HR Application schema as designated by the CREATE CONTEXT syntax shown above. The AppCtxPermit Object becomes the TRUST point for the administration of the HR Context.

Syntax

public static AppCtxPermit createAppCtxPermit()

Parameters

None

Returns

AppCtxPermitObject

setContext(AppCtxPermit, String, String, String, String, String)

Description

This method checks the AppCtxPermit Object and lets the user do a set Contex.

Syntax

public static void setContext(AppCtxPermit permit, java.lang.String namespace, 
java.lang.String attribute, java.lang.String value, java.lang.String username, 
java.lang.String client_id)

Parameters

permit - AppCtx object that stores information on the Class designed to administer the Application Context.

namespace - NameSpace

attribute - Attribute

value - Value of the Attribute

username - Username of the user permitted to see the client

client_id - Client-identifier of the session

Returns

None


AppCtxManager Example

The example shown here provides a sample Java class that can be loaded into the database using the loadjava tool.

SQL> CREATE CONTEXT ctx1  using ctxj.employee ACCESSED GLOBALLY;

/* The java class */
import java.sql.*;
import oracle.sql.*;
import oracle.jdbc2.*;
import oracle.jdbc.driver.*;
import oracle.security.rdbms.server.AppCtx.*;
import java.util.ResourceBundle;

class Employee
{
  public static void setctx9() throws Exception
  {
   try
   {
       App CtxPermit appCtxPermit = AppCtxManager.createAppCtxPermit() ;
    AppCtxManager.setContext(appCtxPermit, "Ctx1","Attr1", "9","ctxj","10");
   }
   catch(Exception e)
   {
       e.printStackTrace() ;
     throw new Exception(e.toString());  
   }
}
public static void clrctx4() throws Exception
{
 try
  {
       AppCtxPermit appCtxPermit = AppCtxManager.createAppCtxPermit() ;
    AppCtxManager.clearContext(appCtxPermit, "Ctx1", "10", "Attr1") ;
   }
   catch(Exception e)
   {
       e.printStackTrace() ;
     throw new Exception(e.toString());
    }
 }
}

/* load the java class into the database */
loadjava -resolve -resolver "((* CTXJ) (* SYS))" -v -u ctxj/ctxj 
Employee.java



Go to previous page Go to next page
Oracle
Copyright © 1996, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback