LibreOffice Module ucb (master)  1
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
webdav_ucp::NeonSession Class Reference

#include <NeonSession.hxx>

Inheritance diagram for webdav_ucp::NeonSession:
[legend]
Collaboration diagram for webdav_ucp::NeonSession:
[legend]

Public Member Functions

 NeonSession (const rtl::Reference< DAVSessionFactory > &rSessionFactory, const OUString &inUri, const css::uno::Sequence< css::beans::NamedValue > &rFlags, const ucbhelper::InternetProxyDecider &rProxyDecider)
 
virtual bool CanUse (const OUString &inPath, const css::uno::Sequence< css::beans::NamedValue > &rFlags) override
 
virtual bool UsesProxy () override
 
const DAVRequestEnvironmentgetRequestEnvironment () const
 
virtual void OPTIONS (const OUString &inPath, DAVOptions &rOptions, const DAVRequestEnvironment &rEnv) override
 
virtual void PROPFIND (const OUString &inPath, const Depth inDepth, const std::vector< OUString > &inPropNames, std::vector< DAVResource > &ioResources, const DAVRequestEnvironment &rEnv) override
 
virtual void PROPFIND (const OUString &inPath, const Depth inDepth, std::vector< DAVResourceInfo > &ioResInfo, const DAVRequestEnvironment &rEnv) override
 
virtual void PROPPATCH (const OUString &inPath, const std::vector< ProppatchValue > &inValues, const DAVRequestEnvironment &rEnv) override
 
virtual void HEAD (const OUString &inPath, const std::vector< OUString > &inHeaderNames, DAVResource &ioResource, const DAVRequestEnvironment &rEnv) override
 
virtual css::uno::Reference< css::io::XInputStream > GET (const OUString &inPath, const DAVRequestEnvironment &rEnv) override
 
virtual void GET (const OUString &inPath, css::uno::Reference< css::io::XOutputStream > &ioOutputStream, const DAVRequestEnvironment &rEnv) override
 
virtual css::uno::Reference< css::io::XInputStream > GET (const OUString &inPath, const std::vector< OUString > &inHeaderNames, DAVResource &ioResource, const DAVRequestEnvironment &rEnv) override
 
virtual void GET0 (const OUString &inPath, const std::vector< OUString > &inHeaderNames, DAVResource &ioResource, const DAVRequestEnvironment &rEnv) override
 
virtual void GET (const OUString &inPath, css::uno::Reference< css::io::XOutputStream > &ioOutputStream, const std::vector< OUString > &inHeaderNames, DAVResource &ioResource, const DAVRequestEnvironment &rEnv) override
 
virtual void PUT (const OUString &inPath, const css::uno::Reference< css::io::XInputStream > &inInputStream, const DAVRequestEnvironment &rEnv) override
 
virtual css::uno::Reference< css::io::XInputStream > POST (const OUString &inPath, const OUString &rContentType, const OUString &rReferer, const css::uno::Reference< css::io::XInputStream > &inInputStream, const DAVRequestEnvironment &rEnv) override
 
virtual void POST (const OUString &inPath, const OUString &rContentType, const OUString &rReferer, const css::uno::Reference< css::io::XInputStream > &inInputStream, css::uno::Reference< css::io::XOutputStream > &oOutputStream, const DAVRequestEnvironment &rEnv) override
 
virtual void MKCOL (const OUString &inPath, const DAVRequestEnvironment &rEnv) override
 
virtual void COPY (const OUString &inSourceURL, const OUString &inDestinationURL, const DAVRequestEnvironment &rEnv, bool inOverWrite) override
 
virtual void MOVE (const OUString &inSourceURL, const OUString &inDestinationURL, const DAVRequestEnvironment &rEnv, bool inOverWrite) override
 
virtual void DESTROY (const OUString &inPath, const DAVRequestEnvironment &rEnv) override
 
virtual void LOCK (const OUString &inURL, css::ucb::Lock &inLock, const DAVRequestEnvironment &rEnv) override
 
virtual void UNLOCK (const OUString &inURL, const DAVRequestEnvironment &rEnv) override
 
virtual void abort () override
 
const OUString & getHostName () const
 
::uno::Reference< ::uno::XComponentContext > const & getComponentContext () const
 
const voidgetRequestData () const
 
bool isDomainMatch (const OUString &certHostName)
 
int CertificationNotify (const ne_ssl_certificate *cert)
 
int NeonAuth (const char *inAuthProtocol, const char *inRealm, int attempt, char *inoutUserName, char *inoutPassWord)
 
void PreSendRequest (ne_request *req, ne_buffer *headers)
 
- Public Member Functions inherited from webdav_ucp::DAVSession
void acquire ()
 
void release ()
 

Protected Member Functions

virtual ~NeonSession () override
 
- Protected Member Functions inherited from webdav_ucp::DAVSession
 DAVSession (rtl::Reference< DAVSessionFactory > const &rFactory)
 
virtual ~DAVSession ()
 

Private Member Functions

void Init ()
 
void Init (const DAVRequestEnvironment &rEnv)
 
void HandleError (int nError, const OUString &inPath, const DAVRequestEnvironment &rEnv)
 
ucbhelper::InternetProxyServer getProxySettings () const
 
bool removeExpiredLocktoken (const OUString &inURL, const DAVRequestEnvironment &rEnv)
 
bool LOCK (NeonLock *pLock, sal_Int32 &rlastChanceToSendRefreshRequest)
 
bool UNLOCK (NeonLock *pLock)
 
int POST (ne_session *sess, const char *uri, const char *buffer, ne_block_reader reader, void *userdata, const OUString &rContentType, const OUString &rReferer)
 
OUString makeAbsoluteURL (OUString const &rURL) const
 

Static Private Member Functions

static int GET (ne_session *sess, const char *uri, ne_block_reader reader, bool getheaders, void *userdata)
 
static int GET0 (ne_session *sess, const char *uri, bool getheaders, void *userdata)
 
static int PUT (ne_session *sess, const char *uri, const char *buffer, size_t size)
 
static bool getDataFromInputStream (const css::uno::Reference< css::io::XInputStream > &xStream, css::uno::Sequence< sal_Int8 > &rData, bool bAppendTrailingZeroByte)
 

Private Attributes

osl::Mutex m_aMutex
 
OUString m_aScheme
 
OUString m_aHostName
 
OUString m_aProxyName
 
sal_Int32 m_nPort
 
sal_Int32 m_nProxyPort
 
css::uno::Sequence< css::beans::NamedValue > const m_aFlags
 
HttpSessionm_pHttpSession
 
bool m_bNeedNewSession = false
 
void *const m_pRequestData
 
const ucbhelper::InternetProxyDeciderm_rProxyDecider
 
DAVRequestEnvironment m_aEnv
 

Static Private Attributes

static bool m_bGlobalsInited = false
 
static NeonLockStore m_aNeonLockStore
 

Friends

class NeonLockStore
 

Additional Inherited Members

- Protected Attributes inherited from webdav_ucp::DAVSession
rtl::Reference< DAVSessionFactorym_xFactory
 

Detailed Description

Definition at line 46 of file NeonSession.hxx.

Constructor & Destructor Documentation

NeonSession::~NeonSession ( )
overrideprotectedvirtual

Definition at line 645 of file NeonSession.cxx.

References webdav_ucp::getGlobalNeonMutex(), m_pHttpSession, and m_pRequestData.

NeonSession::NeonSession ( const rtl::Reference< DAVSessionFactory > &  rSessionFactory,
const OUString &  inUri,
const css::uno::Sequence< css::beans::NamedValue > &  rFlags,
const ucbhelper::InternetProxyDecider rProxyDecider 
)

Member Function Documentation

void NeonSession::abort ( )
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

Definition at line 1757 of file NeonSession.cxx.

References SAL_INFO.

bool NeonSession::CanUse ( const OUString &  inPath,
const css::uno::Sequence< css::beans::NamedValue > &  rFlags 
)
overridevirtual
int NeonSession::CertificationNotify ( const ne_ssl_certificate *  cert)
void NeonSession::COPY ( const OUString &  inSource,
const OUString &  inDestination,
const DAVRequestEnvironment rEnv,
bool  inOverwrite 
)
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

Definition at line 1445 of file NeonSession.cxx.

References webdav_ucp::NeonUri::GetPath(), HandleError(), Init(), m_aMutex, m_pHttpSession, OUStringToOString(), and SAL_INFO.

void NeonSession::DESTROY ( const OUString &  inPath,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

Definition at line 1495 of file NeonSession.cxx.

References HandleError(), Init(), m_aMutex, m_pHttpSession, OUStringToOString(), and SAL_INFO.

uno::Reference< io::XInputStream > NeonSession::GET ( const OUString &  inPath,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

Definition at line 1225 of file NeonSession.cxx.

References HandleError(), Init(), m_aMutex, m_pHttpSession, NeonSession_ResponseBlockReader(), OUStringToOString(), and SAL_INFO.

Referenced by GET().

virtual void webdav_ucp::NeonSession::GET ( const OUString &  inPath,
css::uno::Reference< css::io::XOutputStream > &  o,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

uno::Reference< io::XInputStream > NeonSession::GET ( const OUString &  inPath,
const std::vector< OUString > &  inHeaderNames,
DAVResource ioResource,
const DAVRequestEnvironment rEnv 
)
overridevirtual
virtual void webdav_ucp::NeonSession::GET ( const OUString &  inPath,
css::uno::Reference< css::io::XOutputStream > &  o,
const std::vector< OUString > &  inHeaderNames,
DAVResource ioResource,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

int NeonSession::GET ( ne_session *  sess,
const char *  uri,
ne_block_reader  reader,
bool  getheaders,
void userdata 
)
staticprivate

Definition at line 2083 of file NeonSession.cxx.

References webdav_ucp::getGlobalNeonMutex(), name, and SAL_INFO.

void NeonSession::GET0 ( const OUString &  inPath,
const std::vector< OUString > &  inHeaderNames,
DAVResource ioResource,
const DAVRequestEnvironment rEnv 
)
overridevirtual
int NeonSession::GET0 ( ne_session *  sess,
const char *  uri,
bool  getheaders,
void userdata 
)
staticprivate

Definition at line 2126 of file NeonSession.cxx.

References webdav_ucp::getGlobalNeonMutex(), name, and SAL_INFO.

::uno::Reference< ::uno::XComponentContext > const& webdav_ucp::NeonSession::getComponentContext ( ) const
inline

Definition at line 201 of file NeonSession.hxx.

References webdav_ucp::DAVSession::m_xFactory.

bool NeonSession::getDataFromInputStream ( const css::uno::Reference< css::io::XInputStream > &  xStream,
css::uno::Sequence< sal_Int8 > &  rData,
bool  bAppendTrailingZeroByte 
)
staticprivate

Definition at line 2253 of file NeonSession.cxx.

const OUString& webdav_ucp::NeonSession::getHostName ( ) const
inline

Definition at line 199 of file NeonSession.hxx.

References m_aHostName.

Referenced by isDomainMatch().

ucbhelper::InternetProxyServer NeonSession::getProxySettings ( ) const
private
const void* webdav_ucp::NeonSession::getRequestData ( ) const
inline

Definition at line 204 of file NeonSession.hxx.

References m_pRequestData.

const DAVRequestEnvironment& webdav_ucp::NeonSession::getRequestEnvironment ( ) const
inline

Definition at line 87 of file NeonSession.hxx.

References m_aEnv.

void NeonSession::HandleError ( int  nError,
const OUString &  inPath,
const DAVRequestEnvironment rEnv 
)
private
Exceptions
std::exception

Definition at line 1848 of file NeonSession.cxx.

References webdav_ucp::DAVException::DAV_HTTP_AUTH, webdav_ucp::DAVException::DAV_HTTP_AUTHPROXY, webdav_ucp::DAVException::DAV_HTTP_CONNECT, webdav_ucp::DAVException::DAV_HTTP_ERROR, webdav_ucp::DAVException::DAV_HTTP_FAILED, webdav_ucp::DAVException::DAV_HTTP_LOOKUP, webdav_ucp::DAVException::DAV_HTTP_REDIRECT, webdav_ucp::DAVException::DAV_HTTP_RETRY, webdav_ucp::DAVException::DAV_HTTP_TIMEOUT, webdav_ucp::DAVException::DAV_LOCK_EXPIRED, webdav_ucp::DAVException::DAV_LOCKED, webdav_ucp::DAVException::DAV_LOCKED_SELF, webdav_ucp::NeonLockStore::findByUri(), webdav_ucp::NeonUri::GetURI(), m_aEnv, m_aHostName, m_aNeonLockStore, m_aProxyName, m_bNeedNewSession, m_nPort, m_nProxyPort, m_pHttpSession, makeAbsoluteURL(), webdav_ucp::NeonUri::makeConnectionEndPointString(), makeStatusCode(), removeExpiredLocktoken(), SAL_INFO, SAL_WARN, webdav_ucp::SC_BAD_GATEWAY, webdav_ucp::SC_BAD_REQUEST, webdav_ucp::SC_CONFLICT, webdav_ucp::SC_EXPECTATION_FAILED, webdav_ucp::SC_FAILED_DEPENDENCY, webdav_ucp::SC_FORBIDDEN, webdav_ucp::SC_GATEWAY_TIMEOUT, webdav_ucp::SC_GONE, webdav_ucp::SC_HTTP_VERSION_NOT_SUPPORTED, webdav_ucp::SC_INSUFFICIENT_STORAGE, webdav_ucp::SC_INTERNAL_SERVER_ERROR, webdav_ucp::SC_LENGTH_REQUIRED, webdav_ucp::SC_LOCKED, webdav_ucp::SC_METHOD_NOT_ALLOWED, webdav_ucp::SC_NOT_ACCEPTABLE, webdav_ucp::SC_NOT_FOUND, webdav_ucp::SC_NOT_IMPLEMENTED, webdav_ucp::SC_PAYMENT_REQUIRED, webdav_ucp::SC_PRECONDITION_FAILED, webdav_ucp::SC_PROXY_AUTHENTICATION_REQUIRED, webdav_ucp::SC_REQUEST_ENTITY_TOO_LARGE, webdav_ucp::SC_REQUEST_TIMEOUT, webdav_ucp::SC_REQUEST_URI_TOO_LONG, webdav_ucp::SC_REQUESTED_RANGE_NOT_SATISFIABLE, webdav_ucp::SC_SERVICE_UNAVAILABLE, webdav_ucp::SC_UNAUTHORIZED, webdav_ucp::SC_UNPROCESSABLE_ENTITY, and webdav_ucp::SC_UNSUPPORTED_MEDIA_TYPE.

Referenced by COPY(), DESTROY(), GET(), GET0(), HEAD(), MKCOL(), MOVE(), OPTIONS(), PROPFIND(), PROPPATCH(), and UNLOCK().

void NeonSession::HEAD ( const OUString &  inPath,
const std::vector< OUString > &  inHeaderNames,
DAVResource ioResource,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

Definition at line 1204 of file NeonSession.cxx.

References HandleError(), Init(), m_aMutex, m_pHttpSession, and SAL_INFO.

void NeonSession::Init ( void  )
private
void NeonSession::Init ( const DAVRequestEnvironment rEnv)
private
Exceptions
css::uno::RuntimeException

Definition at line 658 of file NeonSession.cxx.

References Init(), m_aEnv, and m_aMutex.

bool NeonSession::isDomainMatch ( const OUString &  certHostName)

Definition at line 2341 of file NeonSession.cxx.

References getHostName().

virtual void webdav_ucp::NeonSession::LOCK ( const OUString &  inPath,
css::ucb::Lock &  inLock,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

bool NeonSession::LOCK ( NeonLock pLock,
sal_Int32 &  rlastChanceToSendRefreshRequest 
)
private
OUString NeonSession::makeAbsoluteURL ( OUString const &  rURL) const
private

Definition at line 2360 of file NeonSession.cxx.

References webdav_ucp::NeonUri::GetURI(), m_pHttpSession, and OUStringToOString().

Referenced by HandleError(), OPTIONS(), and UNLOCK().

void NeonSession::MKCOL ( const OUString &  inPath,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

Definition at line 1430 of file NeonSession.cxx.

References HandleError(), Init(), m_aMutex, m_pHttpSession, OUStringToOString(), and SAL_INFO.

void NeonSession::MOVE ( const OUString &  inSource,
const OUString &  inDestination,
const DAVRequestEnvironment rEnv,
bool  inOverwrite 
)
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

Definition at line 1471 of file NeonSession.cxx.

References webdav_ucp::NeonUri::GetPath(), HandleError(), Init(), m_aMutex, m_pHttpSession, OUStringToOString(), and SAL_INFO.

int NeonSession::NeonAuth ( const char *  inAuthProtocol,
const char *  inRealm,
int  attempt,
char *  inoutUserName,
char *  inoutPassWord 
)
void NeonSession::OPTIONS ( const OUString &  inPath,
DAVOptions rOptions,
const DAVRequestEnvironment rEnv 
)
overridevirtual
virtual css::uno::Reference< css::io::XInputStream > webdav_ucp::NeonSession::POST ( const OUString &  inPath,
const OUString &  rContentType,
const OUString &  rReferer,
const css::uno::Reference< css::io::XInputStream > &  inInputStream,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

virtual void webdav_ucp::NeonSession::POST ( const OUString &  inPath,
const OUString &  rContentType,
const OUString &  rReferer,
const css::uno::Reference< css::io::XInputStream > &  inInputStream,
css::uno::Reference< css::io::XOutputStream > &  oOutputStream,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

int NeonSession::POST ( ne_session *  sess,
const char *  uri,
const char *  buffer,
ne_block_reader  reader,
void userdata,
const OUString &  rContentType,
const OUString &  rReferer 
)
private
  • Read the value of the Content-Length header into ctx.total */

Definition at line 2193 of file NeonSession.cxx.

References webdav_ucp::getGlobalNeonMutex(), and m_pRequestData.

void NeonSession::PreSendRequest ( ne_request *  req,
ne_buffer *  headers 
)

Definition at line 549 of file NeonSession.cxx.

References EOL, m_aMutex, and OUStringToOString().

Referenced by NeonSession_PreSendRequest().

void NeonSession::PROPFIND ( const OUString &  inPath,
const Depth  inDepth,
const std::vector< OUString > &  inPropertyNames,
std::vector< DAVResource > &  ioResources,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

Definition at line 1011 of file NeonSession.cxx.

References HandleError(), Init(), m_aMutex, m_pHttpSession, OUStringToOString(), and SAL_INFO.

Referenced by removeExpiredLocktoken().

void NeonSession::PROPFIND ( const OUString &  inPath,
const Depth  inDepth,
std::vector< DAVResourceInfo > &  ioResInfo,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

Definition at line 1044 of file NeonSession.cxx.

References HandleError(), Init(), m_aMutex, m_pHttpSession, OUStringToOString(), and SAL_INFO.

void NeonSession::PROPPATCH ( const OUString &  inPath,
const std::vector< ProppatchValue > &  inValues,
const DAVRequestEnvironment rEnv 
)
overridevirtual
virtual void webdav_ucp::NeonSession::PUT ( const OUString &  inPath,
const css::uno::Reference< css::io::XInputStream > &  s,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
std::exception

Implements webdav_ucp::DAVSession.

int NeonSession::PUT ( ne_session *  sess,
const char *  uri,
const char *  buffer,
size_t  size 
)
staticprivate

Definition at line 2162 of file NeonSession.cxx.

References webdav_ucp::getGlobalNeonMutex().

bool NeonSession::removeExpiredLocktoken ( const OUString &  inURL,
const DAVRequestEnvironment rEnv 
)
private
void NeonSession::UNLOCK ( const OUString &  inPath,
const DAVRequestEnvironment rEnv 
)
overridevirtual
bool NeonSession::UNLOCK ( NeonLock pLock)
private

Definition at line 1715 of file NeonSession.cxx.

References m_aMutex, m_bNeedNewSession, m_pHttpSession, and SAL_INFO.

bool NeonSession::UsesProxy ( )
overridevirtual

Implements webdav_ucp::DAVSession.

Definition at line 887 of file NeonSession.cxx.

References Init(), and m_aProxyName.

Friends And Related Function Documentation

friend class NeonLockStore
friend

Definition at line 216 of file NeonSession.hxx.

Member Data Documentation

DAVRequestEnvironment webdav_ucp::NeonSession::m_aEnv
private

Definition at line 66 of file NeonSession.hxx.

Referenced by getRequestEnvironment(), HandleError(), and Init().

css::uno::Sequence< css::beans::NamedValue > const webdav_ucp::NeonSession::m_aFlags
private

Definition at line 55 of file NeonSession.hxx.

Referenced by CanUse(), and Init().

OUString webdav_ucp::NeonSession::m_aHostName
private

Definition at line 51 of file NeonSession.hxx.

Referenced by CanUse(), getHostName(), getProxySettings(), HandleError(), Init(), and NeonSession().

osl::Mutex webdav_ucp::NeonSession::m_aMutex
private

Definition at line 49 of file NeonSession.hxx.

Referenced by COPY(), DESTROY(), GET(), GET0(), HEAD(), Init(), LOCK(), MKCOL(), MOVE(), OPTIONS(), PROPFIND(), PROPPATCH(), and UNLOCK().

NeonLockStore NeonSession::m_aNeonLockStore
staticprivate

Definition at line 69 of file NeonSession.hxx.

Referenced by HandleError(), Init(), LOCK(), OPTIONS(), removeExpiredLocktoken(), and UNLOCK().

OUString webdav_ucp::NeonSession::m_aProxyName
private

Definition at line 52 of file NeonSession.hxx.

Referenced by HandleError(), Init(), and UsesProxy().

OUString webdav_ucp::NeonSession::m_aScheme
private

Definition at line 50 of file NeonSession.hxx.

Referenced by CanUse(), getProxySettings(), Init(), and NeonSession().

bool NeonSession::m_bGlobalsInited = false
staticprivate

Definition at line 68 of file NeonSession.hxx.

Referenced by Init().

bool webdav_ucp::NeonSession::m_bNeedNewSession = false
private

Definition at line 57 of file NeonSession.hxx.

Referenced by HandleError(), Init(), LOCK(), and UNLOCK().

sal_Int32 webdav_ucp::NeonSession::m_nPort
private

Definition at line 53 of file NeonSession.hxx.

Referenced by CanUse(), getProxySettings(), HandleError(), Init(), and NeonSession().

sal_Int32 webdav_ucp::NeonSession::m_nProxyPort
private

Definition at line 54 of file NeonSession.hxx.

Referenced by HandleError(), and Init().

HttpSession* webdav_ucp::NeonSession::m_pHttpSession
private
void* const webdav_ucp::NeonSession::m_pRequestData
private

Definition at line 58 of file NeonSession.hxx.

Referenced by getRequestData(), POST(), and ~NeonSession().

const ucbhelper::InternetProxyDecider& webdav_ucp::NeonSession::m_rProxyDecider
private

Definition at line 59 of file NeonSession.hxx.

Referenced by getProxySettings().


The documentation for this class was generated from the following files: