Package net.shibboleth.idp.cas.service

# Class PatternServiceRegistry

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.cas.service.PatternServiceRegistry

All Implemented Interfaces:
  `ServiceRegistry`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`

public class PatternServiceRegistry extends AbstractIdentifiableInitializableComponent implements ServiceRegistry
Service registry that evaluates a candidate service URL against one or more defined services, where each definition contains a service URL regular expression pattern.

NOTE: This class will become an implementation component in the next major software version.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Map<ServiceDefinition,Pattern>`
`definitions`
Map of service definitions to compiled patterns.
`private final org.slf4j.Logger`
`log`
Class logger.

## Constructor Summary

Constructors
Constructor
Description
`PatternServiceRegistry()`

## Method Summary

Modifier and Type
Method
Description
`Service`
`lookup(String serviceURL)`
Looks up a service entry from a service URL.
`void`
`setDefinitions(List<ServiceDefinition> serviceDefinitions)`
Sets the list of service definitions that back the registry.

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`doInitialize, ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### definitions

@Nonnull private Map<ServiceDefinition,Pattern> definitions
Map of service definitions to compiled patterns.

## Constructor Details

### PatternServiceRegistry

public PatternServiceRegistry()

## Method Details

### setDefinitions

public void setDefinitions(@Nonnull List<ServiceDefinition> serviceDefinitions)
Sets the list of service definitions that back the registry.

Parameters:
  `serviceDefinitions` - List of service definitions, each of which defines a match pattern to evaluate a candidate service URL.

### lookup

@Nullable public Service lookup(@Nonnull String serviceURL)
Looks up a service entry from a service URL.

Specified by:
  `lookup` in interface `ServiceRegistry`
Parameters:
  `serviceURL` - Non-null CAS service URL.
Returns:
  Service found in registry or null if no match found.