private void updateProperties() { Provider provider = getEntity(); setName(provider.getName()); setType(provider.getType()); setDescription(provider.getDescription()); setUrl(provider.getUrl()); }
if (provider.getUrl().startsWith(Uri.SCHEME_HTTPS)) { AsyncDataProvider.getInstance().getProviderCertificateChain(new AsyncQuery<>(certs -> { boolean ok = false;
@Mapping(from = Provider.class, to = ExternalHostProvider.class) public static ExternalHostProvider map(Provider entity, ExternalHostProvider template) { ExternalHostProvider model = template != null? template: new ExternalHostProvider(); if (entity.getId() != null) { model.setId(entity.getId().toString()); } if (entity.getName() != null) { model.setName(entity.getName()); } if (entity.getDescription() != null) { model.setDescription(entity.getDescription()); } if (entity.getUrl() != null) { model.setUrl(entity.getUrl()); } model.setRequiresAuthentication(entity.isRequiringAuthentication()); if (entity.getUsername() != null) { model.setUsername(entity.getUsername()); } // The password isn't mapped for security reasons. // if (entity.getPassword() != null) { // model.setPassword(entity.getPassword()); // } return model; } }
protected MapSqlParameterSource createBaseProviderParametersMapper(Provider<?> entity) { return createIdParameterMapper(entity.getId()) .addValue("name", entity.getName()) .addValue("description", entity.getDescription()) .addValue("url", entity.getUrl()) .addValue("provider_type", EnumUtils.nameOrNull(entity.getType())) .addValue("auth_required", entity.isRequiringAuthentication()) .addValue("auth_username", entity.getUsername()) .addValue("auth_password", DbFacadeUtils.encryptPassword(entity.getPassword())) .addValue("custom_properties", SerializationFactory.getSerializer().serialize(entity.getCustomProperties())) .addValue("auth_url", entity.getAuthUrl()) .addValue("is_unmanaged", entity.getIsUnmanaged()); }
@Override public String toString() { return ToStringBuilder.forInstance(this) .append("id", getId()) .append("name", getName()) .append("description", getDescription()) .append("url", getUrl()) .append("type", getType()) .append("requiringAuthentication", isRequiringAuthentication()) .append("username", getUsername()) .appendFiltered("password", getPassword()) .append("customProperties", getCustomProperties()) .append("additionalProperties", getAdditionalProperties()) .append("authUrl", getAuthUrl()) .append("isUnmanaged", getIsUnmanaged()) .build(); }