Package org.apache.oozie.jms

Examples of org.apache.oozie.jms.JMSConnectionInfo


     * @param publisherURI URI of the publisher
     * @return JMSConnectionInfo to connect to the JMS server that the publisher publishes to
     */
    public JMSConnectionInfo getJMSConnectionInfo(URI publisherURI) {
        String publisherAuthority = publisherURI.getAuthority();
        JMSConnectionInfo connInfo = null;
        if (publisherJMSConnInfoMap.containsKey(publisherAuthority)) {
            connInfo = publisherJMSConnInfoMap.get(publisherAuthority);
        }
        else {
            String schemeWithAuthority = publisherURI.getScheme() + "://" + publisherAuthority;
            for (MappingRule mr : mappingRules) {
                String jndiPropertiesString = mr.applyRule(schemeWithAuthority);
                if (jndiPropertiesString != null) {
                    connInfo = new JMSConnectionInfo(jndiPropertiesString);
                    publisherJMSConnInfoMap.put(publisherAuthority, connInfo);
                    LOG.info("Adding hcat server [{0}] to the list of JMS publishers", schemeWithAuthority);
                    break;
                }
            }
View Full Code Here


     * @param hcatURI hcatalog partition URI
     * @param topic JMS topic to register to
     * @param msgHandler Handler which will process the messages received on the topic
     */
    public void registerForNotification(HCatURI hcatURI, String topic, HCatMessageHandler msgHandler) {
        JMSConnectionInfo connInfo = getJMSConnectionInfo(hcatURI.getURI());
        jmsService.registerForNotification(connInfo, topic, msgHandler);
        registeredTopicsMap.put(
                getKeyForRegisteredTopicsMap(hcatURI), topic);
    }
View Full Code Here

    }

    public void unregisterFromNotification(HCatURI hcatURI) {
        String topic = registeredTopicsMap.remove(getKeyForRegisteredTopicsMap(hcatURI));
        if (topic != null) {
            JMSConnectionInfo connInfo = getJMSConnectionInfo(hcatURI.getURI());
            jmsService.unregisterFromNotification(connInfo, topic);
        }
    }
View Full Code Here

    public void unregisterFromNotification(String server, String database, String table) {
        String key = server + DELIMITER + database + DELIMITER + table;
        String topic = registeredTopicsMap.remove(key);
        if (topic != null) {
            try {
                JMSConnectionInfo connInfo = getJMSConnectionInfo(new URI("hcat://" + server));
                jmsService.unregisterFromNotification(connInfo, topic);
            }
            catch (URISyntaxException e) {
                LOG.warn("Error unregistering from notification for topic [{0}]. Hcat table=[{1}]", topic, key, e);
            }
View Full Code Here

        addMissingDependencyAndRegister(dep4, actionId4);
        addMissingDependencyAndRegister(dep4, actionId4);

        HCatAccessorService hcatService = Services.get().get(HCatAccessorService.class);
        JMSAccessorService jmsService = Services.get().get(JMSAccessorService.class);
        JMSConnectionInfo connInfo = hcatService.getJMSConnectionInfo(dep1.getURI());
        assertTrue(hcatService.isRegisteredForNotification(dep1)); //server1,db,table1
        assertTrue(hcatService.isRegisteredForNotification(dep3)); //server2,db,table2
        assertTrue(jmsService.isListeningToTopic(connInfo, dep1.getDb() + "." + dep1.getTable()));
        assertTrue(jmsService.isListeningToTopic(connInfo, dep3.getDb() + "." + dep3.getTable()));
View Full Code Here

    @Test
    public void testConnection() throws Exception {
        HCatAccessorService hcatService = services.get(HCatAccessorService.class);
        JMSAccessorService jmsService = services.get(JMSAccessorService.class);
        // both servers should connect to default JMS server
        JMSConnectionInfo connInfo = hcatService.getJMSConnectionInfo(new URI("hcat://hcatserver.blue.server.com:8020"));
        ConnectionContext ctxt1 = jmsService.createConnectionContext(connInfo);
        assertTrue(ctxt1.isConnectionInitialized());
        JMSConnectionInfo connInfo1 = hcatService.getJMSConnectionInfo(new URI("http://unknown:80"));
        ConnectionContext ctxt2 = jmsService.createConnectionContext(connInfo1);
        assertTrue(ctxt2.isConnectionInitialized());
        assertEquals(ctxt1, ctxt2);
        ctxt1.close();
    }
View Full Code Here

TOP

Related Classes of org.apache.oozie.jms.JMSConnectionInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.