org.wso2.carbon.databridge.agent.util
Class DataPublisherUtil

java.lang.Object
  extended by org.wso2.carbon.databridge.agent.util.DataPublisherUtil

public class DataPublisherUtil
extends Object

A Util class which holds all the utility processing methods in the data publisher operation.


Method Summary
static String getDefaultAuthUrl(String receiverURL)
          Deduce the default authentication URL based on the receiver URL passed in.
static String getDefaultAuthURLSet(String receiverURLSet)
          Deduce the default authentication URL set based on the receiver URL set passed in.
static ArrayList<Object[]> getEndpointGroups(String urlSet)
          Process and extracts the receiver Groups from the string of URL set pattern passed in.
static String[] getProtocolHostPort(String url)
          Extracts and return the protocol, host, port elements from the URL.
static void validateURLs(ArrayList receiverGroups, ArrayList authGroups)
          Validate whether the receiverGroup and authenticationGroups are matching with pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getEndpointGroups

public static ArrayList<Object[]> getEndpointGroups(String urlSet)
                                             throws DataEndpointConfigurationException
Process and extracts the receiver Groups from the string of URL set pattern passed in.

Parameters:
urlSet - receiverGroups URL set
Returns:
List of Receiver groups
Throws:
DataEndpointConfigurationException

validateURLs

public static void validateURLs(ArrayList receiverGroups,
                                ArrayList authGroups)
                         throws DataEndpointConfigurationException
Validate whether the receiverGroup and authenticationGroups are matching with pattern. Basically if the receiver groups has been configured to be in the failover pattern, then the authentication URL also needs to be in the same way. Hence this method validates the provided receiverGroups, and authenticationGroup.

Parameters:
receiverGroups - List of Receiver groups
authGroups - List of Authentication groups.
Throws:
DataEndpointConfigurationException

getProtocolHostPort

public static String[] getProtocolHostPort(String url)
Extracts and return the protocol, host, port elements from the URL.

Parameters:
url - String of URL that needs to be processed.
Returns:
Array which has elements - protocol, host, and port in the given order.

getDefaultAuthUrl

public static String getDefaultAuthUrl(String receiverURL)
Deduce the default authentication URL based on the receiver URL passed in.

Parameters:
receiverURL - receiver URL for which it's required to get the authentication URL.
Returns:
default authentication URL.

getDefaultAuthURLSet

public static String getDefaultAuthURLSet(String receiverURLSet)
                                   throws DataEndpointConfigurationException
Deduce the default authentication URL set based on the receiver URL set passed in.

Parameters:
receiverURLSet - receiver URL set for which it's required to get the authentication URL set.
Returns:
default authentication URL set.
Throws:
DataEndpointConfigurationException


Copyright © 2015 WSO2. All rights reserved.