Package nl.b3p.csw.server
Class GeoNetworkCswServer
- java.lang.Object
-
- nl.b3p.csw.server.GeoNetworkCswServer
-
- All Implemented Interfaces:
CswServable<org.jdom2.Document>
public class GeoNetworkCswServer extends Object implements CswServable<org.jdom2.Document>
- Author:
- Erik van de Pol. Most of this class by Chris van Lith.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.http.client.CookieStorecookieStoreprotected StringcswDiscoveryUrlprotected StringcswPasswordprotected StringcswPublicationUrlprotected StringcswUserprotected static org.apache.commons.logging.Loglogprotected StringloginUrlprotected ResponseListenable<org.jdom2.Document>responseListenable
-
Constructor Summary
Constructors Constructor Description GeoNetworkCswServer(String loginUrl, String cswUrl, String cswUser, String cswPassword)GeoNetworkCswServer(String loginUrl, String cswUrl, String cswUser, String cswPassword, ResponseListenable responseListenable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jdom2.DocumentdoRequest(String cswRequestXml, boolean transaction)Posts cswRequestXml to the server.ResponseListenablegetResponseListenable()protected booleanhttpPostCswLoginRequest(String url, String username, String password)protected org.jdom2.DocumenthttpPostCswRequest(String request, String url)protected org.jdom2.DocumenthttpPostCswRequest(String request, String url, String username, String password)protected booleanlogin(String url, String username, String password)voidsetResponseListenable(ResponseListenable responseListenable)
-
-
-
Field Detail
-
log
protected static org.apache.commons.logging.Log log
-
cookieStore
protected org.apache.http.client.CookieStore cookieStore
-
cswDiscoveryUrl
protected String cswDiscoveryUrl
-
cswPublicationUrl
protected String cswPublicationUrl
-
loginUrl
protected String loginUrl
-
cswUser
protected String cswUser
-
cswPassword
protected String cswPassword
-
responseListenable
protected ResponseListenable<org.jdom2.Document> responseListenable
-
-
Method Detail
-
getResponseListenable
public ResponseListenable getResponseListenable()
-
setResponseListenable
public void setResponseListenable(ResponseListenable responseListenable)
-
doRequest
public org.jdom2.Document doRequest(String cswRequestXml, boolean transaction) throws IOException, org.jdom2.JDOMException, javax.xml.bind.JAXBException, OwsException
Description copied from interface:CswServablePosts cswRequestXml to the server. Classes implementing CswServable should supply their own login logic.- Specified by:
doRequestin interfaceCswServable<org.jdom2.Document>- Returns:
- The response from the server as a String. The String should contain xml.
- Throws:
IOExceptionorg.jdom2.JDOMExceptionjavax.xml.bind.JAXBExceptionOwsException
-
login
protected boolean login(String url, String username, String password) throws IOException, org.jdom2.JDOMException, javax.xml.bind.JAXBException, OwsException
- Throws:
IOExceptionorg.jdom2.JDOMExceptionjavax.xml.bind.JAXBExceptionOwsException
-
httpPostCswLoginRequest
protected boolean httpPostCswLoginRequest(String url, String username, String password) throws IOException, org.jdom2.JDOMException, javax.xml.bind.JAXBException, OwsException
- Throws:
IOExceptionorg.jdom2.JDOMExceptionjavax.xml.bind.JAXBExceptionOwsException
-
httpPostCswRequest
protected org.jdom2.Document httpPostCswRequest(String request, String url) throws IOException, org.jdom2.JDOMException, javax.xml.bind.JAXBException, OwsException
- Throws:
IOExceptionorg.jdom2.JDOMExceptionjavax.xml.bind.JAXBExceptionOwsException
-
httpPostCswRequest
protected org.jdom2.Document httpPostCswRequest(String request, String url, String username, String password) throws IOException, org.jdom2.JDOMException, javax.xml.bind.JAXBException, OwsException
- Throws:
IOExceptionorg.jdom2.JDOMExceptionjavax.xml.bind.JAXBExceptionOwsException
-
-