Class GaeHttpTransport

  • All Implemented Interfaces:
    Transport

    public class GaeHttpTransport
    extends java.lang.Object
    implements Transport
    This class is an implementation of Transport using the Google AppEngine urlFetch
    Since:
    1.0 Jan 29 2009
    Version:
    1.0
    Author:
    Ron Hess
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.OutputStream connect​(java.lang.String uri, java.lang.String soapAction)
      Connect to the specified endpoint.
      java.io.OutputStream connect​(java.lang.String endpoint, java.util.HashMap<java.lang.String,​java.lang.String> headers)  
      java.io.OutputStream connect​(java.lang.String uri, java.util.HashMap<java.lang.String,​java.lang.String> httpHeaders, boolean enableCompression)  
      static com.google.appengine.api.urlfetch.HTTPRequest createRequest​(ConnectorConfig config, java.net.URL url, java.util.Map<java.lang.String,​java.lang.String> httpHeaders)  
      static com.google.appengine.api.urlfetch.HTTPRequest createRequest​(ConnectorConfig config, java.net.URL url, java.util.Map<java.lang.String,​java.lang.String> httpHeaders, boolean enableCompression)  
      java.io.InputStream getContent()
      returns the response from the endpoint.
      boolean isSuccessful()
      checks whether the response from the remote server is successful or not.
      void setConfig​(ConnectorConfig config)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GaeHttpTransport

        public GaeHttpTransport()
    • Method Detail

      • connect

        public java.io.OutputStream connect​(java.lang.String uri,
                                            java.lang.String soapAction)
                                     throws java.io.IOException
        Description copied from interface: Transport
        Connect to the specified endpoint.
        Specified by:
        connect in interface Transport
        Parameters:
        uri - endpoint address
        soapAction - soap action
        Returns:
        output stream that can be used to send response
        Throws:
        java.io.IOException - failed to connect to the endpoint
      • connect

        public java.io.OutputStream connect​(java.lang.String endpoint,
                                            java.util.HashMap<java.lang.String,​java.lang.String> headers)
                                     throws java.io.IOException
        Specified by:
        connect in interface Transport
        Throws:
        java.io.IOException
      • connect

        public java.io.OutputStream connect​(java.lang.String uri,
                                            java.util.HashMap<java.lang.String,​java.lang.String> httpHeaders,
                                            boolean enableCompression)
                                     throws java.io.IOException
        Specified by:
        connect in interface Transport
        Throws:
        java.io.IOException
      • createRequest

        public static com.google.appengine.api.urlfetch.HTTPRequest createRequest​(ConnectorConfig config,
                                                                                  java.net.URL url,
                                                                                  java.util.Map<java.lang.String,​java.lang.String> httpHeaders)
                                                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • createRequest

        public static com.google.appengine.api.urlfetch.HTTPRequest createRequest​(ConnectorConfig config,
                                                                                  java.net.URL url,
                                                                                  java.util.Map<java.lang.String,​java.lang.String> httpHeaders,
                                                                                  boolean enableCompression)
                                                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getContent

        public java.io.InputStream getContent()
                                       throws java.io.IOException
        Description copied from interface: Transport
        returns the response from the endpoint. This method must be called after a connect call.
        Specified by:
        getContent in interface Transport
        Returns:
        response or error stream.
        Throws:
        java.io.IOException - failed to get content
      • isSuccessful

        public boolean isSuccessful()
        Description copied from interface: Transport
        checks whether the response from the remote server is successful or not.
        Specified by:
        isSuccessful in interface Transport
        Returns:
        true if the call was successful