1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef INCLUDED_UCB_SOURCE_UCP_WEBDAV_NEON_DAVSESSION_HXX
30 #define INCLUDED_UCB_SOURCE_UCP_WEBDAV_NEON_DAVSESSION_HXX
32 #include <config_lgpl.h>
34 #include <rtl/ustring.hxx>
35 #include <com/sun/star/io/XInputStream.hpp>
36 #include <com/sun/star/io/XOutputStream.hpp>
37 #include "DAVProperties.hxx"
38 #include "DAVResource.hxx"
39 #include "DAVSessionFactory.hxx"
40 #include "DAVTypes.hxx"
41 #include "DAVRequestEnvironment.hxx"
43 namespace com
{ namespace sun
{ namespace star
{ namespace beans
{
47 namespace com
{ namespace sun
{ namespace star
{ namespace ucb
{
59 osl_atomic_increment( &m_nRefCount
);
64 if ( osl_atomic_decrement( &m_nRefCount
) == 0 )
66 m_xFactory
->releaseElement( this );
71 virtual bool CanUse( const OUString
& inPath
,
72 const css::uno::Sequence
< css::beans::NamedValue
>& rFlags
) = 0;
74 virtual bool UsesProxy() = 0;
78 /// @throws std::exception
79 virtual void OPTIONS( const OUString
& inPath
,
81 const DAVRequestEnvironment
& rEnv
) = 0;
84 /// @throws std::exception
85 virtual void PROPFIND( const OUString
& inPath
,
87 const std::vector
< OUString
> & inPropertyNames
,
88 std::vector
< DAVResource
> & ioResources
,
89 const DAVRequestEnvironment
& rEnv
) = 0;
92 /// @throws std::exception
93 virtual void PROPFIND( const OUString
& inPath
,
95 std::vector
< DAVResourceInfo
> & ioResInfo
,
96 const DAVRequestEnvironment
& rEnv
) = 0;
98 /// @throws std::exception
99 virtual void PROPPATCH( const OUString
& inPath
,
100 const std::vector
< ProppatchValue
> & inValues
,
101 const DAVRequestEnvironment
& rEnv
) = 0;
103 /// @throws std::exception
104 virtual void HEAD( const OUString
& inPath
,
105 const std::vector
< OUString
> & inHeaderNames
,
106 DAVResource
& ioResource
,
107 const DAVRequestEnvironment
& rEnv
) = 0;
109 /// @throws std::exception
110 virtual css::uno::Reference
< css::io::XInputStream
>
111 GET( const OUString
& inPath
,
112 const DAVRequestEnvironment
& rEnv
) = 0;
114 /// @throws std::exception
115 virtual void GET( const OUString
& inPath
,
116 css::uno::Reference
< css::io::XOutputStream
>& o
,
117 const DAVRequestEnvironment
& rEnv
) = 0;
119 /// @throws std::exception
120 virtual css::uno::Reference
< css::io::XInputStream
>
121 GET( const OUString
& inPath
,
122 const std::vector
< OUString
> & inHeaderNames
,
123 DAVResource
& ioResource
,
124 const DAVRequestEnvironment
& rEnv
) = 0;
126 // used as HEAD substitute when HEAD is not implemented on server
127 /// @throws std::exception
129 GET0( const OUString
& inPath
,
130 const std::vector
< OUString
> & inHeaderNames
,
131 DAVResource
& ioResource
,
132 const DAVRequestEnvironment
& rEnv
) = 0;
134 /// @throws std::exception
136 GET( const OUString
& inPath
,
137 css::uno::Reference
< css::io::XOutputStream
>& o
,
138 const std::vector
< OUString
> & inHeaderNames
,
139 DAVResource
& ioResource
,
140 const DAVRequestEnvironment
& rEnv
) = 0;
142 /// @throws std::exception
143 virtual void PUT( const OUString
& inPath
,
144 const css::uno::Reference
< css::io::XInputStream
>& s
,
145 const DAVRequestEnvironment
& rEnv
) = 0;
147 /// @throws std::exception
148 virtual css::uno::Reference
< css::io::XInputStream
>
149 POST( const OUString
& inPath
,
150 const OUString
& rContentType
,
151 const OUString
& rReferer
,
152 const css::uno::Reference
< css::io::XInputStream
> & inInputStream
,
153 const DAVRequestEnvironment
& rEnv
) = 0;
155 /// @throws std::exception
156 virtual void POST( const OUString
& inPath
,
157 const OUString
& rContentType
,
158 const OUString
& rReferer
,
159 const css::uno::Reference
< css::io::XInputStream
> & inInputStream
,
160 css::uno::Reference
< css::io::XOutputStream
> & oOutputStream
,
161 const DAVRequestEnvironment
& rEnv
) = 0;
163 /// @throws std::exception
164 virtual void MKCOL( const OUString
& inPath
,
165 const DAVRequestEnvironment
& rEnv
) = 0;
167 /// @throws std::exception
168 virtual void COPY( const OUString
& inSource
,
169 const OUString
& inDestination
,
170 const DAVRequestEnvironment
& rEnv
,
171 bool inOverwrite
) = 0;
173 /// @throws std::exception
174 virtual void MOVE( const OUString
& inSource
,
175 const OUString
& inDestination
,
176 const DAVRequestEnvironment
& rEnv
,
177 bool inOverwrite
) = 0;
179 /// @throws std::exception
180 virtual void DESTROY( const OUString
& inPath
,
181 const DAVRequestEnvironment
& rEnv
) = 0;
184 /// @throws std::exception
185 virtual void LOCK( const OUString
& inPath
,
186 css::ucb::Lock
& inLock
,
187 const DAVRequestEnvironment
& rEnv
) = 0;
189 /// @throws std::exception
190 virtual void UNLOCK( const OUString
& inPath
,
191 const DAVRequestEnvironment
& rEnv
) = 0;
193 /// @throws std::exception
194 virtual void abort() = 0;
197 rtl::Reference
< DAVSessionFactory
> m_xFactory
;
199 explicit DAVSession( rtl::Reference
< DAVSessionFactory
> const & rFactory
)
200 : m_xFactory( rFactory
), m_nRefCount( 0 ) {}
202 virtual ~DAVSession() {}
205 DAVSessionFactory::Map::iterator m_aContainerIt
;
206 oslInterlockedCount m_nRefCount
;
208 friend class DAVSessionFactory
;
209 friend struct std::default_delete
< DAVSession
>;
212 } // namespace webdav_ucp
214 #endif // INCLUDED_UCB_SOURCE_UCP_WEBDAV_NEON_DAVSESSION_HXX
216 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */