public final void setVersion(SoapVersion v) { super.put(SoapVersion.class, v); this.version = v; }
public final void setVersion(SoapVersion v) { super.put(SoapVersion.class, v); this.version = v; }
public void setDestination(Destination d) { put(Destination.class, d); }
public void setAttachments(Collection<Attachment> attachments) { put(ATTACHMENTS, attachments); }
public void setDestination(Destination d) { put(Destination.class, d); }
public void setDestination(Destination d) { put(Destination.class, d); }
public void setAttachments(Collection<Attachment> attachments) { put(ATTACHMENTS, attachments); }
public void setDestination(Destination d) { put(Destination.class, d); }
public void setAttachments(Collection<Attachment> attachments) { put(ATTACHMENTS, attachments); }
public void setAttachments(Collection<Attachment> attachments) { put(ATTACHMENTS, attachments); }
exchange.setInMessage(m); m.setContent(InputStream.class, new ByteArrayInputStream(bytes, 0, p.getLength())); m.put(OutputStream.class, out); queue.execute(() -> getMessageObserver().onMessage(m)); } catch (IOException ex) {
/** * Return users matching the given criteria. The visible groups, trees and companies are checked. The returned * groups of each user depends on the groups the user can see. The result is not secured : it contains DN. * * @param company * The optional company name to match. * @param group * The optional group name to match. * @return All matched users. */ public List<UserOrg> findAllNotSecure(final String company, final String group) { final Set<GroupOrg> visibleGroups = groupResource.getContainers(); // Search the users final MessageImpl message = new MessageImpl(); message.put(Message.QUERY_STRING, DataTableAttributes.PAGE_LENGTH + "=10000000"); return findAllNotSecure(visibleGroups, company, group, null, new UriInfoImpl(message)).getContent(); }
protected void processStreamIo(IoSession session, InputStream in, OutputStream out) { final MessageImpl m = new MessageImpl(); final Exchange exchange = new ExchangeImpl(); exchange.setDestination(UDPDestination.this); m.setDestination(UDPDestination.this); exchange.setInMessage(m); m.setContent(InputStream.class, in); out = new UDPDestinationOutputStream(out); m.put(OutputStream.class, out); queue.execute(() -> getMessageObserver().onMessage(m)); }
protected void processStreamIo(IoSession session, InputStream in, OutputStream out) { final MessageImpl m = new MessageImpl(); final Exchange exchange = new ExchangeImpl(); exchange.setDestination(UDPDestination.this); m.setDestination(UDPDestination.this); exchange.setInMessage(m); m.setContent(InputStream.class, in); out = new UDPDestinationOutputStream(out); m.put(OutputStream.class, out); queue.execute(() -> getMessageObserver().onMessage(m)); }
public void onMessage(Message message) { try { // HTTP seems to need this right now... ExchangeImpl ex = new ExchangeImpl(); ex.setInMessage(message); Conduit backChannel = message.getDestination().getBackChannel(message); MessageImpl res = new MessageImpl(); ex.setOutMessage(res); res.put(Message.CONTENT_TYPE, "text/xml"); backChannel.prepare(res); OutputStream out = res.getContent(OutputStream.class); InputStream is = resource.openStream(); IOUtils.copy(is, out, 2048); out.flush(); out.close(); is.close(); backChannel.close(res); } catch (Exception e) { e.printStackTrace(); } }
private void dispatchDirect(Message message) throws IOException { if (destination.getMessageObserver() == null) { throw new IllegalStateException("Local destination does not have a MessageObserver on address " + destination.getAddress().getAddress().getValue()); } MessageImpl copy = new MessageImpl(); copy.put(IN_CONDUIT, this); copy.setDestination(destination); transportFactory.copy(message, copy); MessageImpl.copyContent(message, copy); OutputStream out = message.getContent(OutputStream.class); out.flush(); out.close(); CachedOutputStream stream = message.get(CachedOutputStream.class); copy.setContent(InputStream.class, stream.getInputStream()); copy.removeContent(CachedOutputStream.class); stream.releaseTempFileHold(); // Create a new incoming exchange and store the original exchange for the response ExchangeImpl ex = new ExchangeImpl(); ex.setInMessage(copy); ex.put(IN_EXCHANGE, message.getExchange()); ex.put(LocalConduit.DIRECT_DISPATCH, true); ex.setDestination(destination); destination.getMessageObserver().onMessage(copy); }
private void dispatchDirect(Message message) throws IOException { if (destination.getMessageObserver() == null) { throw new IllegalStateException("Local destination does not have a MessageObserver on address " + destination.getAddress().getAddress().getValue()); } MessageImpl copy = new MessageImpl(); copy.put(IN_CONDUIT, this); copy.setDestination(destination); transportFactory.copy(message, copy); MessageImpl.copyContent(message, copy); OutputStream out = message.getContent(OutputStream.class); out.flush(); out.close(); CachedOutputStream stream = message.get(CachedOutputStream.class); copy.setContent(InputStream.class, stream.getInputStream()); copy.removeContent(CachedOutputStream.class); stream.releaseTempFileHold(); // Create a new incoming exchange and store the original exchange for the response ExchangeImpl ex = new ExchangeImpl(); ex.setInMessage(copy); ex.put(IN_EXCHANGE, message.getExchange()); ex.put(LocalConduit.DIRECT_DISPATCH, true); ex.setDestination(destination); destination.getMessageObserver().onMessage(copy); }
public static void encodeRMContent(RMMessage rmmsg, Message msg, InputStream msgContent) throws IOException { CachedOutputStream cos = new CachedOutputStream(); if (msg.getAttachments() == null) { rmmsg.setContentType((String)msg.get(Message.CONTENT_TYPE)); IOUtils.copyAndCloseInput(msgContent, cos); cos.flush(); rmmsg.setContent(cos); } else { MessageImpl msgImpl1 = new MessageImpl(); msgImpl1.setContent(OutputStream.class, cos); msgImpl1.setAttachments(msg.getAttachments()); msgImpl1.put(Message.CONTENT_TYPE, msg.get(Message.CONTENT_TYPE)); msgImpl1.setContent(InputStream.class, msgContent); AttachmentSerializer serializer = new AttachmentSerializer(msgImpl1); serializer.setXop(false); serializer.writeProlog(); // write soap root message into cached output stream IOUtils.copyAndCloseInput(msgContent, cos); cos.flush(); serializer.writeAttachments(); rmmsg.setContentType((String) msgImpl1.get(Message.CONTENT_TYPE)); rmmsg.setContent(cos); } }