cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bozemblem
Level 3

Java API Issue

I'm attempting to write a short java program that, when ran, will list to the user which features are currently being served by the active license manager. However, I haven't found a way of doing this other than the following way:

[CODE] String licEnvVar = System.getenv("VENDOR_LICENSE_FILE");
fs = new FeatureSpecifier("f1", "1.0");
lic = new License(fs, licEnvVar, new vendor(), null);
lic.checkout(1);
LicenseSource ls = lic.getLicenseSource();
String[] feat = ls.getFeatureList();
for (int i=0; i System.out.println("" + feat);
}
lic.checkin();[/CODE]

Is there a way, using either the Java API or the flex C libraries, that I can write a program to list out all the supported features with the program itself being ignorant of the features themselves (not having to create a FeatureSpecifier)?
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

For a single license source, you can use LicenseSource.createLicenseSource instead of using a feature specifier; something like this, perhaps:[code]try
{
ls = LicenseSource.createLicenseSource("@localhost", viDemoInfo, null);

String[] featureList = ls.getFeatureList("demo");

if (featureList != null)
{
for (int i = 0; i < featureList.length; i++)
{
System.out.println("Server knows about: " + featureList);
}
}
} catch (FlexlmException darn)
{
System.out.println(darn.getMessage( ));
}[/code]
0 Kudos
bozemblem
Level 3

That worked! Thank you very much.
0 Kudos