All Downloads are FREE. Search and download functionalities are using the official Maven repository.

base.security.ResourceLookup Maven / Gradle / Ivy

/**
 * Creative commons Attribution-NonCommercial license.
 *
 * http://creativecommons.org/licenses/by-nc/2.5/au/deed.en_GB
 *
 * NO WARRANTY IS GIVEN OR IMPLIED, USE AT YOUR OWN RISK.
 */
package base.security;

import java.io.IOException;
import java.util.List;

import base.KeyValue;

public interface ResourceLookup {

	String getResourceType();

	/**
	 * Return the name of a resource associated with this resource UID.
	 *
	 * @param uid Unique identifier of a resource in string format
	 * @return KeyValue pair containing the uid and name of the requested resource, or null
	 */
	KeyValue lookup(String uid) throws IOException;

	/**
	 * The total number of resources of this type. This may be used to determine
	 * if these resources may fit in a dropdown list, or if a search interface may be required.
	 */
	long count() throws IOException;

	/**
	 * List the UID and name of all resources of this type. 
count()
should be called * first to ensure that this will not return too many objects. */ List list() throws IOException; /** * List the UID and name of each resource matching the provided search terms. * * @param keywords Filter the resources based on these keywords. * @return KeyValue pairs containing the uid and name of all resources matching the keywords */ List search(String keywords) throws IOException; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy