Class SimpleTicketServiceImpl
-
- All Implemented Interfaces:
-
pro.fessional.wings.warlock.service.auth.WarlockTicketService
public class SimpleTicketServiceImpl implements WarlockTicketService
Simple Ticket implement, in product, it is recommended to use database or Hazelcast
- Since:
2022-11-05
trydofor
-
-
Field Summary
Fields Modifier and Type Field Description public final ConcurrentHashMap<String, WarlockTicketService.Pass>clientpublic volatile intauthorizeCodeMaxpublic volatile intaccessTokenMax
-
Constructor Summary
Constructors Constructor Description SimpleTicketServiceImpl()
-
Method Summary
Modifier and Type Method Description ConcurrentHashMap<String, WarlockTicketService.Pass>getClient()intgetAuthorizeCodeMax()voidsetAuthorizeCodeMax(int authorizeCodeMax)intgetAccessTokenMax()voidsetAccessTokenMax(int accessTokenMax)voidaddClient(@NotNull() WarlockTicketService.Pass pass)WarlockTicketService.Termdecode(String token)Stringencode(@NotNull() WarlockTicketService.Term term, @NotNull() Duration ttl)WarlockTicketService.PassfindPass(@NotNull() String clientId)Find Pass Info by ClientId, null if not exist intnextSeq(long uid, int type)Get the next serial number under the user by type booleancheckSeq(long uid, int type, int seq)Whether the serial number is valid. voidrevokeAll(long uid)revoke the code and token under the user voidsetHelper(TicketHelp.Helper<String> helper)TicketHelp.Helper<String>getHelper()-
-
Method Detail
-
getClient
ConcurrentHashMap<String, WarlockTicketService.Pass> getClient()
-
getAuthorizeCodeMax
int getAuthorizeCodeMax()
-
setAuthorizeCodeMax
void setAuthorizeCodeMax(int authorizeCodeMax)
-
getAccessTokenMax
int getAccessTokenMax()
-
setAccessTokenMax
void setAccessTokenMax(int accessTokenMax)
-
addClient
void addClient(@NotNull() WarlockTicketService.Pass pass)
-
decode
WarlockTicketService.Term decode(String token)
-
encode
@NotNull() String encode(@NotNull() WarlockTicketService.Term term, @NotNull() Duration ttl)
-
findPass
@Nullable() WarlockTicketService.Pass findPass(@NotNull() String clientId)
Find Pass Info by ClientId, null if not exist
-
nextSeq
int nextSeq(long uid, int type)
Get the next serial number under the user by type
-
checkSeq
boolean checkSeq(long uid, int type, int seq)
Whether the serial number is valid.
-
revokeAll
void revokeAll(long uid)
revoke the code and token under the user
-
-
-
-