/*
* Copyright (c) 2023 Vaughn Nugent
*
* Library: VNLib
* Package: VNLib.Plugins.Essentials
* File: IVirtualEndpointTable.cs
*
* IVirtualEndpointTable.cs is part of VNLib.Plugins.Essentials which is part
* of the larger VNLib collection of libraries and utilities.
*
* VNLib.Plugins.Essentials is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* VNLib.Plugins.Essentials is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
using System;
using System.Diagnostics.CodeAnalysis;
using VNLib.Plugins.Essentials.Endpoints;
namespace VNLib.Plugins.Essentials
{
///
/// Represents a table of virtual endpoints that can be used to process incoming connections
///
public interface IVirtualEndpointTable
{
///
/// Determines the endpoint type(s) and adds them to the endpoint store(s) as necessary
///
/// Params array of endpoints to add to the store
///
///
void AddEndpoint(params IEndpoint[] endpoints);
///
/// Removes the specified endpoint from the virtual endpoint store
///
/// A collection of endpoints to remove from the table
void RemoveEndpoint(params IEndpoint[] eps);
///
/// Stops listening for connections to the specified identified by its path
///
/// An array of endpoint paths to remove from the table
///
///
///
void RemoveEndpoint(params string[] paths);
///
/// A value that indicates whether the table is empty, allows for quick checks
/// without causing lookups
///
bool IsEmpty { get; }
///
/// Attempts to get the endpoint associated with the specified path
///
/// The connection path to recover the endpoint from
///
///
bool TryGetEndpoint(string path, [NotNullWhen(true)] out IVirtualEndpoint? endpoint);
}
}