org.axway.grapes.server.core
Class LicenseHandler

java.lang.Object
  extended by org.axway.grapes.server.core.LicenseHandler

public class LicenseHandler
extends Object

License Handler

Handles the license resolution. It stores the licenses names and the regexp to avoid db access. It must be updated at license addition / deletion.

Author:
jdcoffre

Constructor Summary
LicenseHandler(RepositoryHandler repoHandler)
           
 
Method Summary
 void approveLicense(String name, Boolean approved)
          Approve or reject a license
 void deleteLicense(String name)
          Delete a license from the repository
 DbLicense getLicense(String name)
          Return a html view that contains the targeted license
 List<License> getLicenses()
          Returns all the available license in client/server data model
 List<String> getLicensesNames(FiltersHolder filters)
          Return a list of license names.
 DbLicense resolve(String licenseId)
          Resolve the targeted license thanks to the license ID Return null if no license is matching the licenseId
 void store(DbLicense dbLicense)
          Add or update a license to the database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LicenseHandler

public LicenseHandler(RepositoryHandler repoHandler)
Method Detail

store

public void store(DbLicense dbLicense)
Add or update a license to the database

Parameters:
dbLicense - DbLicense

getLicensesNames

public List<String> getLicensesNames(FiltersHolder filters)
Return a list of license names. This list can either be serialized in HTML or in JSON

Parameters:
filters - FiltersHolder
Returns:
List

getLicense

public DbLicense getLicense(String name)
Return a html view that contains the targeted license

Parameters:
name - String
Returns:
DbLicense

deleteLicense

public void deleteLicense(String name)
Delete a license from the repository

Parameters:
name -

approveLicense

public void approveLicense(String name,
                           Boolean approved)
Approve or reject a license

Parameters:
name - String
approved - Boolean

resolve

public DbLicense resolve(String licenseId)
Resolve the targeted license thanks to the license ID Return null if no license is matching the licenseId

Parameters:
licenseId -
Returns:
DbLicense

getLicenses

public List<License> getLicenses()
Returns all the available license in client/server data model

Returns:
List


Copyright © 2014. All Rights Reserved.