@Service(value="blAuditReportService") public class AuditReportServiceImpl extends Object implements AuditReportService
AuditReportService
Modifier and Type | Field and Description |
---|---|
protected AuditLogFileProvider |
auditLogFileProvider |
protected AuditReportDao |
auditReportDao |
protected WorkflowAuditService |
auditService |
protected EnterpriseEventProducer |
enterpriseEventProducer |
protected EntityItemService |
entityItemService |
protected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil |
eventTransUtil |
protected AuditReportServiceExtensionManager |
extensionManager |
protected WorkflowSandBoxItemService |
sandBoxItemService |
protected WorkflowSandBoxItemService |
sbItemService |
protected com.broadleafcommerce.jobsevents.dao.DatabaseSystemEventDao |
systemEventDao |
protected com.broadleafcommerce.jobsevents.service.SystemEventSender |
systemEventSender
Deprecated.
No longer used internally
|
protected org.springframework.transaction.PlatformTransactionManager |
transactionManager |
protected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil |
transUtil |
Constructor and Description |
---|
AuditReportServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
appendFooter(AuditLogRequest completed,
File merged,
boolean weaved) |
protected void |
buildBasicReportData(StringBuilder reportBuilder,
WorkflowSandBoxItem sandBoxItem) |
protected void |
buildChildItemsReportData(StringBuilder reportBuilder,
WorkflowSandBoxItem sandBoxItem) |
protected void |
buildDeploymentsReportData(StringBuilder reportBuilder,
List<WorkflowDeployment> deployments) |
protected void |
buildDomainChangeLineage(StringBuilder reportBuilder,
EntityItem entityItem) |
protected void |
buildEntityItemReportData(StringBuilder reportBuilder,
Long entityItemId) |
protected List<WorkflowDeployment> |
buildEventsReportData(StringBuilder reportBuilder,
WorkflowSandBoxItem sandBoxItem) |
protected void |
buildLibraryReportData(StringBuilder reportBuilder) |
protected void |
buildPropertyReportData(StringBuilder reportBuilder,
Property property) |
String |
buildReportData(List<Long> workflowItemIds)
Compile the WorkflowSandBoxItem report information.
|
protected StringBuilder |
buildReportFooter(AuditLogRequest completed,
boolean weaved) |
void |
completeReportCompilation()
When the system determines that all admin nodes have checked in and uploaded all relevant logs, this method is called
to perform the final report compilation steps.
|
protected File |
concatenateLogFiles(Stack<AuditLogNodeRequest> requestStack) |
protected List<AuditLogRequest> |
findCompletedUploads()
This method relies on the
DatabaseSystemEventDao to determine
if all active nodes in the cluster have checked in. |
protected List<Date> |
getLogDatesFromItems(List<Long> itemIds) |
void |
init() |
Long |
launchAuditReportRequestProcess(List<Long> containerIds,
AuditReportType reportType)
Start an asynchronous process for retrieval of an audit report (either a standalone log, or a WorkflowSandBoxItem report
that includes the log).
|
protected Blob |
prependReportData(AuditReportRequest reportRequest,
File merged) |
void |
remove(Long requestId)
Delete an
AuditLogRequest instance from the database. |
protected void |
sendAuditLogRequestEvent(AuditLogRequest request)
Deprecated.
|
protected Date |
truncate(Date original) |
void |
uploadLogs(Long requestId,
String hostInfo,
List<Date> dates,
Map<String,String> additionalInfo)
When a admin node consumes the event created in
AuditReportService.launchAuditReportRequestProcess(List, AuditReportType) , it
will call this method in order to upload relevant logs based on the passed in information. |
protected File |
weaveLogFiles(Stack<AuditLogNodeRequest> requestStack) |
protected void |
weaveLogLines(BufferedWriter stageFileWriter,
BufferedReader mergedReader,
BufferedReader nextFileReader,
String mergedSuffix,
String nextSuffix) |
protected WorkflowSandBoxItemService sandBoxItemService
protected AuditReportDao auditReportDao
@Deprecated protected com.broadleafcommerce.jobsevents.service.SystemEventSender systemEventSender
protected EnterpriseEventProducer enterpriseEventProducer
protected AuditLogFileProvider auditLogFileProvider
protected org.springframework.transaction.PlatformTransactionManager transactionManager
protected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil eventTransUtil
protected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil transUtil
protected com.broadleafcommerce.jobsevents.dao.DatabaseSystemEventDao systemEventDao
protected WorkflowSandBoxItemService sbItemService
protected AuditReportServiceExtensionManager extensionManager
protected EntityItemService entityItemService
protected WorkflowAuditService auditService
@PostConstruct public void init()
@Transactional(value="blTransactionManager") public Long launchAuditReportRequestProcess(List<Long> containerIds, AuditReportType reportType)
AuditReportService
launchAuditReportRequestProcess
in interface AuditReportService
containerIds
- the WorkflowSandBoxItem ids that are associated with the log files that should be retrievedreportType
- the type of report (either standalone log or WorkflowSandBoxItem report - including log)AuditLogRequest
instance tracking this request@Transactional(value="blTransactionManager") public void uploadLogs(Long requestId, String hostInfo, List<Date> dates, Map<String,String> additionalInfo)
AuditReportService
AuditReportService.launchAuditReportRequestProcess(List, AuditReportType)
, it
will call this method in order to upload relevant logs based on the passed in information.uploadLogs
in interface AuditReportService
requestId
- the primary key value of AuditLogRequest
hostInfo
- the ip address and host information for this nodedates
- the dates requested for log retrievaladditionalInfo
- any additional information required by the implementation to effectively upload logsAuditReportRequestEventConsumer
@Transactional(value="blTransactionManager") public void remove(Long requestId)
AuditReportService
AuditLogRequest
instance from the database.remove
in interface AuditReportService
requestId
- the primary key value of AuditLogRequest
public void completeReportCompilation()
AuditReportService
AuditLogRequest.getFinalReport()
is populated.completeReportCompilation
in interface AuditReportService
@Transactional(value="blTransactionManager") public String buildReportData(List<Long> workflowItemIds)
AuditReportService
AuditReportType.REPORT
is requested in AuditReportService.launchAuditReportRequestProcess(List, AuditReportType)
buildReportData
in interface AuditReportService
workflowItemIds
- the primary key values for the WorkflowSandBoxItem
instances used to created the reportprotected void buildBasicReportData(StringBuilder reportBuilder, WorkflowSandBoxItem sandBoxItem)
protected void buildChildItemsReportData(StringBuilder reportBuilder, WorkflowSandBoxItem sandBoxItem)
protected void buildEntityItemReportData(StringBuilder reportBuilder, Long entityItemId)
protected void buildDomainChangeLineage(StringBuilder reportBuilder, EntityItem entityItem)
protected void buildPropertyReportData(StringBuilder reportBuilder, Property property)
protected void buildDeploymentsReportData(StringBuilder reportBuilder, List<WorkflowDeployment> deployments)
protected List<WorkflowDeployment> buildEventsReportData(StringBuilder reportBuilder, WorkflowSandBoxItem sandBoxItem)
protected void buildLibraryReportData(StringBuilder reportBuilder)
protected Blob prependReportData(AuditReportRequest reportRequest, File merged) throws IOException
IOException
protected void appendFooter(AuditLogRequest completed, File merged, boolean weaved) throws IOException
IOException
protected File concatenateLogFiles(Stack<AuditLogNodeRequest> requestStack) throws IOException, SQLException
IOException
SQLException
protected File weaveLogFiles(Stack<AuditLogNodeRequest> requestStack) throws IOException, SQLException, LineParseException
protected void weaveLogLines(BufferedWriter stageFileWriter, BufferedReader mergedReader, BufferedReader nextFileReader, String mergedSuffix, String nextSuffix) throws LineParseException, IOException
LineParseException
IOException
protected StringBuilder buildReportFooter(AuditLogRequest completed, boolean weaved)
protected List<AuditLogRequest> findCompletedUploads()
DatabaseSystemEventDao
to determine
if all active nodes in the cluster have checked in. Subclasses may override to implement alternate methods
of detecting log upload completion.@Deprecated protected void sendAuditLogRequestEvent(AuditLogRequest request)
EnterpriseEventProducer.initiateAuditLogRequest(AuditLogRequest)
insteadrequest
- Copyright © 2021. All rights reserved.