use of com.zimbra.cs.ephemeral.EphemeralKey in project zm-mailbox by Zimbra.
the class Entry method hasEphemeralAttr.
public boolean hasEphemeralAttr(String key, String dynamicComponent) throws ServiceException {
EphemeralLocation location = new LdapEntryLocation(this);
EphemeralStore store = EphemeralStore.getFactory().getStore();
return store.has(new EphemeralKey(key, dynamicComponent), location);
}
use of com.zimbra.cs.ephemeral.EphemeralKey in project zm-mailbox by Zimbra.
the class MigrateAttributesTest method verifyCsrfTokenEphemeralInput.
private void verifyCsrfTokenEphemeralInput(EphemeralInput input, String crumb, String data, Long expiration) {
EphemeralKey key = input.getEphemeralKey();
assertEquals(Provisioning.A_zimbraCsrfTokenData, key.getKey());
assertEquals(crumb, key.getDynamicComponent());
assertEquals(data, input.getValue());
assertEquals(expiration, input.getExpiration());
}
use of com.zimbra.cs.ephemeral.EphemeralKey in project zm-mailbox by Zimbra.
the class MigrateAttributesTest method verifyAuthTokenEphemeralInput.
private void verifyAuthTokenEphemeralInput(EphemeralInput input, String token, String serverVersion, Long expiration) {
EphemeralKey key = input.getEphemeralKey();
assertEquals(Provisioning.A_zimbraAuthTokens, key.getKey());
assertEquals(token, key.getDynamicComponent());
assertEquals(serverVersion, input.getValue());
assertEquals(expiration, input.getExpiration());
}
use of com.zimbra.cs.ephemeral.EphemeralKey in project zm-mailbox by Zimbra.
the class MigrateAttributesTest method verifyLastLogonTimestampEphemeralInput.
private void verifyLastLogonTimestampEphemeralInput(EphemeralInput input, String expected) {
EphemeralKey key = input.getEphemeralKey();
assertEquals(Provisioning.A_zimbraLastLogonTimestamp, key.getKey());
assertTrue(key.getDynamicComponent() == null);
assertEquals("currentdate", input.getValue());
}
use of com.zimbra.cs.ephemeral.EphemeralKey in project zm-mailbox by Zimbra.
the class ZimbraAuthToken method registerWithEphemeralStore.
/*
* Used when the auth token needs to be registered with a non-default
* ephemeral backend
*/
public void registerWithEphemeralStore(EphemeralStore store) throws ServiceException {
Account acct = Provisioning.getInstance().get(AccountBy.id, properties.getAccountId());
Expiration expiration = new AbsoluteExpiration(properties.getExpires());
EphemeralLocation location = new LdapEntryLocation(acct);
EphemeralKey key = new EphemeralKey(Provisioning.A_zimbraAuthTokens, String.valueOf(properties.getTokenID()));
EphemeralInput input = new EphemeralInput(key, properties.getServerVersion(), expiration);
store.update(input, location);
}
Aggregations