Class YahooClientImpl

    • Field Detail

      • feedServices

        private final YahooFeedServices feedServices
        Yahoo feed services value
      • thread

        private volatile Thread thread
        thread used for submitting requests
      • credentials

        private volatile YahooFeedCredentials credentials
        credentials used for the Yahoo connection
      • isRunning

        private final AtomicBoolean isRunning
        indicates if the client is running
      • requests

        private final Set<YahooRequest> requests
        the active Yahoo requests
      • requestCounter

        private final AtomicLong requestCounter
        the counter used to keep track of the number of requests
    • Constructor Detail

      • YahooClientImpl

        YahooClientImpl​(YahooFeedServices inFeedServices)
        Create a new YahooClient instance.
        Parameters:
        inFeedServices - a YahooFeedServices value
    • Method Detail

      • isRunning

        public boolean isRunning()
        Specified by:
        isRunning in interface org.springframework.context.Lifecycle
      • start

        public void start()
        Specified by:
        start in interface org.springframework.context.Lifecycle
      • stop

        public void stop()
        Specified by:
        stop in interface org.springframework.context.Lifecycle
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • login

        public boolean login​(YahooFeedCredentials inCredentials)
        Description copied from interface: YahooClient
        Logs in to the Yahoo data source with the given credentials.
        Specified by:
        login in interface YahooClient
        Parameters:
        inCredentials - a YahooFeedCredentials value
        Returns:
        a boolean value
      • logout

        public void logout()
        Description copied from interface: YahooClient
        Logs out from the Yahoo data source.
        Specified by:
        logout in interface YahooClient
      • isLoggedIn

        public boolean isLoggedIn()
        Description copied from interface: YahooClient
        Indicates if the connection is currently logged in or not.
        Specified by:
        isLoggedIn in interface YahooClient
        Returns:
        a boolean value
      • request

        public void request​(YahooRequest inRequest)
        Description copied from interface: YahooClient
        Executes the given request.
        Specified by:
        request in interface YahooClient
        Parameters:
        inRequest - a YahooRequest value
      • cancel

        public void cancel​(YahooRequest inRequest)
        Description copied from interface: YahooClient
        Cancels th given request.
        Specified by:
        cancel in interface YahooClient
        Parameters:
        inRequest - a YahooRequest value
      • getRequestCounter

        public long getRequestCounter()
        Description copied from interface: YahooClient
        Gets the current count of requests.
        Specified by:
        getRequestCounter in interface YahooClient
        Returns:
        a long value
      • submit

        private String submit​(YahooRequest inRequest)
                       throws IOException
        Submits the given request and returns the response from Yahoo.
        Parameters:
        inRequest - a YahooRequest value
        Returns:
        a String value
        Throws:
        IOException - if an error occurs submitting the request