summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-06-27 13:44:47 +0200
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-06-27 17:28:36 +0200
commit6c71f41174fe45e78720ba049e60477735107b9d (patch)
tree22344dd71704e652d1007d728193edb379250ab4 /ucb
parent1fdd61db155cf63d5dd55cc2bfb45af33796e131 (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.cxx6
-rw-r--r--ucb/source/ucp/cmis/cmis_url.cxx9
-rw-r--r--ucb/source/ucp/cmis/cmis_url.hxx5
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( );