Class SimpleAttachmentService
- java.lang.Object
-
- at.stefangeyer.challonge.service.implementation.SimpleAttachmentService
-
- All Implemented Interfaces:
AttachmentService
public class SimpleAttachmentService extends java.lang.Object implements AttachmentService
Attachment Service Implementation
-
-
Constructor Summary
Constructors Constructor Description SimpleAttachmentService(AttachmentRestClient restClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttachmentcreateAttachment(Match match, AttachmentQuery data)Add a file, link, or text attachment to a match.voidcreateAttachment(Match match, AttachmentQuery data, Callback<Attachment> onSuccess, Callback<DataAccessException> onFailure)Add a file, link, or text attachment to a match.AttachmentdeleteAttachment(Match match, Attachment attachment)Delete a match attachment.voiddeleteAttachment(Match match, Attachment attachment, Callback<Attachment> onSuccess, Callback<DataAccessException> onFailure)Delete a match attachment.AttachmentgetAttachment(Match match, long attachmentId)Retrieve a single match attachment record.voidgetAttachment(Match match, long attachmentId, Callback<Attachment> onSuccess, Callback<DataAccessException> onFailure)Retrieve a single match attachment record.java.util.List<Attachment>getAttachments(Match match)Retrieve a match's attachments.voidgetAttachments(Match match, Callback<java.util.List<Attachment>> onSuccess, Callback<DataAccessException> onFailure)Retrieve a match's attachments.AttachmentupdateAttachment(Match match, Attachment attachment, AttachmentQuery data)Update the attributes of a match attachment.voidupdateAttachment(Match match, Attachment attachment, AttachmentQuery data, Callback<Attachment> onSuccess, Callback<DataAccessException> onFailure)Update the attributes of a match attachment.
-
-
-
Constructor Detail
-
SimpleAttachmentService
public SimpleAttachmentService(AttachmentRestClient restClient)
-
-
Method Detail
-
getAttachments
public java.util.List<Attachment> getAttachments(Match match) throws DataAccessException
Description copied from interface:AttachmentServiceRetrieve a match's attachments.- Specified by:
getAttachmentsin interfaceAttachmentService- Parameters:
match- The match to get the attachments from. Must contain the tournament- and match id- Returns:
- The match attachments
- Throws:
DataAccessException- Exchange with the rest api failed
-
getAttachments
public void getAttachments(Match match, Callback<java.util.List<Attachment>> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:AttachmentServiceRetrieve a match's attachments.- Specified by:
getAttachmentsin interfaceAttachmentService- Parameters:
match- The match to get the attachments from. Must contain the tournament- and match idonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
getAttachment
public Attachment getAttachment(Match match, long attachmentId) throws DataAccessException
Description copied from interface:AttachmentServiceRetrieve a single match attachment record.- Specified by:
getAttachmentin interfaceAttachmentService- Parameters:
match- The match to get the attachment from. Must contain the tournament- and match idattachmentId- 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:AttachmentServiceRetrieve a single match attachment record.- Specified by:
getAttachmentin interfaceAttachmentService- Parameters:
match- The match to get the attachment from. Must contain the tournament- and match idattachmentId- The attachment's unique IDonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
createAttachment
public Attachment createAttachment(Match match, AttachmentQuery data) throws DataAccessException
Description copied from interface:AttachmentServiceAdd 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:
createAttachmentin interfaceAttachmentService- Parameters:
match- The match to create the attachment for. Must contain the tournament- and match iddata- 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:AttachmentServiceAdd 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:
createAttachmentin interfaceAttachmentService- Parameters:
match- The match to create the attachment for. Must contain the tournament- and match iddata- The attachment to createonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
updateAttachment
public Attachment updateAttachment(Match match, Attachment attachment, AttachmentQuery data) throws DataAccessException
Description copied from interface:AttachmentServiceUpdate 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:
updateAttachmentin interfaceAttachmentService- Parameters:
match- The match to delete the attachment from. Must contain the tournament- and match idattachment- The attachment to update. Must contain the tournament- and match iddata- 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:AttachmentServiceUpdate 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:
updateAttachmentin interfaceAttachmentService- Parameters:
match- The match to delete the attachment from. Must contain the tournament- and match idattachment- The attachment to update. Must contain the tournament- and match iddata- The attachment to updateonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
deleteAttachment
public Attachment deleteAttachment(Match match, Attachment attachment) throws DataAccessException
Description copied from interface:AttachmentServiceDelete a match attachment.- Specified by:
deleteAttachmentin interfaceAttachmentService- Parameters:
match- The match to delete the attachment from. Must contain the tournament- and match idattachment- The attachment to delete. Must contain the tournament- and match id- Returns:
- The deleted attachment
- Throws:
DataAccessException- Exchange with the rest api failed
-
deleteAttachment
public void deleteAttachment(Match match, Attachment attachment, Callback<Attachment> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:AttachmentServiceDelete a match attachment.- Specified by:
deleteAttachmentin interfaceAttachmentService- Parameters:
match- The match to delete the attachment from. Must contain the tournament- and match idattachment- The attachment to delete. Must contain the tournament- and match idonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
-