Class FileBasedAuditLogStoreConnector
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStoreConnectorBase
org.odpi.openmetadata.adapters.repositoryservices.auditlogstore.file.FileBasedAuditLogStoreConnector
- All Implemented Interfaces:
SecureConnectorExtension
,OMRSAuditLogStore
FileBasedAuditLogStoreConnector provides a connector implementation for a file based audit log.
The audit log is stored in a directory and each audit log record is stored as a file with a filename build
from the record's unique identifier (guid).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection
-
Field Summary
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
connectedAssetProperties, connectionBean, connectionProperties, connectorInstanceId, secretsStoreConnectorMap
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor used by the connector provider. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Free up any resources held since the connector is no longer needed.getAuditLogRecord
(String logRecordId) Retrieve a specific audit log record.getAuditLogRecordsByComponent
(String component, Date startDate, Date endDate, int offset, int maximumRecords) Retrieve a list of log records written by a specific component.getAuditLogRecordsBySeverity
(String severity, Date startDate, Date endDate, int offset, int maximumRecords) Retrieve a list of log records that have specific severity.getAuditLogRecordsByTimeStamp
(Date startDate, Date endDate, int offset, int maximumRecords) Retrieve a list of log records written in a specified time period.void
start()
Set up the name of the file storestoreLogRecord
(OMRSAuditLogRecord logRecord) Store the audit log record in the audit log store.Methods inherited from class org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStoreConnectorBase
getDestinationName, getJSONLogRecord, getSupportedSeverities, initialize, isSupportedSeverity, storeLogRecord, validateLogRecord
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
disconnectConnectors, equals, getConnectedAssetProperties, getConnection, getConnectorInstanceId, hashCode, initializeConnectedAssetProperties, initializeSecretsStoreConnector, isActive, toString
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, setStatisticProperty, setStatisticTimestamp
-
Constructor Details
-
FileBasedAuditLogStoreConnector
public FileBasedAuditLogStoreConnector()Default constructor used by the connector provider.
-
-
Method Details
-
start
Set up the name of the file store- Overrides:
start
in classConnectorBase
- Throws:
ConnectorCheckedException
- something went wrong
-
storeLogRecord
Store the audit log record in the audit log store.- Specified by:
storeLogRecord
in interfaceOMRSAuditLogStore
- Specified by:
storeLogRecord
in classOMRSAuditLogStoreConnectorBase
- Parameters:
logRecord
- log record to store- Returns:
- unique identifier assigned to the log record
- Throws:
InvalidParameterException
- indicates that the logRecord parameter is invalid.
-
getAuditLogRecord
public OMRSAuditLogRecord getAuditLogRecord(String logRecordId) throws InvalidParameterException, RepositoryErrorException Retrieve a specific audit log record.- Specified by:
getAuditLogRecord
in interfaceOMRSAuditLogStore
- Overrides:
getAuditLogRecord
in classOMRSAuditLogStoreConnectorBase
- Parameters:
logRecordId
- unique identifier for the log record- Returns:
- requested audit log record
- Throws:
InvalidParameterException
- indicates that the logRecordId parameter is invalid.RepositoryErrorException
- indicates that the audit log store is not available or has an error.
-
getAuditLogRecordsByTimeStamp
public List<OMRSAuditLogRecord> getAuditLogRecordsByTimeStamp(Date startDate, Date endDate, int offset, int maximumRecords) throws InvalidParameterException, PagingErrorException, RepositoryErrorException Retrieve a list of log records written in a specified time period. The offset and maximumRecords parameters support a paging- Specified by:
getAuditLogRecordsByTimeStamp
in interfaceOMRSAuditLogStore
- Overrides:
getAuditLogRecordsByTimeStamp
in classOMRSAuditLogStoreConnectorBase
- Parameters:
startDate
- start of time periodendDate
- end of time periodoffset
- offset of full collection to begin the return resultsmaximumRecords
- maximum number of log records to return- Returns:
- list of log records from the specified time period
- Throws:
InvalidParameterException
- indicates that the start and/or end date parameters are invalid.PagingErrorException
- indicates that the offset or the maximumRecords parameters are invalid.RepositoryErrorException
- indicates that the audit log store is not available or has an error.
-
getAuditLogRecordsBySeverity
public List<OMRSAuditLogRecord> getAuditLogRecordsBySeverity(String severity, Date startDate, Date endDate, int offset, int maximumRecords) throws InvalidParameterException, PagingErrorException, RepositoryErrorException Retrieve a list of log records that have specific severity. The offset and maximumRecords parameters support a paging model.- Specified by:
getAuditLogRecordsBySeverity
in interfaceOMRSAuditLogStore
- Overrides:
getAuditLogRecordsBySeverity
in classOMRSAuditLogStoreConnectorBase
- Parameters:
severity
- the severity value of messages to returnstartDate
- start of time periodendDate
- end of time periodoffset
- offset of full collection to begin the return resultsmaximumRecords
- maximum number of log records to return- Returns:
- list of log records from the specified time period
- Throws:
InvalidParameterException
- indicates that the severity, start and/or end date parameters are invalid.PagingErrorException
- indicates that the offset or the maximumRecords parameters are invalid.RepositoryErrorException
- indicates that the audit log store is not available or has an error.
-
getAuditLogRecordsByComponent
public List<OMRSAuditLogRecord> getAuditLogRecordsByComponent(String component, Date startDate, Date endDate, int offset, int maximumRecords) throws InvalidParameterException, PagingErrorException, RepositoryErrorException Retrieve a list of log records written by a specific component. The offset and maximumRecords parameters support a paging model.- Specified by:
getAuditLogRecordsByComponent
in interfaceOMRSAuditLogStore
- Overrides:
getAuditLogRecordsByComponent
in classOMRSAuditLogStoreConnectorBase
- Parameters:
component
- name of the component to retrieve events fromstartDate
- start of time periodendDate
- end of time periodoffset
- offset of full collection to begin the return resultsmaximumRecords
- maximum number of log records to return- Returns:
- list of log records from the specified time period
- Throws:
InvalidParameterException
- indicates that the component, start and/or end date parameters are invalid.PagingErrorException
- indicates that the offset or the maximumRecords parameters are invalid.RepositoryErrorException
- indicates that the audit log store is not available or has an error.
-
disconnect
Free up any resources held since the connector is no longer needed.- Overrides:
disconnect
in classConnectorBase
- Throws:
ConnectorCheckedException
- there is a problem within the connector.
-