Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.ote.discovery')
-rw-r--r--plugins/org.eclipse.osee.ote.discovery/.classpath7
-rw-r--r--plugins/org.eclipse.osee.ote.discovery/.project33
-rw-r--r--plugins/org.eclipse.osee.ote.discovery/META-INF/MANIFEST.MF13
-rw-r--r--plugins/org.eclipse.osee.ote.discovery/OSGI-INF/ote.discovery.xml8
-rw-r--r--plugins/org.eclipse.osee.ote.discovery/build.properties5
-rw-r--r--plugins/org.eclipse.osee.ote.discovery/pom.xml35
-rw-r--r--plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/OTEServerDiscovery.java16
-rw-r--r--plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/OTEServerLocation.java13
-rw-r--r--plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerDiscoveryImpl.java170
-rw-r--r--plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerLocationServiceHealth.java53
-rw-r--r--plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerStore.java12
-rw-r--r--plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerStoreImpl.java50
-rw-r--r--plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OteServerNotification.java29
13 files changed, 0 insertions, 444 deletions
diff --git a/plugins/org.eclipse.osee.ote.discovery/.classpath b/plugins/org.eclipse.osee.ote.discovery/.classpath
deleted file mode 100644
index ad32c83a78..0000000000
--- a/plugins/org.eclipse.osee.ote.discovery/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.osee.ote.discovery/.project b/plugins/org.eclipse.osee.ote.discovery/.project
deleted file mode 100644
index 968b3107fc..0000000000
--- a/plugins/org.eclipse.osee.ote.discovery/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.osee.ote.discovery</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ds.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.osee.ote.discovery/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ote.discovery/META-INF/MANIFEST.MF
deleted file mode 100644
index 3de5eb8751..0000000000
--- a/plugins/org.eclipse.osee.ote.discovery/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: OTE Server Discovery (Incubation)
-Bundle-SymbolicName: org.eclipse.osee.ote.discovery
-Bundle-Version: 0.17.0.qualifier
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Service-Component: OSGI-INF/ote.discovery.xml
-Import-Package: org.eclipse.osee.framework.logging,
- org.eclipse.osee.framework.messaging,
- org.eclipse.osee.framework.messaging.services,
- org.eclipse.osee.framework.messaging.services.messages
-Export-Package: org.eclipse.osee.ote.discovery
-Bundle-Vendor: Eclipse Open System Engineering Environment
diff --git a/plugins/org.eclipse.osee.ote.discovery/OSGI-INF/ote.discovery.xml b/plugins/org.eclipse.osee.ote.discovery/OSGI-INF/ote.discovery.xml
deleted file mode 100644
index 0b364d3ff5..0000000000
--- a/plugins/org.eclipse.osee.ote.discovery/OSGI-INF/ote.discovery.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" name="org.eclipse.osee.ote.discovery">
- <implementation class="org.eclipse.osee.ote.discovery.internal.OTEServerDiscoveryImpl"/>
- <reference bind="bindRemoteServiceLookup" cardinality="1..1" interface="org.eclipse.osee.framework.messaging.services.RemoteServiceLookup" name="RemoteServiceLookup" policy="static" unbind="unbindRemoteServiceLookup"/>
- <service>
- <provide interface="org.eclipse.osee.ote.discovery.OTEServerDiscovery"/>
- </service>
-</scr:component>
diff --git a/plugins/org.eclipse.osee.ote.discovery/build.properties b/plugins/org.eclipse.osee.ote.discovery/build.properties
deleted file mode 100644
index 6210e849b5..0000000000
--- a/plugins/org.eclipse.osee.ote.discovery/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- OSGI-INF/
-source.. = src/
diff --git a/plugins/org.eclipse.osee.ote.discovery/pom.xml b/plugins/org.eclipse.osee.ote.discovery/pom.xml
deleted file mode 100644
index 1438bdfe25..0000000000
--- a/plugins/org.eclipse.osee.ote.discovery/pom.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.eclipse.osee</groupId>
- <artifactId>org.eclipse.osee.ote.parent</artifactId>
- <version>0.17.0-SNAPSHOT</version>
- <relativePath>../../plugins/org.eclipse.osee.ote.parent</relativePath>
- </parent>
-
- <artifactId>org.eclipse.osee.ote.discovery</artifactId>
- <packaging>eclipse-plugin</packaging>
- <name>OTE Discovery(Incubation)</name>
-
- <build>
- <!-- workaround for https://issues.sonatype.org/browse/TYCHO-168 -->
- <resources>
- <resource>
- <directory>src</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-source-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
-</project> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/OTEServerDiscovery.java b/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/OTEServerDiscovery.java
deleted file mode 100644
index 3b50be627c..0000000000
--- a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/OTEServerDiscovery.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.eclipse.osee.ote.discovery;
-
-import java.net.URISyntaxException;
-import java.util.List;
-
-public interface OTEServerDiscovery {
-
- List<OTEServerLocation> findServerByTitle(String regex) throws URISyntaxException;
- List<OTEServerLocation> findServerByMachine(String regex) throws URISyntaxException;
- List<OTEServerLocation> findServerByMachineAndTitle(String regexMachine, String regexTitle) throws URISyntaxException;
- List<OTEServerLocation> getAll() throws URISyntaxException;
- List<OTEServerLocation> findServerByTitle(String regex, long timeoutMs) throws URISyntaxException;
- List<OTEServerLocation> findServerByMachine(String string, long timeoutMs) throws URISyntaxException;
- List<OTEServerLocation> findServerByMachineAndTitle(String regexMachine, String regexTitle, long timeoutMs) throws URISyntaxException;
-
-}
diff --git a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/OTEServerLocation.java b/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/OTEServerLocation.java
deleted file mode 100644
index 78b8132aa6..0000000000
--- a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/OTEServerLocation.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.eclipse.osee.ote.discovery;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-public interface OTEServerLocation {
-
- URI getBrokerURI() throws URISyntaxException;
- URI getApplicationServerURI();
- String getTitle();
- String getMachineName();
-
-}
diff --git a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerDiscoveryImpl.java b/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerDiscoveryImpl.java
deleted file mode 100644
index 8f83979301..0000000000
--- a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerDiscoveryImpl.java
+++ /dev/null
@@ -1,170 +0,0 @@
-package org.eclipse.osee.ote.discovery.internal;
-
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.eclipse.osee.framework.messaging.services.RemoteServiceLookup;
-import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth;
-import org.eclipse.osee.ote.discovery.OTEServerDiscovery;
-import org.eclipse.osee.ote.discovery.OTEServerLocation;
-
-public class OTEServerDiscoveryImpl implements OTEServerDiscovery {
-
- private RemoteServiceLookup remoteMessageServiceLookup;
- private OTEServerStore store;
- private OteServerNotification notification;
- private ReentrantLock lock;
- private Condition condition;
-
- public OTEServerDiscoveryImpl(){
- lock = new ReentrantLock();
- condition = lock.newCondition();
- store = new OTEServerStoreImpl(lock, condition);
- notification = new OteServerNotification(store);
- }
-
- public void start(){
- new Thread(new Runnable() {
- @Override
- public void run() {
- remoteMessageServiceLookup.register("osee.ote.server", "1.0", notification);
- remoteMessageServiceLookup.sendOutRequestsForServiceHealth();
- }
- }).start();
- }
-
- public void stop(){
- new Thread(new Runnable() {
- @Override
- public void run() {
- remoteMessageServiceLookup.unregister("osee.ote.server", "1.0", notification);
- }
- }).start();
- }
-
- public void bindRemoteServiceLookup(RemoteServiceLookup remoteMessageServiceLookup){
- this.remoteMessageServiceLookup = remoteMessageServiceLookup;
- }
-
- public void unbindRemoteServiceLookup(RemoteServiceLookup remoteMessageServiceLookup){
- this.remoteMessageServiceLookup = null;
- }
-
- @Override
- public List<OTEServerLocation> findServerByTitle(String regex, long timeoutMs) throws URISyntaxException {
- lock.lock();
- List<OTEServerLocation> locations = findServerByTitle(regex);
- try{
- long nanos = TimeUnit.MILLISECONDS.toNanos(timeoutMs);
- while(nanos > 0 && locations.size() == 0) {
- try {
- nanos = condition.awaitNanos(nanos);
- locations = findServerByTitle(regex);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- } finally {
- lock.unlock();
- }
- return locations;
- }
-
- @Override
- public List<OTEServerLocation> findServerByMachine(String regex, long timeoutMs) throws URISyntaxException {
- lock.lock();
- List<OTEServerLocation> locations = findServerByMachine(regex);
- try{
- long nanos = TimeUnit.MILLISECONDS.toNanos(timeoutMs);
- while(nanos > 0 && locations.size() == 0) {
- try {
- nanos = condition.awaitNanos(nanos);
- locations = findServerByMachine(regex);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- } finally {
- lock.unlock();
- }
- return locations;
- }
-
- @Override
- public List<OTEServerLocation> findServerByTitle(String regex) throws URISyntaxException {
- Collection<ServiceHealth> healths = store.getAll();
- List<OTEServerLocation> locations = new ArrayList<OTEServerLocation>();
- for(ServiceHealth health:healths){
- OTEServerLocationServiceHealth item = new OTEServerLocationServiceHealth(health);
- if(item.isValid() && item.getTitle().matches(regex)){
- locations.add(item);
- }
- }
- return locations;
- }
-
- @Override
- public List<OTEServerLocation> findServerByMachine(String regex) throws URISyntaxException {
- Collection<ServiceHealth> healths = store.getAll();
- List<OTEServerLocation> locations = new ArrayList<OTEServerLocation>();
- for(ServiceHealth health:healths){
- OTEServerLocationServiceHealth item = new OTEServerLocationServiceHealth(health);
- if(item.isValid() && item.getMachineName().matches(regex)){
- locations.add(item);
- }
- }
- return locations;
- }
-
- @Override
- public List<OTEServerLocation> findServerByMachineAndTitle(String regexMachine, String regexTitle) throws URISyntaxException {
- Collection<ServiceHealth> healths = store.getAll();
- List<OTEServerLocation> locations = new ArrayList<OTEServerLocation>();
- for(ServiceHealth health:healths){
- OTEServerLocationServiceHealth item = new OTEServerLocationServiceHealth(health);
- if(item.isValid() && item.getTitle().matches(regexTitle) && item.getMachineName().matches(regexMachine)){
- locations.add(item);
- }
- }
- return locations;
- }
-
- @Override
- public List<OTEServerLocation> getAll() throws URISyntaxException {
- Collection<ServiceHealth> healths = store.getAll();
- List<OTEServerLocation> locations = new ArrayList<OTEServerLocation>();
- for(ServiceHealth health:healths){
- OTEServerLocationServiceHealth item = new OTEServerLocationServiceHealth(health);
- if(item.isValid()){
- locations.add(item);
- }
- }
- return locations;
- }
-
- @Override
- public List<OTEServerLocation> findServerByMachineAndTitle(String regexMachine, String regexTitle, long timeoutMs) throws URISyntaxException {
- lock.lock();
- List<OTEServerLocation> locations = findServerByMachineAndTitle(regexMachine, regexTitle);
- try{
- long nanos = TimeUnit.MILLISECONDS.toNanos(timeoutMs);
- while(nanos > 0 && locations.size() == 0) {
- try {
- nanos = condition.awaitNanos(nanos);
- locations = findServerByMachineAndTitle(regexMachine, regexTitle);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- } finally {
- lock.unlock();
- }
- return locations;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerLocationServiceHealth.java b/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerLocationServiceHealth.java
deleted file mode 100644
index ba7184b718..0000000000
--- a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerLocationServiceHealth.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.eclipse.osee.ote.discovery.internal;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.eclipse.osee.framework.messaging.services.messages.ServiceDescriptionPair;
-import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth;
-import org.eclipse.osee.ote.discovery.OTEServerLocation;
-
-public class OTEServerLocationServiceHealth implements OTEServerLocation {
-
- private URI brokerURI;
- private URI appServerURI;
- private String title;
- private String machineName;
-
- public OTEServerLocationServiceHealth(ServiceHealth health) throws URISyntaxException{
- this.brokerURI = new URI(health.getBrokerURI());
- for(ServiceDescriptionPair pair:health.getServiceDescription()){
- if("station".equals(pair.getName())){
- machineName = pair.getValue();
- } else if("name".equals(pair.getName())){
- title = pair.getValue();
- } else if ("appServerURI".equals(pair.getName())){
- appServerURI = new URI(pair.getValue());
- }
- }
- }
-
- public boolean isValid(){
- return brokerURI!=null && appServerURI != null && title != null && machineName != null;
- }
-
- @Override
- public URI getBrokerURI() throws URISyntaxException {
- return brokerURI;
- }
-
- @Override
- public URI getApplicationServerURI() {
- return appServerURI;
- }
-
- @Override
- public String getTitle() {
- return title;
- }
-
- @Override
- public String getMachineName() {
- return machineName;
- }
-}
diff --git a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerStore.java b/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerStore.java
deleted file mode 100644
index 0f6ef9c7c8..0000000000
--- a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerStore.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.eclipse.osee.ote.discovery.internal;
-
-import java.util.Collection;
-
-import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth;
-
-public interface OTEServerStore {
-
- void add(ServiceHealth serviceHealth);
- void remove(ServiceHealth serviceHealth);
- public Collection<ServiceHealth> getAll();
-}
diff --git a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerStoreImpl.java b/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerStoreImpl.java
deleted file mode 100644
index cd5c947233..0000000000
--- a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OTEServerStoreImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.eclipse.osee.ote.discovery.internal;
-
-import java.util.Collection;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth;
-
-public class OTEServerStoreImpl implements OTEServerStore {
-
- private ConcurrentHashMap<String, ServiceHealth> data;
-
- private Condition condition;
-
- private ReentrantLock lock;
-
- public OTEServerStoreImpl(ReentrantLock lock, Condition condition){
- data = new ConcurrentHashMap<String, ServiceHealth>();
- this.condition = condition;
- this.lock = lock;
- }
-
- @Override
- public void add(ServiceHealth serviceHealth) {
- data.put(serviceHealth.getServiceUniqueId(), serviceHealth);
- lock.lock();
- try{
- condition.signalAll();
- } finally {
- lock.unlock();
- }
- }
-
- @Override
- public void remove(ServiceHealth serviceHealth) {
- data.remove(serviceHealth.getServiceUniqueId());
- lock.lock();
- try{
- condition.signalAll();
- } finally {
- lock.unlock();
- }
- }
-
- @Override
- public Collection<ServiceHealth> getAll(){
- return data.values();
- }
-}
diff --git a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OteServerNotification.java b/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OteServerNotification.java
deleted file mode 100644
index 67ed1f71ad..0000000000
--- a/plugins/org.eclipse.osee.ote.discovery/src/org/eclipse/osee/ote/discovery/internal/OteServerNotification.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.eclipse.osee.ote.discovery.internal;
-
-import org.eclipse.osee.framework.messaging.services.ServiceNotification;
-import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth;
-
-public class OteServerNotification implements ServiceNotification{
-
- private OTEServerStore store;
-
- public OteServerNotification(OTEServerStore store) {
- this.store = store;
- }
-
- @Override
- public void onServiceUpdate(ServiceHealth serviceHealth) {
- store.add(serviceHealth);
- }
-
- @Override
- public void onServiceGone(ServiceHealth serviceHealth) {
- store.remove(serviceHealth);
- }
-
- @Override
- public boolean isServiceGone(ServiceHealth serviceHealth) {
- return true;
- }
-
-}

Back to the top