Interface ContactHandler


public interface ContactHandler
This handler provides access to Contact objects.
Since:
11.26
  • Method Details

    • getContact

      @Deprecated(forRemoval=true, since="13.10") Optional<Contact> getContact(Ticket ticket)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use Issue.getContact() instead
      This method returns the optional Contact of a Ticket. If the Ticket is not assigned to a Contact the methods returns an empty Optional.
      Parameters:
      ticket - the Ticket for which the Contact should be retrieved
      Returns:
      the optional Contact of a Ticket, or an empty Optional if the ticket has no contact.
      Since:
      11.26
    • getContact

      @Deprecated(forRemoval=true, since="13.10") Optional<Contact> getContact(Call call)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use Issue.getContact() instead
      This method returns the optional Contact of a Call. If the Call is not assigned to a Contact the methods returns an empty Optional.
      Parameters:
      call - the Call for which the Contact should be retrieved
      Returns:
      the optional Contact of a Call, or an empty Optional if the call has no contact.
      Since:
      12.14
    • getContact

      @Deprecated(forRemoval=true, since="13.10") Optional<Contact> getContact(Chat chat)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use Issue.getContact() instead
      This method returns the optional Contact of a Chat. If the Chat is not assigned to a Contact the methods returns an empty Optional.
      Parameters:
      chat - the Chat for which the Contact should be retrieved
      Returns:
      the optional Contact of a Chat, or an empty Optional if the chat has no contact.
      Since:
      13.5
    • getContactByID

      Optional<Contact> getContactByID(Long id)
      This method returns the optional Contact of an id. If the id is not assigned to a Contact the methods returns an empty Optional.
      Parameters:
      id - the id for which the Contact should be retrieved
      Returns:
      the optional Contact of an id, or an empty Optional if the ticket has no contact.
      Since:
      12.24
    • getContactByContactIdentifier

      Optional<Contact> getContactByContactIdentifier(ContactIdentifier contactIdentifier)
      This method returns the optional Contact for a ContactIdentifier. If the search criteria of the ContactIdentifier do not match any Contact the method returns an empty Optional.
      Parameters:
      contactIdentifier - the ContactIdentifier with the search criteria inside.
      Returns:
      the optional Contact for a ContactIdentifier, or an empty Optional if the search criteria of the ContactIdentifier do not match any Contact.
      Since:
      12.24
    • getContactListByContactIdentifier

      List<Contact> getContactListByContactIdentifier(ContactIdentifier contactIdentifier)
      This method returns a list of all contacts matching any of the search criteria of the ContactIdentifier. If more than one Contact is found, the list is sorted ascending by the contact's id.
      Parameters:
      contactIdentifier - the ContactIdentifier with the search criteria inside
      Returns:
      the list of matching contacts
      Since:
      12.24
    • getContactByContactIdentifier

      Optional<Contact> getContactByContactIdentifier(ContactIdentifier contactIdentifier, Tenant tenant)
      This method returns the optional Contact for a ContactIdentifier and a Tenant. If the search criteria of the ContactIdentifier and the Tenant do not belong to any Contact the method returns an empty Optional.
      Parameters:
      contactIdentifier - the ContactIdentifier with the search criteria inside
      tenant - the Tenant assigned to a Contact
      Returns:
      the optional Contact for a ContactIdentifier and a Tenant, or an empty Optional if the search criteria of the ContactIdentifier and the Tenant do not match any Contact.
      Since:
      12.24
    • getContactListByContactIdentifier

      List<Contact> getContactListByContactIdentifier(ContactIdentifier contactIdentifier, Tenant tenant)
      This method returns a list of contacts that are assigned to a Tenant and matching any of the search criteria of the ContactIdentifier. If more than one Contact is found, the list is sorted ascending by the contact's id.
      Parameters:
      contactIdentifier - the ContactIdentifier with the search criteria inside
      tenant - the Tenant assigned to a Contact
      Returns:
      the list of matching contacts
      Since:
      12.24
    • getJoinedContactList

      List<Contact> getJoinedContactList(Contact contact)
      Returns a list of contacts that are joined to the associated Contact. If more than one Contact is found, the list is sorted ascending by the contact's id.
      Parameters:
      contact - the Contact to be used to search for associated contacts
      Returns:
      the list of associated contacts
      Since:
      12.24
    • getContactModifier

      ContactModifier getContactModifier(Contact contact, Optional<User> user)
      Build a ContactModifier for the passed Contact object.
      Parameters:
      contact - the instance to modify
      user - pass a user, if called in a user context. Otherwise pass an empty optional.
      Returns:
      a ContactModifier associated with the Contact.
      Since:
      12.14
    • getContactRelationHandler

      ContactRelationHandler getContactRelationHandler(Contact contact, Optional<User> user)
      Build a ContactRelationHandler for the passed Contact object.
      Parameters:
      contact - the instance to modify
      user - pass a user, if called in a user context. Otherwise pass an empty optional.
      Returns:
      a ContactRelationHandler for the Contact.
      Since:
      12.24
    • assignContact

      void assignContact(Issue issue, Contact contact) throws ValidationException
      Change the associated Contact of the Issue. Please note that both the Contact and the Issue provide an optionally assigned Tenant that must match to each other when changing the contact of an Issue. A match means that either both tenants are not set (null) or both tenants are set and equal to each other. Otherwise a ValidationException is thrown.
      Parameters:
      issue - the Issue of the contact to be assigned to.
      contact - the Contact that should be assigned to the specified issue.
      Throws:
      ValidationException - if the issue or the contact is invalid or if the specified contact cannot be assigned to the issue e.g. due to a mismatching tenant.
      Since:
      13.10