public final class CommitterUtil extends Object
Committer-related utility methods.
Modifier and Type | Method and Description |
---|---|
static void |
applyTargetContent(ICommitterRequest req,
String targetContentField)
Applies the document content (input stream) to the target
field name.
|
static void |
applyTargetId(ICommitterRequest req,
String sourceIdField,
String targetIdField)
Applies the source ID field value after extracting it using
extractSourceIdValue(ICommitterRequest, String) ,
to the target ID ID field supplied. |
static String |
extractSourceIdValue(ICommitterRequest req,
String sourceIdField)
Extracts the source ID value.
|
static String |
extractSourceIdValue(ICommitterRequest req,
String sourceIdField,
boolean keepSourceIdField)
Extracts the source ID value.
|
static String |
getContentAsString(ICommitterRequest req)
Gets the request content as a string.
|
public static String getContentAsString(ICommitterRequest req) throws CommitterException
UpsertRequest
instances.req
- committer requestnull
CommitterException
- could not get content as stringpublic static String extractSourceIdValue(ICommitterRequest req, String sourceIdField)
req
- committer requestsourceIdField
- name of the metadata field holding the ID value
or blank.public static String extractSourceIdValue(ICommitterRequest req, String sourceIdField, boolean keepSourceIdField)
req
- committer requestsourceIdField
- name of the metadata field holding the ID value
or blank.keepSourceIdField
- whether to keep the source ID fieldpublic static void applyTargetContent(ICommitterRequest req, String targetContentField) throws CommitterException
targetContentField
argument is
null
or blank, the document content is ignored (not set).
Only applicable to UpsertRequest
instances.req
- committer requesttargetContentField
- name of the target field holding the document
content.CommitterException
- could not apply target contentpublic static void applyTargetId(ICommitterRequest req, String sourceIdField, String targetIdField)
extractSourceIdValue(ICommitterRequest, String)
,
to the target ID ID field supplied.
If targetIdField
or source ID value, is null
or blank, the document ID is ignored (not set).req
- committer requestsourceIdField
- name of the source field holding the document IDtargetIdField
- name of the target field holding the document IDCopyright © 2009–2022 Norconex Inc.. All rights reserved.