From ea88e73ed7fcf5ecbe7e7e9e004ced274e530417 Mon Sep 17 00:00:00 2001 From: slewis Date: Tue, 25 Mar 2014 16:34:52 -0700 Subject: Initial checkin of ssl generic provider java8 remote services support Change-Id: I0000000000000000000000000000000000000000 --- .../plugin.xml | 35 +++++++++++ .../java8/J8GenericContainerInstantiator.java | 2 +- .../java8/J8SSLClientSOContainer.java | 19 ++++++ .../java8/J8SSLGenericContainerInstantiator.java | 67 ++++++++++++++++++++++ .../java8/J8SSLServerSOContainer.java | 25 ++++++++ 5 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLClientSOContainer.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLGenericContainerInstantiator.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLServerSOContainer.java (limited to 'providers') diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/plugin.xml b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/plugin.xml index 3fa1bdf64..a8e6731fb 100644 --- a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/plugin.xml +++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/plugin.xml @@ -19,6 +19,25 @@ hidden="true" name="ecf.generic.client.java8"> + + + + + + @@ -35,6 +54,22 @@ class="org.eclipse.ecf.provider.internal.remoteservice.java8.J8RemoteServiceContainerAdapterFactory"> + + + + + + + + + + diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8GenericContainerInstantiator.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8GenericContainerInstantiator.java index 1f6401160..c5644795a 100644 --- a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8GenericContainerInstantiator.java +++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8GenericContainerInstantiator.java @@ -56,7 +56,7 @@ public class J8GenericContainerInstantiator extends // For a client, if exporter is server we can import // or if remote is either generic server or generic client } else if (JAVA8_CLIENT_NAME.equals(description.getName())) { - if (supportedConfigs.contains(JAVA8_SERVER_NAME) || supportedConfigs.contains(TCPCLIENT_NAME)) + if (supportedConfigs.contains(JAVA8_SERVER_NAME) || supportedConfigs.contains(JAVA8_CLIENT_NAME)) results.add(JAVA8_CLIENT_NAME); } if (results.size() == 0) diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLClientSOContainer.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLClientSOContainer.java new file mode 100644 index 000000000..fe82ee5a6 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLClientSOContainer.java @@ -0,0 +1,19 @@ +/******************************************************************************* + * Copyright (c) 2014 Composent, Inc. and others. All rights reserved. This + * program and the accompanying materials are made available under the terms of + * the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Composent, Inc. - initial API and implementation + ******************************************************************************/ +package org.eclipse.ecf.provider.internal.remoteservice.java8; + +import org.eclipse.ecf.core.sharedobject.ISharedObjectContainerConfig; +import org.eclipse.ecf.provider.generic.SSLClientSOContainer; + +public class J8SSLClientSOContainer extends SSLClientSOContainer { + + public J8SSLClientSOContainer(ISharedObjectContainerConfig config, int ka) { + super(config, ka); + } +} \ No newline at end of file diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLGenericContainerInstantiator.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLGenericContainerInstantiator.java new file mode 100644 index 000000000..da2e1898f --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLGenericContainerInstantiator.java @@ -0,0 +1,67 @@ +/******************************************************************************* + * Copyright (c) 2014 Composent, Inc. and others. All rights reserved. This + * program and the accompanying materials are made available under the terms of + * the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Composent, Inc. - initial API and implementation + ******************************************************************************/ +package org.eclipse.ecf.provider.internal.remoteservice.java8; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.ecf.core.ContainerTypeDescription; +import org.eclipse.ecf.core.IContainer; +import org.eclipse.ecf.provider.generic.SOContainerConfig; +import org.eclipse.ecf.provider.generic.SSLGenericContainerInstantiator; + +public class J8SSLGenericContainerInstantiator extends + SSLGenericContainerInstantiator { + + public static final String JAVA8_SSL_CLIENT_NAME = "ecf.generic.ssl.client.java8"; + public static final String JAVA8_SSL_SERVER_NAME = "ecf.generic.ssl.server.java8"; + + @Override + protected boolean isClient(ContainerTypeDescription description) { + if (description.getName().equals(JAVA8_SSL_SERVER_NAME)) + return false; + return true; + } + + @Override + protected IContainer createClientContainer(GenericContainerArgs gcargs) + throws Exception { + return new J8TCPClientSOContainer(new SOContainerConfig(gcargs.getID()), gcargs.getKeepAlive().intValue()); + } + + @Override + protected IContainer createServerContainer(GenericContainerArgs gcargs) + throws Exception { + return new J8TCPServerSOContainer(new SOContainerConfig(gcargs.getID()), gcargs.getBindAddress(), gcargs.getKeepAlive().intValue()); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public String[] getImportedConfigs(ContainerTypeDescription description, String[] exporterSupportedConfigs) { + if (exporterSupportedConfigs == null) + return null; + List results = new ArrayList(); + List supportedConfigs = Arrays.asList(exporterSupportedConfigs); + // For a server, if exporter is a client then we can be an importer + if (JAVA8_SSL_SERVER_NAME.equals(description.getName())) { + if (supportedConfigs.contains(JAVA8_SSL_CLIENT_NAME)) + results.add(JAVA8_SSL_SERVER_NAME); + // For a client, if exporter is server we can import + // or if remote is either generic server or generic client + } else if (JAVA8_SSL_CLIENT_NAME.equals(description.getName())) { + if (supportedConfigs.contains(JAVA8_SSL_SERVER_NAME) || supportedConfigs.contains(JAVA8_SSL_CLIENT_NAME)) + results.add(JAVA8_SSL_CLIENT_NAME); + } + if (results.size() == 0) + return null; + return (String[]) results.toArray(new String[] {}); + } + +} diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLServerSOContainer.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLServerSOContainer.java new file mode 100644 index 000000000..e3356c6ef --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLServerSOContainer.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2014 Composent, Inc. and others. All rights reserved. This + * program and the accompanying materials are made available under the terms of + * the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Composent, Inc. - initial API and implementation + ******************************************************************************/ +package org.eclipse.ecf.provider.internal.remoteservice.java8; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.URISyntaxException; + +import org.eclipse.ecf.core.sharedobject.ISharedObjectContainerConfig; +import org.eclipse.ecf.provider.generic.SSLServerSOContainer; + +public class J8SSLServerSOContainer extends SSLServerSOContainer { + + public J8SSLServerSOContainer(ISharedObjectContainerConfig config, + InetAddress bindAddress, int keepAlive) throws IOException, + URISyntaxException { + super(config, bindAddress, keepAlive); + } +} \ No newline at end of file -- cgit v1.2.3