ome.services.licenses
Interface ILicense

All Superinterfaces:
ServiceInterface
All Known Subinterfaces:
LicenseStore
All Known Implementing Classes:
LicenseBean, Store

public interface ILicense
extends ServiceInterface

(CLIENT) Provides methods for acquiring and releasing server licenses. For this service to be active, it must be compiled into the server jar file via server/build.xml and the omero.hard-wired.interceptor configuration property. Each LicenseStore implementation will behave differently, but in general it is intended that users will have to acquire a license (represented by a byte-array license token) which must be presented on all method calls to non-ILicense services. This is enforced by LicenseWiring, the HardWiredInterceptor implementation which will be compiled in.

Since:
3.0-RC1
Author:
Josh Moore      josh.moore@gmx.de
See Also:
LicenseStore, LicenseWiring

Method Summary
 byte[] acquireLicense()
          Reserves a license for the current user.
 long getAvailableLicenseCount()
          Returns the number of licenses which can currently be acquired.
 long getLicenseTimeout()
          Returns the timeout per license as interpreted by the LicenseStore implementation.
 long getTotalLicenseCount()
          Returns the total number of licenses which the server has.
 boolean releaseLicense(byte[] token)
          Frees a license for re-reservation via acquireLicense().
 void resetLicenses()
          Administrative method to clear all active licenses and possibly to re-initialize the LicenseStore.
 

Method Detail

getAvailableLicenseCount

long getAvailableLicenseCount()
Returns the number of licenses which can currently be acquired. There is no guarantee that the number will remain constant before the next call, and therefore clients should be prepared to handle exceptions during acquisition. No guarantee is given on the interpretation of licenses used. Refer to the LicenseStore implementation for more details. For example, a power-user may consume more than one license per acquisition.


getTotalLicenseCount

long getTotalLicenseCount()
Returns the total number of licenses which the server has. This number is relatively constant, but can be changed via a call to resetLicenses()


getLicenseTimeout

long getLicenseTimeout()
Returns the timeout per license as interpreted by the LicenseStore implementation. Please refer there for more information.


acquireLicense

byte[] acquireLicense()
Reserves a license for the current user. The token returned must likely be presented on each subsequent method call if the LicenseWiring interceptor is in effect. Licenses may timeout depending on the LicenseStore implementation. Clients should be ready to handle exceptions on any method call. Licenses should also be released when possible so that other users can access the server.


releaseLicense

boolean releaseLicense(byte[] token)
Frees a license for re-reservation via acquireLicense(). If the license is invalid, no exception is thrown, but rather a false value returned.


resetLicenses

void resetLicenses()
Administrative method to clear all active licenses and possibly to re-initialize the LicenseStore. This may include a change to the internal settings such as license count or timeout.



OmeroJava Api

Version: Beta-4.2.0-r7571-b29

Copyright © 2009 The University of Dundee. All Rights Reserved.