org.apache.oozie.service
Class CallbackService

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

public class CallbackService
extends Object
implements Service

Service that generates and parses callback URLs.


Field Summary
static String CONF_BASE_URL
           
static String CONF_PREFIX
           
 
Fields inherited from interface org.apache.oozie.service.Service
DEFAULT_LOCK_TIMEOUT, lockTimeout, USE_XCOMMAND
 
Constructor Summary
CallbackService()
           
 
Method Summary
 String createCallBackUrl(String actionId, String externalStatusVar)
          Create a callback URL.
 void destroy()
          Destroy the service.
 String getActionId(String callback)
          Return the action ID from a callback URL.
 String getExternalStatus(String callback)
          Return the action external status from a callback URL.
 Class<? extends Service> getInterface()
          Return the public interface of the Dag engine service.
 void init(Services services)
          Initialize the service.
 boolean isValid(String callback)
          Return if a callback URL is valid or not.
 
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

CONF_BASE_URL

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

CallbackService

public CallbackService()
Method Detail

init

public void init(Services services)
Initialize the service.

Specified by:
init in interface Service
Parameters:
services - services instance.

destroy

public void destroy()
Destroy the service.

Specified by:
destroy in interface Service

getInterface

public Class<? extends Service> getInterface()
Return the public interface of the Dag engine service.

Specified by:
getInterface in interface Service
Returns:
CallbackService.

createCallBackUrl

public String createCallBackUrl(String actionId,
                                String externalStatusVar)
Create a callback URL.

Parameters:
actionId - action ID for the callback URL.
externalStatusVar - variable for the caller to inject the external status.
Returns:
the callback URL.

isValid

public boolean isValid(String callback)
Return if a callback URL is valid or not.

Parameters:
callback - callback URL (it can be just the callback portion of it).
Returns:
true if the callback URL is valid, false if it is not.

getActionId

public String getActionId(String callback)
Return the action ID from a callback URL.

Parameters:
callback - callback URL (it can be just the callback portion of it).
Returns:
the action ID from a callback URL.

getExternalStatus

public String getExternalStatus(String callback)
Return the action external status from a callback URL.

Parameters:
callback - callback URL (it can be just the callback portion of it).
Returns:
the action external status from a callback URL.


Copyright © 2012 Apache Software Foundation. All Rights Reserved.