public class FakeMailboxes extends java.lang.Object implements IMailboxes
Constructor and Description |
---|
FakeMailboxes(java.util.Map<java.lang.String,ItemValue<Mailbox>> mboxes) |
Modifier and Type | Method and Description |
---|---|
ItemValue<Mailbox> |
byEmail(java.lang.String email) |
ItemValue<Mailbox> |
byName(java.lang.String name) |
java.util.List<java.lang.String> |
byRouting(Mailbox.Routing routing) |
java.util.List<java.lang.String> |
byType(Mailbox.Type type) |
TaskRef |
check(java.lang.String uid)
|
TaskRef |
checkAll()
|
TaskRef |
checkAndRepair(java.lang.String uid)
|
TaskRef |
checkAndRepairAll()
|
void |
create(java.lang.String uid,
Mailbox mailshare)
Creates a new
Mailbox entry. |
void |
delete(java.lang.String uid)
Delete
Mailbox entry |
ItemValue<Mailbox> |
getComplete(java.lang.String uid)
Fetch a
Mailbox from its unique uid |
MailFilter |
getDomainFilter() |
java.util.List<AccessControlEntry> |
getMailboxAccessControlList(java.lang.String mailboxUid) |
MailboxConfig |
getMailboxConfig(java.lang.String uid) |
MailFilter |
getMailboxFilter(java.lang.String mailboxUid) |
MailboxQuota |
getMailboxQuota(java.lang.String uid) |
java.lang.Integer |
getUnreadMessagesCount()
Get the unread mail messages count of the currently logged in user
|
java.util.List<ItemValue<Mailbox>> |
list() |
java.util.List<java.lang.String> |
listUids() |
java.util.List<ItemValue<Mailbox>> |
multipleGet(java.util.List<java.lang.String> uids) |
void |
setDomainFilter(MailFilter filter) |
void |
setMailboxAccessControlList(java.lang.String mailboxUid,
java.util.List<AccessControlEntry> accessControlEntries) |
void |
setMailboxFilter(java.lang.String mailboxUid,
MailFilter filter) |
void |
update(java.lang.String uid,
Mailbox mailshare)
Modifies an existing
Mailbox entry. |
public void create(java.lang.String uid, Mailbox mailshare) throws ServerFault
IMailboxes
Mailbox
entry.create
in interface IMailboxes
uid
- uid of the entrymailshare
- value of the entryServerFault
public void update(java.lang.String uid, Mailbox mailshare) throws ServerFault
IMailboxes
Mailbox
entry.update
in interface IMailboxes
uid
- uid of the entrymailshare
- value of the entryServerFault
public ItemValue<Mailbox> getComplete(java.lang.String uid) throws ServerFault
IMailboxes
Mailbox
from its unique uidgetComplete
in interface IMailboxes
ItemValue
ServerFault
public void delete(java.lang.String uid) throws ServerFault
IMailboxes
Mailbox
entrydelete
in interface IMailboxes
ServerFault
public ItemValue<Mailbox> byEmail(java.lang.String email) throws ServerFault
byEmail
in interface IMailboxes
ServerFault
public ItemValue<Mailbox> byName(java.lang.String name) throws ServerFault
byName
in interface IMailboxes
ServerFault
public MailFilter getDomainFilter() throws ServerFault
getDomainFilter
in interface IMailboxes
ServerFault
public void setDomainFilter(MailFilter filter) throws ServerFault
setDomainFilter
in interface IMailboxes
ServerFault
public MailFilter getMailboxFilter(java.lang.String mailboxUid) throws ServerFault
getMailboxFilter
in interface IMailboxes
ServerFault
public void setMailboxFilter(java.lang.String mailboxUid, MailFilter filter) throws ServerFault
setMailboxFilter
in interface IMailboxes
ServerFault
public java.util.List<AccessControlEntry> getMailboxAccessControlList(java.lang.String mailboxUid) throws ServerFault
getMailboxAccessControlList
in interface IMailboxes
ServerFault
public void setMailboxAccessControlList(java.lang.String mailboxUid, java.util.List<AccessControlEntry> accessControlEntries) throws ServerFault
setMailboxAccessControlList
in interface IMailboxes
ServerFault
public java.util.List<java.lang.String> byType(Mailbox.Type type) throws ServerFault
byType
in interface IMailboxes
ServerFault
public java.lang.Integer getUnreadMessagesCount() throws ServerFault
IMailboxes
getUnreadMessagesCount
in interface IMailboxes
ServerFault
public java.util.List<ItemValue<Mailbox>> list() throws ServerFault
list
in interface IMailboxes
ServerFault
public java.util.List<java.lang.String> byRouting(Mailbox.Routing routing) throws ServerFault
byRouting
in interface IMailboxes
ServerFault
public TaskRef checkAndRepairAll() throws ServerFault
IMailboxes
IDirEntryMaintenance.repair(Set)
Set<String>
opsIds = IDirEntryMaintenance.getAvailableOperations()
.stream().map(mo -> mo.identifier)
.collect(Collectors.toSet());
for (String entryUid: IDirectory.search(
DirEntryQuery.filterKind(Kind.GROUP, Kind.MAILSHARE, Kind.RESOURCE, Kind.USER))
.values.stream()
.map(deiv -> deiv.uid)
.collect()Collectors.toSet()) {
IDirEntryMaintenance.repair(opsIds);
}
checkAndRepairAll
in interface IMailboxes
ServerFault
public TaskRef checkAll() throws ServerFault
IMailboxes
IDirEntryMaintenance.check(Set)
Set<String>
opsIds = IDirEntryMaintenance.getAvailableOperations()
.stream().map(mo -> mo.identifier)
.collect(Collectors.toSet());
for (String entryUid: IDirectory.search(
DirEntryQuery.filterKind(Kind.GROUP, Kind.MAILSHARE, Kind.RESOURCE, Kind.USER))
.values.stream()
.map(deiv -> deiv.uid)
.collect()Collectors.toSet()) {
IDirEntryMaintenance.check(opsIds);
}
checkAll
in interface IMailboxes
ServerFault
public TaskRef checkAndRepair(java.lang.String uid) throws ServerFault
IMailboxes
IDirEntryMaintenance.repair(Set)
Set<String>
opsIds = IDirEntryMaintenance.getAvailableOperations()
.stream().map(mo -> mo.identifier)
.collect(Collectors.toSet());
IDirEntryMaintenance.repair(opsIds);
checkAndRepair
in interface IMailboxes
ServerFault
public TaskRef check(java.lang.String uid) throws ServerFault
IMailboxes
IDirEntryMaintenance.check(Set)
Set<String>
opsIds = IDirEntryMaintenance.getAvailableOperations()
.stream().map(mo -> mo.identifier)
.collect(Collectors.toSet());
IDirEntryMaintenance.check(opsIds);
check
in interface IMailboxes
ServerFault
public MailboxQuota getMailboxQuota(java.lang.String uid) throws ServerFault
getMailboxQuota
in interface IMailboxes
ServerFault
public java.util.List<ItemValue<Mailbox>> multipleGet(java.util.List<java.lang.String> uids) throws ServerFault
multipleGet
in interface IMailboxes
ServerFault
public MailboxConfig getMailboxConfig(java.lang.String uid) throws ServerFault
getMailboxConfig
in interface IMailboxes
ServerFault
public java.util.List<java.lang.String> listUids()
listUids
in interface IMailboxes
Copyright © 2021. All Rights Reserved.