Database Reference
In-Depth Information
Application Client Call to Copy List of Connection Strings
From the client application, we will call a new method in OracleJavaSecure , copyAppConnections() . It
takes one parameter, the old inner class version name. When the current (new) inner class is evaluated
on the Oracle database, we will be able to determine the new version right from the inner class.
We model copyAppConnections() on a method we have already examined, putAppConnections() . Our
new method calls the Oracle procedure, appsec_admin_pkg.p_copy_app_conns , passing the application
inner class and the old version name. In this case, we do not pass the connsHash list of connection
strings—it is obviously not needed.
It will be a rare event when we call our procedure, p_copy_app_conns , to copy an application's
connection strings list from one version of the inner class to the next version. We wouldn't create a new
version of our inner class each time we update the application; only when we want to retire a previous
version of the application, when our changes make a previous version of an application either
dysfunctional or unacceptable.
We call p_copy_app_conns with an instance of our new version of the application inner class. We
also designate the old version name so we know from where to get our connection strings. This
procedure, in Listing 11-27, bears strong resemblance to various procedures we've examined before. We
assure SSO and 2-factor authentication, before moving on.
If this connection is acceptable, then we call the function, f_copy_conns , which accomplishes the
duplication of the list of connection, strings to the new version.
Listing 11-27. Copy List of Connection Strings to New Version, p_copy_app_conns
PROCEDURE p_copy_app_conns(
m_two_factor_cd v_two_fact_cd_cache.two_factor_cd%TYPE,
m_class_instance v_app_conn_registry.class_instance%TYPE,
m_prev_version v_app_conn_registry.class_version%TYPE,
m_application_id v_two_fact_cd_cache.application_id%TYPE,
m_err_no OUT NUMBER,
m_err_txt OUT VARCHAR2 )
IS
return_user VARCHAR2(40);
m_app_user v_application_registry.app_user%TYPE := 'APPVER' ;
BEGIN
m_err_no := 0;
return_user := f_is_sso ( m_app_user );
IF( return_user IS NOT NULL )
THEN
IF( m_two_factor_cd IS NULL )
THEN
m_err_txt := appsec_only_pkg. f_send_2_factor (return_user, m_application_id);
ELSIF( appsec_only_pkg. f_is_cur_cached_cd ( return_user, m_application_id,
m_two_factor_cd ) = 'Y' )
THEN
-- Reuse existing VARCHAR2, RETURN_USER
return_user :=appsec_only_pkg. f_copy_conns (m_class_instance,m_prev_version);
ELSE
-- Wrong 2-Factor code entered
RAISE NO_DATA_FOUND;
END IF;
app_sec_pkg.p_log_error( 0, 'Success copying App Conns, ' || return_user );
 
Search WWH ::




Custom Search