/** * Factory method to create a default {@link PropertiesBuilder} instance. * * @return an instance of the {@link PropertiesBuilder} class with not {@link Properties}. * @see #PropertiesBuilder() */ public static PropertiesBuilder create() { return new PropertiesBuilder(); }
/** * Factory method to create an instance of {@link PropertiesBuilder} initialized with the given {@link Properties}. * * @param properties {@link Properties} used as the default properties of the constructed {@link PropertiesBuilder}. * @return an instance of {@link PropertiesBuilder} initialized with the given {@link Properties}. * @see java.util.Properties * @see #PropertiesBuilder(Properties) */ public static PropertiesBuilder from(Properties properties) { return new PropertiesBuilder(properties); }
/** * Factory method to create a default {@link PropertiesBuilder} instance. * * @return an instance of the {@link PropertiesBuilder} class with not {@link Properties}. * @see #PropertiesBuilder() */ public static PropertiesBuilder create() { return new PropertiesBuilder(); }
/** * Factory method to create an instance of {@link PropertiesBuilder} initialized with the given {@link Properties}. * * @param properties {@link Properties} used as the default properties of the constructed {@link PropertiesBuilder}. * @return an instance of {@link PropertiesBuilder} initialized with the given {@link Properties}. * @see java.util.Properties * @see #PropertiesBuilder(Properties) */ public static PropertiesBuilder from(Properties properties) { return new PropertiesBuilder(properties); }
/** * Constructs and initializes a {@link PropertiesBuilder} containing all properties * from the given {@link Reader}. * * @param reader {@link Reader} source containing properties to use as the defaults for the constructed builder. * @return a {@link PropertiesBuilder} initialized with properties from the given {@link Reader}. * @throws IllegalArgumentException if the {@link Reader} cannot be read. * @see java.io.Reader * @see java.util.Properties#load(Reader) */ public static PropertiesBuilder from(Reader reader) { try { Properties defaults = new Properties(); defaults.load(reader); return new PropertiesBuilder(defaults); } catch (IOException cause) { throw new IllegalArgumentException("Failed to read properties from Reader", cause); } }
/** * Constructs and initializes a {@link PropertiesBuilder} containing all properties * from the given {@link InputStream} in XML format. * * @param xml {@link InputStream} source containing properties in XML format to use as defaults * for the constructed builder. * @return a {@link PropertiesBuilder} initialized with properties from the given XML {@link InputStream}. * @throws IllegalArgumentException if the XML {@link InputStream} cannot be read. * @see java.io.InputStream * @see java.util.Properties#loadFromXML(InputStream) */ public static PropertiesBuilder fromXml(InputStream xml) { try { Properties defaults = new Properties(); defaults.loadFromXML(xml); return new PropertiesBuilder(defaults); } catch (IOException cause) { throw new IllegalArgumentException("Failed to read properties from XML", cause); } }
/** * Constructs and initializes a {@link PropertiesBuilder} containing all properties * from the given {@link InputStream}. * * @param in {@link InputStream} source containing properties to use as the defaults for the constructed builder. * @return a {@link PropertiesBuilder} initialized with properties from the given {@link InputStream}. * @throws IllegalArgumentException if the {@link InputStream} cannot be read. * @see java.io.InputStream * @see java.util.Properties#load(InputStream) */ public static PropertiesBuilder from(InputStream in) { try { Properties defaults = new Properties(); defaults.load(in); return new PropertiesBuilder(defaults); } catch (IOException cause) { throw new IllegalArgumentException("Failed to read properties from InputStream", cause); } }
/** * Constructs and initializes a {@link PropertiesBuilder} containing all properties * from the given {@link Reader}. * * @param reader {@link Reader} source containing properties to use as the defaults for the constructed builder. * @return a {@link PropertiesBuilder} initialized with properties from the given {@link Reader}. * @throws IllegalArgumentException if the {@link Reader} cannot be read. * @see java.io.Reader * @see java.util.Properties#load(Reader) */ public static PropertiesBuilder from(Reader reader) { try { Properties defaults = new Properties(); defaults.load(reader); return new PropertiesBuilder(defaults); } catch (IOException cause) { throw new IllegalArgumentException("Failed to read properties from Reader", cause); } }
/** * Constructs and initializes a {@link PropertiesBuilder} containing all properties * from the given {@link InputStream}. * * @param in {@link InputStream} source containing properties to use as the defaults for the constructed builder. * @return a {@link PropertiesBuilder} initialized with properties from the given {@link InputStream}. * @throws IllegalArgumentException if the {@link InputStream} cannot be read. * @see java.io.InputStream * @see java.util.Properties#load(InputStream) */ public static PropertiesBuilder from(InputStream in) { try { Properties defaults = new Properties(); defaults.load(in); return new PropertiesBuilder(defaults); } catch (IOException cause) { throw new IllegalArgumentException("Failed to read properties from InputStream", cause); } }
/** * Constructs and initializes a {@link PropertiesBuilder} containing all properties * from the given {@link InputStream} in XML format. * * @param xml {@link InputStream} source containing properties in XML format to use as defaults * for the constructed builder. * @return a {@link PropertiesBuilder} initialized with properties from the given XML {@link InputStream}. * @throws IllegalArgumentException if the XML {@link InputStream} cannot be read. * @see java.io.InputStream * @see java.util.Properties#loadFromXML(InputStream) */ public static PropertiesBuilder fromXml(InputStream xml) { try { Properties defaults = new Properties(); defaults.loadFromXML(xml); return new PropertiesBuilder(defaults); } catch (IOException cause) { throw new IllegalArgumentException("Failed to read properties from XML", cause); } }
@Bean public ClientCacheFactoryBean clientCache(GemfireSecurityProperties securityProperties, GemfireSslProperties sslProperties) { ClientCacheFactoryBean clientCacheFactoryBean = new ClientCacheFactoryBean(); clientCacheFactoryBean.setUseBeanFactoryLocator(false); clientCacheFactoryBean.setPoolName("gemfirePool"); if (StringUtils.hasText(securityProperties.getUsername()) && StringUtils .hasText(securityProperties.getPassword())) { Properties properties = new Properties(); properties .setProperty(SECURITY_CLIENT, GemfireSecurityProperties.UserAuthInitialize.class.getName() + ".create"); properties.setProperty(SECURITY_USERNAME, securityProperties.getUsername()); properties.setProperty(SECURITY_PASSWORD, securityProperties.getPassword()); clientCacheFactoryBean.setProperties(properties); } if (sslProperties.isSslEnabled()) { PropertiesBuilder pb = new PropertiesBuilder(); pb.add(clientCacheFactoryBean.getProperties()); pb.add(this.toGeodeSslProperties(sslProperties)); clientCacheFactoryBean.setProperties(pb.build()); } clientCacheFactoryBean.setReadyForEvents(true); return clientCacheFactoryBean; }
@Override protected Properties toGemFireProperties(Map<String, Object> annotationAttributes) { PropertiesBuilder gemfireProperties = new PropertiesBuilder();
@Override protected Properties toGemFireProperties(Map<String, Object> annotationAttributes) { PropertiesBuilder gemfireProperties = new PropertiesBuilder();
@Override protected Properties toGemFireProperties(Map<String, Object> annotationAttributes) { PropertiesBuilder gemfireProperties = new PropertiesBuilder();
@Override protected Properties toGemFireProperties(Map<String, Object> annotationAttributes) { PropertiesBuilder gemfireProperties = new PropertiesBuilder();
/** * Converts the App Starter properties into Geode native SSL properties * @param sslProperties App starter properties. * @return Returns the geode native SSL properties. */ private Properties toGeodeSslProperties(GemfireSslProperties sslProperties) { PropertiesBuilder pb = new PropertiesBuilder(); // locator - SSL communication with and between locators // server - SSL communication between clients and servers pb.setProperty("ssl-enabled-components", "server,locator"); pb.setProperty("ssl-keystore", this.resolveRemoteStore(sslProperties.getKeystoreUri(), sslProperties.getUserHomeDirectory(), GemfireSslProperties.LOCAL_KEYSTORE_FILE_NAME)); pb.setProperty("ssl-keystore-password", sslProperties.getSslKeystorePassword()); pb.setProperty("ssl-keystore-type", sslProperties.getKeystoreType()); pb.setProperty("ssl-truststore", this.resolveRemoteStore(sslProperties.getTruststoreUri(), sslProperties.getUserHomeDirectory(), GemfireSslProperties.LOCAL_TRUSTSTORE_FILE_NAME)); pb.setProperty("ssl-truststore-password", sslProperties.getSslTruststorePassword()); pb.setProperty("ssl-truststore-type", sslProperties.getTruststoreType()); pb.setProperty("ssl-ciphers", sslProperties.getCiphers()); return pb.build(); }