Package org.cyclos.impl.system
Class LicenseHandlerImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractGlobalServerComponent
-
- org.cyclos.impl.BaseGlobalHandlerImpl
-
- org.cyclos.impl.system.LicenseHandlerImpl
-
- All Implemented Interfaces:
InstanceHandler,LicenseHandler,LicenseHandlerImplementor
@Component public class LicenseHandlerImpl extends BaseGlobalHandlerImpl implements LicenseHandlerImplementor, InstanceHandler
Implementation forLicenseHandler
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractGlobalServerComponent
rawEntityManagerHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler
-
-
Constructor Summary
Constructors Constructor Description LicenseHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(org.cyclos.license.api.model.LicenseActivationParameters params)Activates a license for this Cyclos instancevoidcheckUserRegistration()Checks whether a new user can be created, returning normally if so, or throwing aValidationExceptionotherwiseorg.cyclos.license.api.model.LicenseDetailsgetDetails()Returns the current license detailsbyte[]getEncryptionKey()Returns the key used for license encryptionDategetLastUpdate()Returns the last time a license was updatedvoidinitialize()booleanisSet()Returns whether there's a license set in this cyclos instancevoidofflineUpdate(SerializableInputStream in)Perform the offline license updatevoidonlineUpdate()Perform the online license updatebooleanonlineUpdateIfNeeded()Perform the online license update if the current license doesn't allow offline updates and if the last update was less than a week agovoidreportInconsistentBalance(BalanceInconsistencyParameters inconsistencies)Reports a balance inconsistency to the license server-
Methods inherited from class org.cyclos.impl.AbstractGlobalServerComponent
getBaseEntityManagerHandler, getEntityManager
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, delete, detach, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
activate
public void activate(org.cyclos.license.api.model.LicenseActivationParameters params)
Description copied from interface:LicenseHandlerActivates a license for this Cyclos instance- Specified by:
activatein interfaceLicenseHandler
-
checkUserRegistration
public void checkUserRegistration()
Description copied from interface:LicenseHandlerChecks whether a new user can be created, returning normally if so, or throwing aValidationExceptionotherwise- Specified by:
checkUserRegistrationin interfaceLicenseHandler
-
getDetails
public org.cyclos.license.api.model.LicenseDetails getDetails()
Description copied from interface:LicenseHandlerReturns the current license details- Specified by:
getDetailsin interfaceLicenseHandler
-
getEncryptionKey
public byte[] getEncryptionKey()
Description copied from interface:LicenseHandlerImplementorReturns the key used for license encryption- Specified by:
getEncryptionKeyin interfaceLicenseHandlerImplementor
-
getLastUpdate
public Date getLastUpdate()
Description copied from interface:InstanceHandlerReturns the last time a license was updated- Specified by:
getLastUpdatein interfaceInstanceHandler
-
initialize
@PostConstruct public void initialize()
-
isSet
public boolean isSet()
Description copied from interface:LicenseHandlerReturns whether there's a license set in this cyclos instance- Specified by:
isSetin interfaceLicenseHandler
-
offlineUpdate
public void offlineUpdate(SerializableInputStream in)
Description copied from interface:InstanceHandlerPerform the offline license update- Specified by:
offlineUpdatein interfaceInstanceHandler
-
onlineUpdate
public void onlineUpdate()
Description copied from interface:InstanceHandlerPerform the online license update- Specified by:
onlineUpdatein interfaceInstanceHandler
-
onlineUpdateIfNeeded
public boolean onlineUpdateIfNeeded()
Description copied from interface:InstanceHandlerPerform the online license update if the current license doesn't allow offline updates and if the last update was less than a week ago- Specified by:
onlineUpdateIfNeededin interfaceInstanceHandler
-
reportInconsistentBalance
public void reportInconsistentBalance(BalanceInconsistencyParameters inconsistencies) throws LicenseServerOfflineException
Description copied from interface:LicenseHandlerReports a balance inconsistency to the license server- Specified by:
reportInconsistentBalancein interfaceLicenseHandler- Throws:
LicenseServerOfflineException
-
-