[java-shib-profile] branch main updated: Add getter for metric name for override by subclasses.
Scott Cantor
cantor.2 at osu.edu
Tue May 14 14:00:16 UTC 2024
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-shib-profile.
View the commit online:
http://git.shibboleth.net/view/?p=java-shib-profile.git;a=commit;h=3837a603baca77b35dad6be3e9e204a85a3a97ba
The following commit(s) were added to refs/heads/main by this push:
new 3837a60 Add getter for metric name for override by subclasses.
3837a60 is described below
commit 3837a603baca77b35dad6be3e9e204a85a3a97ba
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue May 14 10:00:13 2024 -0400
Add getter for metric name for override by subclasses.
---
.../impl/DefaultRelyingPartyConfigurationResolver.java | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/shib-profile-impl/src/main/java/net/shibboleth/profile/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java b/shib-profile-impl/src/main/java/net/shibboleth/profile/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java
index 06494c9..0d3399d 100644
--- a/shib-profile-impl/src/main/java/net/shibboleth/profile/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java
+++ b/shib-profile-impl/src/main/java/net/shibboleth/profile/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java
@@ -188,6 +188,17 @@ public class DefaultRelyingPartyConfigurationResolver extends AbstractIdentifiab
unverifiedConfiguration = configuration;
}
+ /**
+ * Gets the metric name to use to use for counters to track use of configurations.
+ *
+ * @return name for counter metrics
+ *
+ * @since 5.1.3
+ */
+ @Nullable public String getMetricName() {
+ return metricName;
+ }
+
/**
* Set name of metric to use for counters to track use of configurations.
*
@@ -218,7 +229,7 @@ public class DefaultRelyingPartyConfigurationResolver extends AbstractIdentifiab
configIds.add(DEFAULT_RELYING_PARTY_COUNTER);
configIds.add(UNVERIFIED_RELYING_PARTY_COUNTER);
- final String localMetricName = metricName;
+ final String localMetricName = getMetricName();
if (localMetricName != null && !configIds.isEmpty()) {
// Build map of config IDs to counters.
counterMap = configIds.stream().collect(
@@ -238,8 +249,9 @@ public class DefaultRelyingPartyConfigurationResolver extends AbstractIdentifiab
/** {@inheritDoc} */
@Override protected void doDestroy() {
- if (metricName != null && counterGauge != null) {
- MetricsSupport.remove(metricName, counterGauge);
+ final String localMetricName = getMetricName();
+ if (localMetricName != null && counterGauge != null) {
+ MetricsSupport.remove(localMetricName, counterGauge);
}
super.doDestroy();
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list