com.aventstack.extentreports.reporter

## Class ExtentKlovReporter

- java.lang.Object
- - com.aventstack.extentreports.reporter.ConfigurableReporter
  - - com.aventstack.extentreports.reporter.AbstractReporter
    - - com.aventstack.extentreports.reporter.ExtentKlovReporter

- All Implemented Interfaces:
    AnalysisStrategyService, ExtentReporter, TestListener

      public class ExtentKlovReporter
      extends AbstractReporter

  ExtentKlovReporter is a NoSQL database reporter (MongoDB), which updates information in the database which is then used by the ExtentX server to display in-depth analysis.

- - ### Field Summary

    - ### Fields inherited from class com.aventstack.extentreports.reporter.AbstractReporter

      `endTime, levels, startTime, statusList`

    - ### Fields inherited from class com.aventstack.extentreports.reporter.ConfigurableReporter

      `configContext`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExtentKlovReporter()` Initializes the KlovReporter
    `ExtentKlovReporter(String projectName, String reportName)` Initializes the KlovReporter with project and report names

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T extends TestAttribute> void` | `assignAttribute(Test test, TestAttribute attribute, Map<String,org.bson.types.ObjectId> nameObjectIdCollection, com.mongodb.client.MongoCollection<org.bson.Document> mongoCollection, TestAttributeTestContextProvider<T> attributeContext)`
    `void` | `flush(ReportAggregates reportAggregates)` Write to or update the target source (file, database)
    `List<org.bson.types.ObjectId>` | `getCollectionValues(Map<String,org.bson.types.ObjectId> collection)`
    `org.bson.types.ObjectId` | `getProjectId()` Returns the active Project ID
    `String` | `getReporterName()` Get the reporter name
    `org.bson.types.ObjectId` | `getReportId()` Returns the active Report ID
    `ExtentKlovReporter` | `initKlovServerConnection(String url)` Initializes the Mongo DB connection with a connection url
    `ExtentKlovReporter` | `initMongoDbConnection(List<com.mongodb.ServerAddress> seeds)` Initializes the Mongo DB connection with a list of `ServerAddress` addresses
    `ExtentKlovReporter` | `initMongoDbConnection(List<com.mongodb.ServerAddress> seeds, List<com.mongodb.MongoCredential> credentialsList)` Initializes the Mongo DB connection with a list of `ServerAddress` and `MongoCredential`
    `ExtentKlovReporter` | `initMongoDbConnection(List<com.mongodb.ServerAddress> seeds, List<com.mongodb.MongoCredential> credentialsList, com.mongodb.MongoClientOptions options)` Initializes the Mongo DB connection with a list of `ServerAddress`, `MongoCredential` and `MongoClientOptions`
    `ExtentKlovReporter` | `initMongoDbConnection(List<com.mongodb.ServerAddress> seeds, com.mongodb.MongoClientOptions options)` Initializes the Mongo DB connection with a list of `ServerAddress` and `MongoClientOptions`
    `ExtentKlovReporter` | `initMongoDbConnection(com.mongodb.MongoClientURI uri)` Initialize Mongo DB connection with a `MongoClientURI`
    `ExtentKlovReporter` | `initMongoDbConnection(com.mongodb.ServerAddress addr)` Initializes the Mongo DB connection with `ServerAddress`
    `ExtentKlovReporter` | `initMongoDbConnection(com.mongodb.ServerAddress addr, List<com.mongodb.MongoCredential> credentialsList)` Initializes the Mongo DB connection with `ServerAddress` and a list of `MongoCredential` credentials
    `ExtentKlovReporter` | `initMongoDbConnection(com.mongodb.ServerAddress addr, List<com.mongodb.MongoCredential> credentialsList, com.mongodb.MongoClientOptions options)` Initializes the Mongo DB connection with a list of `ServerAddress`, `MongoCredential` and `MongoClientOptions`
    `ExtentKlovReporter` | `initMongoDbConnection(com.mongodb.ServerAddress addr, com.mongodb.MongoClientOptions options)` Initializes the Mongo DB connection with a `ServerAddress` and `MongoClientOptions`
    `ExtentKlovReporter` | `initMongoDbConnection(String host)` Initialize Mongo DB connection with host and default port: 27017
    `ExtentKlovReporter` | `initMongoDbConnection(String host, int port)` Initialize Mongo DB connection with host and post
    `ExtentKlovReporter` | `initMongoDbConnection(String host, com.mongodb.MongoClientOptions options)` Initialize Mongo DB connection with host and `MongoClientOptions`
    `void` | `loadInitializationParams(Properties props)`
    `void` | `loadInitializationParams(String propertiesPath)`
    `void` | `onAuthorAssigned(Test test, Author author)` Invoked each time an author is assigned to any test/node
    `void` | `onCategoryAssigned(Test test, Category category)` Invoked each time a category is assigned to any test/node
    `void` | `onDeviceAssigned(Test test, Device device)` Invoked each time a device is assigned to any test/node
    `void` | `onLogAdded(Test test, Log log)` Invoked each time a log is added to any test/node
    `void` | `onNodeStarted(Test node)` Invoked when a node is started using `createNode()`
    `void` | `onScreenCaptureAdded(Log log, ScreenCapture screenCapture)` Invoked each time a screencapture is added to log
    `void` | `onScreenCaptureAdded(Test test, ScreenCapture screenCapture)` Invoked each time a screencapture is added to test
    `void` | `onScreencastAdded(Test test, Screencast screencast)` Invoked each time a screencast is added
    `void` | `onTestRemoved(Test test)` Invoked when a test is removed using `removeTest()`
    `void` | `onTestStarted(Test test)` Invoked when a test is started using `createTest()`
    `void` | `setProjectName(String projectName)` Sets the project name
    `void` | `setReportName(String reportName)` Sets the report name
    `void` | `start()` Starts passing run information to the reporter
    `void` | `stop()` Stops the reporter.

    - ### Methods inherited from class com.aventstack.extentreports.reporter.AbstractReporter

      `getAnalysisStrategy, getEndTime, getLongRunDuration, getRunDuration, getStartTime, getStatusList, setAnalysisStrategy, setEndTime`

    - ### Methods inherited from class com.aventstack.extentreports.reporter.ConfigurableReporter

      `getConfigContext, loadConfig, loadConfig, loadConfig, loadXMLConfig, loadXMLConfig, loadXMLConfig`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ExtentKlovReporter

          public ExtentKlovReporter()

      Initializes the KlovReporter

    - #### ExtentKlovReporter

          public ExtentKlovReporter(String projectName,
                                    String reportName)

      Initializes the KlovReporter with project and report names
      Parameters:
        `projectName` - Name of the project
        `reportName` - Name of the report

  - ### Method Detail

    - #### setProjectName

          public void setProjectName(String projectName)

      Sets the project name
      Parameters:
        `projectName` - Name of the project

    - #### setReportName

          public void setReportName(String reportName)

      Sets the report name
      Parameters:
        `reportName` - Name of the report

    - #### initMongoDbConnection

          public ExtentKlovReporter initMongoDbConnection(String host)

      Initialize Mongo DB connection with host and default port: 27017
      Parameters:
        `host` - host name
      Returns:
        a `ExtentKlovReporter` object

    - #### initMongoDbConnection

          public ExtentKlovReporter initMongoDbConnection(String host,
                                                          com.mongodb.MongoClientOptions options)

      Initialize Mongo DB connection with host and `MongoClientOptions`
      Parameters:
        `host` - host name
        `options` - `MongoClientOptions` options
      Returns:
        a `ExtentKlovReporter` object

    - #### initMongoDbConnection

          public ExtentKlovReporter initMongoDbConnection(String host,
                                                          int port)

      Initialize Mongo DB connection with host and post
      Parameters:
        `host` - host name
        `port` - port number
      Returns:
        a `ExtentKlovReporter` object

    - #### initMongoDbConnection

          public ExtentKlovReporter initMongoDbConnection(com.mongodb.MongoClientURI uri)

      Initialize Mongo DB connection with a `MongoClientURI`
      Parameters:
        `uri` - `MongoClientURI` uri
      Returns:
        a `ExtentKlovReporter` object

    - #### initMongoDbConnection

          public ExtentKlovReporter initMongoDbConnection(com.mongodb.ServerAddress addr)

      Initializes the Mongo DB connection with `ServerAddress`
      Parameters:
        `addr` - `ServerAddress` server address
      Returns:
        a `ExtentKlovReporter` object

    - #### initMongoDbConnection

          public ExtentKlovReporter initMongoDbConnection(List<com.mongodb.ServerAddress> seeds)

      Initializes the Mongo DB connection with a list of `ServerAddress` addresses
      Parameters:
        `seeds` - A list of `ServerAddress` server addresses
      Returns:
        a `ExtentKlovReporter` object

    - #### initMongoDbConnection

          public ExtentKlovReporter initMongoDbConnection(List<com.mongodb.ServerAddress> seeds,
                                                          List<com.mongodb.MongoCredential> credentialsList)

      Initializes the Mongo DB connection with a list of `ServerAddress` and `MongoCredential`
      Parameters:
        `seeds` - A list of `ServerAddress` server addresses
        `credentialsList` - A list of `MongoCredential` credentials
      Returns:
        a `ExtentKlovReporter` object

    - #### initMongoDbConnection

          public ExtentKlovReporter initMongoDbConnection(List<com.mongodb.ServerAddress> seeds,
                                                          List<com.mongodb.MongoCredential> credentialsList,
                                                          com.mongodb.MongoClientOptions options)

      Initializes the Mongo DB connection with a list of `ServerAddress`, `MongoCredential` and `MongoClientOptions`
      Parameters:
        `seeds` - A list of `ServerAddress` server addresses
        `credentialsList` - A list of `MongoCredential` credentials
        `options` - `MongoClientOptions` options
      Returns:
        a `ExtentKlovReporter` object

    - #### initMongoDbConnection

          public ExtentKlovReporter initMongoDbConnection(List<com.mongodb.ServerAddress> seeds,
                                                          com.mongodb.MongoClientOptions options)

      Initializes the Mongo DB connection with a list of `ServerAddress` and `MongoClientOptions`
      Parameters:
        `seeds` - A list of `ServerAddress` server addresses
        `options` - `MongoClientOptions` options
      Returns:
        a `ExtentKlovReporter` object

    - #### initMongoDbConnection

          public ExtentKlovReporter initMongoDbConnection(com.mongodb.ServerAddress addr,
                                                          List<com.mongodb.MongoCredential> credentialsList)

      Initializes the Mongo DB connection with `ServerAddress` and a list of `MongoCredential` credentials
      Parameters:
        `addr` - `ServerAddress` server address
        `credentialsList` - A list of `MongoCredential` credentials
      Returns:
        a `ExtentKlovReporter` object

    - #### initMongoDbConnection

          public ExtentKlovReporter initMongoDbConnection(com.mongodb.ServerAddress addr,
                                                          List<com.mongodb.MongoCredential> credentialsList,
                                                          com.mongodb.MongoClientOptions options)

      Initializes the Mongo DB connection with a list of `ServerAddress`, `MongoCredential` and `MongoClientOptions`
      Parameters:
        `addr` - A list of `ServerAddress` server addresses
        `credentialsList` - A list of `MongoCredential` credentials
        `options` - `MongoClientOptions` options
      Returns:
        a `ExtentKlovReporter` object

    - #### initMongoDbConnection

          public ExtentKlovReporter initMongoDbConnection(com.mongodb.ServerAddress addr,
                                                          com.mongodb.MongoClientOptions options)

      Initializes the Mongo DB connection with a `ServerAddress` and `MongoClientOptions`
      Parameters:
        `addr` - A list of `ServerAddress` server addresses
        `options` - `MongoClientOptions` options
      Returns:
        a `ExtentKlovReporter` object

    - #### initKlovServerConnection

          public ExtentKlovReporter initKlovServerConnection(String url)

      Initializes the Mongo DB connection with a connection url
      Parameters:
        `url` - Url string
      Returns:
        a `ExtentKlovReporter` object

    - #### loadInitializationParams

          public void loadInitializationParams(String propertiesPath)
                                        throws FileNotFoundException

      Throws:
        `FileNotFoundException`

    - #### loadInitializationParams

          public void loadInitializationParams(Properties props)

    - #### start

          public void start()

      Description copied from interface: `ExtentReporter`
      Starts passing run information to the reporter

    - #### stop

          public void stop()

      Description copied from interface: `ExtentReporter`
      Stops the reporter. Ensures no information is passed to the reporter.

    - #### flush

          public void flush(ReportAggregates reportAggregates)

      Description copied from interface: `ExtentReporter`
      Write to or update the target source (file, database)
      Specified by:
        `flush` in interface `ExtentReporter`
      Overrides:
        `flush` in class `AbstractReporter`
      Parameters:
        `reportAggregates` - a `ReportAggregates` object

    - #### getCollectionValues

          public List<org.bson.types.ObjectId> getCollectionValues(Map<String,org.bson.types.ObjectId> collection)

    - #### onTestStarted

          public void onTestStarted(Test test)

      Description copied from interface: `TestListener`
      Invoked when a test is started using `createTest()`
      Parameters:
        `test` - `Test` object

    - #### onNodeStarted

          public void onNodeStarted(Test node)

      Description copied from interface: `TestListener`
      Invoked when a node is started using `createNode()`
      Parameters:
        `node` - `Test` object

    - #### onLogAdded

          public void onLogAdded(Test test,
                                 Log log)

      Description copied from interface: `TestListener`
      Invoked each time a log is added to any test/node
      Parameters:
        `test` - `Test` object
        `log` - `Log` object

    - #### assignAttribute

          public <T extends TestAttribute> void assignAttribute(Test test,
                                                                TestAttribute attribute,
                                                                Map<String,org.bson.types.ObjectId> nameObjectIdCollection,
                                                                com.mongodb.client.MongoCollection<org.bson.Document> mongoCollection,
                                                                TestAttributeTestContextProvider<T> attributeContext)

    - #### onCategoryAssigned

          public void onCategoryAssigned(Test test,
                                         Category category)

      Description copied from interface: `TestListener`
      Invoked each time a category is assigned to any test/node
      Parameters:
        `test` - `Test` object
        `category` - `Category` object

    - #### onAuthorAssigned

          public void onAuthorAssigned(Test test,
                                       Author author)

      Description copied from interface: `TestListener`
      Invoked each time an author is assigned to any test/node
      Parameters:
        `test` - `Test` object
        `author` - `Author` object

    - #### onScreenCaptureAdded

          public void onScreenCaptureAdded(Test test,
                                           ScreenCapture screenCapture)
                                    throws IOException

      Description copied from interface: `TestListener`
      Invoked each time a screencapture is added to test
      Parameters:
        `test` - `Test` object
        `screenCapture` - `ScreenCapture` object
      Throws:
        `IOException` - Exception thrown if the media object is not found

    - #### onScreenCaptureAdded

          public void onScreenCaptureAdded(Log log,
                                           ScreenCapture screenCapture)
                                    throws IOException

      Description copied from interface: `TestListener`
      Invoked each time a screencapture is added to log
      Parameters:
        `log` - `Log` object
        `screenCapture` - `ScreenCapture` object
      Throws:
        `IOException` - Exception thrown if the media object is not found

    - #### onScreencastAdded

          public void onScreencastAdded(Test test,
                                        Screencast screencast)
                                 throws IOException

      Description copied from interface: `TestListener`
      Invoked each time a screencast is added
      Parameters:
        `test` - `Test` object
        `screencast` - `Screencast` object
      Throws:
        `IOException` - Exception thrown if the media object is not found

    - #### getProjectId

          public org.bson.types.ObjectId getProjectId()

      Returns the active Project ID
      Returns:
        A `ObjectId` object

    - #### getReportId

          public org.bson.types.ObjectId getReportId()

      Returns the active Report ID
      Returns:
        A `ObjectId` object

    - #### onTestRemoved

          public void onTestRemoved(Test test)

      Description copied from interface: `TestListener`
      Invoked when a test is removed using `removeTest()`
      Parameters:
        `test` - `Test` object

    - #### onDeviceAssigned

          public void onDeviceAssigned(Test test,
                                       Device device)

      Description copied from interface: `TestListener`
      Invoked each time a device is assigned to any test/node
      Parameters:
        `test` - `Test` object
        `device` - `Device` object

    - #### getReporterName

          public String getReporterName()

      Description copied from interface: `ExtentReporter`
      Get the reporter name
      Returns:
        reporter name

Copyright © 2018. All rights reserved.