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 PatternAS_NAME_PATTERNstatic StringAS2_ATOMIC_NAMEstatic StringAS2_NAMEstatic StringAS2_QUOTED_NAMEstatic StringAS2_QUOTED_PAIRstatic StringAS2_QUOTED_TEXT_CHAR_SETstatic StringAS2_TEXT_CHAR_SETstatic StringBACKSLASHstatic StringDQUOTE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcreateMessageId(String fqdn)Generates a globally unique message ID which includesfqdn: a fully qualified domain name (FQDN)static booleanisPrintableChar(char c)Determines ifcis a printable character.static voidprintMessage(PrintStream out, org.apache.http.HttpMessage message)Prints the contents of an Http Message to given print stream.static StringprintMessage(org.apache.http.HttpMessage message)static voidprintRequest(PrintStream out, org.apache.http.HttpRequest request)Prints the contents of request to given print stream.static StringprintRequest(org.apache.http.HttpRequest request)static voidvalidateAS2Name(String name)Validates if the givennameis 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 givennameis a valid AS2 Name- Parameters:
name- - the name to validate.- Throws:
InvalidAS2NameException- - Ifnameis 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 ifcis a printable character.- Parameters:
c- - the character to test- Returns:
trueifcis a printable character;falseotherwise.
-
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.
-
-