Class JpaSharingTicketService
- java.lang.Object
-
- org.silverpeas.core.sharing.services.JpaSharingTicketService
-
- All Implemented Interfaces:
ComponentInstanceDeletion
,SharingTicketService
@Service @Singleton public class JpaSharingTicketService extends Object implements SharingTicketService, ComponentInstanceDeletion
- Author:
- ehugonnet
-
-
Constructor Summary
Constructors Constructor Description JpaSharingTicketService()
-
Method Summary
All Methods Instance Methods Concrete 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
delete(String componentInstanceId)
Deletes the resources belonging to the specified component instance.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
public long countTicketsByUser(String userId)
Description copied from interface:SharingTicketService
Gets the number of tickets emitted by the specified users.- Specified by:
countTicketsByUser
in interfaceSharingTicketService
- Parameters:
userId
- the identifier of the user that has emitted the tickets.- Returns:
- the number of tickets.
-
getTicketsByUser
public SilverpeasList<Ticket> getTicketsByUser(String userId, PaginationPage paginationPage, Ticket.QUERY_ORDER_BY orderBy)
Description copied from interface:SharingTicketService
Gets all the tickets emitted by the specified users.- Specified by:
getTicketsByUser
in interfaceSharingTicketService
- 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
public void deleteTicketsForSharedObject(Long sharedObjectId, String type)
Description copied from interface:SharingTicketService
Deletes all the tickets about the specified file.- Specified by:
deleteTicketsForSharedObject
in interfaceSharingTicketService
- Parameters:
sharedObjectId
- the identifier of the shared object.type
- is this shared object type.
-
getTicket
public Ticket getTicket(String key)
Description copied from interface:SharingTicketService
Gets the ticket identified by the specified key.- Specified by:
getTicket
in interfaceSharingTicketService
- Parameters:
key
- the key identifying the ticket.- Returns:
- the ticket.
-
createTicket
public String createTicket(Ticket ticket)
Description copied from interface:SharingTicketService
Creates a new ticket in the system.- Specified by:
createTicket
in interfaceSharingTicketService
- Parameters:
ticket
- the ticket to save.- Returns:
- the key identifying the saved ticket.
-
addDownload
public void addDownload(DownloadDetail download)
Description copied from interface:SharingTicketService
Updates the list of downloads that were done for a specified ticket.- Specified by:
addDownload
in interfaceSharingTicketService
- Parameters:
download
- the new download to add in the list.
-
updateTicket
public void updateTicket(Ticket ticket)
Description copied from interface:SharingTicketService
Updates the information of the specified ticket.- Specified by:
updateTicket
in interfaceSharingTicketService
- Parameters:
ticket
- the ticket with updated information.
-
deleteTicket
public void deleteTicket(String key)
Description copied from interface:SharingTicketService
Deletes the ticket identified by the specified key.- Specified by:
deleteTicket
in interfaceSharingTicketService
- Parameters:
key
- the key identifying the ticket.
-
delete
public void delete(String componentInstanceId)
Deletes the resources belonging to the specified component instance. This method is invoked by Silverpeas when a component instance is being deleted.- Specified by:
delete
in interfaceComponentInstanceDeletion
- Parameters:
componentInstanceId
- the unique identifier of a component instance.
-
getTicketDownloads
public SilverpeasList<DownloadDetail> getTicketDownloads(Ticket ticket, PaginationPage paginationPage, DownloadDetail.QUERY_ORDER_BY orderBy)
Description copied from interface:SharingTicketService
Gets the ticket identified by the specified key.- Specified by:
getTicketDownloads
in interfaceSharingTicketService
- 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.
-
-