Ejemplo n.º 1
0
  @Override
  public void pullRemote(CallingContext context, String raptureURIString) {
    RaptureURI internalURI = new RaptureURI(raptureURIString, Scheme.DOCUMENT);
    if (internalURI.hasDocPath()) {
      throw RaptureExceptionFactory.create(
          HttpURLConnection.HTTP_BAD_REQUEST,
          apiMessageCatalog.getMessage("NoDocPath", internalURI.toShortString())); // $NON-NLS-1$
    }
    checkParameter(NAME, internalURI.getDocPath());

    log.info(
        Messages.getString("Admin.PullPerspective")
            + Messages.getString("Admin.OnType")
            + internalURI.getDocPath() // $NON-NLS-1$ //$NON-NLS-2$
            + Messages.getString("Admin.InAuthority")
            + internalURI.getAuthority()); // $NON-NLS-1$
    // NOW this is the fun one
    // Here are the steps
    // (1) Look at the local, does it have a remote defined? If
    // so, what is the latest commit known about
    // for that remote?
    // (2) Make a remote call to retrieve the commits up to that commit from
    // the RemoteLink
    // (3) For each commit, look at all of the references, retrieve them
    // from the remote and persist them
    // into the repo.
    // (4) Update the local perspective to point at the latest commit, and
    // update the Remote commit to point at that.

    getKernel().getRepo(internalURI.getFullPath()); // $NON-NLS-1$
  }
Ejemplo n.º 2
0
 @Override
 public void initiateTypeConversion(
     CallingContext context, String raptureURIString, String newConfig, int versionsToKeep) {
   RaptureURI internalURI = new RaptureURI(raptureURIString, Scheme.DOCUMENT);
   checkParameter(NAME, internalURI.getDocPath());
   tExecutor.runRebuildFor(
       internalURI.getAuthority(), internalURI.getDocPath(), newConfig, versionsToKeep);
 }
Ejemplo n.º 3
0
 @Override
 public void putArchiveConfig(
     CallingContext context, String raptureURIString, TypeArchiveConfig config) {
   RaptureURI internalURI = new RaptureURI(raptureURIString, Scheme.DOCUMENT);
   checkParameter(NAME, internalURI.getDocPath());
   config.setAuthority(internalURI.getAuthority());
   config.setTypeName(internalURI.getDocPath());
   TypeArchiveConfigStorage.add(config, context.getUser(), "Created type archive config");
 }
Ejemplo n.º 4
0
 @Override
 public void deleteArchiveConfig(CallingContext context, String raptureURIString) {
   RaptureURI addressURI = new RaptureURI(raptureURIString, Scheme.DOCUMENT);
   checkParameter(NAME, addressURI.getDocPath());
   TypeArchiveConfigStorage.deleteByAddress(
       addressURI, context.getUser(), "Removed archive config");
 }
Ejemplo n.º 5
0
 @Override
 public List<String> getTags(CallingContext context, String raptureURIString) {
   RaptureURI internalURI = new RaptureURI(raptureURIString, Scheme.DOCUMENT);
   checkParameter(NAME, internalURI.getDocPath());
   Repository repository = getKernel().getRepo(internalURI.getFullPath()); // $NON-NLS-1$
   return repository.getTags();
 }
Ejemplo n.º 6
0
 @Override
 public Object getReflectionObject(CallingContext ctx, String uri) {
   RaptureURI ruri = new RaptureURI(uri);
   if (ruri.getScheme().equals(Scheme.TABLE)) return Kernel.getIndex().getTable(ctx, uri);
   else if (ruri.getScheme().equals(Scheme.INDEX)) {
     if (ruri.hasDocPath())
       log.warn(uri + " has unexpected dogPath " + ruri.getDocPath() + " - stripped");
     return Kernel.getIndex().getIndex(ctx, ruri.toAuthString());
   } else throw RaptureExceptionFactory.create("URI " + uri + " not supported by IndexEncoder");
 }
Ejemplo n.º 7
0
 @Override
 public void setContext(RaptureURI internalURI) {
   blobPrefix = internalURI.getDocPath();
 }
Ejemplo n.º 8
0
 @Override
 public TypeArchiveConfig getArchiveConfig(CallingContext context, String raptureURIString) {
   RaptureURI addressURI = new RaptureURI(raptureURIString, Scheme.DOCUMENT);
   checkParameter(NAME, addressURI.getDocPath());
   return TypeArchiveConfigStorage.readByAddress(addressURI);
 }