How to know if you are in a datacenter instance programmatically

We need to show different options in the configuration page of our add-on accordingly to the type of instance the add-on is running (i.e. Server or Data Center).
Is there a way to detect the type of instance in a velocity template or programmatically in a servlet?

1 Like

Hey Salvatore,

Have you tried looking at the information you get returned from calling the serverInfo REST endpoint?

Especially the deploymentType attribute might be able to help you out.
Although I don’t have a Data Center instance to test this on so I cannot guarantee that this works.

Another option would be to use the Java API:
specifically the isClusterLicensed method:


@pvandevoorde Based on my testing, the deploymentType attribute returns “Server” regardless of if it’s a licensed Server or Data Center instance.

The Java API docs look promising but probably more work to interact with.

Have you seen any other ways to detect Server vs DC outside of the Java APIs you referenced below?

Easiest way that should work against all products is to use SAL:

Take a look at LicenseHandler - easiest way to see if there’s a data center license hanging around.