diff --git a/lib/partition.ts b/lib/partition.ts index ca273e5..4001f9c 100644 --- a/lib/partition.ts +++ b/lib/partition.ts @@ -1,3 +1,5 @@ +/* Copyright (c) 2024. SailPoint Technologies, Inc. All rights reserved. */ + export class Partition { public name: string public size: number diff --git a/lib/partitionAdapter.ts b/lib/partitionAdapter.ts index bae54f5..8230c34 100644 --- a/lib/partitionAdapter.ts +++ b/lib/partitionAdapter.ts @@ -1,24 +1,33 @@ +/* Copyright (c) 2024. SailPoint Technologies, Inc. All rights reserved. */ + import { Context, readConfig, Response, StdAccountListInput, StdAccountListOutput } from "."; import { Partition } from "./partition"; -export interface PartitionedAdapter { +export interface PartitionAdapter { getPartitions(context: Context, input: StdAccountListInput): Promise> list(context: Context, input: StdAccountListInput, res: Response, partition?: Partition): Promise } -export class Partitioned { +export class PartitionHandler { public partitionAdapter; - constructor(partitionAdapter: PartitionedAdapter) { + constructor(partitionAdapter: PartitionAdapter) { this.partitionAdapter = partitionAdapter; } + /** + * Handles partitioning operation for the connector which supports the partitioning. + * + * @param context Context + * @param input StdAccountListInput + * @param res Response + */ async handler(context: Context, input: StdAccountListInput, res: Response): Promise { const config = await readConfig(); const isPatitionEnabled = config.partitionAggregationEnabled; var partitionList: Array | undefined; - // Get the partitions from the connector + // Get the partitions from the connector if partitining is enabled if (isPatitionEnabled) { partitionList = await this.partitionAdapter.getPartitions(context, input); }