net.geant.edugain.meta.rest
Class RESTClientImpl

java.lang.Object
  extended by net.geant.edugain.meta.rest.RESTClientImpl
All Implemented Interfaces:
RESTClient

public class RESTClientImpl
extends java.lang.Object
implements RESTClient

This class implements a client to be used by BEs (eduGAINBase) for the REST-based meta data operations at the MDS


Field Summary
private  MetaDataPublisher mdPublisher
           
private  MetaDataRequester mdRequester
           
private  java.net.URL mdsBaseUrl
          The MDS base URL
private  java.net.URL mdsUrl
          The full MDS URL used for the required operation
private  ComponentID valCompID
          The valid component ID URI of the addressed MDS interface
 
Constructor Summary
RESTClientImpl()
          Constructor
RESTClientImpl(java.net.URL mdsBase)
          Constructor
 
Method Summary
 java.net.URL getMdsBaseUrl()
          Gets the MDS base URL
 java.net.URL getMdsUrl()
          Gets the MDS URL
 ComponentID getValCompID()
          Gets the validated MDS component ID
 java.util.ArrayList<BEMetaData> lookupMetaData()
          Performs a meta data lookup operation for the list of all bridging elements from all federations, by using only the MDS base URL.
 java.util.ArrayList<BEMetaData> lookupMetaData(java.lang.String federationID)
          Performs a meta data lookup operation for the list of bridging elements belonging to a specific federation; the MDS URL will be composed of the base URL and the 'federationID'.
 BEMetaData lookupMetaData(java.lang.String federationID, java.lang.String entityID)
          Performs a meta data lookup operation for a specific BE interface; the MDS URL will be composed of the base URL, the 'federationID' and the 'entityID' of the bridging element.
 java.util.ArrayList<BEMetaData> lookupMetaData(java.net.URL mdsBase)
          Performs a meta data lookup operation for the list of all bridging elements from all federations, by using only the MDS base URL.
 java.util.ArrayList<BEMetaData> lookupMetaData(java.net.URL mdsBase, java.lang.String federationID)
          Performs a meta data lookup operation for the list of bridging elements belonging to a specific federation; the MDS URL will be composed of the base URL and the 'federationID'.
 BEMetaData lookupMetaData(java.net.URL mdsBase, java.lang.String federationID, java.lang.String entityID)
          Performs a meta data lookup operation for a specific BE interface; the MDS URL will be composed of the base URL, the 'federationID' and the 'entityID' of the bridging element.
 org.opensaml.xml.XMLObject lookupMetaDataRoot()
          Performs a meta data lookup operation for the list of all bridging elements from all federations, by using only the MDS base URL.
 org.opensaml.xml.XMLObject lookupMetaDataRoot(java.lang.String federationID)
          Performs a meta data lookup operation for the list of bridging elements belonging to a specific federation; the MDS URL will be composed of the base URL and the 'federationID'.
 org.opensaml.xml.XMLObject lookupMetaDataRoot(java.lang.String federationID, java.lang.String entityID)
          Performs a meta data lookup operation for a specific BE interface; the MDS URL will be composed of the base URL, the 'federationID' and the 'entityID' of the bridging element.
 org.opensaml.xml.XMLObject lookupMetaDataRoot(java.net.URL mdsBase)
          Performs a meta data lookup operation for the list of all bridging elements from all federations, by using only the MDS base URL.
 org.opensaml.xml.XMLObject lookupMetaDataRoot(java.net.URL mdsBase, java.lang.String federationID)
          Performs a meta data lookup operation for the list of bridging elements belonging to a specific federation; the MDS URL will be composed of the base URL and the 'federationID'.
 org.opensaml.xml.XMLObject lookupMetaDataRoot(java.net.URL mdsBase, java.lang.String federationID, java.lang.String entityID)
          Performs a meta data lookup operation for a specific BE interface; the MDS URL will be composed of the base URL, the 'federationID' and the 'entityID' of the bridging element.
 void publishMetaData(java.lang.String federationID, java.lang.String entityID, BEMetaData beMetaData)
          Performs a meta data publish operation in order to register at the MDS meta data related to a BE within the local federation; the MDS URL will be composed of the base URL, the 'federationID' and the 'entityID' of the concerned BE
 void publishMetaData(java.net.URL mdsBase, java.lang.String federationID, java.lang.String entityID, BEMetaData beMetaData)
          Performs a meta data publish operation in order to register at the MDS meta data related to a BE within the local federation; the MDS URL will be composed of the base URL, the 'federationID' and the 'entityID' of the concerned BE.
 java.util.ArrayList<BEMetaData> searchMetaData(java.util.ArrayList<HomeLocator> homeloc)
          Performs a meta data search operation for the BE interfaces corresponding to the specified home locators; the MDS URL will be composed of the base URL and the list of home locators associated with the pricipal.
 java.util.ArrayList<BEMetaData> searchMetaData(java.lang.String federationID, java.util.ArrayList<HomeLocator> homeloc)
          Performs a meta data search operation for the BE interfaces corresponding to the specified federation and home locators; the MDS URL will be composed of the base URL, the 'federationID' and the list of home locators associated with the pricipal.
 java.util.ArrayList<BEMetaData> searchMetaData(java.net.URL mdsBase, java.util.ArrayList<HomeLocator> homeloc)
          Performs a meta data search operation for the BE interfaces corresponding to the specified home locators; the MDS URL will be composed of the base URL and the list of home locators associated with the pricipal.
 java.util.ArrayList<BEMetaData> searchMetaData(java.net.URL mdsBase, java.lang.String federationID, java.util.ArrayList<HomeLocator> homeloc)
          Performs a meta data search operation for the BE interfaces corresponding to the specified federation and home locators; the MDS URL will be composed of the base URL, the 'federationID' and the list of home locators associated with the pricipal.
 org.opensaml.xml.XMLObject searchMetaDataRoot(java.util.ArrayList<HomeLocator> homeloc)
          Performs a meta data search operation for the BE interfaces corresponding to the specified home locators; the MDS URL will be composed of the base URL and the list of home locators associated with the pricipal.
 org.opensaml.xml.XMLObject searchMetaDataRoot(java.lang.String federationID, java.util.ArrayList<HomeLocator> homeloc)
          Performs a meta data search operation for the BE interfaces corresponding to the specified federation and home locators; the MDS URL will be composed of the base URL, the 'federationID' and the list of home locators associated with the pricipal.
 org.opensaml.xml.XMLObject searchMetaDataRoot(java.net.URL mdsBase, java.util.ArrayList<HomeLocator> homeloc)
          Performs a meta data search operation for the BE interfaces corresponding to the specified home locators; the MDS URL will be composed of the base URL and the list of home locators associated with the pricipal.
 org.opensaml.xml.XMLObject searchMetaDataRoot(java.net.URL mdsBase, java.lang.String federationID, java.util.ArrayList<HomeLocator> homeloc)
          Performs a meta data search operation for the BE interfaces corresponding to the specified federation and home locators; the MDS URL will be composed of the base URL, the 'federationID' and the list of home locators associated with the pricipal.
 void setMdsBaseUrl(java.net.URL mdsBase)
          Sets the MDS base URL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mdsBaseUrl

private java.net.URL mdsBaseUrl
The MDS base URL


mdsUrl

private java.net.URL mdsUrl
The full MDS URL used for the required operation


valCompID

private ComponentID valCompID
The valid component ID URI of the addressed MDS interface


mdRequester

private MetaDataRequester mdRequester

mdPublisher

private MetaDataPublisher mdPublisher
Constructor Detail

RESTClientImpl

public RESTClientImpl()
Constructor


RESTClientImpl

public RESTClientImpl(java.net.URL mdsBase)
Constructor

Parameters:
mdsBase - the MDS base URL
Method Detail

lookupMetaData

public java.util.ArrayList<BEMetaData> lookupMetaData(java.net.URL mdsBase)
                                               throws MetaQueryException
Performs a meta data lookup operation for the list of all bridging elements from all federations, by using only the MDS base URL. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
lookupMetaData in interface RESTClient
Parameters:
mdsBase - the MDS base URL
Returns:
the list of BEMetaData objects corresponding to the search
Throws:
MetaQueryException

lookupMetaData

public java.util.ArrayList<BEMetaData> lookupMetaData()
                                               throws MetaQueryException
Performs a meta data lookup operation for the list of all bridging elements from all federations, by using only the MDS base URL. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
lookupMetaData in interface RESTClient
Returns:
the list of BEMetaData objects corresponding to the search
Throws:
MetaQueryException

lookupMetaDataRoot

public org.opensaml.xml.XMLObject lookupMetaDataRoot(java.net.URL mdsBase)
                                              throws MetaQueryException
Performs a meta data lookup operation for the list of all bridging elements from all federations, by using only the MDS base URL. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
lookupMetaDataRoot in interface RESTClient
Parameters:
mdsBase - the MDS base URL
Returns:
the root element of the SAML 2.0 metadata document - either an EntityDescriptor or an EntitiesDescriptor element
Throws:
MetaQueryException

lookupMetaDataRoot

public org.opensaml.xml.XMLObject lookupMetaDataRoot()
                                              throws MetaQueryException
Performs a meta data lookup operation for the list of all bridging elements from all federations, by using only the MDS base URL. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
lookupMetaDataRoot in interface RESTClient
Returns:
the root element of the SAML 2.0 metadata document - either an EntityDescriptor or an EntitiesDescriptor element
Throws:
MetaQueryException

lookupMetaData

public java.util.ArrayList<BEMetaData> lookupMetaData(java.net.URL mdsBase,
                                                      java.lang.String federationID)
                                               throws MetaQueryException,
                                                      ValidationException
Performs a meta data lookup operation for the list of bridging elements belonging to a specific federation; the MDS URL will be composed of the base URL and the 'federationID'. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
lookupMetaData in interface RESTClient
Parameters:
mdsBase - the MDS base URL
federationID - the unique identifier of the principal's federation
Returns:
the list of BEMetaData objects corresponding to the search
Throws:
MetaQueryException
ValidationException

lookupMetaData

public java.util.ArrayList<BEMetaData> lookupMetaData(java.lang.String federationID)
                                               throws MetaQueryException,
                                                      ValidationException
Performs a meta data lookup operation for the list of bridging elements belonging to a specific federation; the MDS URL will be composed of the base URL and the 'federationID'. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
lookupMetaData in interface RESTClient
Parameters:
federationID - the unique identifier of the principal's federation
Returns:
the list of BEMetaData objects corresponding to the search
Throws:
MetaQueryException
ValidationException

lookupMetaDataRoot

public org.opensaml.xml.XMLObject lookupMetaDataRoot(java.net.URL mdsBase,
                                                     java.lang.String federationID)
                                              throws MetaQueryException,
                                                     ValidationException
Performs a meta data lookup operation for the list of bridging elements belonging to a specific federation; the MDS URL will be composed of the base URL and the 'federationID'. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
lookupMetaDataRoot in interface RESTClient
Parameters:
mdsBase - the MDS base URL
federationID - the unique identifier of the principal's federation
Returns:
the root element of the SAML 2.0 metadata document - either an EntityDescriptor or an EntitiesDescriptor element
Throws:
MetaQueryException
ValidationException

lookupMetaDataRoot

public org.opensaml.xml.XMLObject lookupMetaDataRoot(java.lang.String federationID)
                                              throws MetaQueryException,
                                                     ValidationException
Performs a meta data lookup operation for the list of bridging elements belonging to a specific federation; the MDS URL will be composed of the base URL and the 'federationID'. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
lookupMetaDataRoot in interface RESTClient
Parameters:
federationID - the unique identifier of the principal's federation
Returns:
the root element of the SAML 2.0 metadata document - either an EntityDescriptor or an EntitiesDescriptor element
Throws:
MetaQueryException
ValidationException

lookupMetaData

public BEMetaData lookupMetaData(java.net.URL mdsBase,
                                 java.lang.String federationID,
                                 java.lang.String entityID)
                          throws MetaQueryException,
                                 ValidationException
Performs a meta data lookup operation for a specific BE interface; the MDS URL will be composed of the base URL, the 'federationID' and the 'entityID' of the bridging element. The root element returned by the MDS should be an EntityDescriptor.

Specified by:
lookupMetaData in interface RESTClient
Parameters:
mdsBase - the MDS base URL
federationID - the unique identifier of the principal's federation
entityID - the unique identifier of the bridging element
Returns:
the BEMetaData object corresponding to the search
Throws:
MetaQueryException
ValidationException

lookupMetaData

public BEMetaData lookupMetaData(java.lang.String federationID,
                                 java.lang.String entityID)
                          throws MetaQueryException,
                                 ValidationException
Performs a meta data lookup operation for a specific BE interface; the MDS URL will be composed of the base URL, the 'federationID' and the 'entityID' of the bridging element. The root element returned by the MDS should be an EntityDescriptor.

Specified by:
lookupMetaData in interface RESTClient
Parameters:
federationID - the unique identifier of the principal's federation
entityID - the unique identifier of the bridging element
Returns:
the BEMetaData object corresponding to the search
Throws:
MetaQueryException
ValidationException

lookupMetaDataRoot

public org.opensaml.xml.XMLObject lookupMetaDataRoot(java.net.URL mdsBase,
                                                     java.lang.String federationID,
                                                     java.lang.String entityID)
                                              throws MetaQueryException,
                                                     ValidationException
Performs a meta data lookup operation for a specific BE interface; the MDS URL will be composed of the base URL, the 'federationID' and the 'entityID' of the bridging element. The root element returned by the MDS should be an EntityDescriptor.

Specified by:
lookupMetaDataRoot in interface RESTClient
Parameters:
mdsBase - the MDS base URL
federationID - the unique identifier of the principal's federation
entityID - the unique identifier of the bridging element
Returns:
an EntityDescriptor element representing the root of the SAML 2.0 metadata document
Throws:
MetaQueryException
ValidationException

lookupMetaDataRoot

public org.opensaml.xml.XMLObject lookupMetaDataRoot(java.lang.String federationID,
                                                     java.lang.String entityID)
                                              throws MetaQueryException,
                                                     ValidationException
Performs a meta data lookup operation for a specific BE interface; the MDS URL will be composed of the base URL, the 'federationID' and the 'entityID' of the bridging element. The root element returned by the MDS should be an EntityDescriptor.

Specified by:
lookupMetaDataRoot in interface RESTClient
Parameters:
federationID - the unique identifier of the principal's federation
entityID - the unique identifier of the bridging element
Returns:
an EntityDescriptor element representing the root of the SAML 2.0 metadata document
Throws:
MetaQueryException
ValidationException

searchMetaData

public java.util.ArrayList<BEMetaData> searchMetaData(java.net.URL mdsBase,
                                                      java.util.ArrayList<HomeLocator> homeloc)
                                               throws MetaQueryException,
                                                      ValidationException
Performs a meta data search operation for the BE interfaces corresponding to the specified home locators; the MDS URL will be composed of the base URL and the list of home locators associated with the pricipal. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
searchMetaData in interface RESTClient
Parameters:
mdsBase - the MDS base URL
homeloc - the list of home locators
Returns:
a list containing the BEMetaData object(s) corresponding to the search
Throws:
MetaQueryException
ValidationException

searchMetaData

public java.util.ArrayList<BEMetaData> searchMetaData(java.util.ArrayList<HomeLocator> homeloc)
                                               throws MetaQueryException,
                                                      ValidationException
Performs a meta data search operation for the BE interfaces corresponding to the specified home locators; the MDS URL will be composed of the base URL and the list of home locators associated with the pricipal. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
searchMetaData in interface RESTClient
Parameters:
homeloc - the list of home locators
Returns:
a list containing the BEMetaData object(s) corresponding to the search
Throws:
MetaQueryException
ValidationException

searchMetaDataRoot

public org.opensaml.xml.XMLObject searchMetaDataRoot(java.net.URL mdsBase,
                                                     java.util.ArrayList<HomeLocator> homeloc)
                                              throws MetaQueryException,
                                                     ValidationException
Performs a meta data search operation for the BE interfaces corresponding to the specified home locators; the MDS URL will be composed of the base URL and the list of home locators associated with the pricipal. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
searchMetaDataRoot in interface RESTClient
Parameters:
mdsBase - the MDS base URL
homeloc - the list of home locators
Returns:
an EntitiesDescriptor element representing the root of the SAML 2.0 metadata document
Throws:
ValidationException
MetaQueryException

searchMetaDataRoot

public org.opensaml.xml.XMLObject searchMetaDataRoot(java.util.ArrayList<HomeLocator> homeloc)
                                              throws MetaQueryException,
                                                     ValidationException
Performs a meta data search operation for the BE interfaces corresponding to the specified home locators; the MDS URL will be composed of the base URL and the list of home locators associated with the pricipal. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
searchMetaDataRoot in interface RESTClient
Parameters:
homeloc - the list of home locators
Returns:
an EntitiesDescriptor element representing the root of the SAML 2.0 metadata document
Throws:
MetaQueryException
ValidationException

searchMetaData

public java.util.ArrayList<BEMetaData> searchMetaData(java.net.URL mdsBase,
                                                      java.lang.String federationID,
                                                      java.util.ArrayList<HomeLocator> homeloc)
                                               throws MetaQueryException,
                                                      ValidationException
Performs a meta data search operation for the BE interfaces corresponding to the specified federation and home locators; the MDS URL will be composed of the base URL, the 'federationID' and the list of home locators associated with the pricipal. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
searchMetaData in interface RESTClient
Parameters:
mdsBase - the MDS base URL
federationID - the unique identifier of the principal's federation
homeloc - the list of home locators
Returns:
a list containing the BEMetaData object(s) corresponding to the search
Throws:
MetaQueryException
ValidationException

searchMetaData

public java.util.ArrayList<BEMetaData> searchMetaData(java.lang.String federationID,
                                                      java.util.ArrayList<HomeLocator> homeloc)
                                               throws MetaQueryException,
                                                      ValidationException
Performs a meta data search operation for the BE interfaces corresponding to the specified federation and home locators; the MDS URL will be composed of the base URL, the 'federationID' and the list of home locators associated with the pricipal. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
searchMetaData in interface RESTClient
Parameters:
federationID - the unique identifier of the principal's federation
homeloc - the list of home locators
Returns:
a list containing the BEMetaData object(s) corresponding to the search
Throws:
ValidationException
MetaQueryException

searchMetaDataRoot

public org.opensaml.xml.XMLObject searchMetaDataRoot(java.net.URL mdsBase,
                                                     java.lang.String federationID,
                                                     java.util.ArrayList<HomeLocator> homeloc)
                                              throws MetaQueryException,
                                                     ValidationException
Performs a meta data search operation for the BE interfaces corresponding to the specified federation and home locators; the MDS URL will be composed of the base URL, the 'federationID' and the list of home locators associated with the pricipal. The root element returned by the MDS should be an EntitiesDescriptor.

Specified by:
searchMetaDataRoot in interface RESTClient
Parameters:
mdsBase - the MDS base URL
federationID - the unique identifier of the principal's federation
homeloc - the list of home locators
Returns:
an EntitiesDescriptor element representing the root of the SAML 2.0 metadata document
Throws:
ValidationException
MetaQueryException

searchMetaDataRoot

public org.opensaml.xml.XMLObject searchMetaDataRoot(java.lang.String federationID,
                                                     java.util.ArrayList<HomeLocator> homeloc)
                                              throws MetaQueryException,
                                                     ValidationException
Performs a meta data search operation for the BE interfaces corresponding to the specified federation and home locators; the MDS URL will be composed of the base URL, the 'federationID' and the list of home locators associated with the pricipal. The root element returned by the MDS should be an EntitiesDescriptor.

Parameters:
federationID - the unique identifier of the principal's federation
homeloc - the list of home locators
Returns:
an EntitiesDescriptor element representing the root of the SAML 2.0 metadata document
Throws:
MetaQueryException
ValidationException

publishMetaData

public void publishMetaData(java.net.URL mdsBase,
                            java.lang.String federationID,
                            java.lang.String entityID,
                            BEMetaData beMetaData)
                     throws MetaQueryException
Performs a meta data publish operation in order to register at the MDS meta data related to a BE within the local federation; the MDS URL will be composed of the base URL, the 'federationID' and the 'entityID' of the concerned BE.

Specified by:
publishMetaData in interface RESTClient
Parameters:
mdsBase - the MDS base URL
federationID - the unique identifier of the local federation
entityID - the unique identifier of the concerned BE
beMetaData - the BEMetaData object subject to publishing
Throws:
MetaQueryException

publishMetaData

public void publishMetaData(java.lang.String federationID,
                            java.lang.String entityID,
                            BEMetaData beMetaData)
                     throws MetaQueryException
Performs a meta data publish operation in order to register at the MDS meta data related to a BE within the local federation; the MDS URL will be composed of the base URL, the 'federationID' and the 'entityID' of the concerned BE

Specified by:
publishMetaData in interface RESTClient
Parameters:
federationID - the unique identifier of the local federation
entityID - the unique identifier of the concerned BE
beMetaData - the BEMetaData object subject to publishing
Throws:
MetaQueryException

getMdsUrl

public java.net.URL getMdsUrl()
Gets the MDS URL

Specified by:
getMdsUrl in interface RESTClient
Returns:
the MDS URL

getMdsBaseUrl

public java.net.URL getMdsBaseUrl()
Gets the MDS base URL

Specified by:
getMdsBaseUrl in interface RESTClient
Returns:
the MDS URL

setMdsBaseUrl

public void setMdsBaseUrl(java.net.URL mdsBase)
Sets the MDS base URL


getValCompID

public ComponentID getValCompID()
Gets the validated MDS component ID

Returns:
the MDS component ID