Interface IDfChatService
public interface IDfChatService
-
Method Summary
Modifier and TypeMethodDescriptioncom.documentum.fc.client.dcis.chat.model.ChatResponsepostMessage(com.documentum.fc.client.dcis.chat.model.ChatRequest req, String token, IDfSession session) This method allows Documentum users to initiate the chat requests with Aviator plugin.com.documentum.fc.client.dcis.chat.model.ChatResponsepostMessage(com.documentum.fc.client.dcis.chat.model.ChatRequest req, String token, IDfSession session, Map<String, String> additionalHeaders) This method allows Documentum users to initiate the chat requests with Aviator plugin.
-
Method Details
-
postMessage
com.documentum.fc.client.dcis.chat.model.ChatResponse postMessage(com.documentum.fc.client.dcis.chat.model.ChatRequest req, String token, IDfSession session) throws IOException, InterruptedException This method allows Documentum users to initiate the chat requests with Aviator plugin.Sample code:
Java:DfChatService chatService = new DfChatService(); chatService.initialize(session); ChatMessage chatMessage = new ChatMessage.Builder().setAuthor("user").setQuestion("What's up").build(); ChatMetaData workspaceIDMetaData = new ChatMetaData.Builder().setKeyName("workspaceID").setValue("W-898956").build(); ListmetaDataList = new ArrayList<>(); metaDataList.add(workspaceIDMetaData); ChatRequest.Builder chatReqBuilder = new ChatRequest.Builder(); ChatRequest chatRequest = chatReqBuilder.addMessage(chatMessage).addMetaData(metaDataList).setCtx("").build(); ChatResponse chatResponse = null; try { chatResponse = chatService.postMessage(chatRequest, "token", session); } catch (Exception e) { //throw new RuntimeException(e); } - Throws:
IOExceptionInterruptedException
-
postMessage
com.documentum.fc.client.dcis.chat.model.ChatResponse postMessage(com.documentum.fc.client.dcis.chat.model.ChatRequest req, String token, IDfSession session, Map<String, String> additionalHeaders) throws IOException, InterruptedExceptionThis method allows Documentum users to initiate the chat requests with Aviator plugin. Overload that forwards caller-supplied HTTP headers to the downstream chat service. Use this when you need to pass headers such asAccept-Languagefor locale tracking. Any new header added to the map is forwarded automatically.* Sample code: * *
Java:* DfChatService chatService = new DfChatService(); * chatService.initialize(session); * ChatMessage chatMessage = new ChatMessage.Builder().setAuthor("user").setQuestion("What's up").build(); * ChatMetaData workspaceIDMetaData = new ChatMetaData.Builder().setKeyName("workspaceID").setValue("W-898956").build(); * ListmetaDataList = new ArrayList<>(); * metaDataList.add(workspaceIDMetaData); * ChatRequest.Builder chatReqBuilder = new ChatRequest.Builder(); * ChatRequest chatRequest = chatReqBuilder.addMessage(chatMessage).addMetaData(metaDataList).setCtx("").build(); * Map<String, String> headers = new HashMap<>(); * headers.put("Accept-Language", "fr_FR"); * headers.put("X-Locale", "fr_FR"); * ChatResponse chatResponse = null; * try { * chatResponse = chatService.postMessage(chatRequest, "token", session, headers); * } catch (Exception e) { * //throw new RuntimeException(e); * } * - Parameters:
additionalHeaders- headers to append to the outbound HTTP request;nullis treated as empty- Throws:
IOExceptionInterruptedException
-