Ejemplo n.º 1
0
  public void writeRawGitFile(String sha1, InputStream is) throws IOException {
    InputStreamSource iss = new InputStreamSource(is);

    StreamSource source = new StreamSource(iss);

    QueryFutureCallback future = new QueryFutureCallback();
    _deployProxy.sendFile(sha1, source, future);
  }
Ejemplo n.º 2
0
  /**
   * deletes a tag from the repository
   *
   * @param tag the tag to remove
   * @param attributes commit attributes including user and message
   */
  @Override
  public boolean removeTag(CommitBuilder commit) {
    commit.validate();

    String tag = commit.getId();

    return _deployProxy.removeTag(tag, commit.getAttributes());
  }
Ejemplo n.º 3
0
  /**
   * Copies a tag
   *
   * @param tag the new tag to create
   * @param sourceTag the source tag from which to copy
   * @param attributes commit attributes including user and message
   */
  public Boolean copyTag(CommitBuilder target, CommitBuilder source) {
    target.validate();
    source.validate();

    String targetId = target.getId();
    String sourceId = source.getId();

    return _deployProxy.copyTag(targetId, sourceId, target.getAttributes());
  }
Ejemplo n.º 4
0
  private boolean putTag(String tag, String contentHash, Map<String, String> attributes) {
    if (tag == null) throw new NullPointerException();
    if (contentHash == null) throw new NullPointerException();

    HashMap<String, String> attributeCopy;

    if (attributes != null) attributeCopy = new HashMap<String, String>(attributes);
    else attributeCopy = new HashMap<String, String>();

    return _deployProxy.putTag(tag, contentHash, attributeCopy);
  }
Ejemplo n.º 5
0
 public String[] getCommitList(String[] commitList) {
   try {
     return _deployProxy.getCommitList(commitList);
   } catch (ServiceUnavailableException e) {
     throw new ServiceUnavailableException(
         L.l(
             "Deploy service is not available.\n  Ensure <resin:AdminServices> or a <resin:DeployService> is enabled in resin.xml.\n  {0}",
             e.getMessage()),
         e);
   }
 }
Ejemplo n.º 6
0
  public boolean getFile(String tagName, String fileName, OutputStream os) throws IOException {
    StreamSource fileSource = _deployProxy.getFile(tagName, fileName);

    if (fileSource != null) {
      ReadStream is = null;
      GitObjectStream gitIs = new GitObjectStream(fileSource.getInputStream());

      try {
        is = Vfs.openRead(gitIs);

        is.writeToStream(os);
      } finally {
        gitIs.close();

        IoUtil.close(is);
      }

      return true;
    } else {
      return false;
    }
  }
Ejemplo n.º 7
0
 /**
  * Stops a controller based on a deployment tag: wars/foo.com/my-war
  *
  * @param tag the encoded controller name
  */
 public DeployControllerState stop(String tag) {
   return _deployProxy.stop(tag);
 }
Ejemplo n.º 8
0
 /**
  * Starts a controller based on a deployment tag: wars/foo.com/my-war
  *
  * @param tag the encoded controller name
  */
 public DeployControllerState restartCluster(String tag) {
   return _deployProxy.restartCluster(tag);
 }
Ejemplo n.º 9
0
 public DeployTagResult[] queryTags(String pattern) {
   return _deployProxy.queryTags(pattern);
 }
Ejemplo n.º 10
0
 public String[] listFiles(String tagName, String fileName) throws IOException {
   return _deployProxy.listFiles(tagName, fileName);
 }
Ejemplo n.º 11
0
  /** Returns the state for a tag. */
  public Throwable getTagException(String tag) {
    DeployTagStateQuery query = _deployProxy.getTagState(tag); // (TagStateQuery) query(query);

    if (query != null) return query.getThrowable();
    else return null;
  }
Ejemplo n.º 12
0
  /** Returns the state for a tag. */
  public String getTagState(String tag) {
    DeployTagStateQuery query = _deployProxy.getTagState(tag);

    if (query != null) return query.getState();
    else return null;
  }