Eli Mesika has uploaded a new change for review.

Change subject: core: Not able to push more than one external...
......................................................................

core: Not able to push more than one external...

Not able to push more than one external event in 30 second using REST API

This patch enables to add external events with flood rate below 30 if
specified in the POST message.
For example :
<event>
        <description>1</description>
        <severity>normal</severity>
        <origin>CUSTOMER1</origin>
        <custom_id>1</custom_id>
        <flood_rate>1</flood_rate>
</event>

if the following is sent:

<event>
        <description>1</description>
        <severity>normal</severity>
        <origin>CUSTOMER1</origin>
        <custom_id>1</custom_id>
</event>

a default flood rate of 30 sec is used.

Change-Id: I91526e2a744cc6de413091fd1605bf7f08c46735
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1071840
Signed-off-by: Eli Mesika <[email protected]>
---
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBase.java
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/33/25733/1

diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
index b917573..f3af148 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
@@ -1084,9 +1084,9 @@
      *            the log type which determine if timeout is used for it
      */
     private static void updateTimeoutLogableObject(AuditLogableBase 
auditLogable, AuditLogType logType) {
-        int eventFloodRate = (auditLogable.isExternal())
+        int eventFloodRate = (auditLogable.isExternal() && 
auditLogable.getEventFloodInSec() == 0)
                 ?
-                Math.max(auditLogable.getEventFloodInSec(), 30) // Min 
duration for External Events is 30 sec
+                30 // Minimal default duration for External Events is 30 
seconds.
                 :
                 logType.getEventFloodRate();
         if (eventFloodRate > 0) {
diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBase.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBase.java
index 1426fd5..075d6da 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBase.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBase.java
@@ -78,7 +78,7 @@
     private String customId;
     private String origin = "oVirt";
     private int customEventId = -1;
-    private int eventFloodInSec = 30;
+    private int eventFloodInSec = 0;
     private String customData = "";
     private boolean external = false;
     private String compatibilityVersion;


-- 
To view, visit http://gerrit.ovirt.org/25733
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I91526e2a744cc6de413091fd1605bf7f08c46735
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Eli Mesika <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to