Class WSSConfig


  • public final class WSSConfig
    extends Object
    WSSConfig

    Carries configuration data so the WSS4J spec compliance can be modified in runtime. Configure an instance of this object only if you need WSS4J to emulate certain industry clients or previous OASIS specifications for WS-Security interoperability testing purposes.

    The default settings follow the latest OASIS and changing anything might violate the OASIS specs.

    WARNING: changing the default settings will break the compliance with the latest specs. Do this only if you know what you are doing.

    • Method Detail

      • init

        public static void init()
      • cleanUp

        public static void cleanUp()
      • getNewInstance

        public static WSSConfig getNewInstance()
        Returns:
        a new WSSConfig instance configured with the default values
      • getIdAllocator

        public WsuIdAllocator getIdAllocator()
        Returns:
        Returns the WsuIdAllocator used to generate wsu:Id attributes
      • setIdAllocator

        public void setIdAllocator​(WsuIdAllocator idAllocator)
      • setAction

        public Class<?> setAction​(int code,
                                  Action action)
        Associate an action instance with a specific action code. This operation allows applications to supply their own actions for well-known operations. Please note that the Action object does NOT get class-loaded per invocation, and so it is up to the implementing class to ensure that it is thread-safe.
      • setAction

        public Class<?> setAction​(int code,
                                  Class<?> clazz)
        Associate an action instance with a specific action code. This operation allows applications to supply their own actions for well-known operations.
      • setProcessor

        public Class<?> setProcessor​(QName el,
                                     Processor processor)
        Associate a SOAP processor name with a specified SOAP Security header element QName. Processors registered under this QName will be called when processing header elements with the specified type. Please note that the Processor object does NOT get class-loaded per invocation, and so it is up to the implementing class to ensure that it is thread-safe.
      • setProcessor

        public Class<?> setProcessor​(QName el,
                                     Class<?> clazz)
        Associate a SOAP processor name with a specified SOAP Security header element QName. Processors registered under this QName will be called when processing header elements with the specified type.
      • setValidator

        public Class<?> setValidator​(QName el,
                                     Validator validator)
        Associate a SOAP validator name with a specified SOAP Security header element QName. Validators registered under this QName will be called when processing header elements with the specified type. Please note that the Validator object does NOT get class-loaded per invocation, and so it is up to the implementing class to ensure that it is thread-safe.
      • setValidator

        public Class<?> setValidator​(QName el,
                                     Class<?> clazz)
        Associate a SOAP validator name with a specified SOAP Security header element QName. validator registered under this QName will be called when processing header elements with the specified type.
      • getValidator

        public Validator getValidator​(QName el)
                               throws WSSecurityException
        Returns:
        the SOAP Validator associated with the specified QName. The QName is intended to refer to an element in a SOAP security header. This operation returns null if there is no Validator associated with the specified QName.
        Throws:
        WSSecurityException
      • getProcessor

        public Processor getProcessor​(QName el)
                               throws WSSecurityException
        Returns:
        the SOAP processor associated with the specified QName. The QName is intended to refer to an element in a SOAP security header. This operation returns null if there is no processor associated with the specified QName.
        Throws:
        WSSecurityException
      • setCurrentTime

        public void setCurrentTime​(WSTimeSource currentTime)
      • isAddJceProviders

        public static boolean isAddJceProviders()
      • setAddJceProviders

        public static void setAddJceProviders​(boolean addJceProviders)