summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/node-api/src
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-07-08 04:44:11 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-07-08 04:44:11 +0000
commit87843a7f2b800c3c2ac797889c1a7721a1e81ec3 (patch)
tree6caaa47a50c1f3f14bbcb4f877e23d17cd2e8674 /java/sca/modules/node-api/src
parent1a5b394c8279d7692fec6652803fffd1284e359a (diff)
Add a method to get the domain name
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@792030 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/node-api/src')
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java6
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationImpl.java10
2 files changed, 16 insertions, 0 deletions
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java
index 7d2909ba81..221ef1cfab 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java
@@ -40,6 +40,12 @@ public interface NodeConfiguration {
String getDomainURI();
/**
+ * Get the name of the SCA domain
+ * @return The name of the SCA domain
+ */
+ String getDomainName();
+
+ /**
* Set the URI of the SCA domain
* @param domainURI The URI of the SCA domain
*/
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationImpl.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationImpl.java
index e4f102cf4d..2c49d6d9ca 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationImpl.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationImpl.java
@@ -55,6 +55,16 @@ public class NodeConfigurationImpl implements NodeConfiguration {
return domainURI;
}
+ public String getDomainName() {
+ if (domainURI != null) {
+ URI uri = URI.create(domainURI);
+ if (uri.getHost() != null) {
+ return uri.getHost();
+ }
+ }
+ return domainURI;
+ }
+
public NodeConfiguration setDomainURI(String domainURI) {
this.domainURI = domainURI;
return this;