- Revenera Community
- :
- FlexNet Embedded
- :
- FlexNet Embedded Forum
- :
- How to get the number of licenses available to be borrowed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hello,
I'm using the Java Embedded Client 2019.1 - running a local license server connected to the cloud hosted FNO.
I have 2 (related) questions.
Assuming I have this setup...
I have 3 counts of a license feature on my local license server. If I borrow (and acquire) 1 count of this feature, I expect I should have 2 counts available to be borrowed by another client.
Question 1 - which API do I use to get the "available to borrow" count of 2? I have looked at (a) IFeature.getAvailableAcquisitionCount() - which returns zero (b) IFeature.getCount() - which returns one (c) IFeature.getMaxCount() - which returns three. Also looked at ILicenseManager.availableAcquireCount() - which also returns zero.
Question 2 - how do I get say the username or device ID for the clients who currently have active borrows?
Thanks for any help.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @ageorge ,
You are actually getting back the expected results. The Preview request for all features returns back both the maximum count on the server along with the maximum count available to the client requesting the preview. I am assuming you are doing the preview request from the same client that previously requested one of the 3 available features, can you please confirm?
Let's call this Device1 which has a count of 1 of feature F1. The server has a max count of 3 of F1 with 2 available for use by clients other than Device 1. If you performed a preview of all features from Device 2, a count of 2 would be returned as that is the maximum count Device 2 can obtain. A count of 3 is returned for preview request for Device1 because it currently has 1 and can obtain the remaining 2 for a total count of 3.
Best regards,
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hello @ageorge ,
Please refer the information on Capability Preview in the Java XT User Guide (image attached below). You can use the preview request to see licenses on the local server that are available for acquisition.
To see the devices that have licenses with active borrows you can use the License Server REST APIs. You can query the server for the license features, then use the feature ids to see the details on devices using those features.
Best regards,
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Thanks for the response @jberthold
When I create a preview capability request, requesting for all features, and get the response back, using the same scenario as I mentioned in my initial post, I get these results for the feature...
getCount() = 3
getMaxCount() = 3
getAvailableAcquisitionCount() = 0
In the documentation, it does say that the getCount() method will return for each feature "the immediately
available count—that is, the count reserved for the client plus all shared counts that are not currently served to
other clients".
I would have thought from reading that the getCount() method will return 2 since I have borrowed and acquired one count of the feature already.
On the 2nd question, we don't use the REST APIs so that is not an option for now.
Thanks.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @ageorge ,
You are actually getting back the expected results. The Preview request for all features returns back both the maximum count on the server along with the maximum count available to the client requesting the preview. I am assuming you are doing the preview request from the same client that previously requested one of the 3 available features, can you please confirm?
Let's call this Device1 which has a count of 1 of feature F1. The server has a max count of 3 of F1 with 2 available for use by clients other than Device 1. If you performed a preview of all features from Device 2, a count of 2 would be returned as that is the maximum count Device 2 can obtain. A count of 3 is returned for preview request for Device1 because it currently has 1 and can obtain the remaining 2 for a total count of 3.
Best regards,
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @jberthold
Yes you are correct - I am doing the preview request from the same client that previously requested one of the 3 available features.
Thanks for the clarification - this level of detail was not present in documentation hence the reason I was unsure.
On a related issue, this is a comment about responses for a preview request - "Only features with non-zero counts are included in the capability response". My question therefore is, what is the best way to have visibility of all features on a local license server? Preview request would have been the ideal solution except it has the caveat above.
Thanks.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @ageorge ,
Aside from the preview request in the SDK the other option would be to use the license server REST APIs. They do not have the non-zero count restriction.
Best,
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Ok, much appreciated. Thanks.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)