Oracle9i Application Developer's Guide - Advanced Queuing Release 2 (9.2) Part Number A96587-01 |
|
In this chapter we describe the administrative interface to Oracle Advanced Queuing in terms of use cases. That is, we discuss each operation (such as "Creating a Queue Table") as a use case by that name. A table listing all the use cases is provided at the head of the chapter (see Use Case Model: JMS Administrative Interface -- Basic Operations on page 13-2).
A summary figure, "Use Case Diagram: Administrator's Interface -- Basic Operations", locates all the use cases in a single drawing. If you are using the HTML version of this document, you can use this figure to navigate to the use case in which you are interested, by clicking on the relevant use case title.
Each use case is laid out as follows:
See Also:
|
Register a queue/topic connection factory through the database with JDBC connection parameters to LDAP.
registerConnectionFactory
is a static method. To successfully register the connection factory, the DB connection passed to registerConnectionFactory
must be granted AQ_ADMINISTRATOR_ROLE
. After registration, look up the connection factory using JNDI.
See Java (JDBC): Oracle9i Supplied Java Packages Reference, oracle.jms, AQjmsFactory.registerConnectionFactory.
String url; java.sql.connection db_conn; url = "jdbc:oracle:thin:@sun-123:1521:db1"; db_conn = DriverManager.getConnection(url, "scott", "tiger"); AQjmsFactory.registerConnectionFactory(db_conn, "queue_conn1", "sun-123", "db1", 1521, "thin", "queue");
See Also:
|
Register a queue/topic connection factory through the database with a JDBC URL to LDAP.
registerConnectionFactory
is a static method. To successfully register the connection factory, the DB connection passed to registerConnectionFactory
must be granted AQ_ADMINISTRATOR_ROLE
. After registration, look up the connection factory using JNDI.
See Java (JDBC): Oracle9i Supplied Java Packages Reference, oracle.jms, AQjmsFactory.registerConnectionFactory.
String url; java.sql.connection db_conn; url = "jdbc:oracle:thin:@sun-123:1521:db1"; db_conn = DriverManager.getConnection(url, "scott", "tiger"); AQjmsFactory.registerConnectionFactory(db_conn, "topic_conn1", url, null, "topic");
See Also:
|
Register a queue/topic connection factory through LDAP with JDBC connection parameters to LDAP.
registerConnectionFactory
is a static method. To successfully register the connection factory, the hashtable passed to registerConnectionFactory
must contain all the information to establish a valid connection to the LDAP server. Furthermore, the connection must have write access to the connection factory entries in the LDAP server (which requires the LDAP user to be either the database itself or be granted global_aq_user_role
). After registration, look up the connection factory using JNDI.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsFactory.registerConnectionFactory.
Hashtable env = new Hashtable(5, 0.75f); /* the following statements set in hashtable env: * service provider package * the URL of the ldap server * the distinguished name of the database server * the authentication method (simple) * the LDAP user name * the LDAP user password */ env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://sun-456:389"); env.put("searchbase", "cn=db1,cn=Oraclecontext,cn=acme,cn=com"); env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.SECURITY_PRINCIPAL, "cn=db1aqadmin,cn=acme,cn=com"); env.put(Context.SECURITY_CREDENTIALS, "welcome"); AQjmsFactory.registerConnectionFactory(env, "queue_conn1", "sun-123", "db1", 1521, "thin", "queue");
See Also:
|
Register a queue/topic connection factory through LDAP with JDBC connection parameters to LDAP.
registerConnectionFactory
is a static method. To successfully register the connection factory, the hashtable passed to registerConnectionFactory
must contain all the information to establish a valid connection to the LDAP server. Furthermore, the connection must have write access to the connection factory entries in the LDAP server (which requires the LDAP user to be either the database itself or be granted global_aq_user_role)
. After registration, look up the connection factory using JNDI.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsFactory.registerConnectionFactory.
String url; Hashtable env = new Hashtable(5, 0.75f); /* the following statements set in hashtable env: * service provider package * the URL of the ldap server * the distinguished name of the database server * the authentication method (simple) * the LDAP user name * the LDAP user password */ env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://sun-456:389"); env.put("searchbase", "cn=db1,cn=Oraclecontext,cn=acme,cn=com"); env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.SECURITY_PRINCIPAL, "cn=db1aqadmin,cn=acme,cn=com"); env.put(Context.SECURITY_CREDENTIALS, "welcome"); url = "jdbc:oracle:thin:@sun-123:1521:db1"; AQjmsFactory.registerConnectionFactory(env, "topic_conn1", url, null, "topic");
See Also:
|
Unregister a queue/topic connection factory in LDAP.
unregisterConnectionFactory
is a static method. To successfully unregister the connection factory, the DB connection passed to unregisterConnectionFactory
must be granted AQ_ADMINISTRATOR_ROLE
.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsFactory.unregisterConnectionFactory.
String url; java.sql.connection db_conn; url = "jdbc:oracle:thin:@sun-123:1521:db1"; db_conn = DriverManager.getConnection(url, "scott", "tiger"); AQjmsFactory.unregisterConnectionFactory(db_conn, "topic_conn1");
See Also:
|
Register a queue/topic connection factory in LDAP.
unregisterConnectionFactory
is a static method. To successfully unregister the connection factory, the hashtable passed to unregisterConnectionFactory
must contain all the information to establish a valid connection to the LDAP server. Furthermore, the connection must have write access to the connection factory entries in the LDAP server (which requires the LDAP user to be either the database itself or be granted global_aq_user_role
).
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsFactory.unregisterConnectionFactory.
String url; Hashtable env = new Hashtable(5, 0.75f); /* the following statements set in hashtable env: * service provider package * the URL of the ldap server * the distinguished name of the database server * the authentication method (simple) * the LDAP user name * the LDAP user password
*/
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://sun-456:389"); env.put("searchbase", "cn=db1,cn=Oraclecontext,cn=acme,cn=com"); env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.SECURITY_PRINCIPAL, "cn=db1aqadmin,cn=acme,cn=com"); env.put(Context.SECURITY_CREDENTIALS, "welcome"); url = "jdbc:oracle:thin:@sun-123:1521:db1"; AQjmsFactory.unregisterConnectionFactory(env, "queue_conn1");
See Also:
|
Get a Queue Connection Factory with JDBC URL
getQueueConnectionFactory is a static method.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsFactory.getQueueConnectionFactory
String url = "jdbc:oracle:oci8:internal/oracle" Properties info = new Properties(); QueueConnectionFactory qc_fact; info.put("internal_logon", "sysdba"); qc_fact = AQjmsFactory.getQueueConnectionFactory(url, info);
See Also:
|
Get a Queue Connection Factory with JDBC Connection Parameters
getQueueConnectionFactory is a static method.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsFactory.getQueueConnectionFactory
String host = "dlsun"; String ora_sid = "rdbms8i" String driver = "thin"; int port = 5521; QueueConnectionFactory qc_fact; qc_fact = AQjmsFactory.getQueueConnectionFactory(host, ora_sid, port, driver);
See Also:
|
Get a Topic Connection Factory with a JDBC URL.
getTopicConnectionFactory is a static method.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsFactory.getTopicConnectionFactory
String url = "jdbc:oracle:oci8:internal/oracle" Properties info = new Properties(); TopicConnectionFactory tc_fact; info.put("internal_logon", "sysdba"); tc_fact = AQjmsFactory.getTopicConnectionFactory(url, info);
See Also:
|
getTopicConnectionFactory is a Static Method.
Get a topic connection factory with JDBC connection parameters.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsFactory.getTopicConnectionFactory
String host = "dlsun"; String ora_sid = "rdbms8i" String driver = "thin"; int port = 5521; TopicConnectionFactory tc_fact; tc_fact = AQjmsFactory.getTopicConnectionFactory(host, ora_sid, port, driver);
See Also:
|
Get a queue/topic connection factory from LDAP.
Hashtable env = new Hashtable(5, 0.75f); DirContext ctx; queueConnectionFactory qc_fact; /* the following statements set in hashtable env: * service provider package * the URL of the ldap server * the distinguished name of the database server * the authentication method (simple) * the LDAP user name * the LDAP user password */ env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://sun-456:389"); env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.SECURITY_PRINCIPAL, "cn=db1aquser1,cn=acme,cn=com"); env.put(Context.SECURITY_CREDENTIALS, "welcome"); ctx = new InitialDirContext(env); ctx = (DirContext)ctx.lookup("cn=OracleDBConnections,cn=db1,cn=Oraclecontext,cn=acme,c n=com"); qc_fact = (queueConnectionFactory)ctx.lookup("cn=queue_conn1");
See Also:
|
Get a queue/topic from LDAP.
Hashtable env = new Hashtable(5, 0.75f); DirContext ctx; topic topic_1; /* the following statements set in hashtable env: * service provider package * the URL of the ldap server * the distinguished name of the database server * the authentication method (simple) * the LDAP user name * the LDAP user password */ env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://sun-456:389"); env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.SECURITY_PRINCIPAL, "cn=db1aquser1,cn=acme,cn=com"); env.put(Context.SECURITY_CREDENTIALS, "welcome"); ctx = new InitialDirContext(env); ctx = (DirContext)ctx.lookup("cn=OracleDBQueues,cn=db1,cn=Oraclecontext,cn=acme,cn=com "); topic_1 = (topic)ctx.lookup("cn=topic_1");
See Also:
|
Create a queue table.
CLOB, BLOB, BFILE objects are valid attributes for an AQ object type load. However, only CLOB and BLOB can be propagated using AQ propagation in Oracle8i and after.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.createQueueTable
QueueSession q_sess = null; AQQueueTable q_table = null; AQQueueTableProperty qt_prop = null; qt_prop = new AQQueueTableProperty("SYS.AQ$_JMS_BYTES_MESSAGE"); q_table = ((AQjmsSession)q_sess).createQueueTable("boluser", "bol_ship_queue_table", qt_prop);
See Also:
|
Specify queue table properties
Not applicable.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.AQ, AQQueueTableProperty
QueueSession q_sess = null; AQQueueTable q_table = null; AQQueueTableProperty qt_prop = null; qt_prop = new AQQueueTableProperty("SYS.AQ$_JMS_BYTES_MESSAGE"); q_table = ((AQjmsSession)q_sess).createQueueTable("boluser", "bol_ship_queue_table", qt_prop);
See Also:
|
Get a queue table.
If the caller that opened the connection is not the owner of the queue table, the caller must have AQ enqueue/dequeue privileges on queues/topics in the queue table. Otherwise the queue-table will not be returned.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.getQueueTable
QueueSession q_sess; AQQueueTable q_table; q_table = ((AQjmsSession)q_sess).getQueueTable("boluser", "bol_ship_queue_table");
See Also:
|
Specify destination properties.
Not applicable.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsDestinationProperty
No example is provided with this release.
See Also:
|
Create a queue in a specified queue table.
The queue table in which a queue is created has to be a single-consumer queue table.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.createQueue
QueueSession q_sess; AQQueueTable q_table; AqjmsDestinationProperty dest_prop; Queue queue; queue = ((AQjmsSession)q_sess).createQueue(q_table, "jms_q1", dest_prop);
See Also:
|
Create a topic in the publish-subscribe model.
Not applicable.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.createTopic
TopicSession t_sess; AQQueueTable q_table; AqjmsDestinationProperty dest_prop; Topic topic; topic = ((AQjmsSessa)t_sess).createTopic(q_table, "jms_t1", dest_prop);
See Also:
|
Grant AQ system privileges to a user/roles.
Initially only SYS and SYSTEM can use this procedure successfully.
The privileges are ENQUEUE_ANY, DEQUEUE_ANY and MANAGE_ANY.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.grantSystemPrivilege
TopicSession t_sess; ((AQjmsSession)t_sess).grantSystemPrivilege("ENQUEUE_ANY", "scott", false);
See Also:
|
Revoke AQ system privileges from user/roles.
The privileges are ENQUEUE_ANY
, DEQUEUE_ANY
, and MANAGE_ANY
.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.revokeSystemPrivilege
TopicSession t_sess; ((AQjmsSession)t_sess).revokeSystemPrivilege("ENQUEUE_ANY", "scott");
See Also:
|
Grant a topic privilege in the publish-subscribe model.
The privileges are ENQUEUE
, DEQUEUE
and ALL
. ALL
means both. Initially only the queue table owner can use this procedure to grant privileges on the topic.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsDestination.grantTopicPrivilege
TopicSession t_sess; Topic topic; ((AQjmsDestination)topic).grantTopicPrivilege(t_sess, "ENQUEUE", "scott", false);
See Also:
|
Revoke a topic privilege in the publish-subscribe model
The privileges are ENQUEUE
, DEQUEUE
, and ALL
. ALL
means both.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsDestination.revokeTopicPrivilege
TopicSession t_sess; Topic topic; ((AQjmsDestination)topic).revokeTopicPrivilege(t_sess, "ENQUEUE", "scott");
See Also:
|
Grant a queue privilege in the point-to-point model
The privileges are ENQUEUE
, DEQUEUE
and ALL
. ALL
means both. Initially only the queue table owner can use this procedure to grant privileges on the queue.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsDestination.grantQueuePrivilege
QueueSession q_sess; Queue queue; ((AQjmsDestination)queue).grantQueuePrivilege(q_sess, "ENQUEUE", "scott", false);
See Also:
|
Revoke queue privilege in the point-to-point model
The privileges are ENQUEUE, DEQUEUE and ALL. ALL means both. To revoke a privilege, the revoker must be the original grantor of the privilege. The privileges propagated through the GRANT option are revoked if the grantors privilege is also revoked.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsDestination.revokeQueuePrivilege
QueueSession q_sess; Queue queue; ((AQjmsDestination)queue).revokeQueuePrivilege(q_sess, "ENQUEUE", "scott");
See Also:
|
Start a destination.
After creating a destination, the administrator must use the start method to enable the destination. If Enable Enqueue is set to TRUE, then the destination is enabled for enqueue. If Enable Enqueue is set to FALSE, then the destination is disabled for enqueue. Similarly, if Enable Dequeue is set to TRUE, then the destination is enabled for dequeue. If Enable Dequeue is set to FALSE, the destination is disabled for dequeue.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsDestination.start
TopicSession t_sess; QueueSession q_sess; Topic topic; Queue queue; (AQjmsDestination)topic.start(t_sess, true, true); (AQjmsDestination)queue.start(q_sess, true, true);
See Also:
|
Stop a destination.
If Disable Dequeue is set to TRUE, then the destination is disabled for dequeue. If Disable dequeue is set to FALSE, then the current setting is not altered. Similarly if Disable Enqueue set to TRUE, then the destination is disabled for enqueue. If Disable Enqueue is set to FALSE, then the current setting is not altered.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsDestination.stop
TopicSession t_sess; Topic topic; ((AQjmsDestination)topic).stop(t_sess, true, false);
See Also:
|
Alter a destination.
Not applicable.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsDestination.alter
QueueSession q_sess; Queue queue; TopicSession t_sess; Topic topic; AQjmsDestionationProperty dest_prop1, dest_prop2; ((AQjmsDestination)queue).alter(dest_prop1); ((AQjmsDestination)topic).alter(dest_prop2);
See Also:
|
Drop a destination.
Not applicable.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsDestination.drop
QueueSession q_sess; Queue queue; TopicSession t_sess; Topic topic; ((AQjmsDestionation)queue).drop(q_sess); ((AQjmsDestionation)topic).drop(t_sess);
See Also:
|
Schedule a Propagation
Messages can be propagated to other topics in the same database by specifying a NULL destination. If the message has multiple recipients at the same destination in either the same or different queues the message will be propagated to all of them at the same time.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsDestination.schedulePropagation
TopicSession t_sess; Topic topic; ((AQjmsDestination)topic).schedulePropagation(t_sess, null, null, null, null, new Double(0));
See Also:
|
Enable a Propagation Schedule
NULL destination indicates that the propagation is to the local database.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsDestination.enablePropagationSchedule
TopicSession t_sess; Topic topic; ((AQjmsDestination)topic).enablePropagationSchedule(t_sess, "dbs1");
See Also:
|
Alter a propagation schedule.
NULL destination indicates that the propagation is to the local database
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsDestination.alterPropagationSchedule
TopicSession t_sess; Topic topic; ((AQjmsDestination)topic).alterPropagationSchedule(t_sess, null, 30, null, new Double(30));
See Also:
|
Disable a propagation schedule.
NULL
destination indicates that the propagation is to the local database
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsDestination.disablePropagationSchedule
TopicSession t_sess; Topic topic; ((AQjmsDestination)topic).disablePropagationSchedule(t_sess, "dbs1");
See Also:
|
Unschedule a propagation.
Unschedule a previously scheduled propagation.
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsDestination.unschedulePropagation
TopicSession t_sess; Topic topic; ((AQjmsDestination)topic).unschedulePropagation(t_sess, "dbs1");
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|