Class OAuthTokenWebListener

  • All Implemented Interfaces:
    java.util.concurrent.Callable<OAuthTokenFinish>

    public class OAuthTokenWebListener
    extends java.lang.Object
    implements java.util.concurrent.Callable<OAuthTokenFinish>
    This class creates a server handling the OAuth callback URLs. It has two tasks. First it is responsible for executing OAuthTokenInterceptor depending on a path defined by the interceptor itself. Furthermore it does the token parsing in the URL using a OAuthTokenExtractor.
    • Method Detail

      • start

        public java.net.URI start()
        Start the server created by the @{link Builder}.
        Returns:
        A callback URI which should be used during the OAuth process.
      • getToken

        public java.util.concurrent.Future<OAuthTokenFinishgetToken()
        Get the token generated by the OAuth process. In fact, this class returns a Future because the token may not be received by the server when this method is called.
        Returns:
        Returns an OAuthTokenFinish wrapped in a Future. The OAuthTokenFinish should at least contain a token
      • stop

        public void stop()
        Stop the listener server so the port becomes available again.
      • finalize

        public void finalize()
                      throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable