public class CalendarService extends java.lang.Object implements IInternalCalendar
Modifier and Type | Field and Description |
---|---|
static int |
SYNC_ERRORS_LIMIT
When this limit is reached, sync on demand stops.
|
Constructor and Description |
---|
CalendarService(javax.sql.DataSource pool,
org.elasticsearch.client.Client esearchClient,
Container container,
BmContext context,
CalendarAuditor auditor) |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
all()
Returns all the items uid from the container.
|
ContainerChangeset<java.lang.String> |
changeset(java.lang.Long since) |
ContainerChangeset<java.lang.Long> |
changesetById(java.lang.Long since) |
ContainerChangelog |
containerChangelog(java.lang.Long since) |
Count |
count(ItemFlagFilter filter)
Count items matching an
ItemFlagFilter |
void |
create(java.lang.String uid,
VEventSeries event,
java.lang.Boolean sendNotifications)
Creates a
VEvent . |
Ack |
createById(long id,
VEventSeries event)
Creates a
VEventSeries . |
void |
delete(java.lang.String uid,
java.lang.Boolean sendNotifications)
Deletes the
VEventSeries identified by the given unique identifier. |
void |
deleteById(long id)
Delete the event identified by the given item identifier.
|
void |
emitNotification() |
ContainerChangeset<ItemVersion> |
filteredChangesetById(java.lang.Long since,
ItemFlagFilter filter) |
java.util.List<ItemValue<VEventSeries>> |
getByIcsUid(java.lang.String uid)
Returns all
VEventSeries matching the given ICS unique identifier. |
ItemValue<VEventSeries> |
getComplete(java.lang.String uid)
Returns the
VEventSeries identified by the given unique identifier. |
ItemValue<VEventSeries> |
getCompleteById(long id)
Retrieve the
VEventSeries identified by the given identifier. |
long |
getVersion() |
boolean |
isAutoSyncActivated()
Check the automatic synchronization is activated for this calendar.
|
ItemChangelog |
itemChangelog(java.lang.String itemUid,
java.lang.Long since) |
ListResult<ItemValue<VEventSeries>> |
list()
List all the events of this calendar.
|
void |
multipleDeleteById(java.util.List<java.lang.Long> ids) |
java.util.List<ItemValue<VEventSeries>> |
multipleGet(java.util.List<java.lang.String> uids)
Fetch multiple
VEventSeries identified by the given unique
identifiers. |
java.util.List<ItemValue<VEventSeries>> |
multipleGetById(java.util.List<java.lang.Long> ids)
Fetch multiple
VEventSeries from theirs uniques ids |
TaskRef |
reset()
Remove all events from this calendar.
|
ListResult<ItemValue<VEventSeries>> |
search(VEventQuery query)
Search for events matching the given query.
|
ListResult<ItemValue<VEventSeries>> |
searchPendingCounters()
Search pending counters of the current user
|
java.util.List<java.lang.Long> |
sortedIds(SortDescriptor sorted)
Sort the events item identifiers in function of the given
SortDescriptor . |
ContainerChangeset<java.lang.String> |
sync(java.lang.Long since,
VEventChanges changes)
Apply the given changes and return the differences since the given time.
|
void |
touch(java.lang.String uid)
Touch a
VEvent . |
void |
update(java.lang.String uid,
VEventSeries event,
java.lang.Boolean sendNotifications)
Updates a
VEventSeries . |
Ack |
updateById(long id,
VEventSeries event)
Update the event identified by the given item identifier.
|
ContainerUpdatesResult |
updates(VEventChanges changes)
Applies changes (create, update, delete) to a calendar specified by its
containerUid . |
ContainerUpdatesResult |
updates(VEventChanges changes,
boolean notify) |
void |
xfer(java.lang.String serverUid) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allIds
public static final int SYNC_ERRORS_LIMIT
public CalendarService(javax.sql.DataSource pool, org.elasticsearch.client.Client esearchClient, Container container, BmContext context, CalendarAuditor auditor) throws ServerFault
ServerFault
public void create(java.lang.String uid, VEventSeries event, java.lang.Boolean sendNotifications) throws ServerFault
ICalendar
VEvent
.create
in interface ICalendar
uid
- the unique identifier for the new eventevent
- the VEventSeries
to storesendNotifications
- if true
then notify this event creation
on the events busServerFault
public Ack createById(long id, VEventSeries event) throws ServerFault
ICalendar
VEventSeries
.createById
in interface ICalendar
createById
in interface ICrudByIdSupport<VEventSeries>
id
- the item identifier of the VEventSeries
event
- the VEventSeries
to storeServerFault
public Ack updateById(long id, VEventSeries event)
ICalendar
updateById
in interface ICalendar
updateById
in interface ICrudByIdSupport<VEventSeries>
id
- the item identifier of the VEventSeries
event
- the new value to setpublic void update(java.lang.String uid, VEventSeries event, java.lang.Boolean sendNotifications) throws ServerFault
ICalendar
VEventSeries
.update
in interface ICalendar
uid
- the unique identifier of the eventevent
- the VEventSeries
to updatesendNotifications
- if true
then notify this event creation
on the events busServerFault
public ItemValue<VEventSeries> getComplete(java.lang.String uid) throws ServerFault
ICalendar
VEventSeries
identified by the given unique identifier.getComplete
in interface ICalendar
uid
- the unique identifier of the eventVEventSeries
if successfulServerFault
public ItemValue<VEventSeries> getCompleteById(long id)
ICalendar
VEventSeries
identified by the given identifier.getCompleteById
in interface ICalendar
getCompleteById
in interface ICrudByIdSupport<VEventSeries>
id
- the identifier of the eventVEventSeries
if successfulSortDescriptorpublic java.util.List<ItemValue<VEventSeries>> getByIcsUid(java.lang.String uid) throws ServerFault
ICalendar
VEventSeries
matching the given ICS unique identifier.getByIcsUid
in interface ICalendar
uid
- the ICS unique identifierVEventSeries
ServerFault
public java.util.List<ItemValue<VEventSeries>> multipleGet(java.util.List<java.lang.String> uids) throws ServerFault
ICalendar
VEventSeries
identified by the given unique
identifiers.multipleGet
in interface ICalendar
uids
- the list of unique identifiersVEventSeries
ServerFault
public java.util.List<ItemValue<VEventSeries>> multipleGetById(java.util.List<java.lang.Long> ids) throws ServerFault
ICalendar
VEventSeries
from theirs uniques idsmultipleGetById
in interface ICalendar
ids
- the list of unique idVEventSeries
ServerFault
public void deleteById(long id)
ICalendar
deleteById
in interface ICalendar
deleteById
in interface ICrudByIdSupport<VEventSeries>
public void delete(java.lang.String uid, java.lang.Boolean sendNotifications) throws ServerFault
ICalendar
VEventSeries
identified by the given unique identifier.delete
in interface ICalendar
uid
- the unique identifier of the eventsendNotifications
- if true
then notify this event deletion
on the events busServerFault
public void touch(java.lang.String uid) throws ServerFault
ICalendar
VEvent
.touch
in interface ICalendar
uid
- the unique identifier of the eventServerFault
public ContainerChangelog containerChangelog(java.lang.Long since) throws ServerFault
containerChangelog
in interface IChangelogSupport
ContainerChangelog
ServerFault
public ItemChangelog itemChangelog(java.lang.String itemUid, java.lang.Long since) throws ServerFault
itemChangelog
in interface IChangelogSupport
ContainerChangelog
ServerFault
public ContainerUpdatesResult updates(VEventChanges changes, boolean notify)
updates
in interface IInternalCalendar
public ContainerUpdatesResult updates(VEventChanges changes) throws ServerFault
ICalendar
containerUid
.updates
in interface ICalendar
changes
- the changes to applyServerFault
public ListResult<ItemValue<VEventSeries>> search(VEventQuery query) throws ServerFault
ICalendar
search
in interface ICalendar
query
- the VEventQuery
to match againstVEventSeries
ServerFault
public ContainerChangeset<java.lang.String> changeset(java.lang.Long since) throws ServerFault
changeset
in interface IChangelogSupport
ContainerChangeset
ServerFault
public ContainerChangeset<java.lang.Long> changesetById(java.lang.Long since) throws ServerFault
changesetById
in interface IChangelogSupport
ContainerChangeset
with internal
numeric idsServerFault
public ContainerChangeset<ItemVersion> filteredChangesetById(java.lang.Long since, ItemFlagFilter filter) throws ServerFault
filteredChangesetById
in interface IChangelogSupport
filter
- to exclude some items (eg. deleted items)ContainerChangeset
with internal
numeric ids matching the given filterServerFault
public ContainerChangeset<java.lang.String> sync(java.lang.Long since, VEventChanges changes) throws ServerFault
ICalendar
sync
in interface ICalendar
since
- the time from wich compare changeschanges
- the changes to applyContainerChangeset
of the difSortDescriptorferencesServerFault
public ListResult<ItemValue<VEventSeries>> list() throws ServerFault
ICalendar
list
in interface ICalendar
VEventSeries
ServerFault
public java.util.List<java.lang.String> all() throws ServerFault
ICalendar
all
in interface ICalendar
ServerFault
public TaskRef reset() throws ServerFault
ICalendar
reset
in interface ICalendar
ServerFault
public long getVersion() throws ServerFault
getVersion
in interface IChangelogSupport
ServerFault
public Count count(ItemFlagFilter filter) throws ServerFault
ICountingSupport
ItemFlagFilter
count
in interface ICountingSupport
ServerFault
public java.util.List<java.lang.Long> sortedIds(SortDescriptor sorted) throws ServerFault
ICalendar
SortDescriptor
.sortedIds
in interface ICalendar
sortedIds
in interface ISortingSupport
sorted
- sorting criteriaServerFault
public void xfer(java.lang.String serverUid) throws ServerFault
xfer
in interface IDataShardSupport
ServerFault
public void multipleDeleteById(java.util.List<java.lang.Long> ids) throws ServerFault
multipleDeleteById
in interface ICrudByIdSupport<VEventSeries>
ServerFault
public boolean isAutoSyncActivated() throws ServerFault
ICalendar
isAutoSyncActivated
in interface ICalendar
true
if this calendar is automatically synchronized,
false
otherwiseServerFault
public void emitNotification()
emitNotification
in interface IInternalCalendar
public ListResult<ItemValue<VEventSeries>> searchPendingCounters()
ICalendar
searchPendingCounters
in interface ICalendar
Copyright © 2021. All Rights Reserved.