Zengain beta open for customers sign up now:
click here
Documentation
SupportNalpeiron.comGithubFree TrialFeedback
  • Documentation
  • Zentitle2 Docs
  • Zengain Docs
  • Zentitle I (V10)
  • Education & Training
  • Welcome
    • Zentitle2 documentation: License Management Software
    • Introduction to Zentitle2
  • Latest UI Changes
  • Zentitle Overview
    • Zentitle Quick Overview
      • Zentitle2 Features & Benefits
      • A single source of truth: 1 platform
      • Zentitle Architecture
      • Zentitle supports every platform
      • Zentitle business models
      • Critical differences for secure site/offline/dark site management
      • Zentitle for SaaS Licensing
  • Quick Start
    • Onboarding Zentitle2
    • Integrating is easy
    • Pricing & Packaging with Zentitle
  • Using the Platform UI
    • Introduction
    • New User Setup
    • Getting around
      • Search
      • Using reports
      • Providing feedback
    • Getting started
  • UI: ADMINISTRATION
    • Introduction
    • Users
      • Managing Users
      • Resending user invites
      • User permissions
      • Lost password
    • API Credentials
      • Package Registry
    • Webhooks
      • Logs
      • Workflow automation software
    • Integrations
      • FastSpring
      • SalesForce Sample Integration
        • Sample Integration Installation
        • Post-Installation Configuration
        • Connecting Salesforce to Zentitle
        • Creating a Zentitle Customer in SalesForce
        • Creating a Zentitle Entitlement in SalesForce
        • Editing Zentitle Entitlements in SalesForce
        • Managing Software Activations in SalesForce
    • Configuration
      • Import customers
      • Account Based Licensing (Identity-based licensing)
        • Setup Account Based Licensing with OpenID tokens.
        • Setup Account Based Licensing with username/password
        • Branding the user experience
      • End User Portal
        • End User Portal User Access
        • End user - Use of the portal
        • End User Offline Activation
      • Custom Fields
      • Security (2FA)
    • "Hard" Delete
  • UI: Dashboard
    • The Dashboard
  • UI: Customers
    • Customers and contacts
    • Customers
      • Adding (managing) contacts
      • The contact page
      • Setting up End User Portal (EUP) access
      • Inviting contacts to EUP
      • Disabling Customers
      • Managing Entitlements (from the Customer page)
  • UI: Entitlements
    • Entitlements
      • Using Entitlements
      • Maintenance options
    • Working with Entitlements
      • Activation Codes
      • Contacts (ABL)
      • Activations
      • Activity log
      • Notes
    • Managing Entitlements
      • Allocating entitlements
      • Change the offering (upgrade/downgrade)
      • Entitlements with overrides/changes
      • Renewing an entitlement
      • Resetting the usage count
      • Disabling Entitlements
      • Entitlements in overdraft (seats)
  • UI: Product Catalog
    • Product paradigm
    • Products
      • Product Features
      • Overdraft option (feature usage)
      • Feature Control
      • Product Attributes
      • Product Editions
      • Edition Setup
    • Offerings
      • Overdraft option (seats)
      • Managing offerings
      • Maintenance options
      • Change offering (upgrade/downgrade)
      • Custom Fields
    • Plans
      • Trial plans
    • Global Features (and attributes)
  • UI: Local License Server
    • Local License Server (LLS)
      • Local License Server Installation
      • LLS License End-User Management
      • Entitlements to be used on LLS instances
      • LLS Licensing API
      • LLS Release Notes
  • UI: Help
    • Support
  • Developers
    • Licensing & Management APIs
      • API docs
      • API Rate limits
      • Collecting credentials for integration
      • API Versioning
    • The Licensing Client (.NET)
      • Configure NuGet Source
      • Configuring the Activation
      • Configuring the SharedActivation
      • Working with SharedActivation
      • Licensing API Nonce
      • IActivation interface
      • Zentitle2Core Library
      • Exceptions
      • FAQ
      • Release Notes
    • The Licensing Client (C++)
      • Configuring the Activation
      • Licensing API Nonce
      • IActivation interface
      • Zentitle2Core Library
      • Exceptions
      • Release Notes
    • The Licensing Client (Java)
      • Configure JAR Source
      • Configuring the Activation
      • Licensing API Nonce
      • IActivation interface
      • Zentitle2Core Library
      • Exceptions
      • FAQ
      • Release Notes
    • The Zentitle2Core Library (C++)
      • Security
      • Offline Activation
      • Generating Device Fingerprint
      • Using the Zentitle2Core Library
      • Troubleshooting and FAQs
    • Platform Summary
      • Turboscale architecture
      • SaaS Application Licensing
      • On-Premise Licensing
        • 1-Step Offline Deactivation: On-Premise
        • 2-Step Offline Activation: On-Premise
    • Offline Activation
    • Virtual Machine Control
    • No-code Test Application
      • Creating a Product and Entitlement
      • Download the demo files
      • OnPremDemo.dll.config setup
      • Test the demo application
        • Install Desktop Runtime
    • No-code SaaS Example
      • Creating a Product and Entitlement
      • Download the demo files
      • Collecting the serverside parameters
      • Edit appsettings.json file for IDE based Testing
      • Edit docker-compose.yml file for Docker-based Testing
      • Test the demo application
        • Using docker to test
    • Naming conventions/Glossary
  • Premium Features
    • Overdraft Tracker (Basic)
      • API references (Overdraft)
      • Overdraft Tracker on the dashboard
      • Reporting with the Overdraft Tracker
    • Network Licensing
    • Change log feature
  • Use Cases
    • Dark Site Local License Server (Network-based licensing)
    • Renewals (Customer Success) Management
    • Subscription grace periods
    • Self-service - End-user portal
    • Virtualized Environments
    • Usage-Based Licensing
    • Trial Management
    • Identity Based Licensing: Understanding IDP
    • Single Tenant Option
    • Entitlements with ERP & billing systems
    • Entitlements with Subscriptions
    • Entitlements with a CRM
    • E-commerce Integration
    • IoT and hardware licensing
    • SaaS Applications
    • Overuse tracking (overdrafts)
    • Order Fulfillment
  • Zentitle and M&A deals
  • Other
    • Zentitle2 Changelog
      • Terms and Conditions Changelog
Powered by GitBook
LogoLogo

Nalpeiron Privacy Policy

  • Privacy and Cookie Policy

Nalpeiron Growth Platform Terms

  • Nalpeiron ELTC

Get a FREE Trial

  • Click here for FREE Trial

© Copyright - Nalpeiron, all rights reserved. Nalpeiron, The Nalpeiron Growth Platform, Zentitle and Zengain are trademarks of Nalpeiron Inc. All use subject to our Terms above.

On this page

Was this helpful?

Export as PDF
  1. Developers
  2. The Licensing Client (Java)

Configuring the Activation

PreviousConfigure JAR SourceNextLicensing API Nonce

Last updated 1 month ago

Was this helpful?

The license is represented by the Activation object, and there should be only a single instance of the Activation class created for every seat in your app (usually only one, in case your application needs to hold multiple activation instances for more products, see "Multiple Activations Support" page). The state of the Activation can be accessed through the Activation.getState() method.

Configure Activation instance

The following command will create a new instance of the Activation object in Uninitialized state. Before configuring the activation, collect the Tenant ID and Licensing API URL from the Account -> API Credentials page in the UI.

ActivationOptions activationOptions = new ActivationOptions(
    tenandId,
    productId,
    () -> seatId,
    storage,
    onlineActivationOptions,
    offlineActivationOptions,
    activationOperationLock);
// configure the options by following the instructions below
IActivation activation = new Activation(activationOptions, persistence);

There are the following configuration options available:

  • Tenant ID - ID of the tenant. Can be retrieved from the API Credentials page.

  • Product ID - the product for which we are implementing the licensing.

Remember that each "product" has its own unique ID. You will need to use different IDs for every product you release.

  • Seat ID - represents the machine, the user, or some other element which the license should be linked with. Because the seat ID usually depends on the information that is only available at runtime, it is configured as a function. We recommend using the functionality for the machine-specific seat ID.

  • Storage - holds the licensing data, which needs to be persisted on the machine, where your application is running. In the case of the desktop application, the usual choice is a file, and that's why we are providing a PlainTextActivationFileStorage in our SDK. Please note that the data in our PlainTextActivationFileStorage implementation are not encrypted, which allows the user to manipulate and export the licensing data.

    Depending on your use case, we recommend using your own implementation of the IActivationStorage interface or the that leverages the Zentitle2Core library secure storage implementation.

    IActivationStorage storage = new PlainTextFileActivationStorage("pathToTheFile")

  • Online Activation - allows the license activation when there is a network connection to the Licensing server. For the online activation, the following options need to be configured:

    • Licensing API URL - Licensing API base URL

    • HTTP Client Factory - HttpClient callback providing an HTTP Client for executing the Licensing API calls. The factory method enables the implementation of the proper HTTP Client's lifetime management, depending on your app's type. See the for more details.

      IPersistence persistence = new Persistence(
                      licenseStorage,
                      new DateTimeProvider());
      LicensingApiOptions licensingApiOptions = new LicensingApiOptions(
                      apiUrl,
                      tenantId,
                      persistence::getAccessToken,
                      persistence::getApiNonce,
                      persistence::setApiNonce);
      
      CloseableHttpClient httpClient = HttpClientFactory.createHttpClient(
                      licensingApiOptions);
              
      OnlineActivationOptions onlineActivationOptions = new OnlineActivationOptions(
                      licensingApiUrl,
                      () -> httpClient);

  • Offline Activation - In rare cases when a machine lacks a network connection but the license needs to be activated anyway, can be configured in your application.

  • Logging - SDK's logs are available via the implementation of the SLF4J interface. To have access to logs, it is necessary to add a logging framework implementing the SLF4J interface (Logback, Log4j, etc.) as a dependency. It is also necessary to configure the logging framework properly.

  • Activation Operation Lock - the Activation class uses a locking mechanism that makes it thread-safe and prevents the parallel execution of multiple activation methods, which might lead to an inconsistent activation state. The default lock leverages , but if you need a custom locking mechanism, you can provide your own implementation of the IActivationOperationLock interface.

  • State Transition Callback - if you want to "hook your own code" into the activation's state transition logic, you can define a callback, which is executed after the state has been changed.

    activationOptions.setTransitionToNewStateCallback((oldState, updatedActivation) ->
        logger.info("Activation state changed from [{}] to [{}]", oldState, updatedActivation.getState()));
Device Fingerprint
SecureActivationStorage
Documentation
offline activation
Semaphore