Copyright (C) 2024 Hedera Hashgraph, LLC

Licensed under the Apache License, Version 2.0 (the ""License""); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an ""AS IS"" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

interface LeaseRenewalService {
    calculateRenewalDelay(lease: Lease): Duration;
    cancel(scheduleId: number): Promise<boolean>;
    cancelAll(): Promise<Map<number, boolean>>;
    isScheduled(scheduleId: number): Promise<boolean>;
    schedule(lease: Lease): Promise<number>;
}

Implemented by

Methods

  • Cancels a scheduled lease renewal.

    Parameters

    • scheduleId: number

      the unique identifier of the scheduled lease renewal.

    Returns Promise<boolean>

    true if the lease renewal was successfully cancelled; false otherwise.

  • Cancels all scheduled lease renewals.

    Returns Promise<Map<number, boolean>>

    a map of the unique identifiers of the scheduled lease renewals and their cancellation status.

  • Determines if a lease renewal is scheduled.

    Parameters

    • scheduleId: number

      the unique identifier of the scheduled lease renewal.

    Returns Promise<boolean>

    true if the lease renewal is scheduled; false otherwise.

  • Schedules a lease renewal.

    Parameters

    • lease: Lease

      the lease to be renewed.

    Returns Promise<number>

    the unique identifier of the scheduled lease renewal.