Author: david.lloyd(a)jboss.com
Date: 2008-07-31 21:49:45 -0400 (Thu, 31 Jul 2008)
New Revision: 4452
Modified:
remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceURI.java
Log:
Slightly stricter checking
Modified: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceURI.java
===================================================================
---
remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceURI.java 2008-08-01
01:48:05 UTC (rev 4451)
+++
remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceURI.java 2008-08-01
01:49:45 UTC (rev 4452)
@@ -13,13 +13,13 @@
}
/**
- * Determine if this URI is for a Remoting service.
+ * Determine if this URI is a valid Remoting service URI.
*
* @param uri the URI
- * @return {@code true} if the given URI is a Remoting service URI
+ * @return {@code true} if the given URI is a valid Remoting service URI
*/
public static boolean isRemotingServiceUri(final URI uri) {
- return SCHEME.equals(uri.getScheme());
+ return SCHEME.equals(uri.getScheme()) && uri.isOpaque();
}
/**
@@ -31,7 +31,7 @@
*/
public static String getServiceType(final URI uri) throws IllegalArgumentException {
if (! isRemotingServiceUri(uri)) {
- throw new IllegalArgumentException("Not a remoting service URI");
+ throw new IllegalArgumentException("Not a valid remoting service
URI");
}
final String ssp = uri.getSchemeSpecificPart();
final int firstColon = ssp.indexOf(':');
@@ -53,7 +53,7 @@
*/
public static String getGroupName(final URI uri) throws IllegalArgumentException {
if (! isRemotingServiceUri(uri)) {
- throw new IllegalArgumentException("Not a remoting service URI");
+ throw new IllegalArgumentException("Not a valid remoting service
URI");
}
final String ssp = uri.getSchemeSpecificPart();
final int firstColon = ssp.indexOf(':');
@@ -79,7 +79,7 @@
*/
public static String getEndpointName(final URI uri) throws IllegalArgumentException
{
if (! isRemotingServiceUri(uri)) {
- throw new IllegalArgumentException("Not a remoting service URI");
+ throw new IllegalArgumentException("Not a valid remoting service
URI");
}
final String ssp = uri.getSchemeSpecificPart();
final int firstColon = ssp.indexOf(':');
Show replies by date