@citrineos/configuration
Version:
The configuration module for OCPP v2.0.1. This module is not intended to be used directly, but rather as a dependency for other modules.
55 lines (54 loc) • 3.29 kB
TypeScript
import { Boot, IBootRepository } from '@citrineos/data';
import { BootConfig, ICache, IMessageConfirmation, OCPP2_0_1, OCPP1_6, SystemConfig } from '@citrineos/base';
import { ILogObj, Logger } from 'tslog';
type Configuration = SystemConfig['modules']['configuration'];
export declare class BootNotificationService {
protected _bootRepository: IBootRepository;
protected _cache: ICache;
protected _logger: Logger<ILogObj>;
protected _config: Configuration;
constructor(bootRepository: IBootRepository, cache: ICache, config: Configuration, logger?: Logger<ILogObj>);
determineBootStatus(bootConfig: Boot | undefined): OCPP2_0_1.RegistrationStatusEnumType;
createBootNotificationResponse(stationId: string): Promise<OCPP2_0_1.BootNotificationResponse>;
updateBootConfig(bootNotificationResponse: OCPP2_0_1.BootNotificationResponse, stationId: string): Promise<Boot>;
/**
* Determines whether to blacklist or whitelist charger actions based on its boot status.
*
* If the new boot is accepted and the charger actions were previously blacklisted, then whitelist the charger actions.
* If the new boot is not accepted and charger actions were previously whitelisted, then blacklist the charger actions.
*
* @param stationId
* @param cachedBootStatus
* @param bootNotificationResponseStatus
*/
cacheChargerActionsPermissions(stationId: string, cachedBootStatus: OCPP2_0_1.RegistrationStatusEnumType | null, bootNotificationResponseStatus: OCPP2_0_1.RegistrationStatusEnumType): Promise<void>;
createGetBaseReportRequest(stationId: string, maxCachingSeconds: number): Promise<OCPP2_0_1.GetBaseReportRequest>;
/**
* Based on the GetBaseReportMessageConfirmation, checks the cache to ensure GetBaseReport truly succeeded.
* If GetBaseReport did not succeed, this method will throw. Otherwise, it will finish without throwing.
*
* @param stationId
* @param requestId
* @param getBaseReportMessageConfirmation
* @param maxCachingSeconds
*/
confirmGetBaseReportSuccess(stationId: string, requestId: string, getBaseReportMessageConfirmation: IMessageConfirmation, maxCachingSeconds: number): Promise<void>;
/**
* Methods for OCPP 1.6
*/
determineOcpp16BootStatus(bootConfig: BootConfig | undefined): OCPP1_6.BootNotificationResponseStatus;
createOcpp16BootNotificationResponse(stationId: string): Promise<OCPP1_6.BootNotificationResponse>;
/**
* Determines whether to blacklist or whitelist charger actions based on its boot status.
*
* If the new boot is accepted and the charger actions were previously blacklisted, then whitelist the charger actions.
* If the new boot is not accepted and charger actions were previously whitelisted, then blacklist the charger actions.
*
* @param stationId
* @param cachedBootStatus
* @param bootNotificationResponseStatus
*/
cacheOcpp16ChargerActionsPermissions(stationId: string, cachedBootStatus: OCPP1_6.BootNotificationResponseStatus | null, bootNotificationResponseStatus: OCPP1_6.BootNotificationResponseStatus): Promise<void>;
updateOcpp16BootConfig(response: OCPP1_6.BootNotificationResponse, stationId: string): Promise<Boot>;
}
export {};