1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #ifndef _DAVSESSION_HXX_
23 #define _DAVSESSION_HXX_
26 #include <rtl/ustring.hxx>
27 #include <com/sun/star/io/XInputStream.hpp>
28 #include <com/sun/star/io/XOutputStream.hpp>
29 #include "DAVException.hxx"
30 #include "DAVProperties.hxx"
31 #include "DAVResource.hxx"
32 #include "DAVSessionFactory.hxx"
33 #include "DAVTypes.hxx"
34 #include "DAVRequestEnvironment.hxx"
36 namespace com
{ namespace sun
{ namespace star
{ namespace ucb
{
40 namespace http_dav_ucp
43 class DAVAuthListener
;
48 inline void acquire() SAL_THROW(())
50 osl_incrementInterlockedCount( &m_nRefCount
);
53 void release() SAL_THROW(())
55 if ( osl_decrementInterlockedCount( &m_nRefCount
) == 0 )
57 m_xFactory
->releaseElement( this );
62 virtual sal_Bool
CanUse( const ::rtl::OUString
& inPath
) = 0;
64 virtual sal_Bool
UsesProxy() = 0;
71 virtual void OPTIONS( const ::rtl::OUString & inPath,
72 DAVCapabilities & outCapabilities,
73 const DAVRequestEnvironment & rEnv )
74 throw( DAVException ) = 0;
78 virtual void PROPFIND( const ::rtl::OUString
& inPath
,
80 const std::vector
< ::rtl::OUString
> & inPropertyNames
,
81 std::vector
< DAVResource
> & ioResources
,
82 const DAVRequestEnvironment
& rEnv
)
83 throw( DAVException
) = 0;
86 virtual void PROPFIND( const ::rtl::OUString
& inPath
,
88 std::vector
< DAVResourceInfo
> & ioResInfo
,
89 const DAVRequestEnvironment
& rEnv
)
90 throw( DAVException
) = 0;
92 virtual void PROPPATCH( const ::rtl::OUString
& inPath
,
93 const std::vector
< ProppatchValue
> & inValues
,
94 const DAVRequestEnvironment
& rEnv
)
95 throw( DAVException
) = 0;
97 virtual void HEAD( const ::rtl::OUString
& inPath
,
98 const std::vector
< ::rtl::OUString
> & inHeaderNames
,
99 DAVResource
& ioResource
,
100 const DAVRequestEnvironment
& rEnv
)
101 throw( DAVException
) = 0;
103 virtual com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
>
104 GET( const ::rtl::OUString
& inPath
,
105 const DAVRequestEnvironment
& rEnv
)
106 throw( DAVException
) = 0;
108 virtual void GET( const ::rtl::OUString
& inPath
,
109 com::sun::star::uno::Reference
<
110 com::sun::star::io::XOutputStream
>& o
,
111 const DAVRequestEnvironment
& rEnv
)
112 throw( DAVException
) = 0;
114 virtual com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
>
115 GET( const ::rtl::OUString
& inPath
,
116 const std::vector
< ::rtl::OUString
> & inHeaderNames
,
117 DAVResource
& ioResource
,
118 const DAVRequestEnvironment
& rEnv
)
119 throw( DAVException
) = 0;
122 GET( const ::rtl::OUString
& inPath
,
123 com::sun::star::uno::Reference
< com::sun::star::io::XOutputStream
>& o
,
124 const std::vector
< ::rtl::OUString
> & inHeaderNames
,
125 DAVResource
& ioResource
,
126 const DAVRequestEnvironment
& rEnv
)
127 throw( DAVException
) = 0;
129 virtual void PUT( const ::rtl::OUString
& inPath
,
130 const com::sun::star::uno::Reference
<
131 com::sun::star::io::XInputStream
>& s
,
132 const DAVRequestEnvironment
& rEnv
)
133 throw( DAVException
) = 0;
135 virtual com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
>
136 POST( const rtl::OUString
& inPath
,
137 const rtl::OUString
& rContentType
,
138 const rtl::OUString
& rReferer
,
139 const com::sun::star::uno::Reference
<
140 com::sun::star::io::XInputStream
> & inInputStream
,
141 const DAVRequestEnvironment
& rEnv
)
142 throw ( DAVException
) = 0;
144 virtual void POST( const rtl::OUString
& inPath
,
145 const rtl::OUString
& rContentType
,
146 const rtl::OUString
& rReferer
,
147 const com::sun::star::uno::Reference
<
148 com::sun::star::io::XInputStream
> & inInputStream
,
149 com::sun::star::uno::Reference
<
150 com::sun::star::io::XOutputStream
> & oOutputStream
,
151 const DAVRequestEnvironment
& rEnv
)
152 throw ( DAVException
) = 0;
154 virtual void MKCOL( const ::rtl::OUString
& inPath
,
155 const DAVRequestEnvironment
& rEnv
)
156 throw( DAVException
) = 0;
158 virtual void COPY( const ::rtl::OUString
& inSource
,
159 const ::rtl::OUString
& inDestination
,
160 const DAVRequestEnvironment
& rEnv
,
161 sal_Bool inOverwrite
= false )
162 throw( DAVException
) = 0;
164 virtual void MOVE( const ::rtl::OUString
& inSource
,
165 const ::rtl::OUString
& inDestination
,
166 const DAVRequestEnvironment
& rEnv
,
167 sal_Bool inOverwrite
= false )
168 throw( DAVException
) = 0;
170 virtual void DESTROY( const ::rtl::OUString
& inPath
,
171 const DAVRequestEnvironment
& rEnv
)
172 throw( DAVException
) = 0;
175 virtual void LOCK( const ::rtl::OUString
& inPath
,
176 com::sun::star::ucb::Lock
& inLock
,
177 const DAVRequestEnvironment
& rEnv
)
178 throw ( DAVException
) = 0;
180 // refresh existing lock.
181 virtual sal_Int64
LOCK( const ::rtl::OUString
& inPath
,
183 const DAVRequestEnvironment
& rEnv
)
184 throw ( DAVException
) = 0;
186 virtual void UNLOCK( const ::rtl::OUString
& inPath
,
187 const DAVRequestEnvironment
& rEnv
)
188 throw ( DAVException
) = 0;
191 throw( DAVException
) = 0;
194 rtl::Reference
< DAVSessionFactory
> m_xFactory
;
196 DAVSession( rtl::Reference
< DAVSessionFactory
> const & rFactory
)
197 : m_xFactory( rFactory
), m_nRefCount( 0 ) {}
199 virtual ~DAVSession() {}
202 DAVSessionFactory::Map::iterator m_aContainerIt
;
203 oslInterlockedCount m_nRefCount
;
205 friend class DAVSessionFactory
;
206 friend class std::auto_ptr
< DAVSession
>;
209 } // namespace http_dav_ucp
211 #endif // _DAVSESSION_HXX_
213 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */