Package org.jboss.dna.graph

Examples of org.jboss.dna.graph.ExecutionContext$NullSecurityContext


    private TypeSystem typeSystem;
    private XPathParser parser;

    @Before
    public void beforeEach() {
        context = new ExecutionContext();
        context.getNamespaceRegistry().register("x", "http://example.com");
        typeSystem = context.getValueFactories().getTypeSystem();
        parser = new XPathParser(typeSystem);
    }
View Full Code Here


    public void beforeEach() {
        MockitoAnnotations.initMocks(this);
        executedRequests = new LinkedList<Request>();
        sourceName = "Source";
        workspaceName = "default";
        context = new ExecutionContext();
        connection = new MockRepositoryConnection(sourceName, executedRequests);
        stub(connectionFactory.createConnection(sourceName)).toReturn(connection);
        graph = Graph.create(sourceName, connectionFactory, context);

        validUuid = UUID.randomUUID();
View Full Code Here

    private TypeSystem typeSystem;
    private XPathParser parser;

    @Before
    public void beforeEach() {
        typeSystem = new ExecutionContext().getValueFactories().getTypeSystem();
        parser = new XPathParser(typeSystem);
    }
View Full Code Here

        source = new InMemoryRepositorySource();
        source.setName(workspaceName);
        source.setDefaultWorkspaceName(workspaceName);

        // Set up the execution context ...
        ExecutionContext context = new ExecutionContext();
        // Register the test namespace
        context.getNamespaceRegistry().register(TestLexicon.Namespace.PREFIX, TestLexicon.Namespace.URI);

        // Stub out the connection factory ...
        RepositoryConnectionFactory connectionFactory = new RepositoryConnectionFactory() {
            /**
             * {@inheritDoc}
 
View Full Code Here

        stub(principal.getName()).toReturn("name");
        Subject subject = new Subject(false, Collections.singleton(principal), Collections.EMPTY_SET, Collections.EMPTY_SET);
        LoginContext loginContext = mock(LoginContext.class);
        stub(loginContext.getSubject()).toReturn(subject);
        NamespaceRegistry globalRegistry = context.getNamespaceRegistry();
        ExecutionContext sessionContext = context.with(new JaasSecurityContext(loginContext));
        Session session = new JcrSession(repository, workspace, sessionContext, globalRegistry, sessionAttributes);
        try {
            assertThat(session.getUserID(), is("name"));
        } finally {
            session.logout();
View Full Code Here

     * @return the node information
     * @throws RepositorySourceException
     */
    protected ReadNodeRequest getNode( Location location ) throws RepositorySourceException {
        // Check the cache first ...
        final ExecutionContext context = getExecutionContext();
        RepositoryConnection cacheConnection = getConnectionToCache();
        ReadNodeRequest fromCache = new ReadNodeRequest(location);
        cacheConnection.execute(context, fromCache);

        // Look at the cache results from the cache for problems, or if found a plan in the cache look
View Full Code Here

                logger.trace("  {0} {1}", ++i, contribution);
            }
        }

        // Create the node, and use the existing UUID if one is found in the cache ...
        ExecutionContext context = getExecutionContext();
        assert context != null;
        UUID uuid = null;
        Property uuidProperty = location.getIdProperty(DnaLexicon.UUID);
        // If the actual location has no UUID identification property ...
        if (uuidProperty == null || uuidProperty.isEmpty()) {
            uuid = context.getValueFactories().getUuidFactory().create();
            uuidProperty = context.getPropertyFactory().create(DnaLexicon.UUID, uuid);
            // Replace the actual location with one that includes the new UUID property ...
            location = location.with(uuidProperty);
        } else {
            assert uuidProperty.isEmpty() == false;
            uuid = context.getValueFactories().getUuidFactory().create(uuidProperty.getValues().next());
        }
        assert uuid != null;
        FederatedNode mergedNode = new FederatedNode(location, uuid);

        // Merge the results into a single set of results ...
View Full Code Here

     */
    protected void loadContributionsFromSources( Location location,
                                                 Set<String> sourceNames,
                                                 List<Contribution> contributions ) throws RepositorySourceException {
        // At this point, there is no merge plan, so read information from the sources ...
        final ExecutionContext context = getExecutionContext();
        final PathFactory pathFactory = context.getValueFactories().getPathFactory();

        // If the location has no path, then we have to submit a request to ALL sources ...
        if (!location.hasPath()) {
            for (Projection projection : this.sourceProjections) {
                final String source = projection.getSourceName();
View Full Code Here

        Object value = mergePlanProperty.getValues().next();
        return value instanceof MergePlan ? (MergePlan)value : null;
    }

    protected void updateCache( FederatedNode mergedNode ) throws RepositorySourceException {
        final ExecutionContext context = getExecutionContext();
        final RepositoryConnection cacheConnection = getConnectionToCache();
        final Location path = mergedNode.at();

        List<Request> requests = new ArrayList<Request>();
        requests.add(new CreateNodeRequest(path, mergedNode.getProperties()));
View Full Code Here

    protected synchronized void changeRepositoryConfig() {
        if (this.repository != null) {
            RepositoryContext repositoryContext = getRepositoryContext();
            if (repositoryContext != null) {
                // Find in JNDI the repository source registry and the environment ...
                ExecutionContext context = getExecutionContext();
                RepositoryConnectionFactory factory = getRepositoryContext().getRepositoryConnectionFactory();
                // Compute a new repository config and set it on the repository ...
                FederatedRepositoryConfig newConfig = getRepositoryConfiguration(context, factory);
                this.repository.setConfiguration(newConfig);
            }
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.ExecutionContext$NullSecurityContext

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.