Package nexj.core.meta.integration

Examples of nexj.core.meta.integration.CompositeMessagePart


      CSVMessagePartMapping parentMapping = null;
      Element mappingElement = XMLUtil.findChildElement(element, CSV_XML_TAG_NAME);

      //Compute current level
      int nThisLevel;
      CompositeMessagePart parentPart = part.getParent();

      if (parentPart == null)
      {
         nThisLevel = 0;
      }
      else
      {
         //Require sequential aggregation mode
         if (parentPart.getAggregation() != CompositeMessagePart.SEQUENTIAL)
         {
            throw new MetadataException("err.meta.integration.nonSequentialAggregation",
               new Object[]{CSV_XML_TAG_NAME, msg.getName()});
         }

         parentMapping = (CSVMessagePartMapping)parentPart.getMapping();
         nThisLevel = parentMapping.getLevel() + 1;
      }

      //Mapping is required on root element
      if (nThisLevel <= 0)
View Full Code Here


      if (m_envelopeHeaderMap != null)
      {
         m_envelopeHeaderMap.clear();
      }

      CompositeMessagePart rootPart = message.getRoot();
      CompositeType type = createCompositeType(rootPart, message);
      String sName = ((XMLMessagePartMapping)rootPart.getMapping()).getNodeName();
      Element msgElement = (Element)type.getSchema().findItem(sName, SchemaItem.ELEMENT);

      if (msgElement == null)
      {
         msgElement = new Element(sName);
View Full Code Here

            CompositeType childType;
            Element childElement;

            if (child instanceof CompositeMessagePartRef)
            {
               CompositeMessagePart referentPart = ((CompositeMessagePartRef)child).getRefPart();
               Message referentMessage = ((RootXMLMessagePartMapping)referentPart.getMapping()).getRootMessage();

               childType = createCompositeType(referentPart, referentMessage);
               childElement = new Element(childMapping.getNodeName());
               childElement.setType(childType);
               childElement.setDescription(child.getDescription());
View Full Code Here

            type.setAggregation(CompositeType.AGGREGATION_CHOICE);

            for (Iterator itr = iface.getRequestTable().getMessageIterator(); itr.hasNext(); )
            {
               Message msg = (Message)itr.next();
               CompositeMessagePart rootPart = msg.getRoot();
               XMLMessagePartMapping rootPartMapping = (XMLMessagePartMapping)rootPart.getMapping();

               if (rootPartMapping.getNamespace() != null)
               {
                  CompositeType childType = createCompositeType(rootPart, msg);
                  Element child = new Element(rootPartMapping.getNodeName());
View Full Code Here

    */
   public void finish(MessagePart part)
   {
      if (m_nLevel == 0)
      {
         CompositeMessagePart rootPart = (CompositeMessagePartInstance)m_messagePart;
         FixedMessagePartMapping rootMapping = (FixedMessagePartMapping)rootPart.getMapping();

         if (rootMapping != null && rootMapping.getSuffix().length() > 0)
         {
            throw new MetadataException("err.meta.integration.fixed.suffixNotAllowedOnRoot",
               new Object[]{part.getFullPath()});
         }

         // call finish() on the records part
         MessagePart recordsPart = rootPart.getPart(0);
         MessagePartMapping recordsMapping = recordsPart.getMapping();

         if (recordsMapping != null)
         {
            recordsMapping.finish(recordsPart);
         }
      }
      else if (m_nLevel == 1)
      {
         //The second level should have a CompositeMessagePart of 0..* cardinality
         if (!part.isCollection())
         {
            throw new MetadataException("err.meta.integration.fixed.mustHaveTopLevelCollection",
               new Object[]{part.getFullPath()});
         }

         // Call finish() for child mappings
         CompositeMessagePart recordPart = (CompositeMessagePartInstance)m_messagePart;
         for (int i=0; i < recordPart.getPartCount(); i++)
         {
            MessagePart fieldPart = recordPart.getPart(i);
            MessagePartMapping fieldMapping = fieldPart.getMapping();

            fieldMapping.finish(fieldPart);
         }

         createRecordTemplate();
      }
      else
      {
         // Beyond second level, no collections allowed
         if (part.isCollection())
         {
            throw new MetadataException("err.meta.integration.fixed.noNestedCollections",
               new Object[]{part.getFullPath()});
         }

         // fields add their width to the record width
         if (m_messagePart != null && m_messagePart instanceof PrimitiveMessagePart)
         {
            MessagePart recordPart = m_messagePart.getParent();
            FixedMessagePartMapping recordMapping = (FixedMessagePartMapping)recordPart.getMapping();

            recordMapping.addToRecordWidth(m_nWidth);
         }
      }
   }
View Full Code Here

   /**
    * @return a newly instantiated and populated character template.
    */
   private void createRecordTemplate() throws IntegrationException
   {
      CompositeMessagePart recordPart = (CompositeMessagePart)m_messagePart;

      m_chTemplate = new char[m_nWidth];

      int nOffset = 0;

      for (int i = 0; i < recordPart.getPartCount(); i++)
      {
         PrimitiveMessagePart fieldPart = (PrimitiveMessagePart)recordPart.getPart(i);
         FixedMessagePartMapping mapping = (FixedMessagePartMapping)fieldPart.getMapping();

         String sToken = mapping.getPrefix();
         int nTokenLen = sToken.length();

View Full Code Here

   {
      FixedMessagePartMapping parentMapping = null;
      Element mappingElement = XMLUtil.findChildElement(element, FIXED_XML_TAG_NAME);

      //Compute current level
      CompositeMessagePart parentPart = part.getParent();
      int nThisLevel;

      if (parentPart == null)
      {
         nThisLevel = 0;
      }
      else
      {
         //Require sequential aggregation mode
         if (parentPart.getAggregation() != CompositeMessagePart.SEQUENTIAL)
         {
            throw new MetadataException("err.meta.integration.nonSequentialAggregation",
               new Object[]{FIXED_XML_TAG_NAME, msg.getName()});
         }

         parentMapping = (FixedMessagePartMapping)parentPart.getMapping();
         nThisLevel = parentMapping.getLevel() + 1;
      }

      final FixedMessagePartMapping mapping = new FixedMessagePartMapping();
View Full Code Here

TOP

Related Classes of nexj.core.meta.integration.CompositeMessagePart

Copyright © 2018 www.massapicom. 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.