Copyright (C) 2009 eXo Platform SAS.
This is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this software; if not, write to the Free
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA, or see the FSF site: http://www.fsf.org.
Created by The eXo Platform SAS Author : liem.nguyen firstname.lastname@example.org Jun 5, 2009
todo julien : - make delay configuration from init param and
<T> the token type
<K> the token key type
- setter - start/stop expiration daemon - manually invoke
the daemon via @Managed
. 8 bytes (64 bits) would be enough, but we want to get padding-less Byte64 representation,
so we take the next greater number divisible by 3 which is 9. 9 bytes is equal to 72 bits.
The number of random bits generared by
. Use values divisible by 3 to produce random strings
consisting only of
, i.e. URL safe Byte64 without padding.
If a value not divisible by 3 is used the random strings will contain
in addition to the named characters.
long configValue = new Long(params.get(1));
log.warn("Failed to clean expired tokens", t);
Decode a key from its string representation.
stringKey the key a s a string
- the typed key
public abstract long size();
SECOND(1000), MINUTE(1000 * 60), HOUR(1000 * 60 * 60), DAY(1000 * 60 * 60 * 24);