query.declareParameters("String ID");
query.setUnique(true);
final DefaultResourceDescriptor descriptor =
(DefaultResourceDescriptor) query.execute(externalId);
if (null == descriptor) {
throw new ResourceDescriptorStoreException(
"cs-external-id-not-found", externalId);
}
final long oldTtl = descriptor.getTimeToLive();
if (timeToLive > oldTtl) {
descriptor.setTimeToLive(timeToLive);