Class InmemPagedTrs
java.lang.Object
org.eclipse.lyo.oslc4j.trs.server.InmemPagedTrs
- All Implemented Interfaces:
PagedTrs,TrsEventHandler
This class is the backbone of the Tracked resource set service class. This class is extended by
oslc adapters wishing to implement an OSLC TRS interface. The implementing classes need to
implement one method returning the change history of the resources living in the tool exposed by
the OSLC adapter
- Since:
- 2.3.0
- Version:
- $version-stub$
-
Constructor Summary
ConstructorsConstructorDescriptionInmemPagedTrs(int basePageLimit, int changelogPageLimit, URI uriBase, String baseRelativePath, String changeLogRelativePath, Collection<URI> baseResourceUris) InmemPagedTrs(int basePageLimit, int changelogPageLimit, URI uriBase, Collection<URI> baseResourceUris) -
Method Summary
Modifier and TypeMethodDescriptionintintGet the first Base resource.getBaseResource(Integer pageId) Get a page from the paged BasegetBaseResource(URI uri) Get a Base resource by its URIgetChangeLog(Integer pageId) Get a ChangeLog pagegetChangeLog(URI uri) Get a ChangeLog page by its URIGet the last ChangeLog page.Get the Base resource following the given Base.getPrevious(ChangeLog changeLog) Get the previous ChangeLog of the given changeLog.voidvoidvoidonHistoryData(HistoryData event) voidonModified(IResource resource)
-
Constructor Details
-
InmemPagedTrs
public InmemPagedTrs(int basePageLimit, int changelogPageLimit, URI uriBase, String baseRelativePath, String changeLogRelativePath, Collection<URI> baseResourceUris) - Parameters:
basePageLimit- Max items per Base pagechangelogPageLimit- Max items per Changelog pageuriBase- Set it via egUriBuilder.fromUri(OSLC4JUtils.getServletURI()).path("trs").build()baseRelativePath- The relative path of the base, may contain URI template parameters.changeLogRelativePath- The relative path of the changeLog, may contain URI template parameters.baseResourceUris- Initial set of the TRS Base resource URIs
-
InmemPagedTrs
public InmemPagedTrs(int basePageLimit, int changelogPageLimit, URI uriBase, Collection<URI> baseResourceUris) - Parameters:
basePageLimit- Max items per Base pagechangelogPageLimit- Max items per Changelog pageuriBase- Set it via egUriBuilder.fromUri(OSLC4JUtils.getServletURI()).path("trs").build()baseResourceUris- Initial set of the TRS Base resource URIs
-
-
Method Details
-
getBaseResource
Description copied from interface:PagedTrsGet a page from the paged Base- Specified by:
getBaseResourcein interfacePagedTrs- Parameters:
pageId- Base page number- Returns:
- Base resource with the populated Page
-
getBaseResource
Description copied from interface:PagedTrsGet a Base resource by its URI- Specified by:
getBaseResourcein interfacePagedTrs- Parameters:
uri- URI of the Base resource- Returns:
- Base resource or null if not found
-
getBaseFirst
Description copied from interface:PagedTrsGet the first Base resource.- Specified by:
getBaseFirstin interfacePagedTrs- Returns:
- the first Base resource, or null if none exist
-
getNext
Description copied from interface:PagedTrsGet the Base resource following the given Base. -
basePageCount
public int basePageCount()- Specified by:
basePageCountin interfacePagedTrs- Returns:
- number of the Base pages
-
getChangeLog
Description copied from interface:PagedTrsGet a ChangeLog page- Specified by:
getChangeLogin interfacePagedTrs- Parameters:
pageId- ChangeLog page number- Returns:
- ChangeLog page with the populated link to the previous ChangeLog page.
-
getChangeLog
Description copied from interface:PagedTrsGet a ChangeLog page by its URI- Specified by:
getChangeLogin interfacePagedTrs- Parameters:
uri- URI of the ChangeLog page- Returns:
- ChangeLog page or null if not found
-
getChangeLogLast
Description copied from interface:PagedTrsGet the last ChangeLog page.- Specified by:
getChangeLogLastin interfacePagedTrs- Returns:
- the last ChangeLog page
-
getPrevious
Description copied from interface:PagedTrsGet the previous ChangeLog of the given changeLog.- Specified by:
getPreviousin interfacePagedTrs- Returns:
- the previous ChangeLog page
-
changelogPageCount
public int changelogPageCount()- Specified by:
changelogPageCountin interfacePagedTrs- Returns:
- number of the ChangeLog pages
-
onCreated
- Specified by:
onCreatedin interfaceTrsEventHandler
-
onModified
- Specified by:
onModifiedin interfaceTrsEventHandler
-
onDeleted
- Specified by:
onDeletedin interfaceTrsEventHandler
-
onHistoryData
-