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

    Constructors
    Constructor
    Description
    Default constructor used by the connector provider.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Free up any resources held since the connector is no longer needed.
    org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogRecord
    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.
    void
    Set up the name of the file store
    storeLogRecord(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, storeLogRecord

    Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase

    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

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • 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.ConnectorCheckedException
      Set up the name of the file store
      Overrides:
      start in class org.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:
      storeLogRecord in interface org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStore
      Specified by:
      storeLogRecord in class org.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:
      getAuditLogRecord in interface org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStore
      Overrides:
      getAuditLogRecord in class org.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:
      getAuditLogRecordsByTimeStamp in interface org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStore
      Overrides:
      getAuditLogRecordsByTimeStamp in class org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStoreConnectorBase
      Parameters:
      startDate - start of time period
      endDate - end of time period
      offset - offset of full collection to begin the return results
      maximumRecords - 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:
      getAuditLogRecordsBySeverity in interface org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStore
      Overrides:
      getAuditLogRecordsBySeverity in class org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStoreConnectorBase
      Parameters:
      severity - the severity value of messages to return
      startDate - start of time period
      endDate - end of time period
      offset - offset of full collection to begin the return results
      maximumRecords - 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:
      getAuditLogRecordsByComponent in interface org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStore
      Overrides:
      getAuditLogRecordsByComponent in class org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStoreConnectorBase
      Parameters:
      component - name of the component to retrieve events from
      startDate - start of time period
      endDate - end of time period
      offset - offset of full collection to begin the return results
      maximumRecords - 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.ConnectorCheckedException
      Free up any resources held since the connector is no longer needed.
      Overrides:
      disconnect in class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException - there is a problem within the connector.