Class AS2Utils
- java.lang.Object
-
- org.apache.camel.component.as2.api.util.AS2Utils
-
public final class AS2Utils extends Object
Utility Methods used in AS2 Component
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern
AS_NAME_PATTERN
static String
AS2_ATOMIC_NAME
static String
AS2_NAME
static String
AS2_QUOTED_NAME
static String
AS2_QUOTED_PAIR
static String
AS2_QUOTED_TEXT_CHAR_SET
static String
AS2_TEXT_CHAR_SET
static String
BACKSLASH
static String
DQUOTE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
createMessageId(String fqdn)
Generates a globally unique message ID which includesfqdn
: a fully qualified domain name (FQDN)static boolean
isPrintableChar(char c)
Determines ifc
is a printable character.static void
printMessage(PrintStream out, org.apache.http.HttpMessage message)
Prints the contents of an Http Message to given print stream.static String
printMessage(org.apache.http.HttpMessage message)
static void
printRequest(PrintStream out, org.apache.http.HttpRequest request)
Prints the contents of request to given print stream.static String
printRequest(org.apache.http.HttpRequest request)
static void
validateAS2Name(String name)
Validates if the givenname
is a valid AS2 Name
-
-
-
Field Detail
-
DQUOTE
public static final String DQUOTE
- See Also:
- Constant Field Values
-
BACKSLASH
public static final String BACKSLASH
- See Also:
- Constant Field Values
-
AS2_TEXT_CHAR_SET
public static final String AS2_TEXT_CHAR_SET
- See Also:
- Constant Field Values
-
AS2_QUOTED_TEXT_CHAR_SET
public static final String AS2_QUOTED_TEXT_CHAR_SET
- See Also:
- Constant Field Values
-
AS2_QUOTED_PAIR
public static final String AS2_QUOTED_PAIR
- See Also:
- Constant Field Values
-
AS2_QUOTED_NAME
public static final String AS2_QUOTED_NAME
- See Also:
- Constant Field Values
-
AS2_ATOMIC_NAME
public static final String AS2_ATOMIC_NAME
- See Also:
- Constant Field Values
-
AS2_NAME
public static final String AS2_NAME
- See Also:
- Constant Field Values
-
AS_NAME_PATTERN
public static final Pattern AS_NAME_PATTERN
-
-
Method Detail
-
validateAS2Name
public static void validateAS2Name(String name) throws InvalidAS2NameException
Validates if the givenname
is a valid AS2 Name- Parameters:
name
- - the name to validate.- Throws:
InvalidAS2NameException
- - Ifname
is invalid.
-
createMessageId
public static String createMessageId(String fqdn)
Generates a globally unique message ID which includesfqdn
: a fully qualified domain name (FQDN)- Parameters:
fqdn
- - the fully qualified domain name to use in message id.- Returns:
- The generated message id.
-
isPrintableChar
public static boolean isPrintableChar(char c)
Determines ifc
is a printable character.- Parameters:
c
- - the character to test- Returns:
true
ifc
is a printable character;false
otherwise.
-
printRequest
public static String printRequest(org.apache.http.HttpRequest request) throws IOException
- Throws:
IOException
-
printMessage
public static String printMessage(org.apache.http.HttpMessage message) throws IOException
- Throws:
IOException
-
printRequest
public static void printRequest(PrintStream out, org.apache.http.HttpRequest request) throws IOException
Prints the contents of request to given print stream.- Parameters:
out
- - the stream printed to.request
- - the request printed.- Throws:
IOException
- - If failed to print request.
-
printMessage
public static void printMessage(PrintStream out, org.apache.http.HttpMessage message) throws IOException
Prints the contents of an Http Message to given print stream.- Parameters:
out
- - the stream printed to.message
- - the request printed.- Throws:
IOException
- - If failed to print message.
-
-