Class PostgreSQLAuditLogDestinationConnector
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.postgres.PostgreSQLAuditLogDestinationConnector
- All Implemented Interfaces:
SecureConnectorExtension,VirtualConnectorExtension,OMRSAuditLogStore
Connector to add audit log records to a database.
-
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
auditLog, connectionBean, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap -
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.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.voidstart()Set up the databasestoreLogRecord(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, validateLogRecordMethods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
combineConfigurationProperties, disconnectConnectors, equals, fromCanonicalToKebabCase, fromCanonicalToSnakeCase, fromKebabToCanonicalCase, fromSnakeToCanonicalCase, getArrayConfigurationProperty, getArrayConfigurationProperty, getArrayConfigurationProperty, getBooleanConfigurationProperty, getConnection, getConnectorInstanceId, getDateConfigurationProperty, getIntConfigurationProperty, getLongConfigurationProperty, getStringConfigurationProperty, getStringConfigurationProperty, getSuppliedPlaceholderProperties, hashCode, initializeEmbeddedConnectors, initializeSecretsStoreConnector, isActive, logExceptionRecord, logRecord, logRecord, throwMissingConfigurationProperty, throwMissingEndpointAddress, throwMissingResource, throwNoAsset, throwWrongTypeOfAsset, throwWrongTypeOfResource, throwWrongTypeOfRootSchema, toStringMethods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, refreshStatistics, setStatisticProperty, setStatisticTimestamp
-
Constructor Details
-
PostgreSQLAuditLogDestinationConnector
public PostgreSQLAuditLogDestinationConnector()Default constructor used by the connector provider.
-
-
Method Details
-
start
Set up the database- Overrides:
startin classConnectorBase- Throws:
ConnectorCheckedException- something went wrongUserNotAuthorizedException- the connector was disconnected before/during start
-
storeLogRecord
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
Free up any resources held since the connector is no longer needed.- Overrides:
disconnectin classConnectorBase- Throws:
ConnectorCheckedException- there is a problem within the connector.
-