de.fzj.unicore.uas.client
Class ExternalRegistryClient

java.lang.Object
  extended by de.fzj.unicore.uas.client.MultiWSRFClient<RegistryClient>
      extended by de.fzj.unicore.uas.client.ExternalRegistryClient
All Implemented Interfaces:
IRegistryQuery

public class ExternalRegistryClient
extends MultiWSRFClient<RegistryClient>
implements IRegistryQuery

a client for querying and adding to a set of external registries.
By default, the lists of services do not contain duplicates. You can change this behaviour using the setFilterDuplicates() method

Author:
schuller
See Also:
MultiWSRFClient

Nested Class Summary
 
Nested classes/interfaces inherited from interface de.fzj.unicore.uas.client.IRegistryQuery
IRegistryQuery.ServiceListFilter
 
Field Summary
protected static long readd_offset
           
 
Fields inherited from class de.fzj.unicore.uas.client.MultiWSRFClient
clients, logger, MULTICAST, PRIMARY_WITH_BACKUP, ROUNDROBIN, ROUNDROBIN_RETRY_ON_FAILURE
 
Fields inherited from interface de.fzj.unicore.uas.client.IRegistryQuery
STATUS_OK
 
Constructor Summary
ExternalRegistryClient()
           
 
Method Summary
 java.util.Calendar addRegistryEntry(org.oasisOpen.docs.wsrf.sg2.AddDocument in)
          calls "add" on all configured external registries
This method will return the shortest termination time returned by any of the external registries, or a default of 5 minutes in case no external registry can be contacted.
 boolean checkConnection()
          check the connection to the services.
 boolean checkConnection(int timeout)
          check the connection to the services.
 java.lang.String getConnectionStatus()
          check the connection status to the service
 boolean isFilterDuplicates()
           
 java.util.List<org.w3.x2005.x08.addressing.EndpointReferenceType> listAccessibleServices(javax.xml.namespace.QName porttype)
          list services implementing a given porttype
that are accessible to the current client (using getCurrentTime() as test)
 java.util.List<org.oasisOpen.docs.wsrf.sg2.EntryType> listEntries()
          List all the entries in all the registries.
 java.util.List<org.w3.x2005.x08.addressing.EndpointReferenceType> listServices(javax.xml.namespace.QName porttype)
          list services implementing a given porttype
this uses XPath to query the registry, and relies on the entry having the structure
sg: ServiceGroupRP/sg:Entry/sg:MemberServiceEPR/ad:Metadata/meta:InterfaceName with an ws addressing metadata entry listing the "final porttype" that the service implements
 java.util.List<org.w3.x2005.x08.addressing.EndpointReferenceType> listServices(javax.xml.namespace.QName porttype, IRegistryQuery.ServiceListFilter acceptFilter)
           
 void setFilterDuplicates(boolean filterDuplicates)
           
 
Methods inherited from class de.fzj.unicore.uas.client.MultiWSRFClient
addClient, getErrorsOccurred, getInvocationHandler, getMaxRetries, makeProxy, removeClient, setGlobalRetryPolicy, setMaxRetries, setMode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

readd_offset

protected static final long readd_offset
See Also:
Constant Field Values
Constructor Detail

ExternalRegistryClient

public ExternalRegistryClient()
Method Detail

addRegistryEntry

public java.util.Calendar addRegistryEntry(org.oasisOpen.docs.wsrf.sg2.AddDocument in)
calls "add" on all configured external registries
This method will return the shortest termination time returned by any of the external registries, or a default of 5 minutes in case no external registry can be contacted.

Parameters:
in - - an AddDocument
Returns:
Calendar

listAccessibleServices

public java.util.List<org.w3.x2005.x08.addressing.EndpointReferenceType> listAccessibleServices(javax.xml.namespace.QName porttype)
                                                                                         throws java.lang.Exception
Description copied from interface: IRegistryQuery
list services implementing a given porttype
that are accessible to the current client (using getCurrentTime() as test)

Specified by:
listAccessibleServices in interface IRegistryQuery
Returns:
List of EPRs
Throws:
java.lang.Exception

listEntries

public java.util.List<org.oasisOpen.docs.wsrf.sg2.EntryType> listEntries()
List all the entries in all the registries. No duplicate filtering is applied

Specified by:
listEntries in interface IRegistryQuery

listServices

public java.util.List<org.w3.x2005.x08.addressing.EndpointReferenceType> listServices(javax.xml.namespace.QName porttype,
                                                                                      IRegistryQuery.ServiceListFilter acceptFilter)
                                                                               throws java.lang.Exception
Specified by:
listServices in interface IRegistryQuery
Parameters:
porttype - - the porttype
acceptFilter - - for filtering the list
Returns:
List of EPRs
Throws:
java.lang.Exception

listServices

public java.util.List<org.w3.x2005.x08.addressing.EndpointReferenceType> listServices(javax.xml.namespace.QName porttype)
                                                                               throws java.lang.Exception
Description copied from interface: IRegistryQuery
list services implementing a given porttype
this uses XPath to query the registry, and relies on the entry having the structure
sg: ServiceGroupRP/sg:Entry/sg:MemberServiceEPR/ad:Metadata/meta:InterfaceName with an ws addressing metadata entry listing the "final porttype" that the service implements

Specified by:
listServices in interface IRegistryQuery
Returns:
List of EPRs
Throws:
java.lang.Exception

checkConnection

public boolean checkConnection()
check the connection to the services. If the service does not reply within the given timeout, returns false

Specified by:
checkConnection in interface IRegistryQuery
Parameters:
timeout - - connection timeout in milliseconds
Returns:

checkConnection

public boolean checkConnection(int timeout)
check the connection to the services. If no service replies within the given timeout, returns false

Specified by:
checkConnection in interface IRegistryQuery
Parameters:
timeout - - connection timeout in milliseconds
Returns:

getConnectionStatus

public java.lang.String getConnectionStatus()
Description copied from interface: IRegistryQuery
check the connection status to the service

Specified by:
getConnectionStatus in interface IRegistryQuery
Returns:
STATUS_OK (i.e. the string "OK") if connection is OK, an error message otherwise

isFilterDuplicates

public boolean isFilterDuplicates()

setFilterDuplicates

public void setFilterDuplicates(boolean filterDuplicates)


Copyright © 2006-2010 Research Center Juelich. All Rights Reserved.