public class InMemoryTicketComponentImpl extends Object implements TicketComponent
Modifier and Type | Class and Description |
---|---|
static class |
InMemoryTicketComponentImpl.ExpiryMode |
static class |
InMemoryTicketComponentImpl.Ticket
Ticket
|
Modifier and Type | Field and Description |
---|---|
static String |
GRANTED_AUTHORITY_TICKET_PREFIX
Ticket prefix
|
Constructor and Description |
---|
InMemoryTicketComponentImpl()
IOC constructor
|
Modifier and Type | Method and Description |
---|---|
static void |
clearCurrentSecurityContext() |
void |
clearCurrentTicket()
Clear the current ticket
|
int |
countTickets(boolean nonExpiredOnly)
Count tickets
This may be higher than the user count, since a user can have more than one ticket/session
|
boolean |
equals(Object obj) |
String |
getAuthorityForTicket(String ticketString)
Get the authority for the given ticket
|
String |
getCurrentTicket(String userName,
boolean autoCreate)
Get the current ticket
|
String |
getNewTicket(String userName)
Register a new ticket
|
Set<String> |
getUsersWithTickets(boolean nonExpiredOnly)
Get set of users with tickets
This may be lower than the ticket count, since a user can have more than one ticket/session
|
boolean |
getUseSingleTicketPerUser()
Does this ticket component support a single ticket per user or one ticket for each time they login?
|
int |
hashCode() |
void |
invalidateTicketById(String ticketString)
Invalidate the tickets by id
|
void |
invalidateTicketByUser(String userName)
Invalidate all user tickets
|
int |
invalidateTickets(boolean expiredOnly)
Invalidate tickets
|
void |
setExpiryMode(String expiryMode)
How should tickets expire.
|
void |
setOneOff(boolean oneOff)
Are tickets single use
|
void |
setTicketsCache(SimpleCache<String,InMemoryTicketComponentImpl.Ticket> ticketsCache)
Set the ticket cache to support clustering
|
void |
setTicketsExpire(boolean ticketsExpire)
Do tickets expire
|
void |
setUseSingleTicketPerUser(boolean useSingleTicketPerUser) |
void |
setValidDuration(String validDuration)
How long are tickets valid (XML duration as a string)
|
String |
validateTicket(String ticketString)
Check that a certificate is valid and can be used in place of a login.
|
public static final String GRANTED_AUTHORITY_TICKET_PREFIX
public void setTicketsCache(SimpleCache<String,InMemoryTicketComponentImpl.Ticket> ticketsCache)
public void setUseSingleTicketPerUser(boolean useSingleTicketPerUser)
useSingleTicketPerUser
- the useSingleTicketPerUser to setpublic boolean getUseSingleTicketPerUser()
TicketComponent
getUseSingleTicketPerUser
in interface TicketComponent
public void setOneOff(boolean oneOff)
public void setTicketsExpire(boolean ticketsExpire)
public void setExpiryMode(String expiryMode)
public void setValidDuration(String validDuration)
public String getNewTicket(String userName) throws AuthenticationException
TicketComponent
getNewTicket
in interface TicketComponent
userName
- StringAuthenticationException
public String validateTicket(String ticketString) throws AuthenticationException
TicketComponent
validateTicket
in interface TicketComponent
ticketString
- StringAuthenticationException
public void invalidateTicketById(String ticketString)
TicketComponent
invalidateTicketById
in interface TicketComponent
ticketString
- Stringpublic Set<String> getUsersWithTickets(boolean nonExpiredOnly)
TicketComponent
getUsersWithTickets
in interface TicketComponent
nonExpiredOnly
- true for non expired tickets, false for all (including expired) ticketspublic int countTickets(boolean nonExpiredOnly)
TicketComponent
countTickets
in interface TicketComponent
nonExpiredOnly
- true for non expired tickets, false for all (including expired) ticketspublic int invalidateTickets(boolean expiredOnly)
TicketComponent
invalidateTickets
in interface TicketComponent
expiredOnly
- true for EXPIRED tickets, false for ALL (including non-expired) ticketspublic void invalidateTicketByUser(String userName)
TicketComponent
invalidateTicketByUser
in interface TicketComponent
userName
- Stringpublic String getAuthorityForTicket(String ticketString)
TicketComponent
getAuthorityForTicket
in interface TicketComponent
ticketString
- Stringpublic String getCurrentTicket(String userName, boolean autoCreate)
TicketComponent
getCurrentTicket
in interface TicketComponent
userName
- StringautoCreate
- should we create one automatically if there isn't one?public void clearCurrentTicket()
TicketComponent
clearCurrentTicket
in interface TicketComponent
public static void clearCurrentSecurityContext()
Copyright © 2005–2017 Alfresco Software. All rights reserved.