Interface SharingTicketService
-
- All Known Implementing Classes:
JpaSharingTicketService
public interface SharingTicketService
The business service of file sharing. The file sharing service provides a way to share files from the Silverpeas portal to external users. The share of a file to external users consists of creation a ticket for downloading this file from the Silverpeas portal. This ticket can be limited in time and in download count.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addDownload(DownloadDetail download)
Updates the list of downloads that were done for a specified ticket.long
countTicketsByUser(String userId)
Gets the number of tickets emitted by the specified users.String
createTicket(Ticket ticket)
Creates a new ticket in the system.void
deleteTicket(String key)
Deletes the ticket identified by the specified key.void
deleteTicketsForSharedObject(Long sharedObjectId, String type)
Deletes all the tickets about the specified file.Ticket
getTicket(String key)
Gets the ticket identified by the specified key.SilverpeasList<DownloadDetail>
getTicketDownloads(Ticket ticket, PaginationPage paginationPage, DownloadDetail.QUERY_ORDER_BY orderBy)
Gets the ticket identified by the specified key.SilverpeasList<Ticket>
getTicketsByUser(String userId, PaginationPage paginationPage, Ticket.QUERY_ORDER_BY orderBy)
Gets all the tickets emitted by the specified users.void
updateTicket(Ticket ticket)
Updates the information of the specified ticket.
-
-
-
Method Detail
-
countTicketsByUser
long countTicketsByUser(String userId)
Gets the number of tickets emitted by the specified users.- Parameters:
userId
- the identifier of the user that has emitted the tickets.- Returns:
- the number of tickets.
-
getTicketsByUser
SilverpeasList<Ticket> getTicketsByUser(String userId, PaginationPage paginationPage, Ticket.QUERY_ORDER_BY orderBy)
Gets all the tickets emitted by the specified users.- Parameters:
userId
- the identifier of the user that has emitted the tickets.paginationPage
- the needed page (performances)orderBy
- the order by must be performed by the persistence because of performances- Returns:
- the tickets of this user.
-
deleteTicketsForSharedObject
void deleteTicketsForSharedObject(Long sharedObjectId, String type)
Deletes all the tickets about the specified file.- Parameters:
sharedObjectId
- the identifier of the shared object.type
- is this shared object type.
-
getTicket
Ticket getTicket(String key)
Gets the ticket identified by the specified key.- Parameters:
key
- the key identifying the ticket.- Returns:
- the ticket.
-
getTicketDownloads
SilverpeasList<DownloadDetail> getTicketDownloads(Ticket ticket, PaginationPage paginationPage, DownloadDetail.QUERY_ORDER_BY orderBy)
Gets the ticket identified by the specified key.- Parameters:
ticket
- a ticket.paginationPage
- the needed page (performances)orderBy
- the order by must be performed by the persistence because of performances- Returns:
- the list of downloads of the given ticket.
-
createTicket
String createTicket(Ticket ticket)
Creates a new ticket in the system.- Parameters:
ticket
- the ticket to save.- Returns:
- the key identifying the saved ticket.
-
addDownload
void addDownload(DownloadDetail download)
Updates the list of downloads that were done for a specified ticket.- Parameters:
download
- the new download to add in the list.
-
updateTicket
void updateTicket(Ticket ticket)
Updates the information of the specified ticket.- Parameters:
ticket
- the ticket with updated information.
-
deleteTicket
void deleteTicket(String key)
Deletes the ticket identified by the specified key.- Parameters:
key
- the key identifying the ticket.
-
-