From 3642a32ab3c704ee3596d41d57ed6e5abb865579 Mon Sep 17 00:00:00 2001 From: Joseph Cosentino Date: Fri, 28 Jun 2024 16:20:46 -0700 Subject: [PATCH] chore: javadocs --- .../configuration/RuntimeConfiguration.java | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/aws/greengrass/clientdevices/auth/configuration/RuntimeConfiguration.java b/src/main/java/com/aws/greengrass/clientdevices/auth/configuration/RuntimeConfiguration.java index c6c6720bd..1ef85e5c6 100644 --- a/src/main/java/com/aws/greengrass/clientdevices/auth/configuration/RuntimeConfiguration.java +++ b/src/main/java/com/aws/greengrass/clientdevices/auth/configuration/RuntimeConfiguration.java @@ -62,8 +62,8 @@ * | |---- k:v * | |---- "l": lastUpdated * | |---- "hostAddresses": - * |---- : - * |---- [...] + * |---- : + * |---- [...] *

*/ public final class RuntimeConfiguration { @@ -229,12 +229,22 @@ public void removeCertificateV1(String certificateId) { } } + /** + * Persist thing association dto. + * + * @param dto dto + */ public void putThingAssociationV1(ThingAssociationV1DTO dto) { Topics t = getOrRepairTopics(config, ASSOCIATIONS_KEY, ASSOCIATIONS_V1); t.lookup(ASSOCIATIONS_PROP_KEY).withValue(new ArrayList<>(dto.getAssociatedThingNames())); t.lookup(LAST_UPDATED_KEY).withValue(dto.getLastUpdated().toEpochSecond(ZoneOffset.UTC)); } + /** + * Get things associated with the core device. + * + * @return dto + */ public Optional getThingAssociationV1() { Topics t = config.findTopics(ASSOCIATIONS_KEY, ASSOCIATIONS_V1); if (t == null) { @@ -256,6 +266,11 @@ public Optional getThingAssociationV1() { return Optional.of(new ThingAssociationV1DTO(thingNames, lastFetched)); } + /** + * Persist thing description dto. + * + * @param dto dto + */ public void putThingDescriptionV1(ThingDescriptionV1DTO dto) { Topics t = getOrRepairTopics(config, DESCRIPTION_KEY, DESCRIPTION_V1, dto.getThingName()); t.lookup(LAST_UPDATED_KEY).withValue(dto.getLastUpdated().toEpochSecond(ZoneOffset.UTC)); @@ -263,6 +278,12 @@ public void putThingDescriptionV1(ThingDescriptionV1DTO dto) { getOrRepairTopics(t, ATTRIBUTES_PROP_KEY).replaceAndWait(attrs); } + /** + * Get cached IoT describe-thing response. Currently, we only care about the attributes field. + * + * @param thingName thing name + * @return dto + */ public Optional getThingDescriptionV1(String thingName) { Topics t = config.findTopics(DESCRIPTION_KEY, DESCRIPTION_V1, thingName); if (t == null) { @@ -340,8 +361,8 @@ public Stream getAllCertificatesV1() { /** * Put hostAddresses config. * - * @param source connectivity information source - * @param hostAddresses host addresses + * @param source connectivity information source + * @param hostAddresses host addresses */ public void putHostAddressForSource(String source, Set hostAddresses) { config.lookup(HOST_ADDRESSES_KEY, source)