Tabnine Logo
ProfileUpdateEvent.isProfileDeactivated
Code IndexAdd Tabnine to your IDE (free)

How to use
isProfileDeactivated
method
in
rocks.inspectit.server.ci.event.ProfileUpdateEvent

Best Java code snippets using rocks.inspectit.server.ci.event.ProfileUpdateEvent.isProfileDeactivated (Showing top 8 results out of 315)

origin: inspectIT/inspectIT

/**
 * Returns all {@link AbstractClassSensorAssignment} that are "added" as result of this update.
 * If profile was activated then it means that all assignments after the update are considered
 * for adding.
 *
 * @return Returns all {@link AbstractClassSensorAssignment} that are "removed".
 */
public Collection<AbstractClassSensorAssignment<?>> getAddedSensorAssignments() {
  if (isProfileDeactivated()) {
    // if it was deactivated then nothing is for adding
    return Collections.emptyList();
  } else if (isProfileActivated()) {
    // if activated then we consider all new assignment to be for adding
    return getAllSensorAssignments(after);
  } else {
    // otherwise find the difference
    return getAssignmentsDifference(after, before);
  }
}
origin: inspectIT/inspectIT

/**
 * Returns all {@link AbstractClassSensorAssignment} that are "removed" as result of this
 * update. If profile was deactivated then it means that all assignments before the update are
 * considered for removal.
 *
 * @return Returns all {@link AbstractClassSensorAssignment} that are "removed".
 */
public Collection<AbstractClassSensorAssignment<?>> getRemovedSensorAssignments() {
  if (isProfileDeactivated()) {
    // if deactivated then we consider all old assignment to be for removal
    return getAllSensorAssignments(before);
  } else if (isProfileActivated()) {
    // if it was activated then nothing is for removal
    return Collections.emptyList();
  } else {
    // otherwise find the difference
    return getAssignmentsDifference(before, after);
  }
}
origin: inspectIT/inspectIT

@Test
public void profileNotActive() {
  cacheMap.put(1L, cacheEntry);
  eventListener.onApplicationEvent(event);
  verify(event).isProfileActive();
  verify(event).isProfileDeactivated();
  verifyNoMoreInteractions(event);
  verifyZeroInteractions(cacheEntry, configurationHolder, environment, updateJob, future, nextGenInstrumentationManager, objectFactory, executor);
}
origin: inspectIT/inspectIT

@Test
public void deactivated() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  when(old.isActive()).thenReturn(true);
  when(updated.isActive()).thenReturn(false);
  ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
  boolean deactivated = event.isProfileDeactivated();
  assertThat(deactivated, is(true));
}
origin: inspectIT/inspectIT

@Test
public void wasNotActive() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  when(old.isActive()).thenReturn(false);
  when(updated.isActive()).thenReturn(false);
  ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
  boolean deactivated = event.isProfileDeactivated();
  assertThat(deactivated, is(false));
}
origin: inspectIT/inspectIT

  @Test
  public void stillActive() {
    when(old.getId()).thenReturn(ID);
    when(updated.getId()).thenReturn(ID);
    when(old.isActive()).thenReturn(true);
    when(updated.isActive()).thenReturn(true);
    ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
    boolean deactivated = event.isProfileDeactivated();
    assertThat(deactivated, is(false));
  }
}
origin: inspectIT/inspectIT

public void onApplicationEvent(ProfileUpdateEvent event) {
  if (!event.isProfileActive() && !event.isProfileDeactivated()) {
    return;
origin: inspectIT/inspectIT

@Test
@SuppressWarnings({ "unchecked", "rawtypes" })
public void profileWasDeactivated() throws InterruptedException, ExecutionException, TimeoutException {
  cacheMap.put(1L, cacheEntry);
  when(event.isProfileDeactivated()).thenReturn(true);
  when(event.getProfileId()).thenReturn("id_1");
  when(configurationHolder.isInitialized()).thenReturn(true);
  when(environment.getProfileIds()).thenReturn(Sets.newHashSet("id_1"));
  when(objectFactory.getObject()).thenReturn(updateJob);
  when(executor.submit(updateJob)).thenReturn((Future) future);
  eventListener.onApplicationEvent(event);
  verify(event).isProfileActive();
  verify(event).isProfileDeactivated();
  verify(event).getProfileId();
  verify(nextGenInstrumentationManager).getAgentCacheMap();
  verify(cacheEntry).getConfigurationHolder();
  verify(configurationHolder).getEnvironment();
  verify(configurationHolder).isInitialized();
  verify(environment, times(2)).getProfileIds();
  verify(objectFactory).getObject();
  verify(executor).submit(updateJob);
  verify(updateJob).setAgentCacheEntry(cacheEntry);
  verify(updateJob).setProfileUpdateEvent(event);
  verify(future).get(1L, TimeUnit.MINUTES);
  verifyNoMoreInteractions(event, cacheEntry, configurationHolder, environment, updateJob, future, nextGenInstrumentationManager, objectFactory, executor);
}
rocks.inspectit.server.ci.eventProfileUpdateEventisProfileDeactivated

Javadoc

If profile was deactivated as the result of the update action.

Popular methods of ProfileUpdateEvent

  • <init>
    Default constructor.
  • getAddedSensorAssignments
    Returns all AbstractClassSensorAssignment that are "added" as result of this update. If profile was
  • getProfileId
    Returns id of the profile being updated.
  • getRemovedSensorAssignments
    Returns all AbstractClassSensorAssignment that are "removed" as result of this update. If profile wa
  • isProfileActivated
    If profile was activated as the result of the update action.
  • isProfileActive
    Returns if the profile is active.
  • getAllSensorAssignments
    Returns all AbstractClassSensorAssignments from the profile.
  • getAssignmentsDifference
    Finds AbstractClassSensorAssignments that exists in first profile and not in the second one.

Popular in Java

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (Timer)
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JTextField (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now