1

Java API. Is it possible to have several sessions open simultaneously?

Topic: Java API. Is it possible to have several sessions open simultaneously?

Hello,

We are building an online service for our clients, so our backend must fetch Wialon data for multiple accounts (multiple auth tokens).
Our backend has a daemon written in Java to work with Wialon Java API.

Unfortunately, it looks like com.wialon.core.Session is a static singleton object, so it can service only one auth token at a time.

Am I missing something?
What would be the best way to achieve what we need - get updated info on Wialon units for a bunch of users every 5 minutes?

So far it seems I will be rewriting parts of daemon to use Remote API and saving session ids instead.

2

Java API. Is it possible to have several sessions open simultaneously?

Re: Java API. Is it possible to have several sessions open simultaneously?

Gleb Varenov, hello.

Gleb Varenov wrote:

Unfortunately, it looks like com.wialon.core.Session is a static singleton object, so it can service only one auth token at a time.

Yes, you are right.

Gleb Varenov wrote:

What would be the best way to achieve what we need - get updated info on Wialon units for a bunch of users every 5 minutes?

1. You can create a session, get updated info and logout every 5 minutes for each user.
2. You can create a user who is granted access to all necessary units and get update info from one login. If all the necessary objects in the hierarchy are in a single account, you can use this account.
3. You can fork Java Wialon SDK and add an ability to create multiple sessions, but I think this isn't the best way for a service with actuality in 5 minutes.
P.S. And be careful with the limits for requests and sessions.

Mobile Development
Gurtam