toolbox.oracle.xpath.ext
Class OSBExtensionFunctions

java.lang.Object
  extended by toolbox.oracle.xpath.ext.OSBExtensionFunctions

public class OSBExtensionFunctions
extends java.lang.Object

Contains various extension functions that can be used in Oracle Service Bus.

Author:
Hannes Holtzhausen

Method Summary
static java.lang.Long currentDateTimeToMillisOSBImpl()
          Return the current time in milliseconds.
static java.lang.Long dateTimeToMillisOSBImpl(java.lang.String dateStr)
          Return the provided XSD dateTime value in milliseconds.
static java.lang.String digestOSBImpl(java.lang.String message, java.lang.String algorithm, java.lang.String output)
          Perform a one-way hash on the given string and return either a hexadecimal or base64 representation of the hash.
static java.lang.String getSystemPropertyOSBImpl(java.lang.String property, java.lang.String defaultVal)
          Return the named Java System Property.
static java.lang.String maskOSBImpl(java.lang.String input, java.lang.String mode, java.lang.String maskChar, java.lang.Integer count)
          Perform simple String masking operations.
static java.lang.String millisToDateTimeOSBImpl(java.lang.Long time)
          Convert the given milliseconds value into a valid XSD dateTime string.
static java.lang.String parseDateTimeOSBImpl(java.lang.String dateStr, java.lang.String format, java.lang.String output)
          Convert (parse) the given string into a valid XSD dateTime string using the provided format string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSystemPropertyOSBImpl

public static java.lang.String getSystemPropertyOSBImpl(java.lang.String property,
                                                        java.lang.String defaultVal)
Return the named Java System Property.

Parameters:
property - String containing the name of the property that must be returned.
defaultVal - String containing a default value if the property does not exist.
Returns:
String containing the property value or the default value.

digestOSBImpl

public static java.lang.String digestOSBImpl(java.lang.String message,
                                             java.lang.String algorithm,
                                             java.lang.String output)
Perform a one-way hash on the given string and return either a hexadecimal or base64 representation of the hash.

Parameters:
message - String containing the message to perform the hash on.
algorithm - String indicating which digest algorithm to use.
output - HEX or BASE64.
Returns:
String containing the message hash.

maskOSBImpl

public static java.lang.String maskOSBImpl(java.lang.String input,
                                           java.lang.String mode,
                                           java.lang.String maskChar,
                                           java.lang.Integer count)
Perform simple String masking operations.

This method can perform three types of masking operations:

Parameters:
input - String containing the data that must be masked.
mode - String indicating the masking mode: first, last, all.
maskChar - String containing the masking character.
count - An int indicating the character count.
Returns:
String containing the masked data.

currentDateTimeToMillisOSBImpl

public static java.lang.Long currentDateTimeToMillisOSBImpl()
Return the current time in milliseconds.

Returns:
Long value representing the current time in milliseconds.

dateTimeToMillisOSBImpl

public static java.lang.Long dateTimeToMillisOSBImpl(java.lang.String dateStr)
Return the provided XSD dateTime value in milliseconds.

Parameters:
dateStr - Sting containing a valid XSD dateTime value.
Returns:
long value that represents the given date string in milliseconds.

millisToDateTimeOSBImpl

public static java.lang.String millisToDateTimeOSBImpl(java.lang.Long time)
Convert the given milliseconds value into a valid XSD dateTime string.

Parameters:
time - Long value that represents a time stamp.
Returns:
String containing a valid XSD dateTime value.

parseDateTimeOSBImpl

public static java.lang.String parseDateTimeOSBImpl(java.lang.String dateStr,
                                                    java.lang.String format,
                                                    java.lang.String output)
Convert (parse) the given string into a valid XSD dateTime string using the provided format string.

Parameters:
dateStr - String containing the XSD dateTime value to parse.
format - A valid java.text.SimpleDateFormat pattern.
output - String indicating which part of the dateTime must returned. date|time|datetime.
Returns:
String containing a valide XSD dateTime value.