protected void createRepositoryInternally(String backupId, RepositoryEntry rEntry, String rToken,
      DBCreationProperties creationProps) throws RepositoryConfigurationException, RepositoryCreationException
   {
      if (rpcService != null)
      {
         String stringRepositoryEntry = null;
         try
         {
            JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
            JsonValue json = generatorImpl.createJsonObject(rEntry);
            stringRepositoryEntry = json.toString();
         }
         catch (JsonException e)
         {
            throw new RepositoryCreationException("Can not serialize repository entry: " + e.getMessage(), e);
         }

         // notify coordinator node to create repository
         try
         {
            Object result =
               rpcService.executeCommandOnCoordinator(createRepository, true, backupId, stringRepositoryEntry, rToken,
                  creationProps);

            if (result != null)
            {
               if (result instanceof Throwable)
               {
                  throw new RepositoryCreationException("Can't create repository " + rEntry.getName(),
                     (Throwable)result);
               }
               else
               {
                  throw new RepositoryCreationException("createRepository command returned uknown result type.");
               }
            }
         }
         catch (RPCException e)
         {
            Throwable cause = (e).getCause();
            if (cause instanceof RepositoryCreationException)
            {
               throw (RepositoryCreationException)cause;
            }
            else if (cause instanceof RepositoryConfigurationException)
            {
               throw (RepositoryConfigurationException)cause;
            }
            else
            {
               throw new RepositoryCreationException(e.getMessage(), e);
            }
         }

         // execute startRepository at all cluster nodes (coordinator will ignore this command)
         try
         {
            List<Object> results =
               rpcService.executeCommandOnAllNodes(startRepository, true, stringRepositoryEntry, creationProps);

            for (Object result : results)
            {
               if (result != null)
               {
                  if (result instanceof Throwable)
                  {
                     throw new RepositoryCreationException("Repository " + rEntry.getName()
                        + " created on coordinator, but can not be started at other cluster nodes", ((Throwable)result));
                  }
                  else
                  {
                     throw new RepositoryCreationException("startRepository command returns uknown result type");
                  }
               }
            }
         }
         catch (RPCException e)
         {
            throw new RepositoryCreationException("Repository " + rEntry.getName()
               + " created on coordinator, can not be started at other cluster node: " + e.getMessage(), e);
         }
      }
      else
      {
         try
         {
            createRepositoryLocally(backupId, rEntry, rToken, creationProps);
         }
         finally
         {
            pendingRepositories.remove(rToken);
         }
      }
   }
protected void createRepositoryInternally ( String backupId , RepositoryEntry rEntry , String rToken , DBCreationProperties creationProps ) throws RepositoryConfigurationException , RepositoryCreationException { if ( rpcService != null ) { String stringRepositoryEntry = null ; try { JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl ( ) ; JsonValue json = generatorImpl . createJsonObject ( rEntry ) ; stringRepositoryEntry = json . toString ( ) ; } catch ( JsonException e ) { throw new RepositoryCreationException ( "Can not serialize repository entry: " + e . getMessage ( ) , e ) ; } try { Object result = rpcService . executeCommandOnCoordinator ( createRepository , true , backupId , stringRepositoryEntry , rToken , creationProps ) ; if ( result != null ) { if ( result instanceof Throwable ) { throw new RepositoryCreationException ( "Can't create repository " + rEntry . getName ( ) , ( Throwable ) result ) ; } else { throw new RepositoryCreationException ( "createRepository command returned uknown result type." ) ; } } } catch ( RPCException e ) { Throwable cause = ( e ) . getCause ( ) ; if ( cause instanceof RepositoryCreationException ) { throw ( RepositoryCreationException ) cause ; } else if ( cause instanceof RepositoryConfigurationException ) { throw ( RepositoryConfigurationException ) cause ; } else { throw new RepositoryCreationException ( e . getMessage ( ) , e ) ; } } try { List < Object > results = rpcService . executeCommandOnAllNodes ( startRepository , true , stringRepositoryEntry , creationProps ) ; for ( Object result : results ) { if ( result != null ) { if ( result instanceof Throwable ) { throw new RepositoryCreationException ( "Repository " + rEntry . getName ( ) + " created on coordinator, but can not be started at other cluster nodes" , ( ( Throwable ) result ) ) ; } else { throw new RepositoryCreationException ( "startRepository command returns uknown result type" ) ; } } } } catch ( RPCException e ) { throw new RepositoryCreationException ( "Repository " + rEntry . getName ( ) + " created on coordinator, can not be started at other cluster node: " + e . getMessage ( ) , e ) ; } } else { try { createRepositoryLocally ( backupId , rEntry , rToken , creationProps ) ; } finally { pendingRepositories . remove ( rToken ) ; } } }
Create repository internally. serverUrl and connProps contain specific properties for db creation.