use of com.zimbra.cs.ephemeral.EphemeralStore in project zm-mailbox by Zimbra.
the class Entry method purgeEphemeralAttr.
public void purgeEphemeralAttr(String key) throws ServiceException {
EphemeralLocation location = new LdapEntryLocation(this);
EphemeralStore store = EphemeralStore.getFactory().getStore();
store.purgeExpired(new EphemeralKey(key), location);
}
use of com.zimbra.cs.ephemeral.EphemeralStore in project zm-mailbox by Zimbra.
the class Entry method modifyEphemeralAttr.
public void modifyEphemeralAttr(String key, String dynamicComponent, String[] values, boolean update, Expiration expiration) throws ServiceException {
EphemeralLocation location = new LdapEntryLocation(this);
EphemeralStore store = EphemeralStore.getFactory().getStore();
for (String value : values) {
modifyEphemeralAttrInternal(key, dynamicComponent, value, update, expiration, store, location);
}
}
use of com.zimbra.cs.ephemeral.EphemeralStore in project zm-mailbox by Zimbra.
the class Entry method modifyEphemeralAttr.
public void modifyEphemeralAttr(EphemeralInput input, boolean update) throws ServiceException {
EphemeralLocation location = new LdapEntryLocation(this);
EphemeralStore store = EphemeralStore.getFactory().getStore();
if (update) {
store.update(input, location);
} else {
store.set(input, location);
}
}
use of com.zimbra.cs.ephemeral.EphemeralStore in project zm-mailbox by Zimbra.
the class Entry method modifyEphemeralAttr.
public void modifyEphemeralAttr(String key, String dynamicComponent, String value, boolean update, Expiration expiration) throws ServiceException {
EphemeralLocation location = new LdapEntryLocation(this);
EphemeralStore store = EphemeralStore.getFactory().getStore();
modifyEphemeralAttrInternal(key, dynamicComponent, value, update, expiration, store, location);
}
use of com.zimbra.cs.ephemeral.EphemeralStore in project zm-mailbox by Zimbra.
the class Entry method getEphemeralAttrs.
/**
* Returns values for non-dynamic ephemeral attributes.
*/
public Map<String, Object> getEphemeralAttrs() {
Map<String, Object> attrs = new HashMap<String, Object>();
try {
EphemeralStore.Factory ephemeralFactory = EphemeralStore.getFactory(FailureMode.safe);
if (ephemeralFactory == null || ephemeralFactory instanceof LdapEphemeralStore.Factory) {
// This also catches scenarios where the EphemeralStore is not available.
return attrs;
}
Map<String, AttributeInfo> ephemeralAttrs = mAttrMgr.getNonDynamicEphemeralAttrs(getEntryType());
if (ephemeralAttrs == null) {
return attrs;
}
for (Map.Entry<String, AttributeInfo> entry : ephemeralAttrs.entrySet()) {
String attrName = entry.getKey();
AttributeInfo info = entry.getValue();
EphemeralResult result = getEphemeralAttr(attrName);
if (!result.isEmpty()) {
switch(info.getType()) {
case TYPE_BOOLEAN:
attrs.put(attrName, result.getBoolValue());
break;
case TYPE_INTEGER:
attrs.put(attrName, result.getIntValue());
break;
case TYPE_LONG:
attrs.put(attrName, result.getLongValue());
break;
default:
attrs.put(attrName, result.getValue());
break;
}
}
}
} catch (ServiceException e) {
// don't propagate this exception, since we don't want to interrupt getAttrs() calls
ZimbraLog.ephemeral.warn("unable to get ephemeral attributes for %s %s", getEntryType().getName(), getLabel());
}
return attrs;
}
Aggregations