Package nexj.core.meta

Examples of nexj.core.meta.MetadataValidationException


   {
      if (warnings != null)
      {
         if (!XMLUtil.isValidName(m_sNodeName))
         {
            MetadataValidationException e = new MetadataValidationException("err.meta.integraiton.xml.invalidNodeName",
               new Object[]{m_sNodeName, part.getFullPath()});

            setProperties(e, part);
            warnings.addException(e);
         }
View Full Code Here


         {
            m_viewScript.validate(m_schema, this, null);
         }
         catch (UncheckedException e)
         {
            MetadataValidationException x = new MetadataValidationException(e);

            setProperties(x);

            throw x;
         }
View Full Code Here

                     m_metadata.setCoreVersion(info.metadata.getCoreVersion());
                  }

                  if (info.ref == null)
                  {
                     throw new MetadataValidationException("err.meta.mixinNamespace", new Object[]{info.metadata.getName(), sNamespace});
                  }

                  String sVersion = info.ref.getVersion();
                  String sChecksum = info.ref.getChecksum();

                  // validate that repository matches mixin declaration
                  if ((sVersion != null && !sVersion.equals(info.metadata.getVersion()))
                     || (sChecksum != null && !sChecksum.equals(info.metadata.getChecksum())))
                  {
                     throw new MetadataValidationException("err.meta.mixinLinkVersion", new Object[]{
                        info.metadata.getName(),
                        info.metadata.getVersion(),
                        info.metadata.getChecksum(),
                        sVersion,
                        sChecksum,
                        getMetadataName(info.parentNamespace)
                     });
                  }
               }
            }

            public void handleMixinReference(XMLMixin ref, XMLMixin parent)
            {
               String sParentNamespace = parent.getNamespace();
               String sNamespace = ref.getNamespace();
               String sVersion = ref.getVersion();
               String sChecksum = ref.getChecksum();
               MetadataInfo info = (MetadataInfo)m_metadataMap.get(sNamespace);

               if (info == null)
               {
                  info = new MetadataInfo();
                  info.parentNamespace = sParentNamespace;
                  info.ref = (XMLMixin)ref.clone();
                  m_metadataMap.put(sNamespace, info);

                  // mixin declared at top-level is also base
                  if (sParentNamespace.equals(m_metadata.getNamespace()) && sNamespace.equals(m_metadata.getBaseNamespace()))
                  {
                     m_helper.addException(new MetadataValidationException("err.meta.mixinDup",
                        new Object[] {sNamespace, getMetadataName(sParentNamespace)}));
                  }

                  // mixin matches base, but has different version/checksum
                  if (sNamespace.equals(m_metadata.getBaseNamespace()) &&
                     (!sVersion.equals(m_metadata.getBaseVersion()) || !sChecksum.equals(m_metadata.getBaseChecksum())))
                  {
                     m_helper.addException(new MetadataValidationException("err.meta.mixinBaseVersion",
                        new Object[]{sNamespace, sVersion, sChecksum, m_metadata.getBaseVersion(), m_metadata.getBaseChecksum()}));
                  }
               }
               else if (info.ref != null)
               {
                  if (sParentNamespace.equals(info.parentNamespace))
                  {
                     // mixin declared twice in same repository
                     m_helper.addException(new MetadataValidationException("err.meta.mixinDup",
                        new Object[] {sNamespace, getMetadataName(sParentNamespace)}));
                  }

                  // mixin declared more than once with different version/checksum
                  if ((info.ref.getVersion() != null && !info.ref.getVersion().equals(sVersion)) ||
                     (info.ref.getChecksum() != null && !info.ref.getChecksum().equals(sChecksum)))
                  {
                     m_helper.addException(new MetadataValidationException("err.meta.mixinVersion", new Object[] {
                        sNamespace,
                        sVersion,
                        sChecksum,
                        getMetadataName(sParentNamespace),
                        info.ref.getVersion(),
                        info.ref.getChecksum(),
                        getMetadataName(info.parentNamespace)
                     }));
                  }
               }
            }

            public void handleMixinOverrideConflict(XMLMixin ref, XMLMixin mixin)
            {
               throw new MetadataValidationException("err.meta.mixinOverride", new Object[]{ref.getName(), mixin.getName()});
            }

            public void handleCircularReference(XMLMixin mixin)
            {
               throw new MetadataValidationException("err.meta.mixinCycle", new Object[]{mixin.getName()});
            }

            public void handleResourceConflict(XMLResource first, XMLResource second)
            {
               m_helper.addException(new MetadataValidationException("err.meta.mixinConflict",
                  new Object[]{
                     first.getName(),
                     getMetadataName(first.getNamespace()),
                     getMetadataName(second.getNamespace())
                  }));
View Full Code Here

            }
         }
      }
      catch (UncheckedException e)
      {
         MetadataValidationException x = new MetadataValidationException(e);
         getHelper().setMarker(x);
         throw x;
      }
      finally
      {
View Full Code Here

                           frag.setFirst(false);
                           aliasFragmentMap.put(frag.getAlias(), oldFrag);

                           if (!frag.isCompatible(oldFrag))
                           {
                              throw new MetadataValidationException("err.meta.persistence.fragmentPropertyMismatch",
                                 new Object[]{frag.getDataSource().getName() + frag.getSuffix(), oldFrag.getDataSource().getName() + oldFrag.getSuffix()});
                           }
                        }
                     }
                  }
View Full Code Here

         {
            getStatement(i).validate(schema, table);
         }
         catch (UncheckedException e)
         {
            MetadataValidationException x = new MetadataValidationException(e);

            x.setProperty("sql", String.valueOf(i));
            setProperties(x);
            eh = addException(eh, x);
         }
      }
View Full Code Here

                        queue.setFirst(false);
                        aliasQueueMap.put(queue.getAlias(), oldQueue);

                        if (!ObjUtil.equal(queue.getDestination(), oldQueue.getDestination()))
                        {
                           throw new MetadataValidationException("err.meta.integration.mq.destinationMismatch",
                              new Object[]{queue.getName(), oldQueue.getName(), queue.getAlias()});
                        }

                        if (queue.isBroadcast() != oldQueue.isBroadcast())
                        {
                           throw new MetadataValidationException("err.meta.integration.mq.broadcastMismatch",
                              new Object[]{queue.getName(), oldQueue.getName(), queue.getAlias()});
                        }
                     }
                  }
               }
View Full Code Here

         {
            getScript(i).validate(schema, table, adapterArray);
         }
         catch (UncheckedException e)
         {
            MetadataValidationException x = new MetadataValidationException(e);

            x.setProperty("sql", String.valueOf(i));
            setProperties(x);
            eh = addException(eh, x);
         }
      }
View Full Code Here

                     else
                     {
                        mailChannel.setFirst(false);
                        aliasMailMap.put(mailChannel.getAlias(), oldMailChannel);

                        MetadataValidationException e = new MetadataValidationException(
                           "err.meta.mail.duplicateAlias", new Object[]{mailChannel.getName(), oldMailChannel.getName()});

                        mailChannel.setProperties(e);

                        if (loader.getHelper().getWarnings() != null)
View Full Code Here

      MetadataCompoundValidationException eh = null;

      // check for duplicate starting point for definition of adapter support
      if (state.containsAdapter(m_adapter))
      {
         MetadataValidationException e = new MetadataValidationException(
            "err.meta.upgrade.sql.adapterDuplicateStart", new Object[]{m_adapter.getName()});

         setProperties(e);
         eh = addException(eh, e);
      }
View Full Code Here

TOP

Related Classes of nexj.core.meta.MetadataValidationException

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.