Package io.fabric8.api

Examples of io.fabric8.api.GitContext


    private GitContext newGitReadContext() {
        return new GitContext();
    }

    private GitContext newGitWriteContext() {
        return new GitContext().requireCommit().requirePush();
    }
View Full Code Here


    }

    private void doPullInternal() {
        LockHandle writeLock = aquireWriteLock();
        try {
           doPullInternal(new GitContext(), getCredentialsProvider(), true);
        } catch (Throwable e) {
            LOGGER.debug("Error during pull due " + e.getMessage(), e);
            LOGGER.warn("Error during pull due " + e.getMessage() + ". This exception is ignored.");
        } finally {
            writeLock.unlock();
View Full Code Here

    }

    @Override
    public Iterable<PushResult> doPush(Git git) throws Exception {
        assertValid();
        return gitDataStore.get().doPush(git, new GitContext());
    }
View Full Code Here

        }
        GitHelpers.createOrCheckoutBranch(git, branch, "origin");
    }

    private <T> T gitReadOperation(GitOperation<T> gitop) {
        GitContext context = new GitContext();
        return gitDataStore.get().gitOperation(context, gitop, null);
    }
View Full Code Here

        GitContext context = new GitContext();
        return gitDataStore.get().gitOperation(context, gitop, null);
    }

    private <T> T gitWriteOperation(PersonIdent personIdent, GitOperation<T> gitop) {
        GitContext context = new GitContext().requireCommit().requirePush();
        return gitDataStore.get().gitOperation(context, gitop, personIdent);
    }
View Full Code Here

        GitOperation<Profile> gitop = new GitOperation<Profile>() {
            public Profile call(Git git, GitContext context) throws Exception {
                return profileRegistry.getProfile(versionId, "prfB");
            }
        };
        GitContext context = new GitContext().requirePull();
        Profile profile = gitDataStore.gitOperation(context, gitop, null);
       
        Assert.assertEquals("1.0", profile.getVersion());
        Assert.assertEquals("prfB", profile.getId());
        Assert.assertEquals("bbb", profile.getAttributes().get("foo"));
View Full Code Here

        GitOperation<Profile> gitop = new GitOperation<Profile>() {
            public Profile call(Git git, GitContext context) throws Exception {
                return profileRegistry.getProfile(versionId, "prfF");
            }
        };
        GitContext context = new GitContext().requirePull();
        gitDataStore.gitOperation(context, gitop, null);
       
        Assert.assertTrue(profileRegistry.hasProfile(versionId, "prfE"));
        Assert.assertTrue(profileRegistry.hasProfile(versionId, "prfF"));
       
View Full Code Here

        GitOperation<Profile> gitop = new GitOperation<Profile>() {
            public Profile call(Git git, GitContext context) throws Exception {
                return profileRegistry.getProfile(versionId, "prfG");
            }
        };
        GitContext context = new GitContext().requirePull();
        gitDataStore.gitOperation(context, gitop, null);
       
        Profile prfG = profileRegistry.getProfile(versionId, "prfG");
        Assert.assertEquals("bbb", prfG.getAttributes().get("foo"));
       
View Full Code Here

    int bounds = 100;
    int column = 0;
    Function1 function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getProfile();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Profile");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getCount();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Count");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getMinimumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Minumum");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getMaximumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Maximum");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return toHealth(status);
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Status",
        new HealthLabelProvider(function));
    function = new Function1() {
      @Override
      public Double apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getHealth(status.getCount());
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Health",
        new PercentFunctionLabelProvider(function));
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getDependentProfiles();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Dependencies");
View Full Code Here

    int bounds = 100;
    int column = 0;
    Function1 function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getProfile();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Profile");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getCount();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Count");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getMinimumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Minumum");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getMaximumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Maximum");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return toHealth(status);
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Status",
        new HealthLabelProvider(function));
    function = new Function1() {
      @Override
      public Double apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getHealth(status.getCount());
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Health",
        new PercentFunctionLabelProvider(function));
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getDependentProfiles();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Dependencies");
View Full Code Here

TOP

Related Classes of io.fabric8.api.GitContext

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.