ome.services.licenses
Class LicenseBean

java.lang.Object
  extended by ome.logic.AbstractLevel2Service
      extended by ome.services.licenses.LicenseBean
All Implemented Interfaces:
ServiceInterface, ILicense, LicenseStore, SelfConfigurableService

@Transactional(readOnly=true)
public class LicenseBean
extends AbstractLevel2Service
implements LicenseStore

Implementation of the ILicense service interface. LicenseBean primarily delegates to a LicenseStore instance which is created from a hard-coded class name. This class name can be changed via the tools/licenses/build.xml script.

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

Field Summary
 
Fields inherited from class ome.logic.AbstractLevel2Service
iQuery, iUpdate, metadata, queryFactory, sec
 
Constructor Summary
LicenseBean()
           
 
Method Summary
 byte[] acquireLicense()
          See ILicense.acquireLicense()
 void enterMethod(byte[] token, Principal p)
          See LicenseStore#enterValid(byte[])
 void exitMethod(byte[] token, Principal p)
          See LicenseStore#exitMethod(byte[])
 long getAvailableLicenseCount()
          See ILicense.getAvailableLicenseCount()
 long getLicenseTimeout()
          See ILicense.getLicenseTimeout()
 Class<? extends ServiceInterface> getServiceInterface()
           
 long getTotalLicenseCount()
          See ILicense.getTotalLicenseCount()
 boolean hasLicense(byte[] token)
          See LicenseStore.hasLicense(byte[])
 boolean releaseLicense(byte[] token)
          See ILicense.releaseLicense(byte[])
 void resetLicenses()
          See ILicense.resetLicenses()
 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 security)
          This injector does not synchronize or check for null as specified in the LicenseStore.setStaticSecuritySystem(SecuritySystem) method, but delegates to the STORE instance which should implement that logic.
 
Methods inherited from class ome.logic.AbstractLevel2Service
getBeanHelper, getExtendedMetadata, getQueryFactory, getSecuritySystem, selfConfigure, setExtendedMetadata, setQueryFactory, setQueryService, setSecuritySystem, setUpdateService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LicenseBean

public LicenseBean()
Method Detail

getServiceInterface

public final Class<? extends ServiceInterface> getServiceInterface()
Specified by:
getServiceInterface in interface SelfConfigurableService

setStaticSecuritySystem

public void setStaticSecuritySystem(SecuritySystem security)
This injector does not synchronize or check for null as specified in the LicenseStore.setStaticSecuritySystem(SecuritySystem) method, but delegates to the STORE instance which should implement that logic.

Specified by:
setStaticSecuritySystem in interface LicenseStore

setSessionManager

public void setSessionManager(SessionManager sessionManager)
Description copied from interface: LicenseStore
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.

Specified by:
setSessionManager in interface LicenseStore

acquireLicense

public byte[] acquireLicense()
                      throws NoAvailableLicensesException
See ILicense.acquireLicense()

Specified by:
acquireLicense in interface ILicense
Throws:
NoAvailableLicensesException

getAvailableLicenseCount

public long getAvailableLicenseCount()
See ILicense.getAvailableLicenseCount()

Specified by:
getAvailableLicenseCount in interface ILicense

getTotalLicenseCount

public long getTotalLicenseCount()
See ILicense.getTotalLicenseCount()

Specified by:
getTotalLicenseCount in interface ILicense

getLicenseTimeout

public long getLicenseTimeout()
See ILicense.getLicenseTimeout()

Specified by:
getLicenseTimeout in interface ILicense

releaseLicense

public boolean releaseLicense(byte[] token)
                       throws InvalidLicenseException
See ILicense.releaseLicense(byte[])

Specified by:
releaseLicense in interface ILicense
Throws:
InvalidLicenseException

resetLicenses

public void resetLicenses()
See ILicense.resetLicenses()

Specified by:
resetLicenses in interface ILicense

hasLicense

public boolean hasLicense(byte[] token)
See LicenseStore.hasLicense(byte[])

Specified by:
hasLicense in interface LicenseStore

enterMethod

public void enterMethod(byte[] token,
                        Principal p)
See LicenseStore#enterValid(byte[])

Specified by:
enterMethod in interface LicenseStore

exitMethod

public void exitMethod(byte[] token,
                       Principal p)
See LicenseStore#exitMethod(byte[])

Specified by:
exitMethod in interface LicenseStore


OmeroJava Api

Version: Beta-4.1.1-r5927-b91

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