use of com.zimbra.cs.mailbox.Metadata in project zm-mailbox by Zimbra.
the class DbScheduledTask method setProperties.
private static void setProperties(ScheduledTask task, String encodedMetadata) throws ServiceException {
if (StringUtil.isNullOrEmpty(encodedMetadata)) {
return;
}
Metadata metadata = new Metadata(encodedMetadata);
Map<String, ?> map = metadata.asMap();
for (Map.Entry<String, ?> entry : map.entrySet()) {
if (entry.getValue() instanceof String) {
task.setProperty(entry.getKey(), (String) entry.getValue());
}
}
}
use of com.zimbra.cs.mailbox.Metadata in project zm-mailbox by Zimbra.
the class ImapCredentials method saveConfig.
private void saveConfig(Set<String> subscriptions) throws ServiceException {
MetadataList slist = new MetadataList();
if (subscriptions != null && !subscriptions.isEmpty()) {
for (String sub : subscriptions) slist.add(sub);
}
getMailbox().setConfig(getContext(), SN_IMAP, new Metadata().put(FN_SUBSCRIPTIONS, slist));
}
use of com.zimbra.cs.mailbox.Metadata in project zm-mailbox by Zimbra.
the class CalendarData method encodeMetadata.
Metadata encodeMetadata() {
Metadata meta = new Metadata();
meta.put(FN_FOLDER_ID, mFolderId);
meta.put(FN_MODSEQ, mModSeq);
meta.put(FN_RANGE_START, mRangeStart);
meta.put(FN_RANGE_END, mRangeEnd);
meta.put(FN_NUM_CALITEMS, mCalendarItems.size());
int i = 0;
for (CalendarItemData calItemData : mCalendarItems) {
meta.put(FN_CALITEM + i, calItemData.encodeMetadata());
i++;
}
return meta;
}
use of com.zimbra.cs.mailbox.Metadata in project zm-mailbox by Zimbra.
the class CalendarItemData method encodeMetadata.
Metadata encodeMetadata() {
Metadata meta = new Metadata();
meta.put(FN_TYPE, type.toByte());
meta.put(FN_FOLDER_ID, mFolderId);
meta.put(FN_CALITEM_ID, mCalItemId);
meta.put(FN_FLAGS, mFlags);
meta.put(FN_TAGS, DbTag.serializeTags(mTags));
meta.put(FN_IS_PUBLIC, mIsPublic);
meta.put(FN_MOD_METADATA, mModMetadata);
meta.put(FN_MOD_CONTENT, mModContent);
meta.put(FN_DATE, mDate);
meta.put(FN_CHANGE_DATE, mChangeDate);
meta.put(FN_SIZE, mSize);
meta.put(FN_UID, mUid);
meta.put(FN_IS_RECURRING, mIsRecurring);
meta.put(FN_HAS_EXCEPTIONS, mHasExceptions);
if (mAlarm != null)
meta.put(FN_ALARM, mAlarm.encodeMetadata());
if (mDefaultData != null)
meta.put(FN_DEFAULT_INST, mDefaultData.encodeMetadata());
if (mInstances != null) {
meta.put(FN_NUM_INST, mInstances.size());
int i = 0;
for (InstanceData inst : mInstances) {
meta.put(FN_INST + i, inst.encodeMetadata());
i++;
}
}
meta.put(FN_RANGE_START, mActualRangeStart);
meta.put(FN_RANGE_END, mActualRangeEnd);
return meta;
}
use of com.zimbra.cs.mailbox.Metadata in project zm-mailbox by Zimbra.
the class CtagInfo method encodeMetadata.
Metadata encodeMetadata() {
Metadata meta = new Metadata();
meta.put(FN_ID, mId);
meta.put(FN_FOLDER_ID, mFolderId);
meta.put(FN_PATH, mPath);
meta.put(FN_CTAG, mCtag);
if (mIsMountpoint) {
meta.put(FN_REMOTE_ACCOUNT, mRemoteAccount);
meta.put(FN_REMOTE_ID, mRemoteId);
}
return meta;
}
Aggregations