Class SimpleAttachmentService

  • All Implemented Interfaces:
    AttachmentService

    public class SimpleAttachmentService
    extends java.lang.Object
    implements AttachmentService
    Attachment Service Implementation
    • Constructor Detail

    • Method Detail

      • getAttachments

        public void getAttachments​(Match match,
                                   Callback<java.util.List<Attachment>> onSuccess,
                                   Callback<DataAccessException> onFailure)
        Description copied from interface: AttachmentService
        Retrieve a match's attachments.
        Specified by:
        getAttachments in interface AttachmentService
        Parameters:
        match - The match to get the attachments from. Must contain the tournament- and match id
        onSuccess - Called with result if call was successful
        onFailure - Called with exception if call was not successful
      • getAttachment

        public Attachment getAttachment​(Match match,
                                        long attachmentId)
                                 throws DataAccessException
        Description copied from interface: AttachmentService
        Retrieve a single match attachment record.
        Specified by:
        getAttachment in interface AttachmentService
        Parameters:
        match - The match to get the attachment from. Must contain the tournament- and match id
        attachmentId - The attachment's unique ID
        Returns:
        The requested attachment
        Throws:
        DataAccessException - Exchange with the rest api failed
      • getAttachment

        public void getAttachment​(Match match,
                                  long attachmentId,
                                  Callback<Attachment> onSuccess,
                                  Callback<DataAccessException> onFailure)
        Description copied from interface: AttachmentService
        Retrieve a single match attachment record.
        Specified by:
        getAttachment in interface AttachmentService
        Parameters:
        match - The match to get the attachment from. Must contain the tournament- and match id
        attachmentId - The attachment's unique ID
        onSuccess - Called with result if call was successful
        onFailure - Called with exception if call was not successful
      • createAttachment

        public Attachment createAttachment​(Match match,
                                           AttachmentQuery data)
                                    throws DataAccessException
        Description copied from interface: AttachmentService
        Add a file, link, or text attachment to a match. NOTE: The associated tournament's "accept_attachments" attribute must be true for this action to succeed.

        At least 1 of the 3 optional parameters (asset, url or description in the enumeration object) must be provided. Files up to 25MB are allowed for tournaments hosted by Challonge Premier subscribers.

        Specified by:
        createAttachment in interface AttachmentService
        Parameters:
        match - The match to create the attachment for. Must contain the tournament- and match id
        data - The attachment to create
        Returns:
        The created attachment
        Throws:
        DataAccessException - Exchange with the rest api failed
      • createAttachment

        public void createAttachment​(Match match,
                                     AttachmentQuery data,
                                     Callback<Attachment> onSuccess,
                                     Callback<DataAccessException> onFailure)
        Description copied from interface: AttachmentService
        Add a file, link, or text attachment to a match. NOTE: The associated tournament's "accept_attachments" attribute must be true for this action to succeed.

        At least 1 of the 3 optional parameters (asset, url or description in the enumeration object) must be provided. Files up to 25MB are allowed for tournaments hosted by Challonge Premier subscribers.

        Specified by:
        createAttachment in interface AttachmentService
        Parameters:
        match - The match to create the attachment for. Must contain the tournament- and match id
        data - The attachment to create
        onSuccess - Called with result if call was successful
        onFailure - Called with exception if call was not successful
      • updateAttachment

        public Attachment updateAttachment​(Match match,
                                           Attachment attachment,
                                           AttachmentQuery data)
                                    throws DataAccessException
        Description copied from interface: AttachmentService
        Update the attributes of a match attachment.

        Sending the asset does neither work with base64 nor with a multipart-form-data request

        At least 1 of the 3 optional parameters (asset, url or description in the enumeration object) must be provided. Files up to 25MB are allowed for tournaments hosted by Challonge Premier subscribers.

        Specified by:
        updateAttachment in interface AttachmentService
        Parameters:
        match - The match to delete the attachment from. Must contain the tournament- and match id
        attachment - The attachment to update. Must contain the tournament- and match id
        data - The attachment to update
        Returns:
        The updated attachment
        Throws:
        DataAccessException - Exchange with the rest api failed
      • updateAttachment

        public void updateAttachment​(Match match,
                                     Attachment attachment,
                                     AttachmentQuery data,
                                     Callback<Attachment> onSuccess,
                                     Callback<DataAccessException> onFailure)
        Description copied from interface: AttachmentService
        Update the attributes of a match attachment.

        Sending the asset does neither work with base64 nor with a multipart-form-data request

        At least 1 of the 3 optional parameters (asset, url or description in the enumeration object) must be provided. Files up to 25MB are allowed for tournaments hosted by Challonge Premier subscribers.

        Specified by:
        updateAttachment in interface AttachmentService
        Parameters:
        match - The match to delete the attachment from. Must contain the tournament- and match id
        attachment - The attachment to update. Must contain the tournament- and match id
        data - The attachment to update
        onSuccess - Called with result if call was successful
        onFailure - Called with exception if call was not successful
      • deleteAttachment

        public void deleteAttachment​(Match match,
                                     Attachment attachment,
                                     Callback<Attachment> onSuccess,
                                     Callback<DataAccessException> onFailure)
        Description copied from interface: AttachmentService
        Delete a match attachment.
        Specified by:
        deleteAttachment in interface AttachmentService
        Parameters:
        match - The match to delete the attachment from. Must contain the tournament- and match id
        attachment - The attachment to delete. Must contain the tournament- and match id
        onSuccess - Called with result if call was successful
        onFailure - Called with exception if call was not successful