From 87843a7f2b800c3c2ac797889c1a7721a1e81ec3 Mon Sep 17 00:00:00 2001 From: antelder Date: Wed, 8 Jul 2009 04:44:11 +0000 Subject: 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 --- .../tuscany/sca/node/configuration/NodeConfiguration.java | 6 ++++++ .../sca/node/configuration/impl/NodeConfigurationImpl.java | 10 ++++++++++ 2 files changed, 16 insertions(+) (limited to 'java/sca/modules/node-api/src') 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 @@ -39,6 +39,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; -- cgit v1.2.3