net.geant.edugain.meta.publish
Class MetaDataPublisher

java.lang.Object
  extended by net.geant.edugain.meta.publish.MetaDataPublisher

public class MetaDataPublisher
extends java.lang.Object

This class implements a HTTP or HTTPS client which posts the given data to the provided Metadata Service (MDS) URL

Author:
Manuela Stanica

Field Summary
private  Configurator cfg
          eduGAIN Configurator used to retrieve keystore information
private static org.slf4j.Logger log
          Class logger.
private  MetaDataMarshaller mdMarshaller
          Marshaller object used to convert the data into SAML2 XML before publishing to the MDS
private  java.net.HttpURLConnection mdsConnection
          The URLConnection to the MDS
private  int publishRespCode
          The HTTP response code received after publishing
private  java.lang.String publishRespMessage
          The HTTP response message received after publishing
 
Constructor Summary
MetaDataPublisher()
          Constructor
 
Method Summary
 void beDelete(java.net.URL mdsBase, java.lang.String federationID, java.lang.String entityID)
          Deleting function used by an authorized bridging element(BE) in order to delete their own metadata from the MDS
 void bePublish(java.net.URL mdsBase, java.lang.String federationID, java.lang.String entityID, BEMetaData bemd)
          Publishing function used by an authorized bridging element(BE) in order to publish its own metadata to the MDS
 void deleteMetaData(java.lang.String url)
          General delete method; opens a connection to the given URL and deletes the metadata associated with the given entity or federation.
 void fppDelete(java.net.URL mdsBase, java.lang.String federationID)
          Deleting function used centrally by an FPP in order to delete metadata about BE(s) within its federation
 void fppPublish(java.net.URL mdsBase, java.lang.String federationID, java.lang.String fppCompID, java.util.ArrayList<BEMetaData> bemdlist)
          Publishing function used centrally by an FPP in order to publish metadata about BE(s) within its federation
 int getPublishRespCode()
          Gets the REST/HTTP response code
 java.lang.String getPublishRespMessage()
          Gets the REST/HTTP response message
 void publishMetaData(java.lang.String url, java.lang.String xmlString)
          General publishing method; opens a connection to the given URL and posts the data from the provided file.
 void publishMetaData(java.net.URL url, java.lang.String data)
          General publishing method; opens a connection to the given URL and posts the provided data.
 void publishMetaDataFile(java.lang.String url, java.lang.String file)
          General publishing method; opens a connection to the given URL and posts the data from the provided file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cfg

private Configurator cfg
eduGAIN Configurator used to retrieve keystore information


mdsConnection

private java.net.HttpURLConnection mdsConnection
The URLConnection to the MDS


mdMarshaller

private MetaDataMarshaller mdMarshaller
Marshaller object used to convert the data into SAML2 XML before publishing to the MDS


publishRespCode

private int publishRespCode
The HTTP response code received after publishing


publishRespMessage

private java.lang.String publishRespMessage
The HTTP response message received after publishing


log

private static org.slf4j.Logger log
Class logger.

Constructor Detail

MetaDataPublisher

public MetaDataPublisher()
Constructor

Method Detail

publishMetaData

public void publishMetaData(java.net.URL url,
                            java.lang.String data)
                     throws MetaPublishException
General publishing method; opens a connection to the given URL and posts the provided data. This method uses the eduGAIN-base SecureConnection class to perform HTTPS publishing. As it is still under testing, currently the other publishing method is being used.

Parameters:
url - the MDS URL used for opening the connection
data - a String containing the data to be posted
Throws:
MetaPublishException

publishMetaData

public void publishMetaData(java.lang.String url,
                            java.lang.String xmlString)
                     throws MetaPublishException
General publishing method; opens a connection to the given URL and posts the data from the provided file. This method uses classes from org.apache.commons.httpclient to perform publishing to the MDS and is currently stable.

Parameters:
url - a string containing the MDS URL used for opening the connection
xmlString - the data to be posted
Throws:
MetaPublishException

publishMetaDataFile

public void publishMetaDataFile(java.lang.String url,
                                java.lang.String file)
                         throws MetaPublishException
General publishing method; opens a connection to the given URL and posts the data from the provided file. This method uses classes from org.apache.commons.httpclient to perform publishing to the MDS and is currently stable.

Parameters:
url - a string containing the MDS URL used for opening the connection
file - the file containing the data to be posted
Throws:
MetaPublishException

bePublish

public void bePublish(java.net.URL mdsBase,
                      java.lang.String federationID,
                      java.lang.String entityID,
                      BEMetaData bemd)
               throws MetaPublishException
Publishing function used by an authorized bridging element(BE) in order to publish its own metadata to the MDS

Parameters:
mdsBase - the MDS base URL
federationID - the federation name to which the BE belongs
entityID - the BE name
bemd - the BEMetaData subject to publishing
Throws:
eduGMetaPublishException
MetaPublishException

fppPublish

public void fppPublish(java.net.URL mdsBase,
                       java.lang.String federationID,
                       java.lang.String fppCompID,
                       java.util.ArrayList<BEMetaData> bemdlist)
                throws MetaPublishException
Publishing function used centrally by an FPP in order to publish metadata about BE(s) within its federation

Parameters:
mdsBase - the MDS base URL
federationID - the federation name
fppCompID - the component ID of the publishing FPP
bemdlist - the list of BEMetaData objects subject to publishing
Throws:
eduGMetaPublishException
MetaPublishException

deleteMetaData

public void deleteMetaData(java.lang.String url)
                    throws MetaPublishException
General delete method; opens a connection to the given URL and deletes the metadata associated with the given entity or federation.

Parameters:
url - a string containing the MDS URL used for opening the connection
Throws:
MetaPublishException

beDelete

public void beDelete(java.net.URL mdsBase,
                     java.lang.String federationID,
                     java.lang.String entityID)
              throws MetaPublishException
Deleting function used by an authorized bridging element(BE) in order to delete their own metadata from the MDS

Parameters:
mdsBase - the MDS base URL
federationID - the federation name to which the BE belongs
entityID - the BE name
Throws:
eduGMetaPublishException
MetaPublishException

fppDelete

public void fppDelete(java.net.URL mdsBase,
                      java.lang.String federationID)
               throws MetaPublishException
Deleting function used centrally by an FPP in order to delete metadata about BE(s) within its federation

Parameters:
mdsBase - the MDS base URL
federationID - the federation name
Throws:
MetaPublishException

getPublishRespCode

public int getPublishRespCode()
Gets the REST/HTTP response code

Returns:
the response code

getPublishRespMessage

public java.lang.String getPublishRespMessage()
Gets the REST/HTTP response message

Returns:
the response message