test_class.declarator: ciEventReader
test_class.original_string: CIEventReader ciEventReader;
test_class.type: CIEventReader
test_class.var_name: ciEventReader
test_class.declarator: mapper = new CIMapperImpl()
test_class.original_string: CIMapperImpl mapper = new CIMapperImpl();
test_class.type: CIMapperImpl
test_class.var_name: mapper
test_class.file: transmitter/src/test/java/com/oneops/cms/transmitter/CiEventReaderTest.java
test_class.identifier: CiEventReaderTest
test_case.body: @Test
    public void eventForCloudCi() {
  
      CmsCI ci = new CmsCI();
      ci.setCiId(1600);
      ci.setNsPath("/org1/_clouds");
      ci.setCiClassName("account.Cloud");
      ci.setCiStateId(100);
      ci.setCiName("cl1");
  
      CmsCIAttribute attr = new CmsCIAttribute();
      attr.setCiId(1500);
      attr.setAttributeName("adminstatus");
      attr.setDfValue("active");
      attr.setDjValue("active");
  
      mapper.addCI(ci, Collections.singletonList(attr));
  
      CmsCI orgCi = new CmsCI();
      orgCi.setCiId(1400);
      orgCi.setNsPath("/");
      orgCi.setCiClassName("account.Organization");
      orgCi.setCiName("org1");
      orgCi.setCiStateId(100);
  
      CmsCIAttribute tagAttr = new CmsCIAttribute();
      tagAttr.setCiId(1400);
      tagAttr.setAttributeName("tags");
      tagAttr.setDfValue("{\"Owner\":\"user 1\",\"costcenter\":\"c100\",\"pillar\":\"p-o\"}");
      tagAttr.setDjValue("{\"Owner\":\"user 1\",\"costcenter\":\"c100\",\"pillar\":\"p-o\"}");
  
      mapper.addCI(orgCi, Collections.singletonList(tagAttr));
  
      CMSEventRecord eventRecord = new CMSEventRecord();
      eventRecord.setCreated(new Date());
      eventRecord.setSourcePk(1600);
      eventRecord.setEventType("add");
      eventRecord.setSourceName("cm_ci");
  
      CMSEvent event = ciEventReader.populateEvent(eventRecord);
      CmsCISimpleWithTags ciSimple = (CmsCISimpleWithTags) event.getPayload();
      assertThat(ciSimple.getCiId(), is(1600L));
      assertThat(ciSimple.getCiName(), is("cl1"));
      assertThat(ciSimple.getCiAttributes().size(), is(1));
      assertThat(ciSimple.getCiAttributes().get("adminstatus"), is("active"));
      assertThat(ciSimple.getOrg(), is("org1"));
  
      Map<String, String> tags = ciSimple.getTags();
      assertThat(tags.size(), is(3));
      assertThat(tags.get("Owner"), is("user 1"));
      assertThat(tags.get("costcenter"), is("c100"));
      assertThat(tags.get("pillar"), is("p-o"));
    }
test_case.class_method_signature: CiEventReaderTest.eventForCloudCi()
test_case.full_signature: @Test public void eventForCloudCi()
test_case.identifier: eventForCloudCi
test_case.invocations: setCiId setNsPath setCiClassName setCiStateId setCiName setCiId setAttributeName setDfValue setDjValue addCI singletonList setCiId setNsPath setCiClassName setCiName setCiStateId setCiId setAttributeName setDfValue setDjValue addCI singletonList setCreated setSourcePk setEventType setSourceName populateEvent getPayload assertThat getCiId is assertThat getCiName is assertThat size getCiAttributes is assertThat get getCiAttributes is assertThat getOrg is getTags assertThat size is assertThat get is assertThat get is assertThat get is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void eventForCloudCi()
focal_class.declarator: CI_EVENT_PUB_LOCK = "CI_EVENT_PUBLISHER_LOCK"
focal_class.modifier: private static final
focal_class.original_string: private static final String CI_EVENT_PUB_LOCK = "CI_EVENT_PUBLISHER_LOCK";
focal_class.type: String
focal_class.var_name: CI_EVENT_PUB_LOCK
focal_class.declarator: EVENT_TYPE_DELETE = "delete"
focal_class.modifier: private static final
focal_class.original_string: private static final String EVENT_TYPE_DELETE = "delete";
focal_class.type: String
focal_class.var_name: EVENT_TYPE_DELETE
focal_class.declarator: CI_CLASS_ORG = "account.Organization"
focal_class.modifier: private static final
focal_class.original_string: private static final String CI_CLASS_ORG = "account.Organization";
focal_class.type: String
focal_class.var_name: CI_CLASS_ORG
focal_class.declarator: ATTR_KEY_TAGS = "tags"
focal_class.modifier: private static final
focal_class.original_string: private static final String ATTR_KEY_TAGS = "tags";
focal_class.type: String
focal_class.var_name: ATTR_KEY_TAGS
focal_class.declarator: cmsUtil = new CmsUtil()
focal_class.modifier: private
focal_class.original_string: private CmsUtil cmsUtil = new CmsUtil();
focal_class.type: CmsUtil
focal_class.var_name: cmsUtil
focal_class.declarator: gson = new Gson()
focal_class.modifier: private
focal_class.original_string: private Gson gson = new Gson();
focal_class.type: Gson
focal_class.var_name: gson
focal_class.declarator: orgCacheTtlInMins = 30
focal_class.modifier: private
focal_class.original_string: private long orgCacheTtlInMins = 30;
focal_class.type: long
focal_class.var_name: orgCacheTtlInMins
focal_class.declarator: orgCacheMaxSize = 1000
focal_class.modifier: private
focal_class.original_string: private long orgCacheMaxSize = 1000;
focal_class.type: long
focal_class.var_name: orgCacheMaxSize
focal_class.declarator: orgCache
focal_class.modifier: private
focal_class.original_string: private Cache<String, Map<String, String>> orgCache;
focal_class.type: Cache<String, Map<String, String>>
focal_class.var_name: orgCache
focal_class.file: transmitter/src/main/java/com/oneops/cms/transmitter/CIEventReader.java
focal_class.identifier: CIEventReader
focal_class.class_method_signature: CIEventReader.init()
focal_class.full_signature: public void init()
focal_class.identifier: init
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void init()
focal_class.class_method_signature: CIEventReader.getBacklog(EventMapper eventMapper)
focal_class.full_signature: @Override public int getBacklog(EventMapper eventMapper)
focal_class.identifier: getBacklog
focal_class.modifiers: @Override public
focal_class.parameters: (EventMapper eventMapper)
focal_class.return: int
focal_class.signature: int getBacklog(EventMapper eventMapper)
focal_class.class_method_signature: CIEventReader.removeEvent(long eventId, EventMapper eventMapper)
focal_class.full_signature: @Override public void removeEvent(long eventId, EventMapper eventMapper)
focal_class.identifier: removeEvent
focal_class.modifiers: @Override public
focal_class.parameters: (long eventId, EventMapper eventMapper)
focal_class.return: void
focal_class.signature: void removeEvent(long eventId, EventMapper eventMapper)
focal_class.class_method_signature: CIEventReader.getEvents(EventMapper eventMapper)
focal_class.full_signature: @Override public List<CMSEventRecord> getEvents(EventMapper eventMapper)
focal_class.identifier: getEvents
focal_class.modifiers: @Override public
focal_class.parameters: (EventMapper eventMapper)
focal_class.return: List<CMSEventRecord>
focal_class.signature: List<CMSEventRecord> getEvents(EventMapper eventMapper)
focal_class.class_method_signature: CIEventReader.getLockName()
focal_class.full_signature: @Override public String getLockName()
focal_class.identifier: getLockName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getLockName()
focal_class.class_method_signature: CIEventReader.populateEvent(CMSEventRecord record)
focal_class.full_signature: @Override protected CMSEvent populateEvent(CMSEventRecord record)
focal_class.identifier: populateEvent
focal_class.modifiers: @Override protected
focal_class.parameters: (CMSEventRecord record)
focal_class.return: CMSEvent
focal_class.signature: CMSEvent populateEvent(CMSEventRecord record)
focal_class.class_method_signature: CIEventReader.getNsEvent(CMSEventRecord record)
focal_class.full_signature: private CMSEvent getNsEvent(CMSEventRecord record)
focal_class.identifier: getNsEvent
focal_class.modifiers: private
focal_class.parameters: (CMSEventRecord record)
focal_class.return: CMSEvent
focal_class.signature: CMSEvent getNsEvent(CMSEventRecord record)
focal_class.class_method_signature: CIEventReader.getCi(CMSEventRecord record)
focal_class.full_signature: private CMSEvent getCi(CMSEventRecord record)
focal_class.identifier: getCi
focal_class.modifiers: private
focal_class.parameters: (CMSEventRecord record)
focal_class.return: CMSEvent
focal_class.signature: CMSEvent getCi(CMSEventRecord record)
focal_class.class_method_signature: CIEventReader.addTags(CmsCISimpleWithTags ci, CIMapper ciMapper)
focal_class.full_signature: private void addTags(CmsCISimpleWithTags ci, CIMapper ciMapper)
focal_class.identifier: addTags
focal_class.modifiers: private
focal_class.parameters: (CmsCISimpleWithTags ci, CIMapper ciMapper)
focal_class.return: void
focal_class.signature: void addTags(CmsCISimpleWithTags ci, CIMapper ciMapper)
focal_class.class_method_signature: CIEventReader.getOrgDetails(String org, CIMapper ciMapper)
focal_class.full_signature: private Map<String, String> getOrgDetails(String org, CIMapper ciMapper)
focal_class.identifier: getOrgDetails
focal_class.modifiers: private
focal_class.parameters: (String org, CIMapper ciMapper)
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> getOrgDetails(String org, CIMapper ciMapper)
focal_class.class_method_signature: CIEventReader.getCiRel(CMSEventRecord record)
focal_class.full_signature: private CMSEvent getCiRel(CMSEventRecord record)
focal_class.identifier: getCiRel
focal_class.modifiers: private
focal_class.parameters: (CMSEventRecord record)
focal_class.return: CMSEvent
focal_class.signature: CMSEvent getCiRel(CMSEventRecord record)
focal_class.class_method_signature: CIEventReader.getRfcCi(CMSEventRecord record)
focal_class.full_signature: private CMSEvent getRfcCi(CMSEventRecord record)
focal_class.identifier: getRfcCi
focal_class.modifiers: private
focal_class.parameters: (CMSEventRecord record)
focal_class.return: CMSEvent
focal_class.signature: CMSEvent getRfcCi(CMSEventRecord record)
focal_class.class_method_signature: CIEventReader.getRfcRelation(CMSEventRecord record)
focal_class.full_signature: private CMSEvent getRfcRelation(CMSEventRecord record)
focal_class.identifier: getRfcRelation
focal_class.modifiers: private
focal_class.parameters: (CMSEventRecord record)
focal_class.return: CMSEvent
focal_class.signature: CMSEvent getRfcRelation(CMSEventRecord record)
focal_class.class_method_signature: CIEventReader.populateRfcRelationAttributes(CmsRfcRelation relationRfc, DJMapper djMapper)
focal_class.full_signature: private CmsRfcRelation populateRfcRelationAttributes(CmsRfcRelation relationRfc, DJMapper djMapper)
focal_class.identifier: populateRfcRelationAttributes
focal_class.modifiers: private
focal_class.parameters: (CmsRfcRelation relationRfc, DJMapper djMapper)
focal_class.return: CmsRfcRelation
focal_class.signature: CmsRfcRelation populateRfcRelationAttributes(CmsRfcRelation relationRfc, DJMapper djMapper)
focal_class.class_method_signature: CIEventReader.populateRfcCIAttributes(CmsRfcCI ciRfc, DJMapper djMapper)
focal_class.full_signature: private CmsRfcCI populateRfcCIAttributes(CmsRfcCI ciRfc, DJMapper djMapper)
focal_class.identifier: populateRfcCIAttributes
focal_class.modifiers: private
focal_class.parameters: (CmsRfcCI ciRfc, DJMapper djMapper)
focal_class.return: CmsRfcCI
focal_class.signature: CmsRfcCI populateRfcCIAttributes(CmsRfcCI ciRfc, DJMapper djMapper)
focal_class.class_method_signature: CIEventReader.setOrgCacheTtlInMins(long orgCacheTtlInMins)
focal_class.full_signature: public void setOrgCacheTtlInMins(long orgCacheTtlInMins)
focal_class.identifier: setOrgCacheTtlInMins
focal_class.modifiers: public
focal_class.parameters: (long orgCacheTtlInMins)
focal_class.return: void
focal_class.signature: void setOrgCacheTtlInMins(long orgCacheTtlInMins)
focal_class.class_method_signature: CIEventReader.setOrgCacheMaxSize(long orgCacheMaxSize)
focal_class.full_signature: public void setOrgCacheMaxSize(long orgCacheMaxSize)
focal_class.identifier: setOrgCacheMaxSize
focal_class.modifiers: public
focal_class.parameters: (long orgCacheMaxSize)
focal_class.return: void
focal_class.signature: void setOrgCacheMaxSize(long orgCacheMaxSize)
focal_class.superclass: extends BaseEventReader
focal_method.body: @Override
      protected CMSEvent populateEvent(CMSEventRecord record) {
          switch (EventSource.toEventSource(record.getSourceName())) {
              case cm_ci:
                  return getCi(record);
              case cm_ci_rel:
                  return getCiRel(record);
              case rfc_ci:
                  return getRfcCi(record);
              case rfc_relation:
                  return getRfcRelation(record);
              case namespace:
                  return getNsEvent(record);
              default:
                  logger.warn("Bad event source " + record.getSourceName());
                  return null;
          }
      }
focal_method.class_method_signature: CIEventReader.populateEvent(CMSEventRecord record)
focal_method.full_signature: @Override protected CMSEvent populateEvent(CMSEventRecord record)
focal_method.identifier: populateEvent
focal_method.invocations: toEventSource getSourceName getCi getCiRel getRfcCi getRfcRelation getNsEvent warn getSourceName
focal_method.modifiers: @Override protected
focal_method.parameters: (CMSEventRecord record)
focal_method.return: CMSEvent
focal_method.signature: CMSEvent populateEvent(CMSEventRecord record)