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:
org.odpi.openmetadata.frameworks.connectors.SecureConnectorExtension,org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStore
public class FileBasedAuditLogStoreConnector
extends org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.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).
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor used by the connector provider. -
Method Summary
Modifier and TypeMethodDescriptionvoidFree up any resources held since the connector is no longer needed.org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogRecordgetAuditLogRecord(String logRecordId) Retrieve a specific audit log record.List<org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogRecord>getAuditLogRecordsByComponent(String component, Date startDate, Date endDate, int offset, int maximumRecords) Retrieve a list of log records written by a specific component.List<org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogRecord>getAuditLogRecordsBySeverity(String severity, Date startDate, Date endDate, int offset, int maximumRecords) Retrieve a list of log records that have specific severity.List<org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.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 storestoreLogRecord(org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.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, getSupportedSeverities, initialize, storeLogRecordMethods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
equals, getConnectedAssetProperties, getConnection, getConnectorInstanceId, hashCode, initializeConnectedAssetProperties, initializeSecretsStoreConnector, isActive, toStringMethods 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
public void start() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedExceptionSet up the name of the file store- Overrides:
startin classorg.odpi.openmetadata.frameworks.connectors.ConnectorBase- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException- something went wrong
-
storeLogRecord
public String storeLogRecord(org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogRecord logRecord) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException Store the audit log record in the audit log store.- Specified by:
storeLogRecordin interfaceorg.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStore- Specified by:
storeLogRecordin classorg.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStoreConnectorBase- Parameters:
logRecord- log record to store- Returns:
- unique identifier assigned to the log record
- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- indicates that the logRecord parameter is invalid.
-
getAuditLogRecord
public org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogRecord getAuditLogRecord(String logRecordId) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException Retrieve a specific audit log record.- Specified by:
getAuditLogRecordin interfaceorg.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStore- Overrides:
getAuditLogRecordin classorg.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStoreConnectorBase- Parameters:
logRecordId- unique identifier for the log record- Returns:
- requested audit log record
- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- indicates that the logRecordId parameter is invalid.org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException- indicates that the audit log store is not available or has an error.
-
getAuditLogRecordsByTimeStamp
public List<org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogRecord> getAuditLogRecordsByTimeStamp(Date startDate, Date endDate, int offset, int maximumRecords) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException, org.odpi.openmetadata.repositoryservices.ffdc.exception.PagingErrorException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException Retrieve a list of log records written in a specified time period. The offset and maximumRecords parameters support a paging- Specified by:
getAuditLogRecordsByTimeStampin interfaceorg.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStore- Overrides:
getAuditLogRecordsByTimeStampin classorg.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStoreConnectorBase- 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:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- indicates that the start and/or end date parameters are invalid.org.odpi.openmetadata.repositoryservices.ffdc.exception.PagingErrorException- indicates that the offset or the maximumRecords parameters are invalid.org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException- indicates that the audit log store is not available or has an error.
-
getAuditLogRecordsBySeverity
public List<org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogRecord> getAuditLogRecordsBySeverity(String severity, Date startDate, Date endDate, int offset, int maximumRecords) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException, org.odpi.openmetadata.repositoryservices.ffdc.exception.PagingErrorException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException Retrieve a list of log records that have specific severity. The offset and maximumRecords parameters support a paging model.- Specified by:
getAuditLogRecordsBySeverityin interfaceorg.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStore- Overrides:
getAuditLogRecordsBySeverityin classorg.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStoreConnectorBase- 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:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- indicates that the severity, start and/or end date parameters are invalid.org.odpi.openmetadata.repositoryservices.ffdc.exception.PagingErrorException- indicates that the offset or the maximumRecords parameters are invalid.org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException- indicates that the audit log store is not available or has an error.
-
getAuditLogRecordsByComponent
public List<org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogRecord> getAuditLogRecordsByComponent(String component, Date startDate, Date endDate, int offset, int maximumRecords) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException, org.odpi.openmetadata.repositoryservices.ffdc.exception.PagingErrorException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException Retrieve a list of log records written by a specific component. The offset and maximumRecords parameters support a paging model.- Specified by:
getAuditLogRecordsByComponentin interfaceorg.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStore- Overrides:
getAuditLogRecordsByComponentin classorg.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStoreConnectorBase- 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:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- indicates that the component, start and/or end date parameters are invalid.org.odpi.openmetadata.repositoryservices.ffdc.exception.PagingErrorException- indicates that the offset or the maximumRecords parameters are invalid.org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException- indicates that the audit log store is not available or has an error.
-
disconnect
public void disconnect() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedExceptionFree up any resources held since the connector is no longer needed.- Overrides:
disconnectin classorg.odpi.openmetadata.frameworks.connectors.ConnectorBase- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException- there is a problem within the connector.
-