public class AddressBookService extends java.lang.Object implements IInCoreAddressBook
Constructor and Description |
---|
AddressBookService(javax.sql.DataSource dataSource,
org.elasticsearch.client.Client esearchClient,
Container container,
BmContext context) |
Modifier and Type | Method and Description |
---|---|
java.util.List<ItemValue<VCard>> |
all() |
java.util.List<java.lang.String> |
allUids()
List all items from 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) |
void |
copy(java.util.List<java.lang.String> uids,
java.lang.String descContainerUid)
Copy entries from one AddressBook to another one
|
Count |
count(ItemFlagFilter filter)
Count items matching an
ItemFlagFilter |
void |
create(java.lang.String uid,
VCard card)
Creates a new
VCard entry. |
Ack |
createById(long id,
VCard card) |
void |
delete(java.lang.String uid)
Delete vcard entry
|
void |
deleteById(long id) |
void |
deletePhoto(java.lang.String uid) |
void |
emitNotification() |
ContainerChangeset<ItemVersion> |
filteredChangesetById(java.lang.Long since,
ItemFlagFilter filter) |
java.util.List<java.lang.String> |
findByEmail(java.lang.String email) |
ItemValue<VCard> |
getComplete(java.lang.String uid)
Fetch a
VCard from its unique uid |
ItemValue<VCard> |
getCompleteById(long uid) |
byte[] |
getIcon(java.lang.String uid)
A scaled-down (22px x 22px) version of the photo
|
ItemValue<VCardInfo> |
getInfo(java.lang.String uid)
Fetch a
VCardInfo from its unique uid |
byte[] |
getPhoto(java.lang.String uid) |
long |
getVersion() |
ItemChangelog |
itemChangelog(java.lang.String itemUid,
java.lang.Long since) |
void |
move(java.util.List<java.lang.String> uids,
java.lang.String descContainerUid)
Move entries from one AddressBook to another one
|
void |
multipleDeleteById(java.util.List<java.lang.Long> ids) |
java.util.List<ItemValue<VCard>> |
multipleGet(java.util.List<java.lang.String> uids)
Fetch multiple
VCard s from theirs uniques uids |
java.util.List<ItemValue<VCard>> |
multipleGetById(java.util.List<java.lang.Long> ids)
Fetch multiple
VCard s from theirs uniques ids |
void |
reset() |
ListResult<ItemValue<VCardInfo>> |
search(VCardQuery query)
ElasticSearch based vcard search
|
void |
setPhoto(java.lang.String uid,
byte[] photo) |
java.util.List<java.lang.Long> |
sortedIds(SortDescriptor sorted)
Returns all items in a container matching a sort criteria
|
ContainerChangeset<java.lang.String> |
sync(java.lang.Long since,
VCardChanges changes)
CLIENT_WIN style
|
void |
update(java.lang.String uid,
VCard card)
Modifies an existing
VCard entry. |
Ack |
updateById(long id,
VCard card) |
ContainerUpdatesResult |
updates(VCardChanges changes)
Updates multiples entries at once (should be transactional: if one operation
fail, nothing is written)
|
void |
xfer(java.lang.String serverUid) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allIds
public java.util.List<java.lang.String> allUids()
IAddressBook
allUids
in interface IAddressBook
public void create(java.lang.String uid, VCard card)
IAddressBook
VCard
entry.create
in interface IAddressBook
uid
- uid of the entrycard
- value of the entrypublic Ack createById(long id, VCard card)
createById
in interface IAddressBook
createById
in interface ICrudByIdSupport<VCard>
public void update(java.lang.String uid, VCard card)
IAddressBook
VCard
entry.update
in interface IAddressBook
uid
- uid of the entrycard
- value of the entrypublic ItemValue<VCard> getComplete(java.lang.String uid)
IAddressBook
VCard
from its unique uidgetComplete
in interface IAddressBook
ItemValue
public ItemValue<VCard> getCompleteById(long uid)
getCompleteById
in interface IAddressBook
getCompleteById
in interface ICrudByIdSupport<VCard>
public java.util.List<ItemValue<VCard>> multipleGet(java.util.List<java.lang.String> uids)
IAddressBook
VCard
s from theirs uniques uidsmultipleGet
in interface IAddressBook
List>
public java.util.List<ItemValue<VCard>> multipleGetById(java.util.List<java.lang.Long> ids)
IAddressBook
VCard
s from theirs uniques idsmultipleGetById
in interface IAddressBook
List>
public ItemValue<VCardInfo> getInfo(java.lang.String uid)
IAddressBook
VCardInfo
from its unique uidgetInfo
in interface IAddressBook
public ListResult<ItemValue<VCardInfo>> search(VCardQuery query)
IAddressBook
search
in interface IAddressBook
public void delete(java.lang.String uid)
IAddressBook
delete
in interface IAddressBook
public ContainerChangelog containerChangelog(java.lang.Long since)
containerChangelog
in interface IChangelogSupport
ContainerChangelog
public ItemChangelog itemChangelog(java.lang.String itemUid, java.lang.Long since)
itemChangelog
in interface IChangelogSupport
ContainerChangelog
public ContainerChangeset<java.lang.String> changeset(java.lang.Long since)
changeset
in interface IChangelogSupport
ContainerChangeset
public ContainerChangeset<java.lang.Long> changesetById(java.lang.Long since)
changesetById
in interface IChangelogSupport
ContainerChangeset
with internal
numeric idspublic ContainerChangeset<ItemVersion> filteredChangesetById(java.lang.Long since, ItemFlagFilter filter)
filteredChangesetById
in interface IChangelogSupport
filter
- to exclude some items (eg. deleted items)ContainerChangeset
with internal
numeric ids matching the given filterpublic ContainerUpdatesResult updates(VCardChanges changes)
IAddressBook
updates
in interface IAddressBook
public ContainerChangeset<java.lang.String> sync(java.lang.Long since, VCardChanges changes)
IAddressBook
sync
in interface IAddressBook
public void copy(java.util.List<java.lang.String> uids, java.lang.String descContainerUid)
IAddressBook
copy
in interface IAddressBook
public void move(java.util.List<java.lang.String> uids, java.lang.String descContainerUid)
IAddressBook
move
in interface IAddressBook
public void setPhoto(java.lang.String uid, byte[] photo)
setPhoto
in interface IAddressBook
public void deletePhoto(java.lang.String uid)
deletePhoto
in interface IAddressBook
public byte[] getPhoto(java.lang.String uid)
getPhoto
in interface IAddressBook
public byte[] getIcon(java.lang.String uid)
IAddressBook
getIcon
in interface IAddressBook
public java.util.List<java.lang.String> findByEmail(java.lang.String email)
findByEmail
in interface IInCoreAddressBook
public void reset()
reset
in interface IAddressBook
public long getVersion()
getVersion
in interface IChangelogSupport
public Ack updateById(long id, VCard card)
updateById
in interface IAddressBook
updateById
in interface ICrudByIdSupport<VCard>
public void deleteById(long id)
deleteById
in interface IAddressBook
deleteById
in interface ICrudByIdSupport<VCard>
public Count count(ItemFlagFilter filter)
ICountingSupport
ItemFlagFilter
count
in interface ICountingSupport
public java.util.List<java.lang.Long> sortedIds(SortDescriptor sorted)
ISortingSupport
sortedIds
in interface IAddressBook
sortedIds
in interface ISortingSupport
sorted
- sorting criteriaItemValue.internalId
sortedpublic void xfer(java.lang.String serverUid)
xfer
in interface IDataShardSupport
public void multipleDeleteById(java.util.List<java.lang.Long> ids)
multipleDeleteById
in interface ICrudByIdSupport<VCard>
public void emitNotification()
Copyright © 2021. All Rights Reserved.