Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-08-20 05:20:04 -0400
committerTobias Schwarz2014-08-20 05:20:04 -0400
commita95a234f18cfffd3f4317dddcd1e2ddda1727d48 (patch)
tree92021db3ce6f066b688b319be928f673c410b587
parentb1b8d4fa8a78d109dcd8b6b54d3d218f030b7045 (diff)
downloadorg.eclipse.tcf-a95a234f18cfffd3f4317dddcd1e2ddda1727d48.tar.gz
org.eclipse.tcf-a95a234f18cfffd3f4317dddcd1e2ddda1727d48.tar.xz
org.eclipse.tcf-a95a234f18cfffd3f4317dddcd1e2ddda1727d48.zip
Target Explorer: add new agent attribute "Platforms"
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/interfaces/IPeerProperties.java7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java13
3 files changed, 23 insertions, 3 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/interfaces/IPeerProperties.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/interfaces/IPeerProperties.java
index c464a8715..8898f513d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/interfaces/IPeerProperties.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/interfaces/IPeerProperties.java
@@ -32,4 +32,11 @@ public interface IPeerProperties {
* Property: <code>true</code> if this connection was already migrated to a higher version.
*/
public static final String PROP_MIGRATED = "Migrated"; //$NON-NLS-1$
+
+ /**
+ * Property: The list of supported platforms.
+ */
+ public static final String ATTR_PLATFORMS = "Platforms"; //$NON-NLS-1$
+
}
+
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
index 907b76aa1..a7daee02c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
@@ -49,7 +49,7 @@
class="org.eclipse.tcf.te.tcf.locator.internal.PeerModelPropertyTester"
id="org.eclipse.tcf.te.tcf.locator.LocatorModelPropertyTester"
namespace="org.eclipse.tcf.te.tcf.locator"
- properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isProxy,isValid,isValueAdd,isOfType,isRemotePeer"
+ properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isProxy,isValid,isValueAdd,isOfType,isRemotePeer,containsPlatform"
type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
</propertyTester>
@@ -57,7 +57,7 @@
class="org.eclipse.tcf.te.tcf.locator.internal.PeerModelPropertyTester"
id="org.eclipse.tcf.te.tcf.locator.LocatorModelPropertyTester2"
namespace="org.eclipse.tcf.te.tcf.locator"
- properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isProxy,isValueAdd,isOfType,isRemotePeer"
+ properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isProxy,isValueAdd,isOfType,isRemotePeer,containsPlatform"
type="org.eclipse.tcf.protocol.IPeer">
</propertyTester>
@@ -65,7 +65,7 @@
class="org.eclipse.tcf.te.tcf.locator.internal.PeerModelPropertyTester"
id="org.eclipse.tcf.te.tcf.locator.LocatorModelPropertyTester2"
namespace="org.eclipse.tcf.te.tcf.locator"
- properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isProxy,isValueAdd,isOfType,isRemotePeer"
+ properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isProxy,isValueAdd,isOfType,isRemotePeer,containsPlatform"
type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorNode">
</propertyTester>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java
index 4153a7530..e250b1d1a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java
@@ -20,6 +20,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.tcf.internal.core.RemotePeer;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorNode;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties;
@@ -128,6 +129,18 @@ public class PeerModelPropertyTester extends PropertyTester {
}
}
+ if ("containsPlatform".equals(property)) { //$NON-NLS-1$
+ String value = peer.getAttributes().get(IPeerProperties.ATTR_PLATFORMS);
+ if (value != null) {
+ String[] platforms = value.split("\\s*,\\s*"); //$NON-NLS-1$
+ for (String platform : platforms) {
+ if (platform.equalsIgnoreCase(expectedValue.toString())) {
+ return true;
+ }
+ }
+ }
+ }
+
if ("hasAttribute".equals(property)) { //$NON-NLS-1$
String name = args != null && args.length > 0 ? (String)args[0] : null;
boolean hasAttribute = name != null && !"".equals(name) ? peer.getAttributes().containsKey(name) : false; //$NON-NLS-1$

Back to the top