package com.collabnet.ctf.events.custom.events;


import com.collabnet.ctf.events.EventContext;
import com.collabnet.ctf.events.EventListener;
import com.collabnet.ctf.events.SoapVersion;
import com.collabnet.ctf.events.Synchronous;

@EventListener(version = SoapVersion.SOAP_60)
public class GetArtifactCmtAttachmentData {
    @Synchronous(topic = {"object.item.Artifact.update"})
    public void getArtfCmtAttachmentData(final EventContext context) {
        String comment = context.getComment();
        if (comment != null && comment.length() > 0) {
           context.logInfo("GetArtifactCmtAttachmentData Comment: " + context.getComment());
        }
        String[] attachments = context.getAttachmentRawFileIds();
        if (attachments != null && attachments.length > 0) {
            for (String attachment : attachments) {
               context.logInfo("GetArtifactCmtAttachmentData Attachment Raw File Id: " + attachment);
           }
        }
    }
}
