Package org.exoplatform.caldav.client
Class CalDavObjectWriter
java.lang.Object
org.exoplatform.caldav.client.CalDavObjectWriter
- All Implemented Interfaces:
CalendarObjectWriter
The CalDAV door: every write is the
CalDavClient method of the same
name, with the same headers, the same body and the same answer. Zero
behaviour change from the days the engine called the client directly — this
class exists so that the other door (BlueMindImportWriter) can be
chosen per server without the engine knowing there are two.-
Constructor Summary
ConstructorsConstructorDescriptionCalDavObjectWriter(CalDavClient calDavClient) The writer over the one CalDAV client. -
Method Summary
Modifier and TypeMethodDescriptionintdeleteObject(CalDavEndpoint endpoint, String href, String ifMatch) Deletes one object, conditionally when a version is given.overwriteObject(CalDavEndpoint endpoint, String href, String icsData) Writes one object over whatever is there, with no precondition at all.putObject(CalDavEndpoint endpoint, String href, String icsData) Creates one object; an object already at the href is answered 412.updateObject(CalDavEndpoint endpoint, String href, String icsData, String ifMatch) Replaces one existing object, only when its version is still the one the caller last read.
-
Constructor Details
-
CalDavObjectWriter
The writer over the one CalDAV client.- Parameters:
calDavClient- the protocol client every request goes through
-
-
Method Details
-
putObject
Creates one object; an object already at the href is answered 412.- Specified by:
putObjectin interfaceCalendarObjectWriter- Parameters:
endpoint- the declared serverhref- the object's server-absolute path to create aticsData- the iCalendar text to store- Returns:
- the status and, when known, the stored version
-
overwriteObject
Writes one object over whatever is there, with no precondition at all.- Specified by:
overwriteObjectin interfaceCalendarObjectWriter- Parameters:
endpoint- the declared serverhref- the object's server-absolute pathicsData- the iCalendar text to store- Returns:
- the status and, when known, the stored version; never a 412
-
updateObject
Replaces one existing object, only when its version is still the one the caller last read.- Specified by:
updateObjectin interfaceCalendarObjectWriter- Parameters:
endpoint- the declared serverhref- the object's server-absolute pathicsData- the iCalendar text to storeifMatch- the version the caller's own read answered, verbatim- Returns:
- the status and, when known, the stored version; 412 when the object moved on or is gone
-
deleteObject
Deletes one object, conditionally when a version is given.- Specified by:
deleteObjectin interfaceCalendarObjectWriter- Parameters:
endpoint- the declared serverhref- the object's server-absolute pathifMatch- the version to condition the removal on, or null to remove unconditionally- Returns:
- 200 or 204 removed, 404 or 410 already gone, 412 refused
-