Examples of MessageHeader


Examples of flex.messaging.io.amf.MessageHeader

    {
        if (packetHeaders.size() > 0)
        {
            for (Iterator iter = packetHeaders.iterator(); iter.hasNext();)
            {
                MessageHeader header = (MessageHeader)iter.next();
                if (header.getName().equals(LEGACY_SECURITY_HEADER_NAME))
                {
                    Map loginInfo = (Map)header.getData();
                    String principal = loginInfo.get(LEGACY_SECURITY_PRINCIPAL).toString();
                    Object credentials = loginInfo.get(LEGACY_SECURITY_CREDENTIALS);
                    endpoint.getMessageBroker().getLoginManager().login(principal, credentials.toString());
                    break;
                }
View Full Code Here

Examples of flex.messaging.io.amf.MessageHeader

    public void start_header(Attributes attributes)
    {
        if (currentHeader != null || currentBody != null)
            throw new MessageException("Unexpected header tag.");

        currentHeader = new MessageHeader();

        String name = attributes.getValue("name");
        currentHeader.setName(name);

        String mu = attributes.getValue("mustUnderstand");
View Full Code Here

Examples of jp.ameba.mongo.protocol.MessageHeader

    request.encode(encoder);
    // 最終位置からサイズを特定
    int end = output.getPosition();
    int size = end - start;
    // ヘッダにサイズを設定
    MessageHeader header = request.getHeader();
    header.setMessageLength(size);
    // 開始位置まで戻る
    output.setPosition(start);
    // ヘッダ内容を出力
    header.encode(output);
    // 最終位置に戻る
    output.setPosition(end);
  }
View Full Code Here

Examples of jp.ameba.mongo.protocol.MessageHeader

  protected Object decode(
      ChannelHandlerContext context,
      Channel channel,
      ChannelBuffer buffer) throws Exception {
   
    MessageHeader header = (MessageHeader) context.getAttachment();
    if (header == null) {
      header = new MessageHeader();
      context.setAttachment(header);
    }

    // ヘッダー情報が存在しない場合は、ヘッダー情報を読み込む
    if (!header.isReady()) {
      if (buffer.readableBytes() < MessageHeader.HEADER_SIZE) {
        return null;
      }
      header.read(buffer);
    }
   
    // バッファーが不足している場合は、次の読み込みまで待つ
    if (buffer.readableBytes() + 16 < header.getMessageLength()) {
      return null;
    }
   
    // 現時点で、 OP_REPLY 以外のメッセージは受け付けていない
    if (header.getOpCode() != OperationCode.OP_REPLY) {
      throw new MongoException("OP_CODE is not available in server response.");
    }
   
    // ボディ部分の読み取り
    Response response = new Response(header);
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.ebxml.MessageHeader

    if (message.getPayload() instanceof EbMSMessage)
    {
      try
      {
        EbMSMessage msg = (EbMSMessage)message.getPayload();
        MessageHeader messageHeader = msg.getMessageHeader();
        CollaborationProtocolAgreement cpa = ebMSDAO.getCPA(messageHeader.getCPAId());
        Signature signature = (Signature)message.getProperty(Constants.EBMS_SIGNATURE);
        PartyInfo partyInfo = CPAUtils.getPartyInfo(cpa,messageHeader.getFrom().getPartyId());
        List<DeliveryChannel> deliveryChannels = CPAUtils.getDeliveryChannels(partyInfo,messageHeader.getFrom().getRole(),messageHeader.getService(),messageHeader.getAction());
        if (CPAUtils.isSigned(deliveryChannels.get(0)))
        {
          if (signature == null)
          {
            message.setProperty(Constants.EBMS_ERROR,EbMSMessageUtils.createError("//Header/Signature",Constants.EbMSErrorCode.SECURITY_FAILURE.errorCode(),"No signature found."));
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.ebxml.MessageHeader

    if (message.getPayload() instanceof EbMSBaseMessage)
    {
      try
      {
        EbMSBaseMessage msg = (EbMSBaseMessage)message.getPayload();
        MessageHeader messageHeader = msg.getMessageHeader();

        String refToMessageId = messageHeader.getMessageData().getRefToMessageId();
        if (!StringUtils.isEmpty(refToMessageId))
          //FIXME refToMessageId does not have to refer to another message or to an Acknowledgment or ErrorMessage
          if (!ebMSDAO.existsMessage(refToMessageId))
          {
            message.setProperty(Constants.EBMS_ERROR,EbMSMessageUtils.createError("//Header/MessageHeader/MessageData/RefToMessageId",Constants.EbMSErrorCode.VALUE_NOT_RECOGNIZED.errorCode(),"Value not found."));
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.ebxml.MessageHeader

    }

    private boolean isSigned(Document document) throws XPathExpressionException, ParserConfigurationException, SAXException, IOException, JAXBException, DAOException
    {
      Node n = (Node)XMLUtils.executeXPathQuery(new EbXMLNamespaceContext(),document,"/soap:Envelope/soap:Header/ebxml:MessageHeader",XPathConstants.NODE);
      MessageHeader messageHeader = XMLMessageBuilder.getInstance(MessageHeader.class).handle(n);
      CollaborationProtocolAgreement cpa = ebMSDAO.getCPA(messageHeader.getCPAId());
      PartyInfo partyInfo = CPAUtils.getPartyInfo(cpa,messageHeader.getFrom().getPartyId());
      List<DeliveryChannel> channels = CPAUtils.getDeliveryChannels(partyInfo,messageHeader.getFrom().getRole(),messageHeader.getService(),messageHeader.getAction());
      return CPAUtils.isSigned(channels.get(0));
    }
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.ebxml.MessageHeader

    String uuid = UUID.getUUID();
    PartyInfo sendingPartyInfo = CPAUtils.getSendingPartyInfo(cpa,context.getFromRole(),context.getServiceType(),context.getService(),context.getAction());
    PartyInfo receivingPartyInfo = CPAUtils.getReceivingPartyInfo(cpa,context.getToRole(),context.getServiceType(),context.getService(),context.getAction());
    //PartyInfo receivingPartyInfo = CPAUtils.getOtherReceivingPartyInfo(cpa,context.getFromRole(),context.getServiceType(),context.getService(),context.getAction());

    MessageHeader messageHeader = new MessageHeader();

    messageHeader.setVersion(Constants.EBMS_VERSION);
    messageHeader.setMustUnderstand(true);

    messageHeader.setCPAId(cpa.getCpaid());
    messageHeader.setConversationId(context.getConversationId() != null ? context.getConversationId() : uuid);
   
    messageHeader.setFrom(new From());
    PartyId from = new PartyId();
    from.setType(sendingPartyInfo.getPartyId().get(0).getType());
    from.setValue(sendingPartyInfo.getPartyId().get(0).getValue());
    messageHeader.getFrom().getPartyId().add(from);
    messageHeader.getFrom().setRole(sendingPartyInfo.getCollaborationRole().get(0).getRole().getName());

    messageHeader.setTo(new To());
    PartyId to = new PartyId();
    to.setType(receivingPartyInfo.getPartyId().get(0).getType());
    to.setValue(receivingPartyInfo.getPartyId().get(0).getValue());
    messageHeader.getTo().getPartyId().add(to);
    messageHeader.getTo().setRole(receivingPartyInfo.getCollaborationRole().get(0).getRole().getName());
   
    messageHeader.setService(new Service());
    messageHeader.getService().setType(sendingPartyInfo.getCollaborationRole().get(0).getServiceBinding().getService().getType());
    messageHeader.getService().setValue(sendingPartyInfo.getCollaborationRole().get(0).getServiceBinding().getService().getValue());
    messageHeader.setAction(sendingPartyInfo.getCollaborationRole().get(0).getServiceBinding().getCanSend().get(0).getThisPartyActionBinding().getAction());

    messageHeader.setMessageData(new MessageData());
    messageHeader.getMessageData().setMessageId(uuid + "@" + hostname);
    messageHeader.getMessageData().setRefToMessageId(context.getRefToMessageId());
    messageHeader.getMessageData().setTimestamp(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()));

    ReliableMessaging rm = CPAUtils.getReliableMessaging(cpa,messageHeader);
    if (rm != null)
    {
      GregorianCalendar timestamp = messageHeader.getMessageData().getTimestamp().toGregorianCalendar();
      Duration d = rm.getRetryInterval().multiply(rm.getRetries().add(new BigInteger("1")).intValue());
      d.addTo(timestamp);
      timestamp.add(Calendar.SECOND,1);
      messageHeader.getMessageData().setTimeToLive(DatatypeFactory.newInstance().newXMLGregorianCalendar(timestamp));
    }

    DeliveryChannel channel = CPAUtils.getDeliveryChannel(sendingPartyInfo.getCollaborationRole().get(0).getServiceBinding().getCanSend().get(0).getThisPartyActionBinding());

    messageHeader.setDuplicateElimination(PerMessageCharacteristicsType.ALWAYS.equals(channel.getMessagingCharacteristics().getDuplicateElimination()) ? "" : null);
   
    return messageHeader;
  }
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.ebxml.MessageHeader

    return pong;
  }

  public static EbMSStatusResponse ebMSStatusRequestToEbMSStatusResponse(EbMSStatusRequest request, String hostname, EbMSMessageStatus status, GregorianCalendar timestamp) throws DatatypeConfigurationException
  {
    MessageHeader messageHeader = createMessageHeader(request.getMessageHeader(),hostname,new GregorianCalendar(),EbMSMessageType.STATUS_RESPONSE.action());
    StatusResponse statusResponse = createStatusResponse(request.getStatusRequest(),status,timestamp);
    EbMSStatusResponse response = new EbMSStatusResponse(messageHeader,statusResponse);
    return response;
  }
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.ebxml.MessageHeader

    return response;
  }

  public static EbMSMessage ebMSMessageContentToEbMSMessage(CollaborationProtocolAgreement cpa, EbMSMessageContent content, String hostname) throws DatatypeConfigurationException
  {
    MessageHeader messageHeader = createMessageHeader(cpa,content.getContext(),hostname);

    AckRequested ackRequested = createAckRequested(cpa,content.getContext());
   
    Manifest manifest = createManifest();
    for (int i = 0; i < content.getAttachments().size(); i++)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.