Package org.jboss.system.server.profileservice.repository.clustered.metadata

Examples of org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryItemMetadata


      mods.setPreapprovedAddParent(null);
     
      Boolean allow = null;

      // See if this removal is prerejected as part of removing a higher level tree
      RepositoryItemMetadata prerejected = mods.getPrerejectedRemoveParent();
      if (prerejected != null)
      {
         if (item.isChildOf(prerejected))
         {
            allow = Boolean.FALSE;
         }
         else
         {
            // Clean up
            mods.setPrerejectedRemoveParent(null);
         }
      }
      else
      {
         // Removal wasn't prerejected. See if it was preapproved as part
         // of approving removing a higher level tree
         ContentModification preapprovedRemove = mods.peekPreapprovedRemoveParent();
         while (preapprovedRemove != null)
         {
            if (item.isChildOf(preapprovedRemove.getItem()))
            {
               // approved
               allow = Boolean.TRUE;
               break;
            }
            else
            {
               // We're done with children of preapproved parent so add the cached
               // modification to the overall list. This will cause it to
               // get executed *after* its children
               // (i.e. remove parent after removing children)
               mods.addModification(mods.popPreapprovedRemoveParent());
               // Start checking grandparent
               preapprovedRemove = mods.peekPreapprovedRemoveParent();
            }
         }
      }
     
      if (allow == null)
      {
         // Check with our policy
        
         if (merge)
         {
            allow = Boolean.valueOf(policy.acceptMergeRemoval(item, null));
         }
         else
         {           
            // See if the base version of the remote node was aware of the
            // item being removed
            RepositoryItemMetadata baseRemoteItem = getBaseRemoteItem(rootName, item);           
            allow = Boolean.valueOf(policy.acceptJoinRemoval(item, baseRemoteItem));        
         }
      }
     
      if (allow)
View Full Code Here


      return allow;
   }
  
   private RepositoryItemMetadata getBaseRemoteItem(String rootName, RepositoryItemMetadata item)
   {
      RepositoryItemMetadata existingItem = null;
      if (baseRemoteContent != null)
      {
         RepositoryRootMetadata existingRoot = baseRemoteContent.getRepositoryRootMetadata(rootName);
         if (existingRoot != null)
         {
View Full Code Here

         }
         else
         {
            // See if the base version of the remote node was aware of the
            // item being added
            RepositoryItemMetadata baseRemoteItem = getBaseRemoteItem(rootName, item);
            allow = Boolean.valueOf(policy.acceptJoinAddition(item, baseRemoteItem));
         }        
      }
      else
      {
View Full Code Here

   protected abstract void doRollbackFromComplete();  
   protected abstract void doRollbackFromPrepared();
  
   protected static RepositoryItemMetadata getMarkedRemovedItem(ContentModification base)
   {
      RepositoryItemMetadata result = base.getItem();
      if (result.isRemoved() == false)
      {
         result = new RepositoryItemMetadata(result);
         result.setRemoved(true);
      }
     
      return result;
   }
View Full Code Here

      }
   }
  
   protected static RepositoryItemMetadata getMarkedRemovedItem(RepositoryItemMetadata base)
   {
      RepositoryItemMetadata result = base;
      if (result.isRemoved() == false)
      {
         result = new RepositoryItemMetadata(result);
         result.setRemoved(true);
      }
     
      return result;
   }
View Full Code Here

      // don't want to add/remove a directory and then later do something
      // inconsistent with a child. For stuff involving a removal we use
      // a Stack<RepositoryContentModification> so we can add the root removal
      // to the overall list of mods *after* all the children. This is needed
      // to allow the removal to be rolled back.
      RepositoryItemMetadata preapprovedAddParent = null;
      Stack<ContentModification> preapprovedRemoveParent = new Stack<ContentModification>();
      Stack<ContentModification> prerejectedAddParent = new Stack<ContentModification>();
      RepositoryItemMetadata prerejectedRemoveParent = null;
     
      for(int first = 0; first < items.length; first++)
      {
         GeneratedModifications pairmod = new GeneratedModifications(preapprovedAddParent, preapprovedRemoveParent, prerejectedAddParent, prerejectedRemoveParent);
        
View Full Code Here

      return result;     
   }

   public RepositoryItemMetadata addDeploymentContent(String vfsPath, InputStream contentIS) throws IOException
   {
      RepositoryItemMetadata item = this.contentManager.getItemForAddition(vfsPath);
      RepositoryContentMetadata updated = this.contentManager.getContentMetadataForAdd(item, contentIS);
      RepositoryContentMetadata official = this.contentManager.getOfficialContentMetadata();
      LocalContentModificationGenerator generator = new LocalContentModificationGenerator();
      List<ContentModification> modifications;
      try
      {
         modifications = generator.getModificationList(official, updated);
      }
      catch (InconsistentRepositoryStructureException e)
      {
         throw new IllegalStateException("Incompatible structure change", e);
      }
     
      installModifications(modifications, updated);
     
      official = this.contentManager.getOfficialContentMetadata();
      RepositoryRootMetadata rrmd = official.getRepositoryRootMetadata(item.getRootName());
      return rrmd.getItemMetadata(item.getRelativePathElements());
   }
View Full Code Here

         }
         this.id = id;
         this.localActions = localActions;
         for (SynchronizationAction<?> action : localActions)
         {
            RepositoryItemMetadata item = action.getRepositoryContentModification().getItem();
            if (action instanceof SynchronizationInitiationAction<?>)
            {
               initiationActionsByItem.put(item, (SynchronizationInitiationAction<?>) action);
            }
            else if (action instanceof SynchronizationReadAction<?>)
View Full Code Here

TOP

Related Classes of org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryItemMetadata

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.