Class AuditLogServicesClient
java.lang.Object
org.odpi.openmetadata.repositoryservices.clients.AuditLogServicesClient
- All Implemented Interfaces:
AuditLoggingComponent
The AuditLogServicesClient supports the OMRS Repository Services APIs for retrieving audit logs.
Requests to this client are translated one-for-one to requests to the audit log service since
the OMRS REST API has a one-to-one correspondence with the audit log service API.
The URLs for the REST APIs are of this form:
- restURLroot - serverURLroot + "/servers/" + serverName
- rootServiceNameInURL - "/open-metadata/repository-services"
- userIdInURL - optional - "/users/{0}"
- operationSpecificURL - operation specific part of the URL
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAuditLogServicesClient(String serverName, String restURLRoot, String secretsStoreProvider, String secretsStoreLocation, String secretsStoreCollection, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request.AuditLogServicesClient(String serverName, String restURLRoot, Map<String, SecretsStoreConnector> secretsStoreConnectorMap, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request. -
Method Summary
Modifier and TypeMethodDescriptiongetAuditLogReport(String userId) Returns the audit log for the server.Return the component description that is used by this connector in the audit log.voidsetAuditLog(AuditLog auditLog) Receive an audit log object that can be used to record audit log messages.
-
Field Details
-
auditLog
-
-
Constructor Details
-
AuditLogServicesClient
public AuditLogServicesClient(String serverName, String restURLRoot, String secretsStoreProvider, String secretsStoreLocation, String secretsStoreCollection, AuditLog auditLog) throws InvalidParameterException Create a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- the name of the remote serverrestURLRoot- the network address of the server running the repository services. This is of the form serverURLroot + "/servers/" + serverName.- Throws:
InvalidParameterException- bad input parameters
-
AuditLogServicesClient
public AuditLogServicesClient(String serverName, String restURLRoot, Map<String, SecretsStoreConnector> secretsStoreConnectorMap, AuditLog auditLog) throws InvalidParameterExceptionCreate a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- the name of the remote serverrestURLRoot- the network address of the server running the repository services. This is of the form serverURLroot + "/servers/" + serverName.secretsStoreConnectorMap- connectors to secrets storesauditLog- destination for log messages.- Throws:
InvalidParameterException- bad input parameters
-
-
Method Details
-
setAuditLog
Receive an audit log object that can be used to record audit log messages. The caller has initialized it with the correct component description and log destinations.- Specified by:
setAuditLogin interfaceAuditLoggingComponent- Parameters:
auditLog- audit log object
-
getConnectorComponentDescription
Return the component description that is used by this connector in the audit log.- Specified by:
getConnectorComponentDescriptionin interfaceAuditLoggingComponent- Returns:
- id, name, description, wiki page URL.
-
getAuditLogReport
public OMRSAuditLogReport getAuditLogReport(String userId) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException Returns the audit log for the server.- Parameters:
userId- calling user- Returns:
- OMRSAuditLogReport report containing audit log
- Throws:
InvalidParameterException- one of the supplied parameters caused a problemRepositoryErrorException- there is a problem communicating with the remote server.UserNotAuthorizedException- the user is not authorized to perform the operation requested
-