com.rapidclipse.framework.security.authorization.ResourceProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rap-security-auth Show documentation
Show all versions of rap-security-auth Show documentation
Rapid Application Platform / Security / Authentication and Authorization
/*
* Copyright (C) 2013-2023 by XDEV Software, All Rights Reserved.
*
* This file is part of the RapidClipse Application Platform (RAP).
*
* This program 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.
*
* This program 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 .
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* Contributors:
* XDEV Software - initial API and implementation
*/
package com.rapidclipse.framework.security.authorization;
import java.util.Set;
/**
* Function type that provides {@link Resource} instances.
* For details, see {@link #provideResource(Resource, String, Set)}.
*
* @author XDEV Software (TM)
*/
@FunctionalInterface
public interface ResourceProvider
{
/**
* Provides a suitable {@link Resource} instance based on the passed resource name, a potentially already
* existing instance and the collection of names of children (possibly empty).
* Providing means either validating an already existing instance or creating a fitting new instance.
*
* @param existingInstance
* the potentially already existing {@link Resource} instance for the passed name.
* @param factor
* the factor of the access to the passed {@link Resource} instance.
*
* @return a new {@link Resource} instance that satisfies the specified values.
*/
public Resource provideResource(Resource existingInstance, String name, Set children);
}