Class CustomServices
java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.CustomServices
- All Implemented Interfaces:
NewerNewStyleService
,STService
-
Field Summary
Fields inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
applicationEventPublisher, cfManager, exptManager, stServiceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOperationToCustomService
(String id, com.fasterxml.jackson.databind.node.ObjectNode operationDefinition) Adds an operation to a given custom service (identified by the id of its associated configuration).void
createCustomService
(String id, com.fasterxml.jackson.databind.node.ObjectNode definition) Creates a custom service given its definition and the id of the configuration file used for persisting the definition.void
Deletes a custom service given the id of its associated configuration fileReturns the definition of a custom service given the id of the associated configuration filegetCustomServiceId
(String name) Returns theid
of a custom service given its service name (i.e. the one occurring in the associated HTTP endpoint).Returns the identifiers of the configurations stored at system-level that define custom services.void
Reloads the custom service defined by the configuration identified by the given id.void
Reloads all custom services.void
removeOperationFromCustomService
(String id, String operationName) Removes an operation from a custom servicevoid
updateCustomService
(String id, com.fasterxml.jackson.databind.node.ObjectNode definition) Updates a custom service given its definition and the id of the configuration file used for persisting the definition.void
updateOperationInCustomService
(String id, com.fasterxml.jackson.databind.node.ObjectNode operationDefinition, String oldOperationName) Update an operation associated with a given custom service (identified by the id of its associated configuration).Methods 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
-
CustomServices
public CustomServices()
-
-
Method Details
-
getCustomServiceIdentifiers
@PreAuthorize("@auth.isAuthorized(\'customService(service)\', \'R\')") @STServiceOperation public Collection<String> getCustomServiceIdentifiers()Returns the identifiers of the configurations stored at system-level that define custom services.- Returns:
- See Also:
-
getCustomServiceId
@PreAuthorize("@auth.isAuthorized(\'customService(service)\', \'R\')") @STServiceOperation public String getCustomServiceId(String name) Returns theid
of a custom service given its service name (i.e. the one occurring in the associated HTTP endpoint).- Parameters:
name
-- Returns:
-
createCustomService
@PreAuthorize("@auth.isAuthorized(\'customService(service)\', \'C\')") @STServiceOperation(method=POST) public void createCustomService(String id, com.fasterxml.jackson.databind.node.ObjectNode definition) throws IOException, WrongPropertiesException, STPropertyUpdateException, STPropertyAccessException, InstantiationException, IllegalAccessException, SchemaException, IllegalArgumentException, NoSuchExtensionException, InvalidConfigurationException, CustomServiceException Creates a custom service given its definition and the id of the configuration file used for persisting the definition.The definition shall be the JSON serialization of a
CustomService
configuration object. Currently, the sole mandatory part of the definition is the service name.- Parameters:
id
-definition
-- Throws:
NoSuchConfigurationManager
STPropertyAccessException
STPropertyUpdateException
WrongPropertiesException
IOException
InvalidConfigurationException
NoSuchExtensionException
IllegalArgumentException
SchemaException
IllegalAccessException
InstantiationException
CustomServiceException
-
getCustomService
@PreAuthorize("@auth.isAuthorized(\'customService(service)\', \'R\')") @STServiceOperation public CustomService getCustomService(String id) throws STPropertyAccessException Returns the definition of a custom service given the id of the associated configuration file- Parameters:
id
-- Returns:
- Throws:
STPropertyAccessException
-
updateCustomService
@PreAuthorize("@auth.isAuthorized(\'customService(service)\', \'U\')") @STServiceOperation(method=POST) public void updateCustomService(String id, com.fasterxml.jackson.databind.node.ObjectNode definition) throws IOException, WrongPropertiesException, STPropertyUpdateException, STPropertyAccessException, InstantiationException, IllegalAccessException, SchemaException, IllegalArgumentException, NoSuchExtensionException, InvalidConfigurationException, CustomServiceException Updates a custom service given its definition and the id of the configuration file used for persisting the definition.The definition shall be the JSON serialization of a
CustomService
configuration object. -
deleteCustomService
@PreAuthorize("@auth.isAuthorized(\'customService(service)\', \'D\')") @STServiceOperation(method=POST) public void deleteCustomService(String id) throws ConfigurationNotFoundException Deletes a custom service given the id of its associated configuration file- Parameters:
id
-- Throws:
ConfigurationNotFoundException
-
getOperationForms
@PreAuthorize("@auth.isAuthorized(\'customService(service)\', \'R\')") @STServiceOperation public List<Configuration> getOperationForms() -
addOperationToCustomService
@PreAuthorize("@auth.isAuthorized(\'customService(service, operation)\', \'C\')") @STServiceOperation(method=POST) public void addOperationToCustomService(String id, com.fasterxml.jackson.databind.node.ObjectNode operationDefinition) throws IOException, WrongPropertiesException, STPropertyUpdateException, STPropertyAccessException, InstantiationException, IllegalAccessException, SchemaException, IllegalArgumentException, NoSuchExtensionException, InvalidConfigurationException, CustomServiceException Adds an operation to a given custom service (identified by the id of its associated configuration). The operation definition is a JSON object containing the data obtained by filling an operation form. Note that the object must include an @type property holding the conifiguration type.- Parameters:
id
-operationDefinition
-- Throws:
IOException
WrongPropertiesException
STPropertyUpdateException
STPropertyAccessException
InvalidConfigurationException
NoSuchExtensionException
IllegalArgumentException
SchemaException
IllegalAccessException
InstantiationException
CustomServiceException
-
updateOperationInCustomService
@PreAuthorize("@auth.isAuthorized(\'customService(service, operation)\', \'U\')") @STServiceOperation(method=POST) public void updateOperationInCustomService(String id, com.fasterxml.jackson.databind.node.ObjectNode operationDefinition, @Optional String oldOperationName) throws IOException, WrongPropertiesException, STPropertyUpdateException, STPropertyAccessException, InstantiationException, IllegalAccessException, SchemaException, IllegalArgumentException, NoSuchExtensionException, InvalidConfigurationException, CustomServiceException Update an operation associated with a given custom service (identified by the id of its associated configuration). The operation definition is a JSON object containing the data obtained by filling an operation form. Note that the object must include an @type property holding the configuration type. The optional oldOperationName shouldbe passed when the new operation uses a different name.- Parameters:
id
-operationDefinition
-oldOperationName
-- Throws:
NoSuchConfigurationManager
IOException
WrongPropertiesException
STPropertyUpdateException
STPropertyAccessException
InvalidConfigurationException
NoSuchExtensionException
IllegalArgumentException
SchemaException
IllegalAccessException
InstantiationException
CustomServiceException
-
removeOperationFromCustomService
@PreAuthorize("@auth.isAuthorized(\'customService(service, operation)\', \'D\')") @STServiceOperation(method=POST) public void removeOperationFromCustomService(String id, String operationName) throws IOException, WrongPropertiesException, STPropertyAccessException, STPropertyUpdateException, InstantiationException, IllegalAccessException, SchemaException, IllegalArgumentException, NoSuchExtensionException, InvalidConfigurationException, CustomServiceException Removes an operation from a custom service -
reloadCustomService
@PreAuthorize("@auth.isAuthorized(\'customService(service)\', \'R\')") @STServiceOperation(method=POST) public void reloadCustomService(String id) throws InstantiationException, IllegalAccessException, SchemaException, IllegalArgumentException, NoSuchExtensionException, STPropertyAccessException, WrongPropertiesException, InvalidConfigurationException, DuplicateName Reloads the custom service defined by the configuration identified by the given id. -
reloadCustomServices
@PreAuthorize("@auth.isAuthorized(\'customService(service)\', \'R\')") @STServiceOperation(method=POST) public void reloadCustomServices() throws NoSuchConfigurationManagerReloads all custom services.- Throws:
NoSuchConfigurationManager
-