Package net.shibboleth.shared.primitive

# Class DeprecationSupport

java.lang.Object
net.shibboleth.shared.primitive.DeprecationSupport

public final class DeprecationSupport extends Object
Helper methods for reporting usage of deprecated features.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`DeprecationSupport.ObjectType`
Type of object, setting, feature, etc.

## Field Summary

Fields
Modifier and Type
Field
Description
`private static final Set<String>`
`AT_RISK_SET`
Tracks issued at-risks.
`private static final org.slf4j.Logger`
`LOG`
Class logger.
`static final String`
`LOG_CATEGORY`
Log category name for warnings.
`private static final Set<String>`
`WARNED_SET`
Tracks issued warnings.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`private`
`DeprecationSupport()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`static void`
`atRisk(DeprecationSupport.ObjectType type, String name, String context)`
Emit an at-risk warning for an object or feature of the system.
`static void`
`atRiskOnce(DeprecationSupport.ObjectType type, String name, String context)`
Emit a deprecation warning for an object or feature of the system but limit to a single warning for the life of the process or until state is cleared.
`static void`
`clearAtRiskState()`
Clear the previously at-risk state.
`static void`
`clearWarningState()`
Clear the previously warned state.
`static void`
`warn(DeprecationSupport.ObjectType type, String name, String context, String replacement)`
Emit a deprecation warning for an object or feature of the system.
`static void`
`warnOnce(DeprecationSupport.ObjectType type, String name, String context, String replacement)`
Emit a deprecation warning for an object or feature of the system but limit to a single warning for the life of the process or until state is cleared.

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

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

## Field Details

### LOG_CATEGORY

@Nonnull @NotEmpty public static final String LOG_CATEGORY
Log category name for warnings.

See Also:
  - Constant Field Values

### LOG

@Nonnull private static final org.slf4j.Logger LOG
Class logger.

### WARNED_SET

@Nonnull private static final Set<String> WARNED_SET
Tracks issued warnings.

### AT_RISK_SET

@Nonnull private static final Set<String> AT_RISK_SET
Tracks issued at-risks.

## Constructor Details

### DeprecationSupport

private DeprecationSupport()
Constructor.

## Method Details

### warn

public static void warn(@Nonnull DeprecationSupport.ObjectType type, @Nonnull @NotEmpty String name, @Nullable String context, @Nullable String replacement)
Emit a deprecation warning for an object or feature of the system.

Parameters:
  `type` - type of object or feature
  `name` - name of object or feature
  `context` - surrounding context for deprecation warning
  `replacement` - the replacement for the deprecated feature

### warnOnce

public static void warnOnce(@Nonnull DeprecationSupport.ObjectType type, @Nonnull @NotEmpty String name, @Nullable String context, @Nullable String replacement)
Emit a deprecation warning for an object or feature of the system but limit to a single warning for the life of the process or until state is cleared.

Parameters:
  `type` - type of object or feature
  `name` - name of object or feature
  `context` - surrounding context for deprecation warning
  `replacement` - the replacement for the deprecated feature

### atRisk

public static void atRisk(@Nonnull DeprecationSupport.ObjectType type, @Nonnull @NotEmpty String name, @Nullable String context)
Emit an at-risk warning for an object or feature of the system.

Parameters:
  `type` - type of object or feature
  `name` - name of object or feature
  `context` - surrounding context for at-risk warning
Since:
  4.3.0

### atRiskOnce

public static void atRiskOnce(@Nonnull DeprecationSupport.ObjectType type, @Nonnull @NotEmpty String name, @Nullable String context)
Emit a deprecation warning for an object or feature of the system but limit to a single warning for the life of the process or until state is cleared.

Parameters:
  `type` - type of object or feature
  `name` - name of object or feature
  `context` - surrounding context for deprecation warning
Since:
  4.3.0

### clearWarningState

public static void clearWarningState()
Clear the previously warned state.

### clearAtRiskState

public static void clearAtRiskState()
Clear the previously at-risk state.

Since:
  4.3.0