Summary: GigaSpaces provides a generic network filter that also provides SSL support, through an SSL communication filter.
OverviewGigaSpaces provides two types of communication filter:
UsageThe way to load and enable the communication filter, is by setting the system property com.gs.lrmi.filter.factory. The value should be the communication filter factory class name. For example, to use an SSL communication filter, run GigaSpaces with: -Dcom.gs.lrmi.filter.factory=com.gigaspaces.lrmi.nio.filters.SSLFilterFactory Default SSLFilterFactory
Since some types of communication filters are not symmetric regarding the client and server, the class SSLFilterFactory has 2 methods: one to create the communication filter for the client side, and the other for the server side.
If the communication filter needs its own parameters, it can acquire them by directly reading system properties. For example, the supplied SSLFilter needs to get the keystore file, and the password to this file. It uses the following system properties to get them: -Dcom.gs.lrmi.filter.security.keystore=keystore.ks -Dcom.gs.lrmi.filter.security.password=password The keystore file is loaded from somewhere in the classpath. The provided SSLFilter uses keystore type JKS, with key management method SunX509.
Code snippet of the space server. public class SSLServer { public static void main(String [] args) throws Exception{ UrlSpaceConfigurer configurer = new UrlSpaceConfigurer("/./SSLSpace"). lookupGroups("ssl_example_group"); GigaSpace gigaSpace = new GigaSpaceConfigurer(configurer).gigaSpace(); } } Code snippet of the space client. public class SSLClient { public static void main(String [] args) throws Exception{ UrlSpaceConfigurer configurer = new UrlSpaceConfigurer("jini://localhost/*/SSLSpace). lookupGroups("ssl_example_group"); GigaSpace remoteSpace = new GigaSpaceConfigurer(configurer).gigaSpace(); AnEntry entry = new AnEntry(); entry.key = "first"; entry.payload = "first value"; remoteSpace.write(entry); AnEntry value = remoteSpace.read(new AnEntry()); System.out.println(value.payload); } public static class AnEntry implements Entry{ private static final long serialVersionUID = 1L; public AnEntry() { } public String key; public String payload; } } As you can see, until now there is nothing special in the code – it is the same code as if the SSL was not used. -Dcom.gs.lrmi.filter.factory=com.gigaspaces.lrmi.nio.filters.SSLFilterFactory -Dcom.gs.lrmi.filter.security.keystore=keystore.ks -Dcom.gs.lrmi.filter.security.password=password
The indication that SSL is used is the message: Communication Filters Information: CommunicationFilterFactory: com.gigaspaces.lrmi.nio.filters.SSLFilterFactory |
![]() |
GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence |