Class SearchSocket


  • public class SearchSocket
    extends java.lang.Object
    Client side of search socket interface.
    • Constructor Summary

      Constructors 
      Constructor Description
      SearchSocket​(java.net.InetAddress host, int port)
      Construct a new SearchSocket.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      SearchResponse search​(SearchRequest request, FileProductStorage storage)
      Send a search request, converting the response to a java object.
      void search​(SearchRequest request, java.io.OutputStream responseOut)
      Send a search request, writing the response to an outputstream.
      • Methods inherited from class java.lang.Object

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

      • SearchSocket

        public SearchSocket​(java.net.InetAddress host,
                            int port)
        Construct a new SearchSocket.
        Parameters:
        host - the remote host.
        port - the remote port.
    • Method Detail

      • search

        public SearchResponse search​(SearchRequest request,
                                     FileProductStorage storage)
                              throws java.lang.Exception
        Send a search request, converting the response to a java object.
        Parameters:
        request - the request to send.
        storage - where received products are stored.
        Returns:
        the response.
        Throws:
        java.lang.Exception - if error occurs
      • search

        public void search​(SearchRequest request,
                           java.io.OutputStream responseOut)
                    throws java.lang.Exception
        Send a search request, writing the response to an outputstream.
        Parameters:
        request - the request to send.
        responseOut - the outputstream to write.
        Throws:
        java.lang.Exception - if error occurs