Codota Logo
org.kaaproject.kaa.server.common.dao.exception
Code IndexAdd Codota to your IDE (free)

How to use org.kaaproject.kaa.server.common.dao.exception

Best Java code snippets using org.kaaproject.kaa.server.common.dao.exception (Showing top 20 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: kaaproject/kaa

/**
 * Check schema.
 *
 * @param schemaDto the schema dto
 * @param file      the file
 * @throws NotFoundException the control service exception
 */
private void checkSchema(VersionDto schemaDto, RecordFiles file) throws NotFoundException {
 if (schemaDto == null) {
  throw new NotFoundException("Schema " + file + " not found!");
 }
}
origin: kaaproject/kaa

/**
 * This method validates <code>Object</code> object. If object is null than throw
 * <code>IncorrectParameterException</code> exception
 *
 * @param obj          the obj
 * @param errorMessage the error message for exception
 */
public static void validateNotNull(Object obj, String errorMessage) {
 if (obj == null) {
  throw new IncorrectParameterException(errorMessage);
 }
}
origin: kaaproject/kaa

 @Override
 public void removeEndpointRegistrationById(String registrationId)
     throws EndpointRegistrationServiceException {
  try {
   Validate.notBlank(registrationId, "Invalid registration ID provided!");
   this.endpointRegistrationDao.removeById(registrationId);
  } catch (Exception cause) {
   LOG.error("An unexpected exception occured while removing endpoint registration!", cause);
   throw new EndpointRegistrationServiceException(cause);
  }
 }
}
origin: kaaproject/kaa

private ServerProfileSchemaDto getServerProfileSchema(String applicationId,
                           Integer serverProfileVersion)
  throws Exception {
 ServerProfileSchemaDto serverProfileSchema =
   this.controlService.getServerProfileSchemaByApplicationIdAndVersion(
     applicationId, serverProfileVersion);
 if (serverProfileSchema == null) {
  throw new NotFoundException("No server-side endpoint profile schema found!");
 }
 return serverProfileSchema;
}
origin: kaaproject/kaa

/**
 * This method validates <code>Object</code> object. If object is not null than throw
 * <code>IncorrectParameterException</code> exception
 *
 * @param obj          the obj
 * @param errorMessage the error message for exception
 */
public static void validateNull(Object obj, String errorMessage) {
 if (obj != null) {
  throw new IncorrectParameterException(errorMessage);
 }
}
origin: kaaproject/kaa

@Override
public void removeEndpointRegistrationByEndpointId(String endpointId)
    throws EndpointRegistrationServiceException {
 try {
  Validate.notBlank(endpointId, "Invalid endpoint ID provided!");
  this.endpointRegistrationDao.removeByEndpointId(endpointId);
 } catch (Exception cause) {
  LOG.error("An unexpected exception occured while removing endpoint registration!", cause);
  throw new EndpointRegistrationServiceException(cause);
 }
}
origin: kaaproject/kaa

@Override
public CTLSchemaDto getCtlSchemaById(String schemaId) throws ControlServiceException {
 CTLSchemaDto ctlSchemaDto = ctlService.findCtlSchemaById(schemaId);
 if (ctlSchemaDto == null) {
  LOG.error("CTL schema with Id [{}] not found!", schemaId);
  throw new NotFoundException("CTL schema not found!");
 }
 return ctlSchemaDto;
}
origin: kaaproject/kaa

/**
 * This method validate <code>String</code> string. If string is invalid than throw
 * <code>IncorrectParameterException</code> exception
 *
 * @param id           the id
 * @param errorMessage the error message for exception
 */
public static void validateString(String id, String errorMessage) {
 if (id == null || id.isEmpty()) {
  throw new IncorrectParameterException(errorMessage);
 }
}
origin: kaaproject/kaa

@Override
public EndpointSpecificConfigurationDto findEndpointSpecificConfiguration(byte[] endpointKeyHash, Integer confSchemaVersion) {
 Optional<EndpointSpecificConfigurationDto> result;
 if (confSchemaVersion == null) {
  result = endpointSpecificConfigurationService.findActiveConfigurationByEndpointKeyHash(endpointKeyHash);
 } else {
  result = endpointSpecificConfigurationService.findByEndpointKeyHashAndConfSchemaVersion(endpointKeyHash, confSchemaVersion);
 }
 return result.orElseThrow(() -> new NotFoundException("Endpoint specific configuration not found"));
}
origin: kaaproject/kaa

/**
 * @param id           the id.
 * @param errorMessage the error message for exception
 */
public static void validateSqlId(String id, String errorMessage) {
 try {
  Long.valueOf(id);
 } catch (NumberFormatException ex) {
  throw new IncorrectParameterException(errorMessage, ex);
 }
}
origin: kaaproject/kaa

@Override
public EndpointSpecificConfigurationDto deleteEndpointSpecificConfiguration(byte[] endpointKeyHash, Integer confSchemaVersion) {
 Optional<EndpointSpecificConfigurationDto> result;
 if (confSchemaVersion == null) {
  result = endpointSpecificConfigurationService.deleteActiveConfigurationByEndpointKeyHash(endpointKeyHash);
 } else {
  result = endpointSpecificConfigurationService.deleteByEndpointKeyHashAndConfSchemaVersion(endpointKeyHash, confSchemaVersion);
 }
 EndpointSpecificConfigurationDto configuration = result
   .orElseThrow(() -> new NotFoundException("Endpoint specific configuration not found"));
 sendEndpointConfigurationRefreshMessage(configuration);
 return configuration;
}
origin: kaaproject/kaa

private void validateFilterSchemaIds(String endpointProfileSchemaId,
                   String serverProfileSchemaId) {
 if (isBlank(endpointProfileSchemaId) && isBlank(serverProfileSchemaId)) {
  throw new IncorrectParameterException("Both profile schema ids can't be empty");
 }
}
origin: kaaproject/kaa

/**
 * This method validate <code>byte</code> array hash. If hash is invalid than throw
 * <code>IncorrectParameterException</code> exception
 *
 * @param hash         the hash
 * @param errorMessage the error message for exception
 */
public static void validateHash(byte[] hash, String errorMessage) {
 if (!isValidHash(hash)) {
  throw new IncorrectParameterException(errorMessage);
 }
}
origin: kaaproject/kaa

/**
 * This method validate <code>HasId</code> object. If object is invalid than throw
 * <code>IncorrectParameterException</code> exception
 *
 * @param hasId        the hash id
 * @param errorMessage the error message for exception
 */
public static void validateObject(HasId hasId, String errorMessage) {
 if (!isValidObject(hasId)) {
  throw new IncorrectParameterException(errorMessage);
 }
}
origin: kaaproject/kaa

/**
 * This method validate <code>String</code> id. If id is invalid than throw
 * <code>IncorrectParameterException</code> exception
 *
 * @param id           the id
 * @param errorMessage the error message for exception
 */
public static void validateId(String id, String errorMessage) {
 if (!isValidId(id)) {
  throw new IncorrectParameterException(errorMessage);
 }
}
origin: kaaproject/kaa

 /**
  * This method validate <code>HasId</code> object. If object is invalid than throw
  * <code>IncorrectParameterException</code> exception
  *
  * @param hasId        the hash id
  * @param errorMessage the error message for exceptio
  */
 public static void validateSqlObject(HasId hasId, String errorMessage) {
  if (!isValidSqlObject(hasId)) {
   throw new IncorrectParameterException(errorMessage);
  }
 }
}
origin: kaaproject/kaa

 private void validateFilter(ProfileFilterDto dto) {
  if (dto == null) {
   throw new IncorrectParameterException("Can't save profile filter. Incorrect object.");
  }
  if (dto.getEndpointProfileSchemaId() == null && dto.getServerProfileSchemaId() == null) {
   throw new IncorrectParameterException(
       "Profile Filter object invalid. Both schemas are empty.");
  }
  if (StringUtils.isBlank(dto.getEndpointGroupId())) {
   throw new IncorrectParameterException(
       "Profile Filter object invalid. Endpoint Group id invalid:"
       + dto.getEndpointGroupId());
  }
 }
}
origin: kaaproject/kaa

@Override
public CTLSchemaDto findCtlSchemaByFqnAndVerAndTenantIdAndApplicationId(String fqn, Integer
    version, String tenantId, String applicationId) {
 if (isBlank(fqn) || version == null) {
  throw new IncorrectParameterException("Incorrect parameters for ctl schema request.");
 }
 LOG.debug("Find ctl schema by fqn {} version {}, tenant id {} and application id {}", fqn,
     version, tenantId, applicationId);
 return DaoUtil.getDto(ctlSchemaDao.findByFqnAndVerAndTenantIdAndApplicationId(fqn, version,
     tenantId, applicationId));
}
origin: kaaproject/kaa

@Override
public List<EventClassFamilyDto> findEventClassFamiliesByTenantId(
  String tenantId) {
 List<EventClassFamilyDto> eventClassFamilies;
 if (isValidSqlId(tenantId)) {
  LOG.debug("Find event class families by tenant id [{}]", tenantId);
  eventClassFamilies = convertDtoList(eventClassFamilyDao.findByTenantId(tenantId));
 } else {
  throw new IncorrectParameterException("Incorrect tenant id: " + tenantId);
 }
 return eventClassFamilies;
}
origin: kaaproject/kaa

private void validateNotificationSchemaObject(NotificationSchemaDto dto) {
 validateObject(dto, "Invalid notification schema object");
 if (isBlank(dto.getApplicationId()) && !isValidId(dto.getApplicationId())
   || dto.getType() == null) {
  throw new IncorrectParameterException(
      "Invalid notification schema object. Check type or applicationId.");
 }
}
org.kaaproject.kaa.server.common.dao.exception

Most used classes

  • DatabaseProcessingException
  • KaaOptimisticLockingFailureException
  • NotFoundException
  • CredentialsServiceException
    A checked exception to be thrown by org.kaaproject.kaa.server.common.dao.CredentialsService.
  • EndpointRegistrationServiceException
    A checked exception to be thrown by EndpointRegistrationService.
  • UpdateStatusConflictException
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