break;
}
case AddAttachmentRequest: {
response = CommandName.AddAttachmentResponse;
Attachment attachment = (Attachment) cmd.getArguments().get(1);
Content content = (Content) cmd.getArguments().get(2);
taskSession.addAttachment((Long) cmd.getArguments().get(0),
attachment,
content);
List args = new ArrayList(2);
args.add(attachment.getId());
args.add(content.getId());
Command resultsCmnd = new Command(cmd.getId(),
CommandName.AddAttachmentResponse,
args);
session.write(resultsCmnd);
break;
}
case DeleteAttachmentRequest: {
response = CommandName.DeleteAttachmentResponse;
long taskId = (Long) cmd.getArguments().get(0);
long attachmentId = (Long) cmd.getArguments().get(1);
long contentId = (Long) cmd.getArguments().get(2);
taskSession.deleteAttachment(taskId,
attachmentId,
contentId);
Command resultsCmnd = new Command(cmd.getId(),
CommandName.DeleteAttachmentResponse,
Collections.emptyList());
session.write(resultsCmnd);
break;
}
case SetDocumentContentRequest: {
response = CommandName.SetDocumentContentResponse;
long taskId = (Long) cmd.getArguments().get(0);
Content content = (Content) cmd.getArguments().get(1);
taskSession.setDocumentContent(taskId,
content);
List args = new ArrayList(1);
args.add(content.getId());
Command resultsCmnd = new Command(cmd.getId(),
CommandName.SetDocumentContentResponse,
args);
session.write(resultsCmnd);
break;
}
case GetContentRequest: {
response = CommandName.GetContentResponse;
long contentId = (Long) cmd.getArguments().get(0);
Content content = taskSession.getContent(contentId);
List args = new ArrayList(1);
args.add(content);
Command resultsCmnd = new Command(cmd.getId(),
CommandName.GetContentResponse,
args);