NAME
Kernel::System::SystemContract – System Contract Library
PUBLIC INTERFACE
new()
create an object. Do not use it directly, instead use:
use Kernel::System::ObjectManager;
local $Kernel::OM = Kernel::System::ObjectManager->new();
my $SystemContractObject = $Kernel::OM->Get('Kernel::System::SystemContract');
SystemRequiresContract()
Checks if this system requires a contract.
my $SystemRequiresContract = $SystemContractObject->SystemRequiresContract();
OTRSSTORMIsInstalled()
checks if OTRSStorm is installed in the current system. That does not necessarily mean that it is also active, for example if the package is only on the database but not on the file system.
OTRSCONTROLIsInstalled()
checks if OTRSControl is installed in the current system. That does not necessarily mean that it is also active, for example if the package is only on the database but not on the file system.
ContractStatusCheck()
determines the contract status of this system as reported by cloud.otrs.com
and stores it in the system_data cache.
Returns 1 if the cloud call was successful.
ContractStatus()
Returns the current entitlement status.
my $Status = $SystemContractObject->ContractStatus(
CallCloudService => 1, # 0 or 1, call the cloud service before looking at the cache
);
$Status = 'entitled'; # everything is OK
$Status = 'warning'; # last check was OK, and we are in the waiting period - show warning
$Status = 'warning-error'; # last check was OK, and we are past waiting period - show error message
$Status = 'forbidden'; # not entitled (either because the server said so or because the last check was too long ago)
ContractExpiryDateCheck()
checks for the warning period before the contract expires
my $ExpiryDate = $SystemContractObject->ContractExpiryDateCheck();
returns the ExpiryDate if a warning should be displayed
$ExpiryDate = undef; # everything is OK, no warning
$ExpiryDate = '2012-12-12 12:12:12' # contract is about to expire, issue warning
ContractStatusCheckNextUpdateTimeSet()
Set the contract status check next update time.
my $Success = $SystemContractObject->ContractStatusCheckNextUpdateTimeSet();
Returns 1 if the next update time was set successfully.
PRIVATE INTERFACE
_GetSTORMPackageFromRepository()
check get c<OTRSSTORM> package meta-data from the local repository
my $Package = RegistrationObject->_GetSTORMPackageFromRepository();
returns:
$Package = $PackageHashRef; # or false in case of failure or if its not installed
_GetCONTROLPackageFromRepository()
check get c<OTRSCONTROL> package meta-data from the local repository
my $Package = RegistrationObject->_GetCONTROLPackageFromRepository();
returns:
$Package = $PackageHashRef; # or false in case of failure or if its not installed
_HandleContractStatusCheckCloudServiceResult()
Saves the result of and entitlement check cloud service call in the local system data
my $Success = SystemContractObject->_HandleContractStatusCheckCloudServiceResult(
);
returns:
$Success = 1; # or false in case of failure