net.rim.pushsdk.query.subscription
Class SubQueryMessageUnmarshaller

java.lang.Object
  extended by net.rim.pushsdk.query.subscription.SubQueryMessageUnmarshaller

public class SubQueryMessageUnmarshaller
extends Object

Unmarshals subscription query XML messages into Java objects.

Author:
mdandrea

Field Summary
protected static String INVALID_TAG_ERROR_MSG
          Error message indicating an invalid tag was found.
protected static String INVALID_VALUE_ERROR_MSG
          Error message indicating a tag had an invalid value.
protected static String IOEXCEPTION_ERROR_MSG
          Error message indicating that a IOException was encountered.
protected static String MISSING_MANDATORY_ERROR_MSG
          Error message indicating a missing XML tag or attribute that was required.
protected static String MISSING_OUTERMOST_TAG_ERROR_MSG
          Error message indicating that the expected outermost tag of the response (see SubscriptionQueryMessage.QUERY_OUTERMOST_TAG) was not found in the response.
protected static String MISSING_RESPONSE_TAG_ERROR_MSG
          Error message indicating that an expected response tag (see SubscriptionQueryResponse.QUERY_RESPONSE_TAG) was not found in the response.
protected static String NO_XML_ERROR_MSG
          Error message indicating that the response received did not contain any actual XML.
protected static String NOT_XML_ERROR_MSG
          Error message indicating that the response received was not the expected XML content type.
protected static String PARSE_ERROR_MSG
          Error message indicating that the XML response could not be parsed.
protected static String SAXEXCEPTION_ERROR_MSG
          Error message indicating that a SAXException was encountered.
 
Constructor Summary
SubQueryMessageUnmarshaller()
          Constructs a subscription query message unmarshaller.
 
Method Summary
 SubscriptionQueryResponse unmarshal(String xml, String contentType)
          Unmarshals a subscription query XML response message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MISSING_MANDATORY_ERROR_MSG

protected static final String MISSING_MANDATORY_ERROR_MSG
Error message indicating a missing XML tag or attribute that was required.

See Also:
Constant Field Values

INVALID_TAG_ERROR_MSG

protected static final String INVALID_TAG_ERROR_MSG
Error message indicating an invalid tag was found.

See Also:
Constant Field Values

INVALID_VALUE_ERROR_MSG

protected static final String INVALID_VALUE_ERROR_MSG
Error message indicating a tag had an invalid value.

See Also:
Constant Field Values

PARSE_ERROR_MSG

protected static final String PARSE_ERROR_MSG
Error message indicating that the XML response could not be parsed.

See Also:
Constant Field Values

NOT_XML_ERROR_MSG

protected static final String NOT_XML_ERROR_MSG
Error message indicating that the response received was not the expected XML content type.

See Also:
Constant Field Values

NO_XML_ERROR_MSG

protected static final String NO_XML_ERROR_MSG
Error message indicating that the response received did not contain any actual XML.

See Also:
Constant Field Values

MISSING_OUTERMOST_TAG_ERROR_MSG

protected static final String MISSING_OUTERMOST_TAG_ERROR_MSG
Error message indicating that the expected outermost tag of the response (see SubscriptionQueryMessage.QUERY_OUTERMOST_TAG) was not found in the response.

See Also:
Constant Field Values

MISSING_RESPONSE_TAG_ERROR_MSG

protected static final String MISSING_RESPONSE_TAG_ERROR_MSG
Error message indicating that an expected response tag (see SubscriptionQueryResponse.QUERY_RESPONSE_TAG) was not found in the response.

See Also:
Constant Field Values

SAXEXCEPTION_ERROR_MSG

protected static final String SAXEXCEPTION_ERROR_MSG
Error message indicating that a SAXException was encountered.

See Also:
Constant Field Values

IOEXCEPTION_ERROR_MSG

protected static final String IOEXCEPTION_ERROR_MSG
Error message indicating that a IOException was encountered.

See Also:
Constant Field Values
Constructor Detail

SubQueryMessageUnmarshaller

public SubQueryMessageUnmarshaller()
                            throws PushSDKException
Constructs a subscription query message unmarshaller.

Throws:
PushSDKException - if any errors occur initializing the XML parser
Method Detail

unmarshal

public SubscriptionQueryResponse unmarshal(String xml,
                                           String contentType)
                                    throws PushSDKException,
                                           SubQueryFailureException
Unmarshals a subscription query XML response message.

Parameters:
xml - the subscription query response XML to unmarshal
contentType - the content type for validation purposes
Returns:
the umarshalled subscription query response message
Throws:
PushSDKException - if the XML passed in is null or empty, if the content type is not application/xml, or if the tags of the response is incorrect
SubQueryFailureException - if the status code of the response is null; or, is not null, and is both not the success status code and is not the "no results" status code


Copyright © 2011 Research In Motion. All Rights Reserved.