Class TOSService
- java.lang.Object
-
- fr.paris.lutece.plugins.termofservice.service.TOSService
-
public class TOSService extends java.lang.ObjectTOSService
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Optional<Entry>getCurrentEntry()Retrieves the current Terms of Service (TOS) entry.static java.util.Optional<UserAccepted>getUserAcceptedPublishedTOS(java.lang.String strGuid)Retrieves the Terms of Service (TOS) accepted by the specified user when the TOS publication feature is enabled.static java.util.Optional<UserAccepted>getUserAcceptedTOS(java.lang.String strGuid)Retrieves the Terms of Service (TOS) accepted by the specified user.
-
-
-
Method Detail
-
getUserAcceptedTOS
public static java.util.Optional<UserAccepted> getUserAcceptedTOS(java.lang.String strGuid)
Retrieves the Terms of Service (TOS) accepted by the specified user.If the TOS publication feature is enabled, this method returns the acceptance record associated with the currently published TOS. Otherwise, it returns the user's general TOS acceptance record.
- Parameters:
strGuid- the unique identifier of the user- Returns:
- an
Optionalcontaining theUserAcceptedobject if the user has accepted the TOS, or an emptyOptionalif no record is found
-
getUserAcceptedPublishedTOS
public static java.util.Optional<UserAccepted> getUserAcceptedPublishedTOS(java.lang.String strGuid)
Retrieves the Terms of Service (TOS) accepted by the specified user when the TOS publication feature is enabled.This method looks for the currently published TOS entry and returns the record of acceptance corresponding to that published version, if it exists.
- Parameters:
strGuid- the guid- Returns:
- an
Optionalcontaining theUserAcceptedobject if the user has accepted the published TOS, or an emptyOptionalif no record is found
-
getCurrentEntry
public static java.util.Optional<Entry> getCurrentEntry()
Retrieves the current Terms of Service (TOS) entry.If the TOS publication feature is enabled, this method returns the currently published entry. Otherwise, it returns the last available version.
- Returns:
- an
Optionalcontaining the currentEntryif found, or an emptyOptionalotherwise
-
-