org.apache.oozie.service
Class HCatAccessorService

java.lang.Object
  extended by org.apache.oozie.service.HCatAccessorService
All Implemented Interfaces:
Service

public class HCatAccessorService
extends Object
implements Service


Field Summary
static String CONF_PREFIX
           
static String JMS_CONNECTIONS_PROPERTIES
           
 
Fields inherited from interface org.apache.oozie.service.Service
DEFAULT_LOCK_TIMEOUT, lockTimeout, USE_XCOMMAND
 
Constructor Summary
HCatAccessorService()
           
 
Method Summary
 void destroy()
          Destroy the service.
 Class<? extends Service> getInterface()
          Return the public interface of the service.
 JMSConnectionInfo getJMSConnectionInfo(URI publisherURI)
          Given a publisher host:port return the connection details of JMS server that the publisher publishes to
 void init(Services services)
          Initialize the service.
 boolean isKnownPublisher(URI sourceURI)
          Determine whether a given source URI publishes JMS messages
 boolean isRegisteredForNotification(org.apache.oozie.util.HCatURI hcatURI)
          Check if we are already listening to the JMS topic for the table in the given hcatURI
 void registerForNotification(org.apache.oozie.util.HCatURI hcatURI, String topic, HCatMessageHandler msgHandler)
          Register for notifications on a JMS topic for the specified hcatalog table.
 void unregisterFromNotification(org.apache.oozie.util.HCatURI hcatURI)
           
 void unregisterFromNotification(String server, String database, String table)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONF_PREFIX

public static final String CONF_PREFIX
See Also:
Constant Field Values

JMS_CONNECTIONS_PROPERTIES

public static final String JMS_CONNECTIONS_PROPERTIES
See Also:
Constant Field Values
Constructor Detail

HCatAccessorService

public HCatAccessorService()
Method Detail

init

public void init(Services services)
          throws ServiceException
Description copied from interface: Service
Initialize the service.

Invoked by the Service singleton at start up time.

Specified by:
init in interface Service
Parameters:
services - services singleton initializing the service.
Throws:
ServiceException - thrown if the service could not initialize.

isKnownPublisher

public boolean isKnownPublisher(URI sourceURI)
Determine whether a given source URI publishes JMS messages

Parameters:
sourceURI - URI of the publisher
Returns:
true if we have JMS connection information for the source URI, else false

getJMSConnectionInfo

public JMSConnectionInfo getJMSConnectionInfo(URI publisherURI)
Given a publisher host:port return the connection details of JMS server that the publisher publishes to

Parameters:
publisherURI - URI of the publisher
Returns:
JMSConnectionInfo to connect to the JMS server that the publisher publishes to

isRegisteredForNotification

public boolean isRegisteredForNotification(org.apache.oozie.util.HCatURI hcatURI)
Check if we are already listening to the JMS topic for the table in the given hcatURI

Parameters:
hcatURI - hcatalog partition URI
Returns:
true if registered to a JMS topic for the table in the given hcatURI

registerForNotification

public void registerForNotification(org.apache.oozie.util.HCatURI hcatURI,
                                    String topic,
                                    HCatMessageHandler msgHandler)
Register for notifications on a JMS topic for the specified hcatalog table.

Parameters:
hcatURI - hcatalog partition URI
topic - JMS topic to register to
msgHandler - Handler which will process the messages received on the topic

unregisterFromNotification

public void unregisterFromNotification(org.apache.oozie.util.HCatURI hcatURI)

unregisterFromNotification

public void unregisterFromNotification(String server,
                                       String database,
                                       String table)

destroy

public void destroy()
Description copied from interface: Service
Destroy the service.

Invoked by the Service singleton at shutdown time.

Specified by:
destroy in interface Service

getInterface

public Class<? extends Service> getInterface()
Description copied from interface: Service
Return the public interface of the service.

Services are retrieved by its public interface. Specializations of services must return the public interface.

Specified by:
getInterface in interface Service
Returns:
the interface of the service.


Copyright © 2013 Apache Software Foundation. All Rights Reserved.