Class BusinessHeader

  • All Implemented Interfaces:
    AppHdr

    @Deprecated
    @ProwideDeprecated(phase4=SRU2023)
    public class BusinessHeader
    extends java.lang.Object
    implements AppHdr
    Deprecated.
    use specific implementation of AppHdr instead, such as BusinessAppHdrV01
    This header model was the original implemented as a holder for the two available headers:

    A more flexible and scalable solution is done is provided now by the AppHdr interface and its implementing classes. Usage of this BusinessHeader is discourage in favor of AppHdr implementations such as BusinessAppHdrV01 or LegacyAppHdr

    Since:
    7.7
    • Constructor Detail

      • BusinessHeader

        @Deprecated
        @ProwideDeprecated(phase4=SRU2023)
        public BusinessHeader()
        Deprecated.
        use a specific implementation of AppHdr instead, such as BusinessAppHdrV01
      • BusinessHeader

        @Deprecated
        @ProwideDeprecated(phase4=SRU2023)
        public BusinessHeader​(ApplicationHeader applicationHeader)
        Deprecated.
        use specific implementation of AppHdr instead, such as LegacyAppHdr
      • BusinessHeader

        @Deprecated
        @ProwideDeprecated(phase4=SRU2023)
        public BusinessHeader​(LegacyAppHdr legacyAppHdr)
        Deprecated.
        use specific implementation of AppHdr instead, such as LegacyAppHdr
      • BusinessHeader

        @Deprecated
        @ProwideDeprecated(phase4=SRU2023)
        public BusinessHeader​(BusinessAppHdrV01 businessAppHdrV01)
        Deprecated.
        use specific implementation of AppHdr instead, such as BusinessAppHdrV01
    • Method Detail

      • setApplicationHeader

        public void setApplicationHeader​(ApplicationHeader applicationHeader)
        Deprecated.
      • setBusinessApplicationHeader

        public void setBusinessApplicationHeader​(BusinessApplicationHeaderV01 businessApplicationHeader)
        Deprecated.
      • from

        public java.lang.String from()
        Deprecated.
        Gets the sender BIC code.
        If the header is a BAH, tries to gets the BIC code from this elements in the following order:
        1. BusinessApplicationHeaderV01/Fr/FIId/FinInstnId/BICFI
        2. BusinessApplicationHeaderV01/Fr/OrgId/Id/OrgId/Id/AnyBIC

        If the header is an AH, gets the same from ApplicationHeader/From/Type+Id where if Type is BIC the Id is returned as is, otherwise the domain name is parsed to extract the SWIFT BIC
        Specified by:
        from in interface AppHdr
        Returns:
        found BIC or null if not present or cannot be parsed
      • to

        public java.lang.String to()
        Deprecated.
        Gets the receiver BIC code
        If the header is a BAH, tries to gets the BIC code from this elements in the following order:
        1. BusinessApplicationHeaderV01/To/FIId/FinInstnId/BICFI
        2. BusinessApplicationHeaderV01/To/OrgId/Id/OrgId/Id/AnyBIC

        If the header is an AH, gets the same from ApplicationHeader/To/Type+Id where if Type is BIC the Id is returned as is, otherwise the domain name is parsed to extract the SWIFT BIC
        Specified by:
        to in interface AppHdr
        Returns:
        found BIC or null if not present or cannot be parsed
      • reference

        public java.lang.String reference()
        Deprecated.
        Get the message reference.
        Specified by:
        reference in interface AppHdr
        Returns:
        the message reference from the header or null if the element is not found
        Since:
        7.8
        See Also:
        BusinessApplicationHeaderV01Impl.getBizMsgIdr(), ApplicationHeaderImpl.getMsgRef()
      • messageName

        public java.lang.String messageName()
        Deprecated.
        Description copied from interface: AppHdr
        Gets the message name from the "MsgDefIdr" (BAH) or "MsgName" (AH) element.
        Specified by:
        messageName in interface AppHdr
        Returns:
        the message name from the header or null if the element is not found
        Since:
        9.0.1
      • serviceName

        public java.lang.String serviceName()
        Deprecated.
        Description copied from interface: AppHdr
        Gets the service name from the "BizSvc" (BAH) or "SvcName" (AH) element.
        Specified by:
        serviceName in interface AppHdr
        Returns:
        the service name from the header or null if the element is not found
        Since:
        9.0.1
      • duplicate

        public boolean duplicate()
        Deprecated.
        Description copied from interface: AppHdr
        Gets the duplicate flag from the "PssblDplct" (BAH) or "Dup" (AH) element
        Specified by:
        duplicate in interface AppHdr
        Returns:
        true if the element is present, false otherwise
        Since:
        9.0.1
      • creationDate

        public java.time.OffsetDateTime creationDate()
        Deprecated.
        Description copied from interface: AppHdr
        Gets the message creation date from the "CreDate" (BAH) or "CrDate" (AH) element.
        Specified by:
        creationDate in interface AppHdr
        Returns:
        found date or null if the element is not found
        Since:
        9.0.1
      • xml

        public java.lang.String xml()
        Deprecated.
        Get this header as an XML string.
        Specified by:
        xml in interface AppHdr
        Returns:
        header serialized into XML string or null if neither header version is present
        Since:
        7.8
        See Also:
        xml(String, boolean)
      • xml

        public java.lang.String xml​(java.lang.String prefix,
                                    boolean includeXMLDeclaration)
        Deprecated.
        Get this header as an XML string. Since this class contains a dual model supporting two type of headers (swift and ISO), if both headers are present in the object the BusinessApplicationHeaderV01 will be used.
        Specified by:
        xml in interface AppHdr
        Parameters:
        prefix - optional prefix for namespace (empty by default)
        includeXMLDeclaration - true to include the XML declaration (false by default)
        Returns:
        header serialized into XML string or null if neither header version is present
        Since:
        7.8
      • element

        public org.w3c.dom.Element element()
        Deprecated.
        Gets the header as an Element object.
        Specified by:
        element in interface AppHdr
        Returns:
        Element this header parsed into Element or null if header is null
        Since:
        7.8
      • setCreationDate

        public void setCreationDate​(boolean overwrite)
        Deprecated.
        Sets the creation date in the inner header object with current moment in UTC time zone.
        Either of the inner headers must be not null. If both are null this method does nothing.
        Specified by:
        setCreationDate in interface AppHdr
        Parameters:
        overwrite - if true, the creation date will always be set overwriting any previous value; if false it will be set only if it is not already set
        Since:
        7.8.5