Package nexj.core.meta.integration

Examples of nexj.core.meta.integration.CompositeMessagePart


      int nDiffLen = Pair.length(associationPath) - Pair.length(oldPath);
      Pair longerPath = (nDiffLen > 0) ? associationPath : oldPath;

      if (nDiffLen != 0)
      {
         CompositeMessagePart rootPart = ((CompositeMessagePart)longerPath.getHead()).getRoot();

         for (int i = Math.abs(nDiffLen); i > 1; i--, longerPath = longerPath.getNext()) ;

         CompositeMessagePart recursivePart = (CompositeMessagePart)longerPath.getHead();

         if (recursivePart instanceof CompositeMessagePartRef)
         {
            CompositeMessagePart refPart = ((CompositeMessagePartRef)recursivePart).getRefPart();

            if (refPart != rootPart)
            {
               return null;
            }
View Full Code Here


      {
         MessagePart msgPart = composite.getPart(i);

         if (msgPart instanceof CompositeMessagePart)
         {
            CompositeMessagePart part = (CompositeMessagePart)msgPart;
            ObjectMessagePartMapping partMapping = (ObjectMessagePartMapping)part.getMapping();

            if (partMapping.getAssociationCode() != null)
            {
               Pair associationPath = new Pair(part);
               CompositeMessagePart rootPart = part.getRoot();

               for (MessagePart parentMsgPart = part.getParent(); parentMsgPart != null; parentMsgPart = parentMsgPart.getParent())
               {
                  ObjectMessagePartMapping parentMsgPartMapping = (ObjectMessagePartMapping)parentMsgPart.getMapping();
                  boolean bRoot = (parentMsgPart == rootPart);
View Full Code Here

    * @see nexj.core.meta.integration.MessagePartMapping#refer(CompositeMessagePartRef)
    */
   public void refer(CompositeMessagePartRef ref)
   {
      ObjectMessagePartMapping mapping = (ObjectMessagePartMapping)ref.getRefPart().getMapping();
      CompositeMessagePart rootPart = ref.getRoot();
      ObjectMessagePartMapping rootMapping = (ObjectMessagePartMapping)rootPart.getMapping();

      // Build the dependent message parts map for the root message.
      if (rootMapping != null)
      {
         rootMapping.buildDependentMsgPartsMap(rootPart);
      }

      if (mapping != this)
      {
         if (mapping.m_systemPartArray != null)
         {
            for (int i = 0; i < SYSTEM_ATTRIBUTES.length; ++i)
            {
               MessagePart part = mapping.getSystemPart(i);

               if (part != null)
               {
                  setSystemPart(part);
               }
            }
         }

         // Build the dependent message parts map for the referenced message.
         mapping.buildDependentMsgPartsMap(ref.getRefPart());

         Pair localAssocPath = null;

         // Copy the dependency list from the referenced part to the referee while appending to the association paths.
         for (CompositeMessagePart partToResolve = ref; partToResolve != null; partToResolve = partToResolve.getParent())
         {
            ObjectMessagePartMapping partParentMapping = (ObjectMessagePartMapping)partToResolve.getMapping();

            if (mapping.getDependentMessagePartsCount() > 0)
            {
               for (Lookup.Iterator itr = mapping.getDependentMessagePartsIterator(); itr.hasNext();)
               {
                  CompositeMessagePart part = (CompositeMessagePart)itr.next();
                  boolean bRoot = (partToResolve == rootPart);

                  // skip itself, however add to root even if the delete flag is not set on it
                  if (partToResolve != part && (partParentMapping.isDelete() || bRoot))
                  {
View Full Code Here

         addClassMessage(m_metaclass, m_message);
      }

      if (part instanceof CompositeMessagePartInstance)
      {
         CompositeMessagePart composite = (CompositeMessagePartInstance)part;

         for (int i = 0, nCount = composite.getPartCount(); i < nCount; i++)
         {
            MessagePart child = composite.getPart(i);
            MessagePartMapping mapping = child.getMapping();

            if (mapping != null)
            {
               mapping.finish(child);
            }
         }
      }

      if (part.equals(part.getRoot()) && part instanceof CompositeMessagePart)
      {
         CompositeMessagePart rootComposite = (CompositeMessagePart)part;
         ObjectMessagePartMapping rootMapping = (ObjectMessagePartMapping)rootComposite.getMapping();
         MessagePart syncKeyPart = rootMapping.getSystemPart(ATTR_SYNC_KEY);

         if (syncKeyPart != null)
         {
            for (int i = 0, nCount = rootComposite.getPartCount(); i < nCount; i++)
            {
               MessagePart childPart = rootComposite.getPart(i);

               if (syncKeyPart != childPart)
               {
                  ObjectMessagePartMapping childMapping = (ObjectMessagePartMapping)childPart.getMapping();
View Full Code Here

      if (part instanceof PrimitiveMessagePart)
      {
         return;
      }

      CompositeMessagePart composite = (CompositeMessagePart)part;

      for (int i = composite.getPartCount() - 1; i >= 0; --i)
      {
         MessagePart childPart = composite.getPart(i);
         ObjectMessagePartMapping partMapping = (ObjectMessagePartMapping)childPart.getMapping();

         if (partMapping.getAttribute() != null &&
            partMapping.getAttribute() == m_metaclass.getUpdateAccessAttribute())
         {
            setUpdateAccessPart(childPart);

            break;
         }
      }

      if (composite instanceof CompositeMessagePartInstance)
      {
         for (int i = 0, nSize = composite.getPartCount(); i < nSize; i++)
         {
            MessagePart child = composite.getPart(i);

            ((ObjectMessagePartMapping)child.getMapping()).finish2(child);
         }
      }
   }
View Full Code Here

         // Require a child part with name set
         boolean bFoundNamePart = false;

         if (part instanceof CompositeMessagePart)
         {
            CompositeMessagePart composite = (CompositeMessagePart)part;

            for (int i = 0; i < composite.getPartCount(); i++)
            {
               MessagePart childPart = composite.getPart(i);

               if (((ZipMessagePartMapping)childPart.getMapping()).m_nValue == VALUE_NAME)
               {
                  bFoundNamePart = true;

                  break;
               }
            }
         }

         if (!bFoundNamePart)
         {
            throw new MetadataException("err.meta.integration.zip.missingNameChild",
               new Object[]{part.getFullPath()});
         }
      }
      else if (m_nLevel == 2)
      {
         // Check that the parts here are simple, single-valued
         if (!(part instanceof PrimitiveMessagePart) ||
             ((PrimitiveMessagePart)part).isCollection())
         {
            throw new MetadataException("err.meta.integration.zip.nonPrimitive",
               new Object[]{part.getFullPath()});
         }
      }
      else
      {
         throw new IllegalStateException("Message part depth: " + m_nLevel);
      }

      if (part instanceof CompositeMessagePartInstance)
      {
         CompositeMessagePart composite = (CompositeMessagePartInstance)part;

         for (int i = 0, nCount = composite.getPartCount(); i < nCount; i++)
         {
            MessagePart child = composite.getPart(i);
            MessagePartMapping mapping = child.getMapping();

            if (mapping != null)
            {
               mapping.finish(child);
View Full Code Here

      ZipMessagePartMapping parentMapping = null;
      Element mappingElement = XMLUtil.findChildElement(element, "ZipMapping");

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

      if (parentPart == null)
      {
         nThisLevel = 0;
      }
      else
      {
         parentMapping = (ZipMessagePartMapping)parentPart.getMapping();
         nThisLevel = parentMapping.getLevel() + 1;
      }

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

         {
            throw new MetadataValidationException("err.meta.integration.vcard.invalidQuoting",
               new Object[]{sQuoting, part.getFullPath()});
         }

         CompositeMessagePart parentPart = part.getParent();
         String sWrapping = XMLUtil.getStringAttr(mappingElement, "wrapping");

         if (parentPart != null && sWrapping == null)
         {
            mapping.setWrapping(((VCardMessagePartMapping)parentPart.getMapping()).getWrapping());
         }
         else if ("whitespace".equals(sWrapping))
         {
            mapping.setWrapping(VCardMessagePartMapping.WRAPPING_WHITESPACE);
         }
View Full Code Here

    *
    * @see nexj.core.meta.integration.MessagePartMapping#finish(nexj.core.meta.integration.MessagePart)
    */
   public void finish(MessagePart part)
   {
      CompositeMessagePart parentPart = part.getParent();

      m_sFullName = m_sName;

      if (parentPart != null)
      {
         VCardMessagePartMapping parentMapping = (VCardMessagePartMapping)parentPart.getMapping();

         if (parentMapping.getType() == TYPE_GROUP)
         {
            if (m_nType == TYPE_PARAMETER)
            {
               throw new MetadataException("err.meta.integration.vcard.invalidParameterPlacement",
                  new Object[]{part.getFullPath()});
            }
         }

         if (parentMapping.getName().length() > 0)
         {
            m_sFullName = parentMapping.getFullName() + '.' + m_sName;
         }
      }

      if (part instanceof PrimitiveMessagePart)
      {
         if (m_nType == TYPE_GROUP)
         {
            throw new MetadataException("err.meta.integration.vcard.groupMappedPrimitive",
               new Object[]{part.getFullPath()});
         }
      }
      else if (part instanceof CompositeMessagePart)
      {
         if (m_nType == TYPE_PARAMETER)
         {
            throw new MetadataException("err.meta.integration.vcard.parameterMappedComposite",
               new Object[]{part.getFullPath()});
         }
      }

      if (part instanceof CompositeMessagePartInstance)
      {
         CompositeMessagePart composite = (CompositeMessagePart)part;

         if (m_nType == VCardMessagePartMapping.TYPE_VALUE)
         {
            int nChildCount = composite.getPartCount();

            for (int i = 0; i < nChildCount; i++)
            {
               MessagePart childPart = (MessagePart)composite.getPart(i);
               VCardMessagePartMapping childMapping = (VCardMessagePartMapping)childPart.getMapping();

               if (childMapping.getType() == TYPE_VALUE || childMapping.getType() == TYPE_GROUP)
               {
                  if (m_valuePart != null)
                  {
                     throw new MetadataException("err.meta.integration.vcard.singleValueChildRequired",
                        new Object[]{part.getFullPath()});
                  }

                  m_valuePart = childPart;
               }
            }

            if (m_valuePart == null)
            {
               throw new MetadataException("err.meta.integration.vcard.singleValueChildRequired",
                  new Object[]{part.getFullPath()});
            }
         }

         for (int i = 0, nCount = composite.getPartCount(); i < nCount; i++)
         {
            MessagePart child = composite.getPart(i);
            MessagePartMapping mapping = child.getMapping();

            if (mapping != null)
            {
               mapping.finish(child);
View Full Code Here

   /**
    * @see nexj.core.meta.integration.MessagePartMapping#refer(CompositeMessagePartRef)
    */
   public void refer(CompositeMessagePartRef ref)
   {
      CompositeMessagePart parent = ref.getParent();
      MessagePartMapping mapping = (parent == null) ? null : parent.getMapping();

      if (mapping != null &&
         ((HL7MessagePartMapping)mapping).getLevel() >= ((m_nLevel == LEVEL_GROUP) ? LEVEL_SEGMENT : m_nLevel))
      {
         throw new MetadataException("err.meta.integration.hl7.refLevel", new Object[]{ref.getFullPath()});
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.