Package com.longbridge
Class OAuth
- java.lang.Object
-
- com.longbridge.OAuth
-
- All Implemented Interfaces:
AutoCloseable
public class OAuth extends Object implements AutoCloseable
OAuth 2.0 client handle for Longbridge OpenAPIInstances are created by
OAuthBuilder.build(java.util.function.Consumer<java.lang.String>). This class is an opaque handle to the native OAuth object. Callclose()(or use try-with-resources) to release native memory when no longer needed.OAuthBuilder builder = new OAuthBuilder("your-client-id"); builder.setCallbackPort(8080); // optional OAuth oauth = builder.build(url -> System.out.println("Open: " + url)).get(); try { Config config = Config.fromOAuth(oauth); } finally { oauth.close(); }
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
-