You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2019/05/01 06:20:21 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #3232: Cadf events

DaanHoogland commented on a change in pull request #3232: Cadf events
URL: https://github.com/apache/cloudstack/pull/3232#discussion_r280009781
 
 

 ##########
 File path: server/src/main/java/com/cloud/event/ActionEventUtils.java
 ##########
 @@ -286,23 +295,48 @@ private static long getDomainId(long accountId) {
         return account.getDomainId();
     }
 
-    private static void populateFirstClassEntities(Map<String, String> eventDescription){
+    private static void populateFirstClassEntities(Map<String, String> eventDescription) {
 
         CallContext context = CallContext.current();
         Map<Object, Object> contextMap = context.getContextParameters();
 
-        for(Map.Entry<Object, Object> entry : contextMap.entrySet()){
-            try{
-                Class<?> clz = (Class<?>)entry.getKey();
-                if(clz != null && Identity.class.isAssignableFrom(clz)){
+        for (Map.Entry<Object, Object> entry : contextMap.entrySet()) {
+            try {
+                Class<?> clz = (Class<?>) entry.getKey();
+                if (clz != null && Identity.class.isAssignableFrom(clz)) {
                     String uuid = getEntityUuid(clz, entry.getValue());
                     eventDescription.put(ReflectUtil.getEntityName(clz), uuid);
                 }
-            } catch (Exception e){
+            } catch (Exception e) {
                 s_logger.trace("Caught exception while populating first class entities for event bus, moving on");
             }
         }
 
     }
 
+    private static void createCadfRecord(EventVO event) {
+
+        /*for (Map.Entry <String, String> entry : eventExtraInformation.entrySet()) {
+            System.out.println("key " + entry.getKey());
+            System.out.println("value " + entry.getValue());
+        }*/
+
+        Gson gson = new GsonBuilder()
+                .excludeFieldsWithoutExposeAnnotation()
+                //.setPrettyPrinting()
 
 Review comment:
   please, remove commented code

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services