Class AuditLogServicesClient

java.lang.Object
org.odpi.openmetadata.repositoryservices.clients.AuditLogServicesClient
All Implemented Interfaces:
org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent

public class AuditLogServicesClient extends Object implements org.odpi.openmetadata.frameworks.auditlog.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
  • Constructor Summary

    Constructors
    Constructor
    Description
    AuditLogServicesClient(String serverName, String restURLRoot)
    Create a new client with no authentication embedded in the HTTP request.
    AuditLogServicesClient(String serverName, String restURLRoot, String userId, String password)
    Create a new client that passes userId and password in each HTTP request.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.odpi.openmetadata.repositoryservices.auditlog.OMRSAuditLogReport
    Returns the audit log for the server.
    org.odpi.openmetadata.frameworks.auditlog.ComponentDescription
    Return the component description that is used by this connector in the audit log.
    void
    setAuditLog(org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog)
    Receive an audit log object that can be used to record audit log messages.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AuditLogServicesClient

      public AuditLogServicesClient(String serverName, String restURLRoot) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException
      Create a new client with no authentication embedded in the HTTP request.
      Parameters:
      serverName - the name of the remote server
      restURLRoot - the network address of the server running the repository services. This is of the form serverURLroot + "/servers/" + serverName.
      Throws:
      org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException - bad input parameters
    • AuditLogServicesClient

      public AuditLogServicesClient(String serverName, String restURLRoot, String userId, String password) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException
      Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.
      Parameters:
      serverName - the name of the remote server
      restURLRoot - the network address of the server running the repository services. This is of the form serverURLroot + "/servers/" + serverName.
      userId - caller's userId embedded in all HTTP requests
      password - caller's userId embedded in all HTTP requests
      Throws:
      org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException - bad input parameters
  • Method Details

    • setAuditLog

      public void setAuditLog(org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog)
      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:
      setAuditLog in interface org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent
      Parameters:
      auditLog - audit log object
    • getConnectorComponentDescription

      public org.odpi.openmetadata.frameworks.auditlog.ComponentDescription getConnectorComponentDescription()
      Return the component description that is used by this connector in the audit log.
      Specified by:
      getConnectorComponentDescription in interface org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent
      Returns:
      id, name, description, wiki page URL.
    • getAuditLogReport

      public org.odpi.openmetadata.repositoryservices.auditlog.OMRSAuditLogReport getAuditLogReport(String userId) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException, org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException
      Returns the audit log for the server.
      Parameters:
      userId - calling user
      Returns:
      OMRSAuditLogReport report containing audit log
      Throws:
      org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException - one of the supplied parameters caused a problem
      org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - there is a problem communicating with the remote server.
      org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException - the user is not authorized to perform the operation requested