Class InsertDocument
- java.lang.Object
-
- org.gcube.accounting.aggregator.persist.DocumentElaboration
-
- org.gcube.accounting.aggregator.persist.InsertDocument
-
public class InsertDocument extends DocumentElaboration
- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description protected FilecalledMethodCSVFileprotected intcountstatic StringCSV_FILENAME_SUFFIXprotected org.gcube.documentstore.persistence.PersistencePostgreSQLpersistencePostgreSQLprotected Map<String,Map<String,Integer>>serviceClassName_calledMethodsThis is used to save a CSV file which allow to made a post analysis of calledMethods The format of the CSV file is serviceClass,serviceName,calledMethod e.g.protected booleanserviceUsageRecordElaborationprotected List<String>unparsableLines-
Fields inherited from class org.gcube.accounting.aggregator.persist.DocumentElaboration
aggregationStatus, file, finalAggregationState, ID, logger, MAX_RETRY, rowToBeElaborated, startTime, THRESHOLD_FOR_FIVE_PERCENT, THRESHOLD_FOR_ONE_PERCENT
-
-
Constructor Summary
Constructors Constructor Description InsertDocument(AggregationStatus aggregationStatus, File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddServiceClassName_calledMethods(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)protected voidafterElaboration()Perform actions at the end of line by line elaborationprotected org.gcube.com.fasterxml.jackson.databind.JsonNodeanalyseLine(String line)protected voidelaborateLine(String line)FilegetCalledMethodCSVFile()protected StringgetKey(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)voidsetServiceUsageRecordElaboration(boolean serviceUsageRecordElaboration)-
Methods inherited from class org.gcube.accounting.aggregator.persist.DocumentElaboration
elaborate, readFile
-
-
-
-
Field Detail
-
CSV_FILENAME_SUFFIX
public static final String CSV_FILENAME_SUFFIX
- See Also:
- Constant Field Values
-
serviceClassName_calledMethods
protected Map<String,Map<String,Integer>> serviceClassName_calledMethods
This is used to save a CSV file which allow to made a post analysis of calledMethods The format of the CSV file is serviceClass,serviceName,calledMethod e.g. SDI,GeoNetwork,create There is an entry for each triple
-
serviceUsageRecordElaboration
protected boolean serviceUsageRecordElaboration
-
calledMethodCSVFile
protected File calledMethodCSVFile
-
persistencePostgreSQL
protected org.gcube.documentstore.persistence.PersistencePostgreSQL persistencePostgreSQL
-
count
protected int count
-
-
Constructor Detail
-
InsertDocument
public InsertDocument(AggregationStatus aggregationStatus, File file) throws Exception
- Throws:
Exception
-
-
Method Detail
-
getKey
protected String getKey(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)
-
addServiceClassName_calledMethods
protected void addServiceClassName_calledMethods(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)
-
analyseLine
protected org.gcube.com.fasterxml.jackson.databind.JsonNode analyseLine(String line) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException, IOException
- Throws:
org.gcube.com.fasterxml.jackson.core.JsonProcessingExceptionIOException
-
elaborateLine
protected void elaborateLine(String line) throws Exception
- Specified by:
elaborateLinein classDocumentElaboration- Throws:
Exception
-
afterElaboration
protected void afterElaboration() throws ExceptionDescription copied from class:DocumentElaborationPerform actions at the end of line by line elaboration- Specified by:
afterElaborationin classDocumentElaboration- Throws:
Exception
-
setServiceUsageRecordElaboration
public void setServiceUsageRecordElaboration(boolean serviceUsageRecordElaboration)
-
getCalledMethodCSVFile
public File getCalledMethodCSVFile()
-
-