Class TabularSourceBigDataPersister<S extends TabularSource<?>>

    • Constructor Detail

      • TabularSourceBigDataPersister

        public TabularSourceBigDataPersister()
    • Method Detail

      • getDocumentTypeId

        protected java.lang.String getDocumentTypeId​(S source)
        Returns the identifier to use for the document type generated to the given source.
        Parameters:
        source - the source.
        Returns:
        the corresponding document type identifier.
        Since:
        8.1.0
        See Also:
        generateDocumentType(S)
      • getDocumentTypeFieldId

        protected java.lang.String getDocumentTypeFieldId​(S source)
        Returns the identifier to use for the document type source field
        Parameters:
        source - the source.
        Returns:
        the corresponding source field identifier.
        Since:
        8.2.0
      • updateBigData

        public void updateBigData​(S source)
        Description copied from interface: ISourceBigDataPersister
        Updates the big data repository according to a source.

        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.

        Specified by:
        updateBigData in interface ISourceBigDataPersister<S extends TabularSource<?>>
        Parameters:
        source - the source.
      • addContextDocuments

        public void addContextDocuments​(java.lang.String sourceId,
                                        java.lang.String contextId)
        Description copied from interface: ISourceBigDataPersister
        Adds all 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.

        Specified by:
        addContextDocuments in interface ISourceBigDataPersister<S extends TabularSource<?>>
        Parameters:
        sourceId - the source identifier.
        contextId - the context identifier. Usually a service or service instance identifier.
      • deleteContextDocuments

        public void deleteContextDocuments​(java.lang.String sourceId,
                                           java.lang.String contextId)
        Description copied from interface: ISourceBigDataPersister
        Deletes documents from the portal big data repository for the specified source in a context.
        Specified by:
        deleteContextDocuments in interface ISourceBigDataPersister<S extends TabularSource<?>>
        Parameters:
        sourceId - the source identifier.
        contextId - the context identifier.
      • getServiceSource

        protected static Source<?> getServiceSource​(java.lang.String sourceId,
                                                    ISourceContext sourceContext)
        Returns the source of a service.
        Parameters:
        sourceId - the desired source identifier.
        sourceContext - the source context to use to create the sources.
        Returns:
        the source.
        Since:
        10.0.0
      • addDocuments

        protected void addDocuments​(S source,
                                    ISourceData data,
                                    IBigDataIndexer bigDataIndexer)
        Adds documents to the portal big data repository for the given source data.
        Parameters:
        source - the source.
        data - the source's data to be used to generate the documents.
        bigDataIndexer - the big data indexer to add the documents.
        Since:
        8.1.0
      • generateDocuments

        protected java.util.Collection<? extends Document> generateDocuments​(S source,
                                                                             ISourceData data)
        Generates the documents to be stored for a given source data.

        The default implementations of addDocuments methods call this method to generate the documents to be added.

        Parameters:
        source - the source.
        data - the source data.
        Returns:
        a collection of documents to be added for the given data.
        Since:
        8.1.0
        See Also:
        #generateDocumentPublications(TabularSource, ISourceData)
      • addDocumentPublications

        protected void addDocumentPublications​(StandardDocument standardDocument,
                                               S source,
                                               ISourceData data)
        Generates and adds the publications to be used as the value for StandardDocumentType#FIELD_PUBLICATIONS.

        This method is called by generateDocuments(TabularSource, ISourceData).

        Parameters:
        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.
        Since:
        8.1.0
      • addDocumentPublications

        protected void addDocumentPublications​(StandardDocument standardDocument,
                                               S source,
                                               ISourceData row,
                                               java.util.Collection<java.lang.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.

        This method is called by addDocumentPublications(StandardDocument, TabularSource, ISourceData).

        Parameters:
        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.
        Since:
        8.1.0
      • getPublishedPrincipalIds

        protected java.util.Collection<java.lang.String> getPublishedPrincipalIds​(S source,
                                                                                  ISourceData row)
        Returns the published principal identifiers to compose publications that will be added to StandardDocumentType#FIELD_PUBLICATIONS.

        This method is called by addDocumentPublications(StandardDocument, TabularSource, ISourceData, Collection).

        Parameters:
        source - the source that the generated document belongs to.
        row - the row being processed.
        Returns:
        published principal identifiers.
        Since:
        8.1.0
      • generateDocumentPublishedContextURL

        protected java.lang.String generateDocumentPublishedContextURL​(S source,
                                                                       ISourceData row,
                                                                       java.lang.String serviceInstanceId)
        Generates the URL For a published context to refer a row on a service instance.

        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.

        Parameters:
        source - the source the document is being generated for.
        row - the row being processed.
        serviceInstanceId - the service instance identifier.
        Returns:
        the published context URL.
        Since:
        8.1.0
      • deleteDocuments

        public final void deleteDocuments​(S source,
                                          java.lang.String... itemIds)
        Description copied from interface: ISourceBigDataPersister
        Deletes documents from the portal big data repository that corresponds to the data with the given primary key values.
        Specified by:
        deleteDocuments in interface ISourceBigDataPersister<S extends TabularSource<?>>
        Parameters:
        source - the source.
        itemIds - the source data primary key values.
      • deleteDocuments

        public void deleteDocuments​(S source,
                                    java.util.Collection<java.lang.String> itemIds)
        Description copied from interface: ISourceBigDataPersister
        Deletes documents from the portal big data repository that corresponds to the data with the given primary key values.
        Specified by:
        deleteDocuments in interface ISourceBigDataPersister<S extends TabularSource<?>>
        Parameters:
        source - the source.
        itemIds - the source data primary key values.