Codota Logo
PlatformSensorTypeIdentDao
Code IndexAdd Codota to your IDE (free)

How to use
PlatformSensorTypeIdentDao
in
rocks.inspectit.server.dao

Best Java code snippets using rocks.inspectit.server.dao.PlatformSensorTypeIdentDao (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
@MethodLog
public long registerPlatformSensorTypeIdent(long platformId, String fullyQualifiedClassName) {
  try {
    List<Long> platformSensorTypeIdentIds = platformSensorTypeIdentDao.findIdByClassNameAndPlatformId(fullyQualifiedClassName, platformId);
    if (1 == platformSensorTypeIdentIds.size()) {
      return platformSensorTypeIdentIds.get(0).longValue();
    } else {
      // only if it s not registered we need updating
      PlatformIdent platformIdent = new PlatformIdent();
      platformIdent.setId(platformId);
      PlatformSensorTypeIdent platformSensorTypeIdent = new PlatformSensorTypeIdent();
      platformSensorTypeIdent.setPlatformIdent(platformIdent);
      platformSensorTypeIdent.setFullyQualifiedClassName(fullyQualifiedClassName);
      platformSensorTypeIdentDao.saveOrUpdate(platformSensorTypeIdent);
      return platformSensorTypeIdent.getId();
    }
  } finally {
    platformIdentCache.markDirty(platformId);
  }
}
origin: inspectIT/inspectIT

  /**
   * Test the registration of the platform sensor type.
   */
  @Test
  public void registerPlatformSensorType() {
    final long platformSensorId = 20;
    long platformId = 1;
    final String fqcName = "class";
    when(platformSensorTypeIdentDao.findIdByClassNameAndPlatformId(fqcName, platformId)).thenReturn(Collections.<Long> emptyList());
    Mockito.doAnswer(new Answer<Object>() {
      @Override
      public Object answer(InvocationOnMock invocation) throws Throwable {
        PlatformSensorTypeIdent platformSensorTypeIdent = (PlatformSensorTypeIdent) invocation.getArguments()[0];
        platformSensorTypeIdent.setId(Long.valueOf(platformSensorId));
        platformSensorTypeIdent.setFullyQualifiedClassName(fqcName);
        return null;
      }
    }).when(platformSensorTypeIdentDao).saveOrUpdate((PlatformSensorTypeIdent) anyObject());
    long registeredId = registrationService.registerPlatformSensorTypeIdent(platformId, fqcName);
    assertThat(registeredId, is(equalTo(platformSensorId)));
    verify(platformIdentCache, times(1)).markDirty(platformId);
    ArgumentCaptor<PlatformSensorTypeIdent> platformSensorArgument = ArgumentCaptor.forClass(PlatformSensorTypeIdent.class);
    verify(platformSensorTypeIdentDao, times(1)).saveOrUpdate(platformSensorArgument.capture());
    assertThat(platformSensorArgument.getValue().getFullyQualifiedClassName(), is(equalTo(fqcName)));
    assertThat(platformSensorArgument.getValue().getPlatformIdent().getId(), is(equalTo(platformId)));
    verify(platformIdentCache, times(1)).markDirty(platformId);
  }
}
rocks.inspectit.server.daoPlatformSensorTypeIdentDao

Javadoc

This DAO is used to handle all PlatformSensorTypeIdent objects.

Most used methods

  • findIdByClassNameAndPlatformId
    Find the PlatformSensorTypeIdent object IDs with given fully qualified sensor class name and platfor
  • saveOrUpdate
    Saves or updates this PlatformSensorTypeIdent in the underlying storage.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getExternalFilesDir (Context)
  • getSystemService (Context)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now