/** * Convert a service identifier into a suitable key for the underlying storage service. * * @param serviceId the service identifier * * @return an appropriately sized storage key */ @Nonnull @NotEmpty private String getSPSessionStorageKey(@Nonnull @NotEmpty final String serviceId) { if (serviceId.length() > sessionManager.getStorageService().getCapabilities().getKeySize()) { return DigestUtils.sha256Hex(serviceId); } else { return serviceId; } }
/** {@inheritDoc} */ @Override protected void doInitialize() throws ComponentInitializationException { super.doInitialize(); if (artifactStore == null) { throw new ComponentInitializationException("StorageService cannot be null"); } // We can't shorten the artifacts as lookup keys at the moment because // the key is used to recreate the original artifact value. artifactStoreKeySize = getStorageService().getCapabilities().getKeySize(); }
log.error("context {} too long for StorageService (limit {})", context, caps.getContextSize()); return false; } else if (s.length() > caps.getKeySize()) { key = DigestUtils.sha1Hex(s); } else {
final int keySize = storageService.getCapabilities().getKeySize();
final int keySize = storageService.getCapabilities().getKeySize();
final int keySize = storageService.getCapabilities().getKeySize();