Package org.exoplatform.services.jcr.ext.initializer

Examples of org.exoplatform.services.jcr.ext.initializer.RemoteWorkspaceInitializationException


   {
      RemoteHttpClient client = new RemoteHttpClient(sourceUrl);
      String result = client.execute(repositoryName, workspaceName, id);

      if (result.startsWith("FAIL"))
         throw new RemoteWorkspaceInitializationException("Can not getting the remote workspace data : " + result);

      try
      {
         latch.await();
      }
      catch (InterruptedException e)
      {
         throw new RemoteWorkspaceInitializationException("The interapted : " + e.getMessage(), e);
      }

      if (remoteReceiver.getException() != null)
         throw new RemoteWorkspaceInitializationException("Can not getting the remote workspace data : "
            + remoteReceiver.getException().getMessage(), remoteReceiver.getException());

      try
      {
         remoteReceiver.getContext().getChangesFile().validate();
      }
      catch (InvalidChecksumException e)
      {
         new RemoteWorkspaceInitializationException("Can not getting the remote workspace data : " + e.getMessage(), e);
      }

      String filePath = remoteReceiver.getContext().getChangesFile().toString();

      return new File(filePath);
View Full Code Here


      {
         channelManager.connect();
      }
      catch (ReplicationException e)
      {
         throw new RemoteWorkspaceInitializationException("Can not  initialize the transport : " + e.getMessage(), e);
      }
   }
View Full Code Here

   public void sendWorkspaceData(File workspaceData) throws RemoteWorkspaceInitializationException,
      NoMemberToSendException
   {

      if (!PrivilegedFileHelper.exists(workspaceData))
         throw new RemoteWorkspaceInitializationException("The file with workspace data not exists.");

      byte[] crc;
      try
      {
         crc = getCheckSum(workspaceData);

         try
         {
            if (channelManager.getOtherMembers().size() == 0)
               throw new NoMemberToSendException("No member to sent, member list : "
                  + channelManager.getOtherMembers().size());

            remoteTransmitter.sendChangesLogFile(channelManager.getOtherMembers().get(0), workspaceData, crc);
         }
         catch (IOException e)
         {
            throw new RemoteWorkspaceInitializationException(
               "Can not send the workspace data file : " + e.getMessage(), e);
         }
      }
      catch (NoSuchAlgorithmException e)
      {
         throw new RemoteWorkspaceInitializationException("Can not calculate the checksum for workspace data file : "
            + e.getMessage(), e);
      }
      catch (IOException e)
      {
         throw new RemoteWorkspaceInitializationException("Can not calculate the checksum for workspace data file : "
            + e.getMessage(), e);
      }

   }
View Full Code Here

            new InitializationErrorPacket(InitializationErrorPacket.INITIALIZATION_ERROR_PACKET, message);
         channelManager.sendPacket(packet, channelManager.getOtherMembers().get(0));
      }
      catch (IOException e)
      {
         throw new RemoteWorkspaceInitializationException("Cannot send export data " + e.getMessage(), e);
      }
   }
View Full Code Here

            }
            catch (IOException e)
            {
               log.error("Cannot save workspace data changes", e);
               exception = new RemoteWorkspaceInitializationException("Cannot save workspace data changes", e);
               latch.countDown();
            }
            break;

         case InitializationErrorPacket.INITIALIZATION_ERROR_PACKET :
            InitializationErrorPacket ePacket = (InitializationErrorPacket)packet;
            exception = new RemoteWorkspaceInitializationException(ePacket.getErrorMessage());
            latch.countDown();
            break;

         default :
            break;
View Full Code Here

    */
   public void onStateChanged(StateEvent event)
   {
      if (membrerInited == 2 && event.getMembers().size() == 1 && (context == null || !context.isFinished()))
      {
         exception = new RemoteWorkspaceInitializationException("The remote member was disconected");
         latch.countDown();
      }
      else
         membrerInited = event.getMembers().size();
   }
View Full Code Here

         URL url = new URL(complURL);

         String userInfo = url.getUserInfo();
         if (userInfo == null || userInfo.split(":").length != 2)
            throw new RemoteWorkspaceInitializationException(
               "Fail remote initializetion : the user name or password not not specified : " + dataSourceUrl);

         String userName = userInfo.split(":")[0];
         String password = userInfo.split(":")[1];

         HTTPConnection connection = new HTTPConnection(url);
         connection.removeModule(CookieModule.class);

         String realmName = getRealm(complURL);
         connection.addBasicAuthorization(realmName, userName, password);

         HTTPResponse resp = connection.Get(url.getFile());

         result = resp.getText();

         AuthorizationInfo.removeAuthorization(url.getHost(), url.getPort(), "Basic", realmName);

         if (resp.getStatusCode() != HTTP_OK)
            throw new RemoteWorkspaceInitializationException("Fail remote initializetion : " + result);

      }
      catch (ModuleException e)
      {
         throw new RemoteWorkspaceInitializationException(e.getMessage(), e);
      }
      catch (ParseException e)
      {
         throw new RemoteWorkspaceInitializationException(e.getMessage(), e);
      }
      catch (IOException e)
      {
         throw new RemoteWorkspaceInitializationException(e.getMessage(), e);
      }

      return result;
   }
View Full Code Here

   {
      RemoteHttpClient client = new RemoteHttpClient(sourceUrl);
      String result = client.execute(repositoryName, workspaceName, id);

      if (result.startsWith("FAIL"))
         throw new RemoteWorkspaceInitializationException("Can not getting the remote workspace data : " + result);

      try
      {
         latch.await();
      }
      catch (InterruptedException e)
      {
         throw new RemoteWorkspaceInitializationException("The interapted : " + e.getMessage(), e);
      }

      if (remoteReceiver.getException() != null)
         throw new RemoteWorkspaceInitializationException("Can not getting the remote workspace data : "
            + remoteReceiver.getException().getMessage(), remoteReceiver.getException());

      try
      {
         remoteReceiver.getContext().getChangesFile().validate();
      }
      catch (InvalidChecksumException e)
      {
         new RemoteWorkspaceInitializationException("Can not getting the remote workspace data : " + e.getMessage(), e);
      }

      String filePath = remoteReceiver.getContext().getChangesFile().toString();

      return new File(filePath);
View Full Code Here

      {
         channelManager.connect();
      }
      catch (ReplicationException e)
      {
         throw new RemoteWorkspaceInitializationException("Can not  initialize the transport : " + e.getMessage(), e);
      }
   }
View Full Code Here

   public void sendWorkspaceData(File workspaceData) throws RemoteWorkspaceInitializationException,
      NoMemberToSendException
   {

      if (!workspaceData.exists())
         throw new RemoteWorkspaceInitializationException("The file with workspace data not exists.");

      byte[] crc;
      try
      {
         crc = getCheckSum(workspaceData);

         try
         {
            if (channelManager.getOtherMembers().size() == 0)
               throw new NoMemberToSendException("No member to sent, member list : "
                  + channelManager.getOtherMembers().size());

            remoteTransmitter.sendChangesLogFile(channelManager.getOtherMembers().get(0), workspaceData, crc);
         }
         catch (IOException e)
         {
            throw new RemoteWorkspaceInitializationException(
               "Can not send the workspace data file : " + e.getMessage(), e);
         }
      }
      catch (NoSuchAlgorithmException e)
      {
         throw new RemoteWorkspaceInitializationException("Can not calculate the checksum for workspace data file : "
            + e.getMessage(), e);
      }
      catch (IOException e)
      {
         throw new RemoteWorkspaceInitializationException("Can not calculate the checksum for workspace data file : "
            + e.getMessage(), e);
      }

   }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.ext.initializer.RemoteWorkspaceInitializationException

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.