public class TrsProviderHandler extends TRSTaskHandler
Modifier and Type | Field and Description |
---|---|
protected URI |
lastProcessedChangeEventUri
The URI of the last processed change event
|
protected ChangeEventListener |
listener |
protected String |
trsUriBase
The entry point URI for the tracked resource set of this provider
|
baseAuth_pwd, baseAuth_userName, oslcClient, sparql_baseAuth_pwd, sparql_baseAuth_userName, sparqlQueryService, sparqlUpdateService, threadName
Constructor and Description |
---|
TrsProviderHandler(String trsUriBase,
org.eclipse.lyo.oslc4j.client.OslcClient client,
String sparqlUpdateService,
String sparqlQueryService,
String sparqlUsername,
String sparqlPassword,
String providerUsername,
String providerPassword) |
Modifier and Type | Method and Description |
---|---|
void |
attachListener(ChangeEventListener listener) |
protected void |
baseChangeEventsOptimization(List<org.eclipse.lyo.core.trs.ChangeEvent> compressedChangesList,
List<URI> baseMembers)
Deprecated.
|
protected List<URI> |
baseChangeEventsOptimizationSafe(List<org.eclipse.lyo.core.trs.ChangeEvent> compressedChangesList,
List<URI> baseMembers) |
boolean |
changeLogContainsEvent(URI syncPointUri,
org.eclipse.lyo.core.trs.ChangeLog changeLog)
returns true if the change log pojo contains the change event with the
given uri and false otherwise
|
protected List<org.eclipse.lyo.core.trs.ChangeEvent> |
compressChanges(List<org.eclipse.lyo.core.trs.ChangeEvent> changesToProcess)
takes an ordered list of change events to be processed and compressed the
list by removing multiple change events for the same resource and keeping
only the latest event for that resource
|
boolean |
fetchRemoteChangeLogs(org.eclipse.lyo.core.trs.ChangeLog currentChangeLog,
List<org.eclipse.lyo.core.trs.ChangeLog> changeLogs)
Request the pages of the change log from the TRS provider sequentially
through the traversal of the paging information until the last processed
change event is found.
|
List<org.eclipse.lyo.core.trs.ChangeLog> |
fetchUpdatedChangeLogs(org.eclipse.lyo.core.trs.TrackedResourceSet updatedTrs)
Return a list of change Lo objects corresponding to the pages of the
change log after requesting them from the change log url.
|
void |
pollAndProcessChanges()
The main method for a TRS provider.
|
void |
processChangeEvent(org.eclipse.lyo.core.trs.ChangeEvent changeEvent)
Create the necessary sparql update for processing the change events and
send it to the sparql update service
|
protected void |
processTRSTask()
Implementation of the method inherited from the TRSTaskHandler class.
|
String |
toString() |
List<org.eclipse.lyo.core.trs.Base> |
updateBases(org.eclipse.lyo.core.trs.TrackedResourceSet updatedTrs)
Return a list of base objects corresponding to the pages of the base
after requesting them from the base url.
|
fetchTRSRemoteResource, run
protected URI lastProcessedChangeEventUri
protected String trsUriBase
protected ChangeEventListener listener
public TrsProviderHandler(String trsUriBase, org.eclipse.lyo.oslc4j.client.OslcClient client, String sparqlUpdateService, String sparqlQueryService, String sparqlUsername, String sparqlPassword, String providerUsername, String providerPassword)
sparqlUpdateService
- Set to null to disable the triplestore updatepublic void attachListener(ChangeEventListener listener)
protected void processTRSTask()
processTRSTask
in class TRSTaskHandler
public List<org.eclipse.lyo.core.trs.Base> updateBases(org.eclipse.lyo.core.trs.TrackedResourceSet updatedTrs) throws JenaModelException, IOException, URISyntaxException
updatedTrs
- the trs object retrieved after retrieving it using the trs uriJenaModelException
IOException
URISyntaxException
public List<org.eclipse.lyo.core.trs.ChangeLog> fetchUpdatedChangeLogs(org.eclipse.lyo.core.trs.TrackedResourceSet updatedTrs) throws ServerRollBackException, IOException, JenaModelException, URISyntaxException
updatedTrs
- the trs object retrieved after retrieving it using the trs uriServerRollBackException
IOException
JenaModelException
URISyntaxException
public boolean fetchRemoteChangeLogs(org.eclipse.lyo.core.trs.ChangeLog currentChangeLog, List<org.eclipse.lyo.core.trs.ChangeLog> changeLogs) throws JenaModelException, IOException, URISyntaxException
currentChangeLog
- the first change log from which the next page will be
retrieved to retrieve the other pages of the change logchangeLogs
- the list of change logs which will be filled with the pages of
the change logJenaModelException
IOException
URISyntaxException
public boolean changeLogContainsEvent(URI syncPointUri, org.eclipse.lyo.core.trs.ChangeLog changeLog)
@Deprecated protected void baseChangeEventsOptimization(List<org.eclipse.lyo.core.trs.ChangeEvent> compressedChangesList, List<URI> baseMembers)
compressedChangesList
- the optimized list of change eventsbaseMembers
- the members of the basepublic void pollAndProcessChanges() throws URISyntaxException, JenaModelException, IOException, ServerRollBackException, RepresentationRetrievalException
public void processChangeEvent(org.eclipse.lyo.core.trs.ChangeEvent changeEvent) throws IOException, URISyntaxException
changeEvent
- the change event to be processedIOException
URISyntaxException
protected List<URI> baseChangeEventsOptimizationSafe(List<org.eclipse.lyo.core.trs.ChangeEvent> compressedChangesList, List<URI> baseMembers)
protected List<org.eclipse.lyo.core.trs.ChangeEvent> compressChanges(List<org.eclipse.lyo.core.trs.ChangeEvent> changesToProcess)
Copyright © 2019. All Rights Reserved.