public void setEvent(DBObject event) { this.event = encodeReservedCharacteres(event); }
@Override public int hashCode() { int result = endpointKeyHash != null ? Arrays.hashCode(endpointKeyHash) : 0; result = 31 * result + (notification != null ? notification.hashCode() : 0); return result; }
@Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof MongoEndpointNotification)) { return false; } MongoEndpointNotification that = (MongoEndpointNotification) object; if (!Arrays.equals(endpointKeyHash, that.endpointKeyHash)) { return false; } return !(notification != null ? !notification.equals(that.notification) : that.notification != null); }
@Test public void basicTest() { EventClassFamilyVersionState state = new EventClassFamilyVersionState(); state.setEcfId("testID"); state.setVersion(42); EventClassFamilyVersionStateDto dto = state.toDto(); EventClassFamilyVersionState state2 = new EventClassFamilyVersionState(dto); Assert.assertEquals(state.getEcfId(), state2.getEcfId()); Assert.assertEquals(state.getVersion(), state2.getVersion()); }
@Override public EndpointSpecificConfigurationDto toDto() { EndpointSpecificConfigurationDto dto = new EndpointSpecificConfigurationDto(); dto.setEndpointKeyHash(this.getEndpointKeyHash()); dto.setConfiguration(this.getConfiguration()); dto.setConfigurationSchemaVersion(this.getConfigurationVersion()); dto.setVersion(this.getVersion()); return dto; }
@Override public MongoEndpointProfile save(EndpointProfileDto dto) { return save(new MongoEndpointProfile(dto)); }
@Override public MongoEndpointConfiguration save(EndpointConfigurationDto dto) { return save(new MongoEndpointConfiguration(dto)); } }
@Override public MongoEndpointUser save(EndpointUserDto dto) { return save(new MongoEndpointUser(dto)); }
@Override public MongoEndpointUserConfiguration save(EndpointUserConfigurationDto dto) { LOG.debug("Saving user specific configuration {}", dto); MongoEndpointUserConfiguration userConfiguration = save( new MongoEndpointUserConfiguration(dto)); if (LOG.isTraceEnabled()) { LOG.trace("Saving result: {}", userConfiguration); } else { LOG.debug("Saving result: {}", userConfiguration != null); } return userConfiguration; }
@Test public void convertToModelListNullArgsListTest() { List<EndpointGroupState> list = MongoDaoUtil.convertDtoToModelList(null); Assert.assertNull(list); }
@Override public MongoNotification save(NotificationDto notification) { return save(new MongoNotification(notification)); } }
@Override public MongoEndpointNotification save(EndpointNotificationDto dto) { return save(new MongoEndpointNotification(dto)); } }
@Override public MongoTopicListEntry save(TopicListEntryDto dto) { return save(new MongoTopicListEntry(dto)); }
@Override public String generateAccessToken(String externalUid, String tenantId) { MongoEndpointUser endpointUser = findByExternalIdAndTenantId(externalUid, tenantId); String accessToken = UUID.randomUUID().toString(); endpointUser.setAccessToken(accessToken); save(endpointUser); return accessToken; }
/** * All-args constructor. */ public MongoEndpointSpecificConfiguration(EndpointSpecificConfigurationDto dto) { this.endpointKeyHash = dto.getEndpointKeyHash(); this.configurationVersion = dto.getConfigurationSchemaVersion(); this.configuration = dto.getConfiguration(); this.version = dto.getVersion(); generateId(); }
@Override public EndpointNotificationDto toDto() { EndpointNotificationDto dto = new EndpointNotificationDto(); dto.setId(id); dto.setEndpointKeyHash(getArrayCopy(endpointKeyHash)); dto.setNotificationDto(notification != null ? notification.toDto() : null); return dto; } }
public void setHeader(DBObject header) { this.header = encodeReservedCharacteres(header); }
/** * Create new instance of <code>MongoEndpointNotification</code>. * @param dto data transfer object contain data that * assign on fields of new instance */ public MongoEndpointNotification(EndpointNotificationDto dto) { this.id = dto.getId(); this.endpointKeyHash = getArrayCopy(dto.getEndpointKeyHash()); this.notification = dto.getNotificationDto() != null ? new MongoNotification(dto.getNotificationDto()) : null; }
public void setServerProfile(DBObject serverProfile) { this.serverProfile = encodeReservedCharacteres(serverProfile); }
public void setClientProfile(DBObject clientProfile) { this.clientProfile = encodeReservedCharacteres(clientProfile); }