congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
EndpointConfigurationDao
Code IndexAdd Tabnine to your IDE (free)

How to use
EndpointConfigurationDao
in
org.kaaproject.kaa.server.common.dao.impl

Best Java code snippets using org.kaaproject.kaa.server.common.dao.impl.EndpointConfigurationDao (Showing top 14 results out of 315)

origin: kaaproject/kaa

@Override
public EndpointConfigurationDto findEndpointConfigurationByHash(byte[] hash) {
 validateHash(hash, "Can't find endpoint configuration by hash. Invalid configuration hash "
           + hash);
 return getDto(endpointConfigurationDao.findByHash(hash));
}
origin: kaaproject/kaa

@Override
public EndpointConfigurationDto saveEndpointConfiguration(EndpointConfigurationDto
                                 endpointConfigurationDto) {
 return getDto(endpointConfigurationDao.save(endpointConfigurationDto));
}
origin: kaaproject/kaa

@Test
public void testRemoveByHash() throws Exception {
 List<CassandraEndpointConfiguration> configs = generateConfiguration(3);
 CassandraEndpointConfiguration expected = configs.get(0);
 endpointConfigurationDao.removeByHash(expected.getConfigurationHash().array());
 CassandraEndpointConfiguration found = endpointConfigurationDao.findByHash(expected.getConfigurationHash().array());
 Assert.assertNull(found);
}
origin: kaaproject/kaa

@Test
public void testRemoveByIdNullKey() throws Exception {
 List<CassandraEndpointConfiguration> configs = generateConfiguration(3);
 CassandraEndpointConfiguration expected = configs.get(0);
 endpointConfigurationDao.removeById(null);
 CassandraEndpointConfiguration found = endpointConfigurationDao.findByHash(expected.getConfigurationHash().array());
 Assert.assertEquals(expected, found);
}
origin: kaaproject/kaa

@Test
public void saveEndpointConfigurationTest() {
 EndpointConfigurationDto configurationDto = generateEndpointConfiguration();
 MongoEndpointConfiguration found = endpointConfigurationDao.findById(ByteBuffer.wrap(configurationDto.getConfigurationHash()));
 Assert.assertNotNull(found);
 MongoEndpointConfiguration savedDto = endpointConfigurationDao.save(found);
 Assert.assertNotNull(savedDto);
 Assert.assertEquals(savedDto, found);
}
origin: kaaproject/kaa

@Test
public void removeEndpointConfigurationByIdTest() {
 EndpointConfigurationDto endpointConfiguration = generateEndpointConfiguration();
 Assert.assertNotNull(endpointConfiguration);
 endpointConfigurationDao.removeById(ByteBuffer.wrap(endpointConfiguration.getConfigurationHash()));
 MongoEndpointConfiguration found = endpointConfigurationDao.findById(ByteBuffer.wrap(endpointConfiguration.getConfigurationHash()));
 Assert.assertNull(found);
}
origin: kaaproject/kaa

@Test
public void testFindByIdNullKey() throws Exception {
 CassandraEndpointConfiguration found = endpointConfigurationDao.findById(null);
 Assert.assertNull(found);
}
origin: kaaproject/kaa

@Test
public void removeEndpointConfigurationByHashTest() {
 EndpointConfigurationDto endpointConfiguration = generateEndpointConfiguration();
 Assert.assertNotNull(endpointConfiguration);
 byte[] bytes = endpointConfiguration.getConfigurationHash();
 endpointConfigurationDao.removeByHash(bytes);
 MongoEndpointConfiguration configurationDto = endpointConfigurationDao.findByHash(bytes);
 Assert.assertNull(configurationDto);
}
origin: kaaproject/kaa

 @Test
 public void testRemoveById() throws Exception {
  List<CassandraEndpointConfiguration> configs = generateConfiguration(3);
  CassandraEndpointConfiguration expected = configs.get(0);
  endpointConfigurationDao.removeById(expected.getConfigurationHash());
  CassandraEndpointConfiguration found = endpointConfigurationDao.findByHash(expected.getConfigurationHash().array());
  Assert.assertNull(found);
 }
}
origin: kaaproject/kaa

@Test
public void testFindById() throws Exception {
 List<CassandraEndpointConfiguration> configs = generateConfiguration(3);
 CassandraEndpointConfiguration expected = configs.get(0);
 CassandraEndpointConfiguration found = endpointConfigurationDao.findById(expected.getConfigurationHash());
 Assert.assertEquals(expected, found);
}
origin: kaaproject/kaa

protected EndpointConfigurationDto generateEndpointConfiguration() {
 EndpointConfigurationDto configurationDto = new EndpointConfigurationDto();
 configurationDto.setConfigurationHash(UUID.randomUUID().toString().getBytes());
 configurationDto.setConfiguration(UUID.randomUUID().toString().getBytes());
 return endpointConfigurationDao.save(new MongoEndpointConfiguration(configurationDto)).toDto();
}
origin: kaaproject/kaa

@Test
public void testFindByHash() throws Exception {
 List<CassandraEndpointConfiguration> configs = generateConfiguration(3);
 CassandraEndpointConfiguration expected = configs.get(0);
 CassandraEndpointConfiguration found = endpointConfigurationDao.findByHash(expected.getConfigurationHash().array());
 Assert.assertEquals(expected, found);
}
origin: kaaproject/kaa

@Test
public void findEndpointConfigurationByIdTest() {
 EndpointConfigurationDto configurationDto = generateEndpointConfiguration();
 MongoEndpointConfiguration found = endpointConfigurationDao.findById(ByteBuffer.wrap(configurationDto.getConfigurationHash()));
 Assert.assertNotNull(found);
}
origin: kaaproject/kaa

protected List<CassandraEndpointConfiguration> generateConfiguration(int count) {
 List<CassandraEndpointConfiguration> configurations = new ArrayList<>();
 for (int i = 0; i < count; i++) {
  CassandraEndpointConfiguration configuration = new CassandraEndpointConfiguration();
  configuration.setConfiguration(ByteBuffer.wrap(generateBytes()));
  configuration.setConfigurationHash(ByteBuffer.wrap(generateBytes()));
  configurations.add(endpointConfigurationDao.save(configuration));
 }
 return configurations;
}
org.kaaproject.kaa.server.common.dao.implEndpointConfigurationDao

Javadoc

The interface Endpoint configuration dao.

Most used methods

  • findByHash
    Find endpoint configuration by hash.
  • save
    Save endpoint configuration.
  • findById
  • removeByHash
    Remove endpoint configuration by hash.
  • removeById

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • getContentResolver (Context)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Permission (java.security)
    Legacy security code; do not use.
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • CodeWhisperer alternatives
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