How to close BoxDeveloperEditionAPIConnection or BoxTransactionalAPIConnection ?回答済み
We are creating one BoxDeveloperEditionAPIConnection in main thread like :
BoxDeveloperEditionAPIConnection api = new BoxDeveloperEditionAPIConnection(...);
Then we create multiple daemon threads and in each thread we create :
BoxTransactionalAPIConnection = new BoxTransactionalAPIConnection(api.getAccessToken());
So now we have one BoxDeveloperEditionAPIConnection and multiple BoxTransactionalAPIConnection ' s
The question is how to close these connections? We couldn't find any method for closing the connection.
Should we call revokeToken on each connection instead ?
Would appreciate any help or suggestion in this. Thanks.
As mentioned in this guide, tokens are valid for 60 minutes. Are you using one of our SDKS? Token management should be built in if so.
Alex, Box Developer Advocate
We are using following Box SDK : GitHub - box/box-java-sdk: The Box SDK for Java.
So if we create mulitple instances of BoxDeveloperEditionAPIConnection or BoxTransactionalAPIConnection then don't we need to manage closing of these connections ?
Is there anything we need to manage on our side for these connections or tokens ?
Hi Abhishek Mayee,
You don't need to manage the BoxDeveloperEditionAPIConnection nor BoxTransactionalAPIConnection. There is no resource "opened" like for example socket that you should close. Connections basically manage token exchange so that you do not need to worry about this.
If you want to revoke tokens used you can call api.revokeToken() . As Alex Novotny said token will expire after 60 minutes.