Examples of RepositoryAdminLoginContext


Examples of org.apache.ace.client.repository.RepositoryAdminLoginContext

        // login at Repository admin
        try {
            URL url =  new URL(getConfigValue( ConfigItem.HOSTNAME) + getConfigValue( ConfigItem.ENDPOINT));
            String customerName = getConfigValue( ConfigItem.CUSTOMER_NAME);

            RepositoryAdminLoginContext loginContext = m_reposAdmin.createLoginContext(user);
            loginContext.addShopRepository(url, customerName, getConfigValue( ConfigItem.STORE_REPOSITORY), false)
            .addGatewayRepository(url, customerName, getConfigValue( ConfigItem.GATEWAY_REPOSITORY), true)
            .addDeploymentRepository(url, customerName, getConfigValue( ConfigItem.DEPLOYMENT_REPOSITORY), true);
            m_reposAdmin.login(loginContext);

            // start refresh task
View Full Code Here

Examples of org.apache.ace.client.repository.RepositoryAdminLoginContext

        addRepository("storeInstance", "apache", "store", true);
        addRepository("targetInstance", "apache", "target", true);
        addRepository("deploymentInstance", "apache", "deployment", true);

        RepositoryAdminLoginContext loginContext = m_repositoryAdmin.createLoginContext(user);
        loginContext
            .add(loginContext.createShopRepositoryContext()
                .setLocation(m_endpoint).setCustomer("apache").setName("store").setWriteable())
            .add(loginContext.createTargetRepositoryContext()
                .setLocation(m_endpoint).setCustomer("apache").setName("target").setWriteable())
            .add(loginContext.createDeploymentRepositoryContext()
                .setLocation(m_endpoint).setCustomer("apache").setName("deployment").setWriteable());

        m_repositoryAdmin.login(loginContext);

        runAndWaitForEvent(new Callable<Object>() {
View Full Code Here

Examples of org.apache.ace.client.repository.RepositoryAdminLoginContext

        startRepositoryService();

        addRepository("storeInstance", "apache", "store", true);
        addRepository("targetInstance", "apache", "target", true);

        final RepositoryAdminLoginContext loginContext1 = m_repositoryAdmin.createLoginContext(user1);
        loginContext1
            .add(loginContext1.createShopRepositoryContext()
                .setLocation(m_endpoint).setCustomer("apache").setName("store").setWriteable())
            .add(loginContext1.createTargetRepositoryContext()
                .setLocation(m_endpoint).setCustomer("apache").setName("target").setWriteable());

        m_repositoryAdmin.login(loginContext1);

        FeatureObject g1 = createBasicFeatureObject("feature1");
View Full Code Here

Examples of org.apache.ace.client.repository.RepositoryAdminLoginContext

        startRepositoryService();

        addRepository("storeInstance", "apache", "store", true);
        addRepository("targetInstance", "apache", "target", true);

        final RepositoryAdminLoginContext loginContext1 = m_repositoryAdmin.createLoginContext(user1);
        loginContext1
            .add(loginContext1.createShopRepositoryContext()
                .setLocation(m_endpoint).setCustomer("apache").setName("store").setWriteable())
            .add(loginContext1.createTargetRepositoryContext()
                .setLocation(m_endpoint).setCustomer("apache").setName("target"));

        m_repositoryAdmin.login(loginContext1);

        m_repositoryAdmin.checkout();
View Full Code Here

Examples of org.apache.ace.client.repository.RepositoryAdminLoginContext

        }
        catch (IllegalStateException ise) {
            // expected
        }

        final RepositoryAdminLoginContext loginContext1 = m_repositoryAdmin.createLoginContext(user1);
        loginContext1
            .add(loginContext1.createShopRepositoryContext()
                .setLocation(m_endpoint).setCustomer("apache").setName("store").setWriteable())
            .add(loginContext1.createTargetRepositoryContext()
                .setLocation(m_endpoint).setCustomer("apache").setName("target").setWriteable());

        m_repositoryAdmin.login(loginContext1);

        assertFalse("When first logging in without checking out, the repository cannot be current.", m_repositoryAdmin.isCurrent());
        assertFalse("Immediately after login, the repository not is modified.", m_repositoryAdmin.isModified());

        try {
            m_repositoryAdmin.commit();
            fail("We should not be able to commit before we check something out.");
        }
        catch (IllegalStateException e) {
            // expected
        }

        runAndWaitForEvent(new Callable<Object>() {
            public Object call() throws Exception {
                m_repositoryAdmin.checkout();
                return null;
            }
        }, false, RepositoryAdmin.TOPIC_REFRESH);

        assertTrue("After initial checkout, the repository is current.", m_repositoryAdmin.isCurrent());
        assertFalse("Immediately after login, the repository cannot be modified.", m_repositoryAdmin.isModified());

        ArtifactObject b1 = runAndWaitForEvent(new Callable<ArtifactObject>() {
            public ArtifactObject call() throws Exception {
                return createBasicBundleObject("bundle1");
            }
        }, false, ArtifactObject.TOPIC_ADDED, RepositoryAdmin.TOPIC_STATUSCHANGED);

        assertTrue("After initial checkout, the repository is current.", m_repositoryAdmin.isCurrent());
        assertTrue("We have added a bundle, so the repository is modified.", m_repositoryAdmin.isModified());
        assertEquals(1, m_artifactRepository.get().size());
        assertEquals("We expect the working state of our bundle to be New;", WorkingState.New, m_repositoryAdmin.getWorkingState(b1));
        assertEquals("We expect one bundle object in working state New;", 1, m_repositoryAdmin.getNumberWithWorkingState(ArtifactObject.class, WorkingState.New));
        assertEquals("We expect 0 bundle objects in working state Changed;", 0, m_repositoryAdmin.getNumberWithWorkingState(ArtifactObject.class, WorkingState.Changed));
        assertEquals("We expect 0 bundle objects in working state Unchanged;", 0, m_repositoryAdmin.getNumberWithWorkingState(ArtifactObject.class, WorkingState.Unchanged));

        runAndWaitForEvent(new Callable<Object>() {
            public Object call() throws Exception {
                m_repositoryAdmin.logout(false);
                return null;
            }
        }, false, RepositoryAdmin.TOPIC_LOGOUT);

        cleanUp();

        assertEquals(0, m_artifactRepository.get().size());

        runAndWaitForEvent(new Callable<Object>() {
            public Object call() throws Exception {
                m_repositoryAdmin.login(loginContext1);
                return null;
            }
        }, false, RepositoryAdmin.TOPIC_LOGIN);

        assertTrue("There has not been another commit in between, so we are still current.", m_repositoryAdmin.isCurrent());
        assertTrue("We have made changes since the last commit, so the repository must be modified.", m_repositoryAdmin.isModified());
        assertEquals(1, m_artifactRepository.get().size());
        assertEquals("We expect the working state of our bundle to be New;", WorkingState.New, m_repositoryAdmin.getWorkingState(b1));
        assertEquals("We expect one bundle object in working state New;", 1, m_repositoryAdmin.getNumberWithWorkingState(ArtifactObject.class, WorkingState.New));
        assertEquals("We expect 0 bundle objects in working state Changed;", 0, m_repositoryAdmin.getNumberWithWorkingState(ArtifactObject.class, WorkingState.Changed));
        assertEquals("We expect 0 bundle objects in working state Unchanged;", 0, m_repositoryAdmin.getNumberWithWorkingState(ArtifactObject.class, WorkingState.Unchanged));

        m_repositoryAdmin.commit();

        assertTrue("After a commit, the repository must be current.", m_repositoryAdmin.isCurrent());
        assertFalse("After a commit, the repository cannot be modified.", m_repositoryAdmin.isModified());

        runAndWaitForEvent(new Callable<Object>() {
            public Object call() throws Exception {
                m_repositoryAdmin.logout(false);
                return null;
            }
        }, false, RepositoryAdmin.TOPIC_LOGOUT);

        cleanUp();

        final RepositoryAdminLoginContext loginContext2 = m_repositoryAdmin.createLoginContext(user2);
        loginContext2
            .add(loginContext2.createShopRepositoryContext()
                .setLocation(m_endpoint).setCustomer("apache").setName("store").setWriteable())
            .add(loginContext2.createTargetRepositoryContext()
                .setLocation(m_endpoint).setCustomer("apache").setName("target").setWriteable());

        runAndWaitForEvent(new Callable<Object>() {
            public Object call() throws Exception {
                m_repositoryAdmin.login(loginContext2);
View Full Code Here

Examples of org.apache.ace.client.repository.RepositoryAdminLoginContext

        // login at Repository admin
        try {
            URL url =  new URL(getConfigValue( ConfigItem.HOSTNAME) + getConfigValue( ConfigItem.ENDPOINT));
            String customerName = getConfigValue( ConfigItem.CUSTOMER_NAME);

            RepositoryAdminLoginContext loginContext = m_reposAdmin.createLoginContext(user);
            loginContext
                .add(loginContext.createShopRepositoryContext()
                    .setLocation(url).setCustomer(customerName).setName(getConfigValue(ConfigItem.STORE_REPOSITORY)))
                .add(loginContext.createTargetRepositoryContext()
                    .setLocation(url).setCustomer(customerName).setName(getConfigValue(ConfigItem.TARGET_REPOSITORY)).setWriteable())
                .add(loginContext.createDeploymentRepositoryContext()
                    .setLocation(url).setCustomer(customerName).setName(getConfigValue(ConfigItem.DEPLOYMENT_REPOSITORY)).setWriteable());

            m_reposAdmin.login(loginContext);

            // start refresh task
View Full Code Here

Examples of org.apache.ace.client.repository.RepositoryAdminLoginContext

     * @param user
     * @throws IOException in case of I/O problems.
     */
    private boolean login(final User user) {
        try {
            RepositoryAdminLoginContext context = m_admin.createLoginContext(user);
           
            // @formatter:off
            context.setObrBase(m_obrUrl)
                .add(context.createShopRepositoryContext()
                    .setLocation(m_repository).setCustomer(customerName).setName(shopRepo).setWriteable())
                .add(context.createTargetRepositoryContext()
                    .setLocation(m_repository).setCustomer(customerName).setName(targetRepo).setWriteable())
                .add(context.createDeploymentRepositoryContext()
                    .setLocation(m_repository).setCustomer(customerName).setName(deployRepo).setWriteable());
            // @formatter:on

            m_admin.login(context);
            initGrid(user);
View Full Code Here

Examples of org.apache.ace.client.repository.RepositoryAdminLoginContext

        addRepository("storeInstance", customer, "store", true);
        addRepository("targetInstance", customer, "target", true);
        addRepository("deploymentInstance", customer, "deployment", true);

        RepositoryAdminLoginContext loginContext = m_repositoryAdmin.createLoginContext(user);
        loginContext
            .add(loginContext.createShopRepositoryContext()
                .setLocation(m_endpoint).setCustomer(customer).setName("store").setWriteable())
            .add(loginContext.createTargetRepositoryContext()
                .setLocation(m_endpoint).setCustomer(customer).setName("target").setWriteable())
            .add(loginContext.createDeploymentRepositoryContext()
                .setLocation(m_endpoint).setCustomer(customer).setName("deployment").setWriteable());

        m_repositoryAdmin.login(loginContext);
  }
View Full Code Here

Examples of org.apache.ace.client.repository.RepositoryAdminLoginContext

            if (user == null) {
                // No user obtained through request/fallback scenario; login failed...
                return false;
            }

            RepositoryAdminLoginContext context = m_repositoryAdmin.createLoginContext(user);
           
            context.setObrBase(m_obrURL)
                .add(context.createShopRepositoryContext()
                    .setLocation(m_repositoryURL)
                    .setCustomer(m_customerName)
                    .setName(m_storeRepositoryName)
                    .setWriteable())
                .add(context.createTargetRepositoryContext()
                    .setLocation(m_repositoryURL)
                    .setCustomer(m_customerName)
                    .setName(m_distributionRepositoryName)
                    .setWriteable())
                .add(context.createDeploymentRepositoryContext()
                    .setLocation(m_repositoryURL)
                    .setCustomer(m_customerName)
                    .setName(m_deploymentRepositoryName)
                    .setWriteable());
View Full Code Here

Examples of org.apache.ace.client.repository.RepositoryAdminLoginContext

        addRepository("storeInstance", "apache", "store", true);
        addRepository("targetInstance", "apache", "target", true);
        addRepository("deploymentInstance", "apache", "deployment", true);

        RepositoryAdminLoginContext loginContext = m_repositoryAdmin.createLoginContext(user);
        loginContext
            .add(loginContext.createShopRepositoryContext()
                .setLocation(m_endpoint).setCustomer("apache").setName("store").setWriteable())
            .add(loginContext.createTargetRepositoryContext()
                .setLocation(m_endpoint).setCustomer("apache").setName("target").setWriteable())
            .add(loginContext.createDeploymentRepositoryContext()
                .setLocation(m_endpoint).setCustomer("apache").setName("deployment").setWriteable());

        m_repositoryAdmin.login(loginContext);
        m_repositoryAdmin.checkout();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.