Class Notifications
java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.Notifications
- All Implemented Interfaces:
NewerNewStyleService
,STService
This class provides access to the capabilities of MAPLE
(Mapping Architecture based on Linguistic Evidences).
-
Field Summary
Fields inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
applicationEventPublisher, cfManager, exptManager, stServiceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Returns the available time zone identifiers.isWatching
(org.eclipse.rdf4j.model.Resource resource) Returns true if the user has enabled notifications on the given resource, false otherwisecom.fasterxml.jackson.databind.JsonNode
List<org.eclipse.rdf4j.model.Resource>
Returns all the resources for which the current user has enabled notificationsvoid
Schedules the sending of notifications digests.void
startWatching
(org.eclipse.rdf4j.model.Resource resource) Enables notifications on a resourcevoid
stopWatching
(org.eclipse.rdf4j.model.Resource resource) Disables notifications on a resourcevoid
storeNotificationPreferences
(Map<RDFResourceRole, List<NotificationPreferencesAPI.Action>> preferences) Updates the notification status on the role-action pairsvoid
updateNotificationPreferences
(RDFResourceRole role, NotificationPreferencesAPI.Action action, boolean status) Enables or disables the notification on a role-action pairMethods inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
addValue, checkNotLocallyDefined, createQueryBuilder, generateIRI, generateNatureSPARQLSelectPart, generateNatureSPARQLWherePart, generateResourceWithCustomConstructor, getCodaLexModeForSearchFromLexicalizationModel, getDeleteGraph, getGraphFromNature, getInitializedCodaCore, getManagedConnection, getMetadataGraph, getOptionalProject, getPlatformTransactionManager, getProject, getRepository, getRoleFromNature, getUserNamedGraphs, getWorkingGraph, instantiateSearchStrategy, instantiateSearchStrategy, parseReference, publishResourceDeleted, publishResourceDeleted, removeReifiedValue, retrieveResources, shutDownCodaCore, updateTriplePredicate
-
Constructor Details
-
Notifications
public Notifications()
-
-
Method Details
-
scheduleNotificationDigest
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void scheduleNotificationDigest(@Optional @JsonSerialized @Valid NotificationSystemSettings.CronDefinition schedule) throws STPropertyUpdateException Schedules the sending of notifications digests. The providedschedule
combines a cron expression (compliant with Spring flavor) and and optional time zone id. If schedule is omitted, notifications digests are disabled.- Parameters:
schedule
-- Throws:
STPropertyUpdateException
- See Also:
-
getAvailableTimeZoneIds
Returns the available time zone identifiers.- Returns:
-
startWatching
@STServiceOperation(method=POST) public void startWatching(org.eclipse.rdf4j.model.Resource resource) throws IOException, InterruptedException Enables notifications on a resource- Parameters:
resource
-- Throws:
IOException
InterruptedException
-
stopWatching
@STServiceOperation(method=POST) public void stopWatching(org.eclipse.rdf4j.model.Resource resource) throws IOException, InterruptedException Disables notifications on a resource- Parameters:
resource
-- Throws:
IOException
InterruptedException
-
listWatching
Returns all the resources for which the current user has enabled notifications- Returns:
- Throws:
IOException
-
isWatching
@STServiceOperation public Boolean isWatching(org.eclipse.rdf4j.model.Resource resource) throws IOException Returns true if the user has enabled notifications on the given resource, false otherwise- Parameters:
resource
-- Returns:
- Throws:
IOException
-
getNotificationPreferences
@STServiceOperation public Map<RDFResourceRole,List<NotificationPreferencesAPI.Action>> getNotificationPreferences() throws IOException- Throws:
IOException
-
storeNotificationPreferences
@STServiceOperation(method=POST) public void storeNotificationPreferences(@JsonSerialized Map<RDFResourceRole, List<NotificationPreferencesAPI.Action>> preferences) throws IOException, InterruptedExceptionUpdates the notification status on the role-action pairs- Parameters:
preferences
- for each role lists the actions for which notifications are enabled- Throws:
IOException
InterruptedException
-
updateNotificationPreferences
@STServiceOperation(method=POST) public void updateNotificationPreferences(RDFResourceRole role, NotificationPreferencesAPI.Action action, boolean status) throws IOException, InterruptedException Enables or disables the notification on a role-action pair- Parameters:
role
-action
-status
-- Throws:
IOException
InterruptedException
-
listNotifications
@STServiceOperation public com.fasterxml.jackson.databind.JsonNode listNotifications() throws IOException- Throws:
IOException
-
clearNotifications
@STServiceOperation(method=POST) public void clearNotifications() throws IOException, InterruptedException- Throws:
IOException
InterruptedException
-