Class ODataSerializableResponse

java.lang.Object
com.ptc.odata.windchill.internalinvoker.ODataSerializableResponse
All Implemented Interfaces:
Serializable

public class ODataSerializableResponse extends Object implements Serializable
Response to ODataSerializableRequest. Only used when making internal WRS calls (i.e. from within the MethodServer).
Supported API: true

Extendable: false
See Also:
  • Constructor Details

    • ODataSerializableResponse

      public ODataSerializableResponse()
      Empty constructor for serialization support. Supported API: true
  • Method Details

    • getStatusCode

      public int getStatusCode()
      Gets the status code. Supported API: true
      See Also:
      • HttpStatusCode
    • getAllHeaders

      public Map<String,List<String>> getAllHeaders()
      Get all headers with the according values. Supported API: true
      Returns:
      an unmodifiable Map of header names/values
    • getHeaders

      public List<String> getHeaders(String name)
      Gets header value for a given name. Supported API: true
      Parameters:
      name - the header name as a case-insensitive key
      Returns:
      the header value(s) or null if not found
    • getHeader

      public String getHeader(String name)
      Gets first header value for a given name. If header name is not known null is returned. Supported API: true
      Parameters:
      name - the header name as a case-insensitive key
      Returns:
      the first header value or null if not found
    • getContent

      public byte[] getContent()
      Get the content as byte array. This is a generic method that allows to transform the byte array into any object type. Use this in conjunction with the content type (see getContentType()) to determine how to transform the byte array into the proper object type. Supported API: true
      Returns:
    • getContentAsJSON

      public org.json.JSONObject getContentAsJSON() throws org.json.JSONException, UnsupportedOperationException
      Convenience method to get the response body as JSONObject. Be aware that if the response body is NOT as valid JSON object, this operation will fail and throw an exception. Supported API: true
      Returns:
      Throws:
      org.json.JSONException - if the response body is a malformed JSON
      UnsupportedOperationException - if the content type is not JSON
    • getContentAsXML

      public Document getContentAsXML() throws UnsupportedOperationException, Exception
      Convenience method to get the response body as an XML Document. Be aware that if the response body is NOT as valid XML object, this operation will fail and throw an exception. Supported API: true
      Returns:
      Throws:
      UnsupportedOperationException - if the content type is not XML
      Exception - if the XML is malformed
    • getSkipToken

      public String getSkipToken()
      Convenience method to retrieve the $skiptoken value in "odata.nextLink", so it can be used in subsequent calls in WRSCaller as a query parameter. Returns null if the response is not JSON or if the response does not contain a next link.
      Supported API: true
      Returns:
      the $skiptoken
    • getContentType

      public String getContentType()
      Returns the content type of this response. Supported API: true
      Returns:
    • toString

      public String toString()
      Override of toString() for debug purposes Supported API: true
      Overrides:
      toString in class Object