Scope Service Provider Interface (SPI) Java API

The following is the Java API of the scope (token) service provider interface:

/**
 * ScopeAdapter is the interface use by OpenID Provider to retrieve client's
 * scope and scope for a specific resource for a user.
 *
*/
public interface ScopeAdapter
{
	/**
	 * This method is called when the instance of the adapter is first loaded.
	 * The properties is a map of properties from SecurityRuntime.cfg.
	 * The adapter may initialize itself using these properties.
	 *
	 * @param properties a map of properties from SecurityRuntime.cfg.
	 */
	public void init(Map<String, String> properties);
	/**
	 * Returns descriptions for specified scopes
	 *
	 * @param scopes the scopes to retrieve the descriptons for.
	 * @return the descriptions for specified scopes
	 * @throws AdapterException an exception if failed to retrieve the scopes' descriptions.
	 */
	public String[] getDescriptions(String[] scopes)
		throws AdapterException;
	/**
	 * Retrieve scopes for the resource a specified owner.
	 *
	 * @param owner the owner to resource.
	 * @param resource the resource for the scope to retrieve.
	 * @param resourceAttributes attributes of the resources
	 * @return scopes for the resource a specified owner.
	 * @throws AdapterException an exception if failed to retrieve the scopes of
	 *            the resource.
	 */
	public String[] getResourceScopes(String owner, String resource, Map<String, String> resourceAttributes)
		throws AdapterException;
}