/** * Constructor with entity identifier not found. * * @param entityType * @param entityId */ public KapuaEntityNotFoundException(String entityType, KapuaId entityId) { super(KapuaErrorCodes.ENTITY_NOT_FOUND, entityType, entityId.getId()); this.entityType = entityType; this.entityId = entityId; }
/** * Constructor with entity identifier not found. * * @param entityType * @param entityId */ public KapuaEntityNotFoundException(String entityType, KapuaId entityId) { super(KapuaErrorCodes.ENTITY_NOT_FOUND, entityType, entityId.getId()); this.entityType = entityType; this.entityId = entityId; }
/** * Get the identifier numeric String formatted. * * @return * @since 1.0.0 */ default String toStringId() { return getId().toString(); }
/** * Get the identifier numeric String formatted. * * @return * @since 1.0.0 */ default String toStringId() { return getId().toString(); }
@Override public void setId(KapuaId id) { if (id != null) { this.id = new KapuaEid(id.getId()); } }
@Override public void setId(KapuaId id) { if (id != null) { this.id = new KapuaEid(id.getId()); } }
@Override public void setId(KapuaId id) { if (id != null) { this.id = new KapuaEid(id.getId()); } }
@Override public void setId(KapuaId id) { if (id != null) { this.id = new KapuaEid(id.getId()); } }
/** * Constructor * * @param id */ public KapuaEid(KapuaId id) { this(); setId(id.getId()); }
@Override public void setId(KapuaId id) { if (id != null) { this.id = new KapuaEid(id.getId()); } }
@Override public void setId(KapuaId id) { if (id != null) { this.id = new KapuaEid(id.getId()); } }
@Override public void setId(KapuaId id) { if (id != null) { this.id = new KapuaEid(id.getId()); } }
/** * Constructor * * @param id */ public KapuaEid(KapuaId id) { this(); setId(id.getId()); }
@Override public void setId(KapuaId id) { if (id != null) { this.id = new KapuaEid(id.getId()); } }
/** * Get the identifier Base64 URL encoded formatted. * * @return * @since 1.0.0 */ default String toCompactId() { return Base64.getUrlEncoder().withoutPadding().encodeToString(getId().toByteArray()); }
/** * Get the identifier Base64 URL encoded formatted. * * @return * @since 1.0.0 */ default String toCompactId() { return Base64.getUrlEncoder().withoutPadding().encodeToString(getId().toByteArray()); }
private KapuaConnectionContext parseTopicInfo(javax.jms.Message message) throws JMSException, KapuaException { String originalTopic = message.getStringProperty(MessageConstants.PROPERTY_ORIGINAL_TOPIC); String topic[] = originalTopic.split("\\."); if (topic.length != 5) { logger.error("Invalid topic format. Cannot process connect message."); throw new KapuaException(KapuaErrorCodes.ILLEGAL_ARGUMENT, "wrong connect message topic"); } String accountName = topic[1]; String clientId = topic[2]; Account account = KapuaSecurityUtils.doPrivileged(() -> accountService.findByName(accountName)); Long scopeId = account.getId().getId().longValue(); return new KapuaConnectionContext(scopeId, clientId, MULTI_ACCOUNT_CLIENT_ID); }
private AccountListResult findChildAccountsTrusted(KapuaId accountId) throws KapuaException { // // Argument Validation ArgumentValidator.notNull(accountId, "accountId"); ArgumentValidator.notNull(accountId.getId(), "accountId.id"); // // Do find return entityManagerSession.onResult(em -> AccountDAO.query(em, new AccountQueryImpl(accountId))); }
private AccountListResult findChildAccountsTrusted(KapuaId accountId) throws KapuaException { // // Argument Validation ArgumentValidator.notNull(accountId, "accountId"); ArgumentValidator.notNull(accountId.getId(), "accountId.id"); // // Do find return entityManagerSession.onResult(em -> AccountDAO.query(em, new AccountQueryImpl(accountId))); }
@Given("^Account$") public void givenAccount(List<TestAccount> accountList) throws Exception { TestAccount testAccount = accountList.get(0); // If accountId is not set in account list, use last created Account for scope id if (testAccount.getScopeId() == null) { testAccount.setScopeId(((Account) stepData.get("LastAccount")).getId().getId()); } stepData.put("LastAccount", createAccount(testAccount)); }