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:
OMRSAuditLogStore
public class FileBasedAuditLogStoreConnector extends OMRSAuditLogStoreConnectorBase
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, securedProperties
-
-
Constructor Summary
Constructors Constructor Description FileBasedAuditLogStoreConnector()Default constructor used by the connector provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisconnect()Free up any resources held since the connector is no longer needed.OMRSAuditLogRecordgetAuditLogRecord(String logRecordId)Retrieve a specific audit log record.List<OMRSAuditLogRecord>getAuditLogRecordsByComponent(String component, Date startDate, Date endDate, int offset, int maximumRecords)Retrieve a list of log records written by a specific component.List<OMRSAuditLogRecord>getAuditLogRecordsBySeverity(String severity, Date startDate, Date endDate, int offset, int maximumRecords)Retrieve a list of log records that have specific severity.List<OMRSAuditLogRecord>getAuditLogRecordsByTimeStamp(Date startDate, Date endDate, int offset, int maximumRecords)Retrieve a list of log records written in a specified time period.voidstart()Set up the name of the file storeStringstoreLogRecord(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
equals, getConnectedAssetProperties, getConnection, getConnectorInstanceId, hashCode, initializeConnectedAssetProperties, isActive, toString
-
-
-
-
Method Detail
-
start
public void start() throws ConnectorCheckedExceptionSet up the name of the file store- Overrides:
startin classConnectorBase- Throws:
ConnectorCheckedException- something went wrong
-
storeLogRecord
public String storeLogRecord(OMRSAuditLogRecord logRecord) throws InvalidParameterException
Store the audit log record in the audit log store.- Specified by:
storeLogRecordin interfaceOMRSAuditLogStore- Specified by:
storeLogRecordin 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:
getAuditLogRecordin interfaceOMRSAuditLogStore- Overrides:
getAuditLogRecordin 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:
getAuditLogRecordsByTimeStampin interfaceOMRSAuditLogStore- Overrides:
getAuditLogRecordsByTimeStampin 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:
getAuditLogRecordsBySeverityin interfaceOMRSAuditLogStore- Overrides:
getAuditLogRecordsBySeverityin 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:
getAuditLogRecordsByComponentin interfaceOMRSAuditLogStore- Overrides:
getAuditLogRecordsByComponentin 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
public void disconnect() throws ConnectorCheckedExceptionFree up any resources held since the connector is no longer needed.- Overrides:
disconnectin classConnectorBase- Throws:
ConnectorCheckedException- there is a problem within the connector.
-
-