diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-06-27 13:44:47 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-06-27 17:29:44 +0200 |
commit | ee6008603a59693a596d6fc1bb6a3320ba7d2940 (patch) | |
tree | e3d342cfc14ed0ff89858a440f4d05f6163c7dd9 /ucb | |
parent | 1f0da495692279762ecdadf918f5fbbaa576fd92 (diff) |
CMIS UCP: session cache, better use the binding URL + repo Id as id
There may be cases where we have the host part of the URL encoded
differently... and thus trigerring the creation of another session when
it's not needed.
Change-Id: Id8da4a7be31c98bb6b01df44da0d3963803b445b
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.cxx | 6 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_url.cxx | 9 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_url.hxx | 5 |
3 files changed, 13 insertions, 7 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 59febd9cc596..ddf09ba56342 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -163,13 +163,13 @@ namespace cmis cmis::URL url( m_sURL ); // Look for a cached session, key is binding url + repo id - INetURLObject aUrlObj( m_sURL ); - m_pSession = pProvider->getSession( aUrlObj.GetHost( ) ); + rtl::OUString sSessionId = url.getBindingUrl( ) + url.getRepositoryId( ); + m_pSession = pProvider->getSession( sSessionId ); if ( NULL == m_pSession ) { // Initiate a CMIS session and register it as we found nothing m_pSession = libcmis::SessionFactory::createSession( url.getSessionParams( ) ); - pProvider->registerSession( aUrlObj.GetHost( ), m_pSession ); + pProvider->registerSession( sSessionId, m_pSession ); } m_sObjectPath = url.getObjectPath( ); diff --git a/ucb/source/ucp/cmis/cmis_url.cxx b/ucb/source/ucp/cmis/cmis_url.cxx index aed136b3d86a..92d859db8309 100644 --- a/ucb/source/ucp/cmis/cmis_url.cxx +++ b/ucb/source/ucp/cmis/cmis_url.cxx @@ -70,16 +70,21 @@ namespace cmis return params; } - rtl::OUString URL::getObjectPath( ) + rtl::OUString& URL::getObjectPath( ) { return m_sPath; } - rtl::OUString URL::getBindingUrl( ) + rtl::OUString& URL::getBindingUrl( ) { return m_sBindingUrl; } + rtl::OUString& URL::getRepositoryId( ) + { + return m_sRepositoryId; + } + void URL::setObjectPath( rtl::OUString sPath ) { m_sPath = sPath; diff --git a/ucb/source/ucp/cmis/cmis_url.hxx b/ucb/source/ucp/cmis/cmis_url.hxx index 833804b7e9f4..4033a176a2c3 100644 --- a/ucb/source/ucp/cmis/cmis_url.hxx +++ b/ucb/source/ucp/cmis/cmis_url.hxx @@ -49,8 +49,9 @@ namespace cmis URL( rtl::OUString const & urlStr ); std::map< int, std::string > getSessionParams( ); - rtl::OUString getObjectPath( ); - rtl::OUString getBindingUrl( ); + rtl::OUString& getObjectPath( ); + rtl::OUString& getBindingUrl( ); + rtl::OUString& getRepositoryId( ); void setObjectPath( rtl::OUString sPath ); rtl::OUString asString( ); |