Class DefaultTicketService

  • All Implemented Interfaces:
    TicketService

    public class DefaultTicketService
    extends java.lang.Object
    implements TicketService
    This service class provides mechanism to find CsTickets by various attributes. Also provides methods to retrieve lists of Agents, AgentGroups, Priorities, States, Intervention Types and Reasons based on the available instances at runtime.
    • Constructor Detail

      • DefaultTicketService

        public DefaultTicketService()
    • Method Detail

      • getAgentGroupsForBaseStore

        public java.util.List<CsAgentGroupModel> getAgentGroupsForBaseStore​(BaseStoreModel store)
        Retrieves a list of the AgentGroups for the provided BaseStore
        Specified by:
        getAgentGroupsForBaseStore in interface TicketService
        Parameters:
        store - The BaseStore to retrieve AgentGroups for
        Returns:
        The list of AgentGroups
      • getAgents

        public java.util.List<EmployeeModel> getAgents()
        Retrieves a list of the Agents as Employees.
        Specified by:
        getAgents in interface TicketService
        Returns:
        The list of Agents
      • getAgentsForBaseStore

        public java.util.List<EmployeeModel> getAgentsForBaseStore​(BaseStoreModel store)
        Retrieves a list of the Agents as Employees for the provided BaseStore
        Specified by:
        getAgentsForBaseStore in interface TicketService
        Parameters:
        store - The BaseStore to retrieve Agents for
        Returns:
        The list of Agents
      • getEventReasons

        public java.util.List<CsEventReason> getEventReasons()
        Retrieves all available Event Reasons in the system.
        Specified by:
        getEventReasons in interface TicketService
        Returns:
        The list of Event Reasons
      • getEventsForTicket

        public java.util.List<CsTicketEventModel> getEventsForTicket​(CsTicketModel ticket)
        Gets all ticket events for CsTicketModel object.
        Specified by:
        getEventsForTicket in interface TicketService
        Parameters:
        ticket - the CsTicketModel for which to return ticket events.
        Returns:
        A list of ticket events.
      • getTicketEventsForCustomerByTicket

        public java.util.List<CsTicketEventModel> getTicketEventsForCustomerByTicket​(CsTicketModel ticket)
        Gets all ticket events for CsTicketModel object excluding private messages.
        Specified by:
        getTicketEventsForCustomerByTicket in interface TicketService
        Parameters:
        ticket - the CsTicketModel for which to return ticket events.
        Returns:
        A list of ticket events.
      • getResolutionTypes

        public java.util.List<CsResolutionType> getResolutionTypes()
        Retrieves all available Resolution Types in the system.
        Specified by:
        getResolutionTypes in interface TicketService
        Returns:
        The list of Resolution Types
      • getTicketCategories

        public java.util.List<CsTicketCategory> getTicketCategories()
        Retrieves all available Ticket Categories in the system.
        Specified by:
        getTicketCategories in interface TicketService
        Returns:
        The list of Ticket Categories
      • getTicketForTicketId

        public CsTicketModel getTicketForTicketId​(java.lang.String ticketId)
        Lookup a specific ticket by ticket ID
        Specified by:
        getTicketForTicketId in interface TicketService
        Parameters:
        ticketId - The id of the ticket to lookup
        Returns:
        The ticket with that Id
      • getTicketPriorities

        public java.util.List<CsTicketPriority> getTicketPriorities()
        Retrieves all available Ticket Priorities in the system.
        Specified by:
        getTicketPriorities in interface TicketService
        Returns:
        The list of Ticket Priorities
      • getTicketsForAgent

        public java.util.List<CsTicketModel> getTicketsForAgent​(EmployeeModel agent)
        Find all the tickets that are assigned to the Agent.
        Specified by:
        getTicketsForAgent in interface TicketService
        Parameters:
        agent - The agent to find assigned tickets for
        Returns:
        A list of tickets matching search criteria
      • getTicketsForAgentGroup

        public java.util.List<CsTicketModel> getTicketsForAgentGroup​(CsAgentGroupModel agentGroup)
        Find all the tickets assigned to the AgentGroup.
        Specified by:
        getTicketsForAgentGroup in interface TicketService
        Parameters:
        agentGroup - The AgentGroup to find assigned tickets for
        Returns:
        A list of tickets matching search criteria
      • getTicketsForCategory

        public java.util.List<CsTicketModel> getTicketsForCategory​(CsTicketCategory... category)
        Find all the tickets that have the provided categories.
        Specified by:
        getTicketsForCategory in interface TicketService
        Parameters:
        category - The category/categories for which to return tickets. The number of arguments is variable and may be zero, although zero arguments will return an empty list.
        Returns:
        A list of tickets matching search criteria
      • getTicketsForCustomer

        public java.util.List<CsTicketModel> getTicketsForCustomer​(UserModel customer)
        Find all tickets that are associated with the customer.
        Specified by:
        getTicketsForCustomer in interface TicketService
        Parameters:
        customer - The customer to find tickets for
        Returns:
        A list of tickets matching search criteria
      • getTicketsForCustomerOrderByModifiedTime

        public java.util.List<CsTicketModel> getTicketsForCustomerOrderByModifiedTime​(UserModel user)
        Find all tickets that are associated with the customer in order by Modified date and time.
        Specified by:
        getTicketsForCustomerOrderByModifiedTime in interface TicketService
        Parameters:
        user - the UserModel whose tickets to be returned
        Returns:
        List
      • getTicketsForOrder

        public java.util.List<CsTicketModel> getTicketsForOrder​(OrderModel order)
        Find all the tickets that are associated with the order.
        Specified by:
        getTicketsForOrder in interface TicketService
        Parameters:
        order - The order to find tickets for
        Returns:
        A list of tickets matching search criteria
      • getTicketsForPriority

        public java.util.List<CsTicketModel> getTicketsForPriority​(CsTicketPriority... priority)
        Find all the tickets that have the provided priorities.
        Specified by:
        getTicketsForPriority in interface TicketService
        Parameters:
        priority - The priority/priorities for which to return tickets. The number of arguments is variable and may be zero, although zero arguments will return an empty list.
        Returns:
        A list of tickets matching search criteria
      • getTicketsForResolutionType

        public java.util.List<CsTicketModel> getTicketsForResolutionType​(CsResolutionType... resolutionType)
        Find all the tickets that have the provided Resolution Type(s).
        Specified by:
        getTicketsForResolutionType in interface TicketService
        Parameters:
        resolutionType - The Resolution Type(s) for which to return tickets. The number of arguments is variable and may be zero, although zero arguments will return an empty list.
        Returns:
        A list of tickets matching search criteria
      • getTicketsForState

        public java.util.List<CsTicketModel> getTicketsForState​(CsTicketState... state)
        Find all the tickets that are in the provided states.
        Specified by:
        getTicketsForState in interface TicketService
        Parameters:
        state - The state(s) for which to return tickets. The number of arguments is variable and may be zero, although zero arguments will return an empty list.
        Returns:
        A list of tickets matching search criteria
      • getTicketStates

        public java.util.List<CsTicketState> getTicketStates()
        Description copied from interface: TicketService
        Retrieves all available Ticket States in the system.
        Specified by:
        getTicketStates in interface TicketService
        Returns:
        The list of Ticket States
      • getTicketType

        public CommentTypeModel getTicketType​(java.lang.String type)
        Description copied from interface: TicketService
        Get the comment type given the code of that type
        Specified by:
        getTicketType in interface TicketService
        Parameters:
        type - The type code of comment type to get
        Returns:
        The comment type represented by the type code
      • getAssociatedObject

        public AbstractOrderModel getAssociatedObject​(java.lang.String associatedCode,
                                                      java.lang.String userUid,
                                                      java.lang.String siteUid)
        Description copied from interface: TicketService
        Extract associatedTo object as AbstractOrderModel
        Specified by:
        getAssociatedObject in interface TicketService
        Parameters:
        associatedCode - code of associated object
        siteUid - optional
        siteUid - optional
        userUid - optional
        Returns:
        AbstractOrderModel
      • getAssociatedTicketObjectResolverMap

        protected java.util.Map<java.lang.String,​TicketAssociatedObjectResolver> getAssociatedTicketObjectResolverMap()
      • setAssociatedTicketObjectResolverMap

        public void setAssociatedTicketObjectResolverMap​(java.util.Map<java.lang.String,​TicketAssociatedObjectResolver> associatedTicketObjectResolverMap)
      • setAgentDao

        public void setAgentDao​(AgentDao agentDao)
      • setCommentService

        public void setCommentService​(CommentService commentService)
      • setEnumerationService

        public void setEnumerationService​(EnumerationService enumerationService)
      • setTicketDao

        public void setTicketDao​(TicketDao ticketDao)
      • setTicketSystemComponent

        public void setTicketSystemComponent​(java.lang.String ticketSystemComponent)
      • setTicketSystemDomain

        public void setTicketSystemDomain​(java.lang.String ticketSystemDomain)