public interface TicketEngine
Interface that declares ticket access and management functions including generation, consumption, revoking and deleting tickets.
Tickets are used as authorization tokens when requesting IO and convert operations.
Modifier and Type | Method and Description |
---|---|
<T extends AbstractTicket> |
consume(String ticketKey)
Consumes a ticket.
|
<T extends AbstractTicket> |
consume(String ticketKey,
Class<T> ticketClass)
Consumes a ticket.
|
<T extends AbstractTicket> |
consume(T ticket)
Consumes a ticket.
|
<T extends AbstractTicket> |
createTicket(com.tenduke.sdk2.objectmodel.identity.Account account,
String path1,
String path2,
Long allowedConsumption,
Boolean isPrivate,
Class<T> ticketClass)
Generates new upload ticket for owner account.
|
<T extends AbstractTicket> |
resolvePrivateTickets(String path1,
String path2,
Class<T> ticketClass)
Resolves tickets associated with a file entry.
|
Class<? extends AbstractTicket> |
resolveTicketClassByTickeyKey(String ticketKey)
Resolves ticket class based on given simple name.
|
void |
revokeTicket(AbstractTicket ticket)
Revokes a ticket.
|
void |
revokeTicket(String ticketKey)
Revokes a ticket.
|
<T extends AbstractTicket> T createTicket(com.tenduke.sdk2.objectmodel.identity.Account account, String path1, String path2, Long allowedConsumption, Boolean isPrivate, Class<T> ticketClass)
T
- Type of ticket.account
- The owner account that grants ticket for upload.path1
- Path 1 claim that ticket is about.path2
- Path 2 claim that ticket is about.allowedConsumption
- The allowed number of requests that this ticket authorizes. If null then value 1
is used as default.isPrivate
- Private flag value to set for ticket. See AbstractTicket.getIsPrivate()
.ticketClass
- Type of ticket.<T extends AbstractTicket> TicketConsumptionResult<T> consume(String ticketKey)
T
- Type of ticket.ticketKey
- Key that identifies the ticket to consume.<T extends AbstractTicket> TicketConsumptionResult<T> consume(String ticketKey, Class<T> ticketClass)
T
- Type of ticket.ticketKey
- Key that identifies the ticket to consume.ticketClass
- Type of ticket.<T extends AbstractTicket> TicketConsumptionResult<T> consume(T ticket)
T
- Type of ticket.ticket
- ticket to consume.void revokeTicket(String ticketKey)
ticketKey
- Key that identifies the ticket.void revokeTicket(AbstractTicket ticket)
ticket
- Ticket to revoke. Null allowed, which will have no side effects.Class<? extends AbstractTicket> resolveTicketClassByTickeyKey(String ticketKey)
ticketKey
- Ticket key to use for resolving ticket class.<T extends AbstractTicket> List<T> resolvePrivateTickets(String path1, String path2, Class<T> ticketClass)
T
- Type of ticket.path1
- Required value of AbstractTicket.getPath1()
to match.path2
- Required value of AbstractTicket.getPath2()
to match.ticketClass
- Class of ticket to resolve.Copyright © 2015. All rights reserved.