|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.geant.edugain.meta.query.MetaDataRequester
public class MetaDataRequester
This class implements a HTTP client which opens a (secure) connection to the provided Metadata Service (MDS) URL and retrieves the server response in the form of a String object.
| Field Summary | |
|---|---|
private static org.slf4j.Logger |
log
Class logger. |
private java.net.HttpURLConnection |
mdsConnection
The connection to the MDS server |
private MetaDataUnmarshaller |
mdUnmarshaller
Unmarshaller object used for unmarshalling the received metadata |
private int |
queryRespCode
The REST response code received from the MDS for the current metadata query |
private java.lang.String |
queryRespMessage
The REST response message received from the MDS for the current metadata query |
| Constructor Summary | |
|---|---|
MetaDataRequester()
Constructor |
|
| Method Summary | |
|---|---|
java.lang.String |
buildQueryString(java.util.ArrayList<HomeLocator> homelocators)
Builds the query string to be included in the MDS URL based on the provided home locators |
java.lang.StringBuffer |
extractXMLData(java.lang.StringBuffer sb,
java.lang.String root)
Extracts the XML data associated to the provided root element from a given string |
BEMetaData |
getBEMetaData(org.opensaml.xml.XMLObject root)
If the root of the received metadata document is an EntityDescriptor, this method maps it to an eduGAINMeta BEMetaData object |
FederationMetaData |
getFedMetaData(org.opensaml.xml.XMLObject root)
If the root of the received metadata document is an EntitiesDescriptor, this method maps it to an eduGAINMeta FederationMetaData object |
int |
getQueryRespCode()
Gets the query REST/HTTP response code |
java.lang.String |
getQueryRespMessage()
Gets the query REST/HTTP response message |
org.opensaml.xml.XMLObject |
getXMLMetaData(java.net.URL url,
java.lang.String root)
Gets the metadata response from the server and marhsalls it to an XML DOM object |
java.lang.StringBuffer |
readContents()
Reads the server answer from the connection input stream into a string |
java.lang.StringBuffer |
readXMLFile(java.lang.String fullPathFilename)
Reads the metadata from an xml file on the local file system into a StringBuffer |
java.lang.StringBuffer |
requestMetaData(java.net.URL url)
Sends a GET request to the given URL and provides the server response, performing redirection if necessary. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.net.HttpURLConnection mdsConnection
private int queryRespCode
private java.lang.String queryRespMessage
private MetaDataUnmarshaller mdUnmarshaller
private static org.slf4j.Logger log
| Constructor Detail |
|---|
public MetaDataRequester()
| Method Detail |
|---|
public org.opensaml.xml.XMLObject getXMLMetaData(java.net.URL url,
java.lang.String root)
throws MetaQueryException
url - the MDS server URLroot - a String representing the root the xml representation to be obtained
MetaQueryException
public FederationMetaData getFedMetaData(org.opensaml.xml.XMLObject root)
throws MetaQueryException
root - the XMLObject representing the root of the metadata document
MetaQueryException
public BEMetaData getBEMetaData(org.opensaml.xml.XMLObject root)
throws MetaQueryException
root - the XMLObject representing the root of the metadata document
MetaQueryException
public java.lang.StringBuffer requestMetaData(java.net.URL url)
throws MetaQueryException
url - the MDS server URL
edMetaQueryException
MetaQueryExceptionpublic java.lang.StringBuffer readContents()
public java.lang.StringBuffer readXMLFile(java.lang.String fullPathFilename)
throws java.io.IOException
java.io.IOException
public java.lang.StringBuffer extractXMLData(java.lang.StringBuffer sb,
java.lang.String root)
throws MetaQueryException
sb - the StringBuffer containing the dataroot - the root element of the xml representation to be obtained
eduGAIMetaQueryException
MetaQueryExceptionpublic java.lang.String buildQueryString(java.util.ArrayList<HomeLocator> homelocators)
homelocators - the list of home locator objects
public int getQueryRespCode()
public java.lang.String getQueryRespMessage()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||