@StableMinor(version="12.5", sinceVersion="10.0") public class TabularSourceBigDataPersister<S extends TabularSource<?>> extends Object implements ISourceBigDataPersister<S>
ISourceBigDataPersister
for tabular sources
.Constructor and Description |
---|
TabularSourceBigDataPersister() |
Modifier and Type | Method and Description |
---|---|
void |
addContextDocuments(String sourceId,
String contextId)
Adds all
documents corresponding to the given source and context to the portal big data
repository. |
protected void |
addDocumentPublications(StandardDocument standardDocument,
S source,
ISourceData data)
Generates and adds the publications to be used as the value for
StandardDocumentType#FIELD_PUBLICATIONS . |
protected void |
addDocumentPublications(StandardDocument standardDocument,
S source,
ISourceData row,
Collection<String> serviceInstanceIds)
Generates and adds the publications to be used as the value for
StandardDocumentType#FIELD_PUBLICATIONS , for an row on a collection of service instances. |
void |
addDocuments(S source,
Collection<? extends ISourceData> datas)
Adds
documents to the portal big data repository for the given source data entries. |
void |
addDocuments(S source,
ISourceData... datas)
Adds
documents to the portal big data repository for the given source data entries. |
protected void |
addDocuments(S source,
ISourceData data,
IBigDataIndexer bigDataIndexer)
Adds
documents to the portal big data repository for the given source data. |
void |
deleteBigData(S source)
Deletes all structure stored in the portal big data repository relative to a source.
|
void |
deleteContextDocuments(String sourceId,
String contextId)
Deletes
documents from the portal big data repository for the specified source in a context. |
void |
deleteDocuments(S source,
Collection<String> itemIds)
Deletes
documents from the portal big data repository that corresponds to the data with the
given primary key values. |
void |
deleteDocuments(S source,
String... itemIds)
Deletes
documents from the portal big data repository that corresponds to the data with the
given primary key values. |
protected String |
generateDocumentPublishedContextURL(S source,
ISourceData row,
String serviceInstanceId)
Generates the URL For a published context to refer a row on a service instance.
|
protected Collection<? extends Document> |
generateDocuments(S source,
ISourceData data)
Generates the documents to be stored for a given source data.
|
protected IDocumentTypeBuilder<? extends StandardDocumentType> |
generateDocumentType(S source)
Generates the document type definition for documents relative to the specified source.
The default implementation generates a document type using as identifier the result of getDocumentTypeId(S)
and this document type contains a field, with identifier of the result of getDocumentTypeFieldId(S) , that
holds the source fields' values. |
protected double |
getDocumentPopularity(StandardDocument document,
S source,
ISourceData data)
Returns the popularity of the given document.
|
protected String |
getDocumentTypeFieldId(S source)
Returns the identifier to use for the document type source field
|
protected String |
getDocumentTypeId(S source)
Returns the identifier to use for the document type generated to the given source.
|
protected Collection<String> |
getPublishedPrincipalIds(S source,
ISourceData row)
Returns the published principal identifiers to compose
publications that will be added to
StandardDocumentType#FIELD_PUBLICATIONS . |
protected static Source<?> |
getServiceSource(String sourceId,
ISourceContext sourceContext)
Returns the source of a service.
|
void |
initBigData(S source)
Initializes the big data repository with elements specifics to a source.
|
void |
updateBigData(S source)
Updates the big data repository according to a source.
|
protected IDocumentTypeBuilder<? extends StandardDocumentType> generateDocumentType(S source)
getDocumentTypeId(S)
and this document type contains a field, with identifier of the result of getDocumentTypeFieldId(S)
, that
holds the source fields' values.source
- the source.getDocumentTypeId(S)
,
getDocumentTypeFieldId(S)
protected String getDocumentTypeId(S source)
source
- the source.generateDocumentType(S)
protected String getDocumentTypeFieldId(S source)
source
- the source.public void initBigData(S source)
ISourceBigDataPersister
This method is called at some moment between the service registration and its use, or when the source big data
will be recreated (after ISourceBigDataPersister.deleteBigData(S)
is called to delete anything related to the source).
This method will usually create the document types
that ISourceBigDataPersister.addDocuments(S, lumis.doui.source.ISourceData...)
for the source
will use.
initBigData
in interface ISourceBigDataPersister<S extends TabularSource<?>>
source
- the source.public void updateBigData(S source)
ISourceBigDataPersister
This method is called at some moment between the service registration and its use.
This method will usually update the document types
for the source.
updateBigData
in interface ISourceBigDataPersister<S extends TabularSource<?>>
source
- the source.public void deleteBigData(S source)
ISourceBigDataPersister
This method is called when a source will cease to exist or when recreating the big data for a source.
This method must delete elements created by ISourceBigDataPersister.initBigData(S)
and documents added by ISourceBigDataPersister.addDocuments(S, lumis.doui.source.ISourceData...)
.
This method will usually delete the document types
created in ISourceBigDataPersister.initBigData(S)
and used
by ISourceBigDataPersister.addDocuments(S, lumis.doui.source.ISourceData...)
, which will remove related documents in cascade.
deleteBigData
in interface ISourceBigDataPersister<S extends TabularSource<?>>
source
- the source.public void addContextDocuments(String sourceId, String contextId)
ISourceBigDataPersister
documents
corresponding to the given source and context to the portal big data
repository.
This method is usually called when re-indexing a source after its documents have been deleted.
addContextDocuments
in interface ISourceBigDataPersister<S extends TabularSource<?>>
sourceId
- the source identifier.contextId
- the context identifier. Usually a service or service instance identifier.public void deleteContextDocuments(String sourceId, String contextId)
ISourceBigDataPersister
documents
from the portal big data repository for the specified source in a context.deleteContextDocuments
in interface ISourceBigDataPersister<S extends TabularSource<?>>
sourceId
- the source identifier.contextId
- the context identifier.protected static Source<?> getServiceSource(String sourceId, ISourceContext sourceContext)
sourceId
- the desired source identifier.sourceContext
- the source context to use to create the sources.public final void addDocuments(S source, ISourceData... datas)
documents
to the portal big data repository for the given source data entries.
To override the documents generated for each data, override
generateDocuments(TabularSource, ISourceData)
instead of this method. If it is necessary to override
this method, override addDocuments(TabularSource, Collection)
instead, as the implementation of this
method only delegates to it.
addDocuments
in interface ISourceBigDataPersister<S extends TabularSource<?>>
source
- the source.datas
- the source's data to be used to generate the documents.public void addDocuments(S source, Collection<? extends ISourceData> datas)
documents
to the portal big data repository for the given source data entries.
To override the documents generated for each data, override
generateDocuments(TabularSource, ISourceData)
instead of this method.
addDocuments
in interface ISourceBigDataPersister<S extends TabularSource<?>>
source
- the source.datas
- the source's data to be used to generate the documents.protected void addDocuments(S source, ISourceData data, IBigDataIndexer bigDataIndexer)
documents
to the portal big data repository for the given source data.source
- the source.data
- the source's data to be used to generate the documents.bigDataIndexer
- the big data indexer to add the documents.protected Collection<? extends Document> generateDocuments(S source, ISourceData data)
The default implementations of addDocuments
methods call this method to generate the documents to be
added.
source
- the source.data
- the source data.#generateDocumentPublications(TabularSource, ISourceData)
protected double getDocumentPopularity(StandardDocument document, S source, ISourceData data)
finite
number.document
- the documentsource
- source related to the given documentdata
- row of contentIDocumentPopularityProvider.calculateDocumentPopularity(StandardDocument)
protected void addDocumentPublications(StandardDocument standardDocument, S source, ISourceData data)
StandardDocumentType#FIELD_PUBLICATIONS
.
This method is called by generateDocuments(TabularSource, ISourceData)
.
standardDocument
- the document to add the publications.source
- the source the document is being generated for.data
- the source data the document is being generated for.protected void addDocumentPublications(StandardDocument standardDocument, S source, ISourceData row, Collection<String> serviceInstanceIds)
StandardDocumentType#FIELD_PUBLICATIONS
, for an row on a collection of service instances.
This method is called by addDocumentPublications(StandardDocument, TabularSource, ISourceData)
.
standardDocument
- the document to add the publications.source
- the source the document is being generated for.row
- the row being processed.serviceInstanceIds
- the service instance identifiers.protected Collection<String> getPublishedPrincipalIds(S source, ISourceData row)
publications
that will be added to
StandardDocumentType#FIELD_PUBLICATIONS
.
This method is called by addDocumentPublications(StandardDocument, TabularSource, ISourceData, Collection)
.
source
- the source that the generated document belongs to.row
- the row being processed.protected String generateDocumentPublishedContextURL(S source, ISourceData row, String serviceInstanceId)
This method is called by #addDocumentPublications(StandardDocument, TabularSource, String, Collection)
.
This method may return null
, if no URL is available for the given row.
In this case, a publication will not be generated.
source
- the source the document is being generated for.row
- the row being processed.serviceInstanceId
- the service instance identifier.public final void deleteDocuments(S source, String... itemIds)
ISourceBigDataPersister
documents
from the portal big data repository that corresponds to the data with the
given primary key values.deleteDocuments
in interface ISourceBigDataPersister<S extends TabularSource<?>>
source
- the source.itemIds
- the source data primary key values.public void deleteDocuments(S source, Collection<String> itemIds)
ISourceBigDataPersister
documents
from the portal big data repository that corresponds to the data with the
given primary key values.deleteDocuments
in interface ISourceBigDataPersister<S extends TabularSource<?>>
source
- the source.itemIds
- the source data primary key values.LumisXP 12.5.0.200928 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.