ome.services.licenses
Interface LicenseStore

All Superinterfaces:
ILicense, ServiceInterface
All Known Implementing Classes:
LicenseBean, Store

public interface LicenseStore
extends ILicense

Provides local extensions of ILicense for validating license tokens and tracking license timeouts.

Since:
3.0-RC1
Author:
Josh Moore, josh.moore at gmx.de

Method Summary
 void enterMethod(byte[] token, Principal p)
          Increments the number of currently active methods associated with a single license and prevents timeouts during the method call.
 void exitMethod(byte[] token, Principal p)
          Decrements the number of active methods associated with a single license and timestamps the last use of the license.
 boolean hasLicense(byte[] token)
          Checks for the validity of a token and that the Not responsible for timeouts.
 void setSessionManager(SessionManager sessionManager)
          Starting with OmeroSessions, the LicenseStore needs to have access more to the SessionManager rather than the SecuritySystem since during session-creation, no user is logged in.
 void setStaticSecuritySystem(SecuritySystem securitySystem)
          Injector which allows the central SecuritySystem instance to be injected in the store post-constructor (since the main instance may be constructed statically.
 
Methods inherited from interface ome.services.licenses.ILicense
acquireLicense, getAvailableLicenseCount, getLicenseTimeout, getTotalLicenseCount, releaseLicense, resetLicenses
 

Method Detail

enterMethod

void enterMethod(byte[] token,
                 Principal p)
                 throws InvalidLicenseException,
                        LicenseTimeout
Increments the number of currently active methods associated with a single license and prevents timeouts during the method call. Required to call hasLicense(byte[]) within its synchronization boundaries, also responsible for timeouts.

Throws:
InvalidLicenseException
LicenseTimeout

exitMethod

void exitMethod(byte[] token,
                Principal p)
Decrements the number of active methods associated with a single license and timestamps the last use of the license.


hasLicense

boolean hasLicense(byte[] token)
                   throws InvalidLicenseException
Checks for the validity of a token and that the Not responsible for timeouts.

Throws:
InvalidLicenseException

setStaticSecuritySystem

void setStaticSecuritySystem(SecuritySystem securitySystem)
Injector which allows the central SecuritySystem instance to be injected in the store post-constructor (since the main instance may be constructed statically. Implementation may want to prevent the setter from being called multiple times, and may want to synchronize access for the same reason.

To do:
This should not need to be "StaticSecuritySystem" but is so because of the current inheritance from ome.logic.AbstractBean of LicenseBean which will hopefully go away in the future.

setSessionManager

void setSessionManager(SessionManager sessionManager)
Starting with OmeroSessions, the LicenseStore needs to have access more to the SessionManager rather than the SecuritySystem since during session-creation, no user is logged in.



OmeroJava Api

Version: Beta-4.2.0-r7571-b29

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