Search in sources :

Example 16 with RedisConnection

use of org.maxkey.persistence.redis.RedisConnection in project MaxKey by dromara.

the class RedisProxyGrantingTicketServices method get.

@Override
public Ticket get(String ticketId) {
    RedisConnection conn = connectionFactory.getConnection();
    Ticket ticket = conn.getObject(PREFIX + ticketId);
    conn.close();
    return ticket;
}
Also used : Ticket(org.maxkey.authz.cas.endpoint.ticket.Ticket) RedisConnection(org.maxkey.persistence.redis.RedisConnection)

Example 17 with RedisConnection

use of org.maxkey.persistence.redis.RedisConnection in project MaxKey by dromara.

the class RedisTicketServices method store.

@Override
public void store(String ticketId, Ticket ticket, int validitySeconds) {
    RedisConnection conn = connectionFactory.getConnection();
    conn.setexObject(prefixTicketId(ticketId), validitySeconds, ticket);
    conn.close();
}
Also used : RedisConnection(org.maxkey.persistence.redis.RedisConnection)

Example 18 with RedisConnection

use of org.maxkey.persistence.redis.RedisConnection in project MaxKey by dromara.

the class RedisOnlineTicketServices method remove.

@Override
public OnlineTicket remove(String ticketId) {
    RedisConnection conn = connectionFactory.getConnection();
    OnlineTicket ticket = conn.getObject(PREFIX + ticketId);
    conn.delete(PREFIX + ticketId);
    conn.close();
    return ticket;
}
Also used : RedisConnection(org.maxkey.persistence.redis.RedisConnection)

Example 19 with RedisConnection

use of org.maxkey.persistence.redis.RedisConnection in project MaxKey by dromara.

the class RedisOnlineTicketServices method get.

@Override
public OnlineTicket get(String ticketId) {
    RedisConnection conn = connectionFactory.getConnection();
    OnlineTicket ticket = conn.getObject(PREFIX + ticketId);
    conn.close();
    return ticket;
}
Also used : RedisConnection(org.maxkey.persistence.redis.RedisConnection)

Example 20 with RedisConnection

use of org.maxkey.persistence.redis.RedisConnection in project MaxKey by dromara.

the class RedisRemeberMeService method read.

@Override
public RemeberMe read(RemeberMe remeberMe) {
    RedisConnection conn = connectionFactory.getConnection();
    RemeberMe readRemeberMe = (RemeberMe) conn.getObject(PREFIX + remeberMe.getUsername());
    conn.close();
    return readRemeberMe;
}
Also used : RedisConnection(org.maxkey.persistence.redis.RedisConnection)

Aggregations

RedisConnection (org.maxkey.persistence.redis.RedisConnection)31 Ticket (org.maxkey.authz.cas.endpoint.ticket.Ticket)6 OAuth2AccessToken (org.maxkey.authz.oauth2.common.OAuth2AccessToken)4 ExpiringOAuth2RefreshToken (org.maxkey.authz.oauth2.common.ExpiringOAuth2RefreshToken)3 OAuth2Authentication (org.maxkey.authz.oauth2.provider.OAuth2Authentication)3 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 OAuth2RefreshToken (org.maxkey.authz.oauth2.common.OAuth2RefreshToken)2 OneTimePassword (org.maxkey.password.onetimepwd.OneTimePassword)2 DateTime (org.joda.time.DateTime)1