test_class.declarator: cmProcessorMock
test_class.modifier: private
test_class.original_string: private CmsCmProcessor cmProcessorMock;
test_class.type: CmsCmProcessor
test_class.var_name: cmProcessorMock
test_class.declarator: envProcessorMock
test_class.modifier: private
test_class.original_string: private EnvPropsProcessor envProcessorMock;
test_class.type: EnvPropsProcessor
test_class.var_name: envProcessorMock
test_class.declarator: notifierMock
test_class.modifier: private
test_class.original_string: private Notifications notifierMock;
test_class.type: Notifications
test_class.var_name: notifierMock
test_class.declarator: rfcProcessorMock
test_class.modifier: private
test_class.original_string: private CmsRfcProcessor rfcProcessorMock;
test_class.type: CmsRfcProcessor
test_class.var_name: rfcProcessorMock
test_class.declarator: restTemplateMock
test_class.modifier: private
test_class.original_string: private RestTemplate restTemplateMock;
test_class.type: RestTemplate
test_class.var_name: restTemplateMock
test_class.declarator: ID_WITH_AUTO_REPAIR = 11
test_class.modifier: private static final
test_class.original_string: private static final long ID_WITH_AUTO_REPAIR = 11;
test_class.type: long
test_class.var_name: ID_WITH_AUTO_REPAIR
test_class.declarator: ID_WITHOUT_AUTO_REPAIR = 10
test_class.modifier: private static final
test_class.original_string: private static final long ID_WITHOUT_AUTO_REPAIR = 10;
test_class.type: long
test_class.var_name: ID_WITHOUT_AUTO_REPAIR
test_class.declarator: ID_WITH_AUTO_SCALING = 21
test_class.modifier: private static final
test_class.original_string: private static final long ID_WITH_AUTO_SCALING = 21;
test_class.type: long
test_class.var_name: ID_WITH_AUTO_SCALING
test_class.declarator: ID_WITHOUT_AUTO_SCALING = 20
test_class.modifier: private static final
test_class.original_string: private static final long ID_WITHOUT_AUTO_SCALING = 20;
test_class.type: long
test_class.var_name: ID_WITHOUT_AUTO_SCALING
test_class.declarator: ID_NOT_FOUND = -1
test_class.modifier: private static final
test_class.original_string: private static final long ID_NOT_FOUND = -1;
test_class.type: long
test_class.var_name: ID_NOT_FOUND
test_class.declarator: logger = Logger.getLogger(FlexStateProcessor.class)
test_class.modifier: private static
test_class.original_string: private static Logger logger = Logger.getLogger(FlexStateProcessor.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: opamp/src/test/java/com/oneops/opamp/service/FlexStateProcessorTest.java
test_class.identifier: FlexStateProcessorTest
test_case.body: @Test
  /** exercises processOverutilized() with an autoscale and a nonautoscale */
  	public void processOverutilized(){
  		CiOpsProcessor cop = mock(CiOpsProcessor.class);
  		when(cop.getCIstate(ID_WITH_AUTO_SCALING)).thenReturn("overutilized");
  		when(cop.getCIstate(ID_WITHOUT_AUTO_SCALING)).thenReturn("other-state");
  
  		FlexStateProcessor fsp = new FlexStateProcessor();
  		fsp.setCoProcessor(cop);	
  		fsp.setEnvProcessor(envProcessorMock);
  		fsp.setCmProcessor(cmProcessorMock);
  		fsp.setNotifier(notifierMock);
  		fsp.setRestTemplate(restTemplateMock);
  		fsp.setTransistorUrl(null);		
  	
  		 try {
  			 CiChangeStateEvent event = new CiChangeStateEvent();
  			event.setCiId(ID_WITH_AUTO_SCALING);
  
  			fsp.processOverutilized(event, true);
  			//drives private method for growPool...
  			event = new CiChangeStateEvent();
  			event.setCiId(ID_WITHOUT_AUTO_SCALING);
  			fsp.processOverutilized(event, true);
  			event = new CiChangeStateEvent();
  			event.setCiId(ID_WITHOUT_AUTO_REPAIR);
  			fsp.processOverutilized(event, true);
  
  		} catch (OpampException e) {
  			logger.warn("Not expected to catch here ",e);
  			throw new RuntimeException(e);
  		}
  	}
test_case.class_method_signature: FlexStateProcessorTest.processOverutilized()
test_case.full_signature: @Test /** exercises processOverutilized() with an autoscale and a nonautoscale */ public void processOverutilized()
test_case.identifier: processOverutilized
test_case.invocations: mock thenReturn when getCIstate thenReturn when getCIstate setCoProcessor setEnvProcessor setCmProcessor setNotifier setRestTemplate setTransistorUrl setCiId processOverutilized setCiId processOverutilized setCiId processOverutilized warn
test_case.modifiers: @Test /** exercises processOverutilized() with an autoscale and a nonautoscale */ public
test_case.parameters: ()
test_case.return: void
test_case.signature: void processOverutilized()
focal_class.declarator: logger = Logger.getLogger(FlexStateProcessor.class)
focal_class.modifier: private static
focal_class.original_string: private static Logger logger = Logger.getLogger(FlexStateProcessor.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: cmProcessor
focal_class.modifier: private
focal_class.original_string: private CmsCmProcessor cmProcessor;
focal_class.type: CmsCmProcessor
focal_class.var_name: cmProcessor
focal_class.declarator: envProcessor
focal_class.modifier: private
focal_class.original_string: private EnvPropsProcessor envProcessor;
focal_class.type: EnvPropsProcessor
focal_class.var_name: envProcessor
focal_class.declarator: coProcessor
focal_class.modifier: private
focal_class.original_string: private CiOpsProcessor coProcessor;
focal_class.type: CiOpsProcessor
focal_class.var_name: coProcessor
focal_class.declarator: notifier
focal_class.modifier: private
focal_class.original_string: private Notifications notifier;
focal_class.type: Notifications
focal_class.var_name: notifier
focal_class.declarator: restTemplate
focal_class.modifier: private
focal_class.original_string: private RestTemplate restTemplate;
focal_class.type: RestTemplate
focal_class.var_name: restTemplate
focal_class.declarator: transistorUrl
focal_class.modifier: private
focal_class.original_string: private String transistorUrl;
focal_class.type: String
focal_class.var_name: transistorUrl
focal_class.declarator: CI_STATE_OVERUTILIZED = "overutilized"
focal_class.modifier: public static final
focal_class.original_string: public static final String CI_STATE_OVERUTILIZED = "overutilized";
focal_class.type: String
focal_class.var_name: CI_STATE_OVERUTILIZED
focal_class.declarator: CI_STATE_UNDERUTILIZED = "underutilized"
focal_class.modifier: public static final
focal_class.original_string: public static final String CI_STATE_UNDERUTILIZED = "underutilized";
focal_class.type: String
focal_class.var_name: CI_STATE_UNDERUTILIZED
focal_class.file: opamp/src/main/java/com/oneops/opamp/service/FlexStateProcessor.java
focal_class.identifier: FlexStateProcessor
focal_class.class_method_signature: FlexStateProcessor.setCmProcessor(CmsCmProcessor cmProcessor)
focal_class.full_signature: public void setCmProcessor(CmsCmProcessor cmProcessor)
focal_class.identifier: setCmProcessor
focal_class.modifiers: public
focal_class.parameters: (CmsCmProcessor cmProcessor)
focal_class.return: void
focal_class.signature: void setCmProcessor(CmsCmProcessor cmProcessor)
focal_class.class_method_signature: FlexStateProcessor.setEnvProcessor(EnvPropsProcessor envProcessor)
focal_class.full_signature: public void setEnvProcessor(EnvPropsProcessor envProcessor)
focal_class.identifier: setEnvProcessor
focal_class.modifiers: public
focal_class.parameters: (EnvPropsProcessor envProcessor)
focal_class.return: void
focal_class.signature: void setEnvProcessor(EnvPropsProcessor envProcessor)
focal_class.class_method_signature: FlexStateProcessor.setCoProcessor(CiOpsProcessor coProcessor)
focal_class.full_signature: public void setCoProcessor(CiOpsProcessor coProcessor)
focal_class.identifier: setCoProcessor
focal_class.modifiers: public
focal_class.parameters: (CiOpsProcessor coProcessor)
focal_class.return: void
focal_class.signature: void setCoProcessor(CiOpsProcessor coProcessor)
focal_class.class_method_signature: FlexStateProcessor.setNotifier(Notifications notifier)
focal_class.full_signature: public void setNotifier(Notifications notifier)
focal_class.identifier: setNotifier
focal_class.modifiers: public
focal_class.parameters: (Notifications notifier)
focal_class.return: void
focal_class.signature: void setNotifier(Notifications notifier)
focal_class.class_method_signature: FlexStateProcessor.setRestTemplate(RestTemplate restTemplate)
focal_class.full_signature: public void setRestTemplate(RestTemplate restTemplate)
focal_class.identifier: setRestTemplate
focal_class.modifiers: public
focal_class.parameters: (RestTemplate restTemplate)
focal_class.return: void
focal_class.signature: void setRestTemplate(RestTemplate restTemplate)
focal_class.class_method_signature: FlexStateProcessor.setTransistorUrl(String transistorUrl)
focal_class.full_signature: public void setTransistorUrl(String transistorUrl)
focal_class.identifier: setTransistorUrl
focal_class.modifiers: public
focal_class.parameters: (String transistorUrl)
focal_class.return: void
focal_class.signature: void setTransistorUrl(String transistorUrl)
focal_class.class_method_signature: FlexStateProcessor.processOverutilized(CiChangeStateEvent event, boolean isNewState)
focal_class.full_signature: public void processOverutilized(CiChangeStateEvent event, boolean isNewState)
focal_class.identifier: processOverutilized
focal_class.modifiers: public
focal_class.parameters: (CiChangeStateEvent event, boolean isNewState)
focal_class.return: void
focal_class.signature: void processOverutilized(CiChangeStateEvent event, boolean isNewState)
focal_class.class_method_signature: FlexStateProcessor.processUnderutilized(CiChangeStateEvent event, boolean isNewState, long originalEventTimestamp)
focal_class.full_signature: public void processUnderutilized(CiChangeStateEvent event, boolean isNewState, long originalEventTimestamp)
focal_class.identifier: processUnderutilized
focal_class.modifiers: public
focal_class.parameters: (CiChangeStateEvent event, boolean isNewState, long originalEventTimestamp)
focal_class.return: void
focal_class.signature: void processUnderutilized(CiChangeStateEvent event, boolean isNewState, long originalEventTimestamp)
focal_class.class_method_signature: FlexStateProcessor.growPool(CiChangeStateEvent event, CmsCI env, boolean isNewState)
focal_class.full_signature: private void growPool(CiChangeStateEvent event, CmsCI env, boolean isNewState)
focal_class.identifier: growPool
focal_class.modifiers: private
focal_class.parameters: (CiChangeStateEvent event, CmsCI env, boolean isNewState)
focal_class.return: void
focal_class.signature: void growPool(CiChangeStateEvent event, CmsCI env, boolean isNewState)
focal_class.class_method_signature: FlexStateProcessor.shrinkPool(CiChangeStateEvent event, CmsCI env, boolean isNewState, long originalEventTimestamp)
focal_class.full_signature: private void shrinkPool(CiChangeStateEvent event, CmsCI env, boolean isNewState, long originalEventTimestamp)
focal_class.identifier: shrinkPool
focal_class.modifiers: private
focal_class.parameters: (CiChangeStateEvent event, CmsCI env, boolean isNewState, long originalEventTimestamp)
focal_class.return: void
focal_class.signature: void shrinkPool(CiChangeStateEvent event, CmsCI env, boolean isNewState, long originalEventTimestamp)
focal_class.class_method_signature: FlexStateProcessor.isAnyPoolMemberOver(CiChangeStateEvent event, long manifestCompId, String state)
focal_class.full_signature: private boolean isAnyPoolMemberOver(CiChangeStateEvent event, long manifestCompId, String state)
focal_class.identifier: isAnyPoolMemberOver
focal_class.modifiers: private
focal_class.parameters: (CiChangeStateEvent event, long manifestCompId, String state)
focal_class.return: boolean
focal_class.signature: boolean isAnyPoolMemberOver(CiChangeStateEvent event, long manifestCompId, String state)
focal_class.class_method_signature: FlexStateProcessor.isAnyPoolMemberOverUtil(long manifestId)
focal_class.full_signature: private boolean isAnyPoolMemberOverUtil(long manifestId)
focal_class.identifier: isAnyPoolMemberOverUtil
focal_class.modifiers: private
focal_class.parameters: (long manifestId)
focal_class.return: boolean
focal_class.signature: boolean isAnyPoolMemberOverUtil(long manifestId)
focal_class.class_method_signature: FlexStateProcessor.processFlexRelation(CmsCIRelation flexRel, CmsCI env, int step, boolean scaleUp)
focal_class.full_signature: private void processFlexRelation(CmsCIRelation flexRel, CmsCI env, int step, boolean scaleUp)
focal_class.identifier: processFlexRelation
focal_class.modifiers: private
focal_class.parameters: (CmsCIRelation flexRel, CmsCI env, int step, boolean scaleUp)
focal_class.return: void
focal_class.signature: void processFlexRelation(CmsCIRelation flexRel, CmsCI env, int step, boolean scaleUp)
focal_class.class_method_signature: FlexStateProcessor.findManifestComputeId(long ciId)
focal_class.full_signature: private long findManifestComputeId(long ciId)
focal_class.identifier: findManifestComputeId
focal_class.modifiers: private
focal_class.parameters: (long ciId)
focal_class.return: long
focal_class.signature: long findManifestComputeId(long ciId)
focal_class.class_method_signature: FlexStateProcessor.findFlexRelation(long ciId)
focal_class.full_signature: private CmsCIRelation findFlexRelation(long ciId)
focal_class.identifier: findFlexRelation
focal_class.modifiers: private
focal_class.parameters: (long ciId)
focal_class.return: CmsCIRelation
focal_class.signature: CmsCIRelation findFlexRelation(long ciId)
focal_method.body: public void processOverutilized(CiChangeStateEvent event, boolean isNewState) throws OpampException{
  		long ciId = event.getCiId();
  		if (CI_STATE_OVERUTILIZED.equals(coProcessor.getCIstate(ciId))) {
  			CmsCI env;
  			if (envProcessor.isAutoscaleEnabled(ciId) && (env = envProcessor.getEnv4Bom(ciId)) != null) {
  				if (envProcessor.isCloudActive4Bom(ciId)) {
  					growPool(event, env, isNewState);
  				} else {
  					notifier.sendFlexNotificationInactiveCloud(event, CI_STATE_OVERUTILIZED);
  				}
  			} else {
  				notifier.sendFlexNotificationNoRepair(event, CI_STATE_OVERUTILIZED);
  			}
  		} else {
  			// ci is already healthy
  			logger.info("Ci is good now - " + ciId);
  		}
  	}
focal_method.class_method_signature: FlexStateProcessor.processOverutilized(CiChangeStateEvent event, boolean isNewState)
focal_method.full_signature: public void processOverutilized(CiChangeStateEvent event, boolean isNewState)
focal_method.identifier: processOverutilized
focal_method.invocations: getCiId equals getCIstate isAutoscaleEnabled getEnv4Bom isCloudActive4Bom growPool sendFlexNotificationInactiveCloud sendFlexNotificationNoRepair info
focal_method.modifiers: public
focal_method.parameters: (CiChangeStateEvent event, boolean isNewState)
focal_method.return: void
focal_method.signature: void processOverutilized(CiChangeStateEvent event, boolean isNewState)