Utility

public class Utility

Utility class for use by both clients and server.

Author:kcyee

Methods

fromUTCString

public static Date fromUTCString(String dateTime)

Convert a string of data type “dateTime” as specified by XML-Schema Part 2: Datatypes section 3.2.7 to local date/time. Only date/time represented as CCYY-MM-DDThh:mm:ssZ is supported.

Parameters:
  • dateTime – Date/time string in UTC.
Returns:

local time representation of the given UTC time string.

generateMessageId

public static String generateMessageId(Date date, EbxmlMessage ebxmlMessage)

Generate globally unique message ID according to the specified date and the information in ebXML message. Required fields are:

  • To/PartyId element [ebMSS 3.1.1.1]
  • CPAId [ebMSS 3.1.2]
  • Service element [ebMSS 3.1.4]
  • Action element [ebMSS 3.1.5]
Parameters:
  • date – Date to be used to generate message ID.
  • ebxmlMessage – ebXML message containing required fields.
Throws:
Returns:

Message ID derived from the given information.

generateMessageId

public static String generateMessageId(Date date, String toPartyId, String cpaId, String service, String action)

Generate message ID from the specified date, ToPartyId, CPAId, service name and action string.

Parameters:
  • date – Date from which message ID is generated.
  • toPartyId – Party ID of the recipient [ebMSS 3.1.1.1].
  • cpaId – CPAId [ebMSS 3.1.2].
  • service – Service name [ebMSS 3.1.4].
  • action – Action name [ebMSS 3.1.5].
Returns:

Message ID derived from the given information.

toUTCString

public static String toUTCString(Date date)

Get timestamp of the specified date in type “dateTime” as specified in XML-Schema Part 2: Datatypes section 3.2.7. Local time is converted to UTC time.

Parameters:
  • date – Local date to be converted to UTC time.
Returns:

UTC time string in CCYY-MM-DDThh:mm:ssZ format