org.kuali.rice.ksb.messaging.serviceexporters
Class ServiceExportManagerImpl.ServiceNameFinder

java.lang.Object
  extended by org.kuali.rice.ksb.messaging.serviceexporters.ServiceExportManagerImpl.ServiceNameFinder
Enclosing class:
ServiceExportManagerImpl

protected static class ServiceExportManagerImpl.ServiceNameFinder
extends Object

Looks up service QNameS based on URL StringS. API is Map-like, but non-service specific portions of the URL are trimmed prior to accessing its internal Map.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
private  ConcurrentMap<String,QName> servicePathToQName
          A service path to service QName map
 
Constructor Summary
protected ServiceExportManagerImpl.ServiceNameFinder()
           
 
Method Summary
 QName lookup(String serviceUrl)
          gets the QName for the service
 void register(ServiceDefinition serviceDefinition)
          adds a mapping from the service specific portion of the service URL to the service name.
 void remove(URL endpointUrl)
          removes the mapping (if one exists) for the service specific portion of this url.
private  String trimServiceUrlBase(String url)
          This method trims the endpoint url base (Config.getEndPointUrl()) base off of the full service URL, e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

servicePathToQName

private ConcurrentMap<String,QName> servicePathToQName
A service path to service QName map

Constructor Detail

ServiceExportManagerImpl.ServiceNameFinder

protected ServiceExportManagerImpl.ServiceNameFinder()
Method Detail

trimServiceUrlBase

private String trimServiceUrlBase(String url)
This method trims the endpoint url base (Config.getEndPointUrl()) base off of the full service URL, e.g. "http://kuali.edu/kr-dev/remoting/SomeService" -> "SomeService". It makes an effort to do so even if the host and ip don't match what is in Config.getEndPointUrl() by stripping host/port info. If the service URL contains the configured subpath for RESTful service, additional trimming is done to isolate the service name from the rest of the url.

Parameters:
url -
Returns:
the service specific suffix. If fullServiceUrl doesn't contain the endpoint url base, fullServiceUrl is returned unmodified.

register

public void register(ServiceDefinition serviceDefinition)
adds a mapping from the service specific portion of the service URL to the service name.

Parameters:
serviceUrl -
serviceName -

remove

public void remove(URL endpointUrl)
removes the mapping (if one exists) for the service specific portion of this url.

Parameters:
serviceUrl -

lookup

public QName lookup(String serviceUrl)
gets the QName for the service

Parameters:
serviceUrl -
Returns:


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.