Search in sources :

Example 6 with EphemeralKey

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);
}
Also used : LdapEntryLocation(com.zimbra.cs.ephemeral.LdapEntryLocation) EphemeralLocation(com.zimbra.cs.ephemeral.EphemeralLocation) LdapEphemeralStore(com.zimbra.cs.ephemeral.LdapEphemeralStore) EphemeralStore(com.zimbra.cs.ephemeral.EphemeralStore) EphemeralKey(com.zimbra.cs.ephemeral.EphemeralKey)

Example 7 with EphemeralKey

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());
}
Also used : EphemeralKey(com.zimbra.cs.ephemeral.EphemeralKey)

Example 8 with EphemeralKey

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());
}
Also used : EphemeralKey(com.zimbra.cs.ephemeral.EphemeralKey)

Example 9 with EphemeralKey

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());
}
Also used : EphemeralKey(com.zimbra.cs.ephemeral.EphemeralKey)

Example 10 with EphemeralKey

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);
}
Also used : LdapEntryLocation(com.zimbra.cs.ephemeral.LdapEntryLocation) EphemeralLocation(com.zimbra.cs.ephemeral.EphemeralLocation) EphemeralInput(com.zimbra.cs.ephemeral.EphemeralInput) AbsoluteExpiration(com.zimbra.cs.ephemeral.EphemeralInput.AbsoluteExpiration) Expiration(com.zimbra.cs.ephemeral.EphemeralInput.Expiration) AbsoluteExpiration(com.zimbra.cs.ephemeral.EphemeralInput.AbsoluteExpiration) EphemeralKey(com.zimbra.cs.ephemeral.EphemeralKey)

Aggregations

EphemeralKey (com.zimbra.cs.ephemeral.EphemeralKey)11 EphemeralLocation (com.zimbra.cs.ephemeral.EphemeralLocation)6 LdapEntryLocation (com.zimbra.cs.ephemeral.LdapEntryLocation)6 EphemeralStore (com.zimbra.cs.ephemeral.EphemeralStore)5 LdapEphemeralStore (com.zimbra.cs.ephemeral.LdapEphemeralStore)4 EphemeralInput (com.zimbra.cs.ephemeral.EphemeralInput)3 AbsoluteExpiration (com.zimbra.cs.ephemeral.EphemeralInput.AbsoluteExpiration)3 Expiration (com.zimbra.cs.ephemeral.EphemeralInput.Expiration)3 EphemeralResult (com.zimbra.cs.ephemeral.EphemeralResult)2 EntrySource (com.zimbra.cs.ephemeral.migrate.AttributeMigration.EntrySource)1 MigrationCallback (com.zimbra.cs.ephemeral.migrate.AttributeMigration.MigrationCallback)1 Test (org.junit.Test)1