Class RemoteAlignmentServices
java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.RemoteAlignmentServices
- All Implemented Interfaces:
NewerNewStyleService
,STService
This class provides services for interacting with remote alignment services.
- Author:
- Manuel Fiorelli
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
applicationEventPublisher, cfManager, exptManager, stServiceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRemoteAlignmentService
(String id, URL serverURL, String username, String password, boolean asDefault, boolean forwardCredentials) Adds a configuration for a remote alignment service.createTask
(AlignmentPlan alignmentPlan) void
Deletes the configuration of a remote alignment service.void
deleteTask
(String id) void
downloadAlignment
(jakarta.servlet.http.HttpServletResponse oRes, String taskId) com.fasterxml.jackson.databind.JsonNode
fetchAlignment
(String taskId) Returns the alignment service associated with the project.Gets the configured remote alignment services.Pings the alignment service to obtian its metadata, which may include system-level settings (schema).Return the list of tasks managed by a remote alignment service.void
Disassociates the project from an alignment service configuration (given itsid
), leaving in place any default service defined by the administrator.searchMatchers
(it.uniroma2.art.maple.scenario.ScenarioDefinition scenarioDefinition) Pings the alignment service to obtain its metadata, which may include system-level settings (schema).void
Associates the project to an alignment service configuration (given itsid
), possibly overriding an existing default service.void
updateRemoteAlignmentService
(String id, URL serverURL, String username, String password, boolean asDefault, boolean forwardCredentials) 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
-
RemoteAlignmentServices
public RemoteAlignmentServices()
-
-
Method Details
-
getServiceMetadata
Pings the alignment service to obtian its metadata, which may include system-level settings (schema). This operation can also be used to eagerly determine whether the configured alignment service is up and running.- Returns:
- Throws:
AlignmentServiceException
-
searchMatchers
@STServiceOperation(method=POST) public List<MatcherDTO> searchMatchers(@JsonSerialized it.uniroma2.art.maple.scenario.ScenarioDefinition scenarioDefinition) throws AlignmentServiceException Pings the alignment service to obtain its metadata, which may include system-level settings (schema). This operation can also be used to eagerly determine whether the configured alignment service is up and running.- Returns:
- Throws:
AlignmentServiceException
-
listTasks
@STServiceOperation public List<TaskDTO> listTasks(Project leftDataset, @Optional Project rightDataset, boolean allowReordering) throws AlignmentServiceException Return the list of tasks managed by a remote alignment service. Tasks that terminated successfully have status"Completed"
and an"endTime"
. Currently, the service filters out any task that involves a closed project.- Parameters:
leftDataset
- left datasetrightDataset
- right dataset. Anull
values indicates that any dataset is fineallowReordering
- left and right datasets may be matched in the reverse order- Returns:
- Throws:
AlignmentServiceException
-
downloadAlignment
@STServiceOperation public void downloadAlignment(jakarta.servlet.http.HttpServletResponse oRes, String taskId) throws AlignmentServiceException - Throws:
AlignmentServiceException
-
fetchAlignment
@STServiceOperation(method=POST) @Read @PreAuthorize("@auth.isAuthorized(\'rdf(resource, alignment)\', \'R\')") public com.fasterxml.jackson.databind.JsonNode fetchAlignment(String taskId) throws IOException, AlignmentInitializationException, AlignmentServiceException -
createTask
@STServiceOperation(method=POST) public String createTask(@JsonSerialized AlignmentPlan alignmentPlan) throws AlignmentServiceException - Throws:
AlignmentServiceException
-
deleteTask
- Throws:
AlignmentServiceException
-
getRemoteAlignmentServices
@PreAuthorize("@auth.isAdmin() || @auth.isAuthorized(\'pm(project, alignmentService)\', \'R\')") @STServiceOperation public Map<String,RemoteAlignmentServiceConfiguration> getRemoteAlignmentServices() throws STPropertyAccessException, NoSuchConfigurationManagerGets the configured remote alignment services. -
getRemoteAlignmentServiceForm
-
addRemoteAlignmentService
@PreAuthorize("@auth.isAdmin()") @STServiceOperation(method=POST) public void addRemoteAlignmentService(String id, URL serverURL, @Optional String username, @Optional String password, @Optional(defaultValue="false") boolean asDefault, @Optional(defaultValue="false") boolean forwardCredentials) throws IOException, WrongPropertiesException, STPropertyUpdateException, NoSuchConfigurationManager, DuplicatedResourceException Adds a configuration for a remote alignment service. Optionally, the configuration can be set as default (it is automatically set as default if it is the first).- Parameters:
id
-serverURL
-username
-password
-asDefault
-- Throws:
IOException
WrongPropertiesException
STPropertyUpdateException
NoSuchConfigurationManager
DuplicatedResourceException
-
updateRemoteAlignmentService
@PreAuthorize("@auth.isAdmin()") @STServiceOperation(method=POST) public void updateRemoteAlignmentService(String id, URL serverURL, @Optional String username, @Optional String password, @Optional boolean asDefault, @Optional(defaultValue="false") boolean forwardCredentials) throws IOException, WrongPropertiesException, STPropertyUpdateException, NoSuchConfigurationManager, STPropertyAccessException -
getDefaultRemoteAlignmentServiceId
@STServiceOperation public String getDefaultRemoteAlignmentServiceId() throws STPropertyAccessException, NoSuchSettingsManager -
deleteRemoteAlignmentService
@PreAuthorize("@auth.isAdmin()") @STServiceOperation(method=POST) public void deleteRemoteAlignmentService(String id) throws ConfigurationNotFoundException, NoSuchConfigurationManager, STPropertyAccessException, STPropertyUpdateException, NoSuchSettingsManager, PropertyNotFoundException, WrongPropertiesException, IOException Deletes the configuration of a remote alignment service. This operation can break existing references from projects. -
setAlignmentServiceForProject
@PreAuthorize("@auth.isAuthorized(\'pm(project, alignmentService)\', \'C\')") @STServiceOperation(method=POST) public void setAlignmentServiceForProject(String id) throws NoSuchSettingsManager, STPropertyUpdateException Associates the project to an alignment service configuration (given itsid
), possibly overriding an existing default service.- Parameters:
id
-- Throws:
ConfigurationNotFoundException
NoSuchSettingsManager
STPropertyUpdateException
-
getAlignmentServiceForProject
@PreAuthorize("@auth.isAuthorized(\'pm(project, alignmentService)\', \'R\')") @STServiceOperation @Nullable public org.apache.commons.lang3.tuple.Pair<String,Boolean> getAlignmentServiceForProject() throws STPropertyAccessException, NoSuchSettingsManagerReturns the alignment service associated with the project. The service returns a pair consisting of a configuration reference and a boolean flag telling whether or not it is explicit. If no service is configured, the returned value isnull
.- Returns:
- Throws:
STPropertyAccessException
NoSuchSettingsManager
-
removeAlignmentServiceForProject
@PreAuthorize("@auth.isAuthorized(\'pm(project, alignmentService)\', \'D\')") @STServiceOperation(method=POST) public void removeAlignmentServiceForProject() throws NoSuchSettingsManager, STPropertyUpdateExceptionDisassociates the project from an alignment service configuration (given itsid
), leaving in place any default service defined by the administrator.
-