Documentation

Resolver
in package

Resolves an URI being defined as an identifier of a repository object to the proper dissemination method.

Tags
author

zozlak

Table of Contents

Constants

FORMAT_LIST_SERVICES  = '__list__'

Properties

$debug  : bool
$config  : object
$log  : Log

Methods

__construct()  : mixed
resolve()  : void
Performs the resolution
checkAccessRights()  : void
Checks if a client is able to access a given URI.
checkFastTrack()  : bool
Checks a fast resolution track "match on mime and appent a suffix to the resource URL".
findDissService()  : ServiceInterface|null
findResource()  : RepoResourceInterface
Finds a repository resource which corresponds to a given URI
getResourceId()  : string
Returns id of a resource to be resolved (based on the HTTP request).
listDissServices()  : void
redirect()  : void
sanitizeAcceptHeader()  : string
Sanitizes requested output format by applying following rules: - `format` request query parameter overwrites whole HTTP Accept header - the wildcard is turned into the default dissemination service - for a CMDI requests format mappings defined in cfg.resolver.cmdi.formatMappings are applied

Constants

FORMAT_LIST_SERVICES

public mixed FORMAT_LIST_SERVICES = '__list__'

Properties

$debug

public static bool $debug = false

Methods

__construct()

public __construct(object $config) : mixed
Parameters
$config : object

resolve()

Performs the resolution

public resolve() : void

checkAccessRights()

Checks if a client is able to access a given URI.

private checkAccessRights(string $uri) : void
Parameters
$uri : string

URI to be checked

Tags
throws
AccessRightsException
throws
RequestException

checkFastTrack()

Checks a fast resolution track "match on mime and appent a suffix to the resource URL".

private checkFastTrack(RepoResourceInterface $res) : bool

The list of {mime type, URL suffix} pairs is read from the config.

Parameters
$res : RepoResourceInterface

repository resource to be disseminated

Return values
bool

findResource()

Finds a repository resource which corresponds to a given URI

private findResource(string $resId) : RepoResourceInterface
Parameters
$resId : string

URI to be mapped to a repository resource

Tags
throws
RuntimeException
Return values
RepoResourceInterface

getResourceId()

Returns id of a resource to be resolved (based on the HTTP request).

private getResourceId() : string
Return values
string

redirect()

private redirect(string $url) : void
Parameters
$url : string

sanitizeAcceptHeader()

Sanitizes requested output format by applying following rules: - `format` request query parameter overwrites whole HTTP Accept header - the wildcard is turned into the default dissemination service - for a CMDI requests format mappings defined in cfg.resolver.cmdi.formatMappings are applied

private sanitizeAcceptHeader(bool $isCmdi) : string
Parameters
$isCmdi : bool

is CMDI id requested?

Return values
string

sanitized Accept header value


        
On this page

Search results