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

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


   @Override
   protected void doCommit()
   {
      ContentModification mod = getRepositoryContentModification();
      RepositoryContentMetadata contentMetadata = getContext().getInProgressMetadata();
      RepositoryRootMetadata rmd = contentMetadata.getRepositoryRootMetadata(mod.getRootName());
      rmd.addItemMetadata(getMarkedRemovedItem(mod));
     
      if (log.isTraceEnabled())
      {
         log.trace("doCommit(): added removal metadata for " + mod.getType() +
View Full Code Here


   @Override
   protected boolean doPrepare()
   {
      boolean ok = false;
      ContentModification mod = getRepositoryContentModification();
      RepositoryContentMetadata toUpdate = getContext().getInProgressMetadata();
      RepositoryRootMetadata rmd = toUpdate.getRepositoryRootMetadata(mod.getRootName());
      if (rmd != null)
      {
         replaced = rmd.getItemMetadata(mod.getItem().getRelativePathElements());
         // BES 2009/04/20 I see no reason not to do this if replaced != null
//         if (replaced == null)
View Full Code Here

   protected void doRollbackFromComplete()
   {
      if (replaced != null)
      {
         ContentModification mod = getRepositoryContentModification();
         RepositoryContentMetadata toUpdate = getContext().getInProgressMetadata();
         RepositoryRootMetadata rmd = toUpdate.getRepositoryRootMetadata(mod.getRootName());
         if (rmd != null)
         {
            rmd.addItemMetadata(replaced);
         }        
      }     
View Full Code Here

   @Override
   protected void doRollbackFromPrepared()
   {
      ContentModification mod = getRepositoryContentModification();
      RepositoryContentMetadata toUpdate = getContext().getInProgressMetadata();
      RepositoryRootMetadata rmd = toUpdate.getRepositoryRootMetadata(mod.getRootName());
      if (rmd != null)
      {
         rmd.removeItemMetadata(mod.getItem().getRelativePathElements());
      }  
   }
View Full Code Here

   public RepositoryContentMetadata synchronizeContent(boolean pullFromCluster)
         throws InconsistentRepositoryStructureException, IOException
   {
      List<ContentModification> modifications = null;
      RepositoryContentMetadata localCurrentContent = this.contentManager.getCurrentContentMetadata();
           
      if (pullFromCluster)
      {
         // Normal join case
         modifications = getModificationsFromCluster(localCurrentContent);
      }
      else if (!inSync)
      {
         // Merge case
         modifications = getModificationsFromCluster(null);        
      }
      else
      {
         // Periodic scan case
         modifications = getLocalModifications(localCurrentContent);
      }
     
      if (modifications != null)
      {
         installModifications(modifications, localCurrentContent);
      }
      else
      {
         // No one else out there. Install the localCurrentContent as official.
         this.contentManager.installCurrentContentMetadata();
      }
     
      RepositoryContentMetadata result = this.contentManager.getOfficialContentMetadata();
      inSync = true;
      return result;     
   }
View Full Code Here

   }

   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

      return rrmd.getItemMetadata(item.getRelativePathElements());
   }

   public void removeDeploymentContent(VirtualFile vf) throws Exception
   {
      RepositoryContentMetadata updated = this.contentManager.getContentMetadataForRemove(vf);
      RepositoryContentMetadata official = this.contentManager.getOfficialContentMetadata();
      LocalContentModificationGenerator generator = new LocalContentModificationGenerator();
      List<ContentModification> modifications;
      try
      {
         modifications = generator.getModificationList(official, updated);
View Full Code Here

   private List<ContentModification> getModificationsFromCluster(RepositoryContentMetadata localCurrentContent)
         throws IOException, InconsistentRepositoryStructureException
   {
      List<ContentModification> modifications = null;
     
      RepositoryContentMetadata localBaseMetadata = this.contentManager.getOfficialContentMetadata();
      if (localBaseMetadata == null)
      {
         localBaseMetadata = this.contentManager.createEmptyContentMetadata();
      }
     
View Full Code Here

      return modifications;
   }

   private List<ContentModification> getLocalModifications(RepositoryContentMetadata localCurrentContent)
   {
      RepositoryContentMetadata official = this.contentManager.getOfficialContentMetadata();
      LocalContentModificationGenerator generator = new LocalContentModificationGenerator();
      try
      {
         return generator.getModificationList(official, localCurrentContent);
      }
View Full Code Here

         {
            throw new NotSynchronizedException();        
         }
        
         // Create the metadata we'll install when we are done
         RepositoryContentMetadata toInstall = new RepositoryContentMetadata(contentManager.getOfficialContentMetadata());
        
         handleInitiateSynchronization(id, modifications, toInstall);
      }     
View Full Code Here

TOP

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

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.