Tabnine Logo
EndpointRegistrationDao.save
Code IndexAdd Tabnine to your IDE (free)

How to use
save
method
in
org.kaaproject.kaa.server.common.dao.impl.EndpointRegistrationDao

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

origin: kaaproject/kaa

@Override
public EndpointRegistrationDto saveEndpointRegistration(
    EndpointRegistrationDto endpointRegistration)
  throws EndpointRegistrationServiceException {
 try {
  Validate.notNull(endpointRegistration, "Invalid endpoint registration provided!");
  String credentialsId = endpointRegistration.getCredentialsId();
  Optional<EndpointRegistrationDto> oldRegistration =
      findEndpointRegistrationByCredentialsId(credentialsId);
  if (oldRegistration.isPresent()) {
   EndpointRegistrationDto oldRegistrationDto = oldRegistration.get();
   if (oldRegistrationDto.getEndpointId() != null
     && !oldRegistrationDto.getEndpointId().equals(endpointRegistration.getEndpointId())) {
    throw new IllegalStateException("The endpoint registration with such credentials "
                    + "already exists!");
   }
  }
  return this.endpointRegistrationDao.save(endpointRegistration).toDto();
 } catch (Exception cause) {
  LOG.error("An unexpected exception occured while saving endpoint registration!", cause);
  throw new EndpointRegistrationServiceException(cause);
 }
}
origin: kaaproject/kaa

/**
 * Constructs an endpoint registration with the information provided and
 * saves it to the database.
 *
 * @param applicationId The application ID
 * @param endpointId    The endpoint ID
 * @param credentialsId The credentials ID
 * @return The endpoint registration saved
 */
protected EndpointRegistrationDto generateEndpointRegistration(String applicationId, String endpointId, String credentialsId) {
 EndpointRegistrationDto endpointRegistration = new EndpointRegistrationDto(applicationId, endpointId, credentialsId, null, null);
 return this.endpointRegistrationDao.save(endpointRegistration).toDto();
}
origin: kaaproject/kaa

protected EndpointRegistrationDto generateEndpointRegistration(
  String applicationId,
  String endpointId,
  String credentialsId,
  Integer serverProfileVersion,
  String serverProfileBody) {
 EndpointRegistrationDto endpointRegistration = new EndpointRegistrationDto();
 endpointRegistration.setApplicationId(applicationId);
 endpointRegistration.setEndpointId(endpointId);
 endpointRegistration.setCredentialsId(credentialsId);
 endpointRegistration.setServerProfileVersion(serverProfileVersion);
 endpointRegistration.setServerProfileBody(serverProfileBody);
 return this.endpointRegistrationDao.save(endpointRegistration).toDto();
}
org.kaaproject.kaa.server.common.dao.implEndpointRegistrationDaosave

Javadoc

Saves the given endpoint registration.

Popular methods of EndpointRegistrationDao

  • findByCredentialsId
    Returns the endpoint registration by credentials ID.
  • findByEndpointId
    Returns the endpooint registration by endpoint ID.
  • removeByEndpointId
    Removes the endpoint registration by endpoint ID.
  • removeById

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setScale (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Top Sublime Text 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