Package org.apache.isis.runtimes.dflt.remoting.common.exchange

Examples of org.apache.isis.runtimes.dflt.remoting.common.exchange.ExecuteClientActionResponse


        final ClientTransactionEvent[] transactionEntries = getTransaction().getEntries();
        final ReferenceData[] referenceData = asData(transactionEntries, knownObjects);

        final int[] eventTypes = asEventTypes(transactionEntries);

        ExecuteClientActionResponse results;
        try {
            final ExecuteClientActionRequest request =
                new ExecuteClientActionRequest(getAuthenticationSession(), referenceData, eventTypes);
            results = connection.executeClientAction(request);
        } catch (final ConcurrencyException e) {
View Full Code Here


            }
            dump(str, data[i], 3, complete);
        }
        log("execute client action " + str);

        final ExecuteClientActionResponse results = decorated.executeClientAction(request);

        complete = new Vector();
        str = new StringBuilder();
        final ReferenceData[] persistedUpdates = results.getPersisted();
        final Version[] changedVersions = results.getChanged();
        for (int i = 0; i < persistedUpdates.length; i++) {
            str.append(indentedNewLine());
            str.append("[");
            str.append(i + 1);
            str.append("] ");
View Full Code Here

     * </ul>
     */
    @Override
    public ExecuteClientActionResponse encodeClientActionResult(final ReferenceData[] madePersistent,
        final Version[] changedVersion, final ObjectData[] updates) {
        return new ExecuteClientActionResponse(madePersistent, changedVersion, updates);
    }
View Full Code Here

        mockery.checking(new Expectations() {
            {
                one(mockEncoder).encodeClientActionResult(with(equalTo(new ObjectData[0])),
                    with(equalTo(new Version[0])), with(equalTo(new ObjectData[0])));
                will(returnValue(new ExecuteClientActionResponse(new ObjectData[0], new Version[0], null)));
            }
        });

        final ExecuteClientActionRequest request =
            new ExecuteClientActionRequest(session, new ReferenceData[0], new int[0]);

        // don't start xactn here, since within call.
        final ExecuteClientActionResponse result = server.executeClientAction(request);

        assertEquals(0, result.getPersisted().length);
        assertEquals(0, result.getChanged().length);
    }
View Full Code Here

            }
        });

        // results returned in their own container
        final ExecuteClientActionResponse results =
            new ExecuteClientActionResponse(new ObjectData[0], new Version[0], null);
        mockery.checking(new Expectations() {
            {
                one(mockEncoder).encodeClientActionResult(with(equalTo(new ReferenceData[1])),
                    with(equalTo(new Version[] { new TestProxyVersion(2) })), with(equalTo(new ObjectData[0])));
                will(returnValue(results));
            }
        });

        final ExecuteClientActionRequest request =
            new ExecuteClientActionRequest(session, new ReferenceData[] { data },
                new int[] { ClientTransactionEvent.CHANGE });
        // don't start xactn here, since within call.
        final ExecuteClientActionResponse result = server.executeClientAction(request);
        final ObjectAdapter object =
            IsisContext.getPersistenceSession().loadObject(adapter.getOid(), adapter.getSpecification());

        assertEquals(new TestProxyVersion(2), object.getVersion());
View Full Code Here

                will(returnValue(null));
            }
        });

        // return results
        final ExecuteClientActionResponse results =
            new ExecuteClientActionResponse(new ObjectData[0], new Version[0], new ObjectData[0]);
        mockery.checking(new Expectations() {
            {
                one(mockEncoder).encodeClientActionResult(with(equalTo(new ReferenceData[1])),
                    with(equalTo(new Version[1])), with(equalTo(new ObjectData[0])));
                will(returnValue(results));
            }
        });

        // don't start xactn here, since within call.

        final ExecuteClientActionRequest request =
            new ExecuteClientActionRequest(session, new ReferenceData[] { data },
                new int[] { ClientTransactionEvent.ADD });
        final ExecuteClientActionResponse response = server.executeClientAction(request);

        final ObjectAdapter object =
            IsisContext.getPersistenceSession().loadObject(adapter.getOid(), adapter.getSpecification());

        assertEquals(results, response);
View Full Code Here

        final Oid oid = adapter.getOid();
        final DummyIdentityData identityData =
            new DummyIdentityData(oid, TestProxyAdapter.class.getName(), new TestProxyVersion(1));

        // return results
        final ExecuteClientActionResponse results =
            new ExecuteClientActionResponse(new ObjectData[0], new Version[0], null);
        mockery.checking(new Expectations() {
            {
                one(mockEncoder).encodeClientActionResult(with(equalTo(new ReferenceData[1])),
                    with(equalTo(new Version[1])), with(equalTo(new ObjectData[0])));
                will(returnValue(results));
            }
        });

        // don't start xactn here, since within call.
        final ExecuteClientActionRequest request =
            new ExecuteClientActionRequest(new TestProxySession(), new ReferenceData[] { identityData },
                new int[] { ClientTransactionEvent.DELETE });
        final ExecuteClientActionResponse result = server.executeClientAction(request);

        assertEquals(results, result);
    }
View Full Code Here

            private void distributionShouldExecuteClientActionForDeletedMovie(
                final DummyIdentityData identityOfObjectToDelete) {
                final Version[] versionUpdates = new Version[] {};
                one(mockDistribution).executeClientAction(with(any(ExecuteClientActionRequest.class)));
                will(returnValue(new ExecuteClientActionResponse(new ObjectData[] {}, versionUpdates, new ObjectData[0])));
            }
        });

        // TODO: should look inside the request object and ensure:
        // with(equalTo(session)),
View Full Code Here

                // final int[] types = new int[] { ClientTransactionEvent.CHANGE, ClientTransactionEvent.CHANGE };

                one(mockDistribution).executeClientAction(with(any(ExecuteClientActionRequest.class)));

                final Version[] versionUpdates = new Version[] { new TestProxyVersion(5), new TestProxyVersion(9) };
                will(returnValue(new ExecuteClientActionResponse(new ObjectData[] { movieData, directorData },
                    versionUpdates, new ObjectData[0])));
            }
        });
        // TODO: should look inside the request object and ensure:
        // with(equalTo(session)),
View Full Code Here

                final DummyReferenceData updateData = new DummyReferenceData(newOid, "type", new TestProxyVersion(456));

                // the server is called with data (movieData) for the object to be persisted
                one(mockDistribution).executeClientAction(with(any(ExecuteClientActionRequest.class)));

                will(returnValue(new ExecuteClientActionResponse(new ReferenceData[] { updateData }, null,
                    new ObjectData[0])));
            }

        });
        // TODO: should look inside the request object and ensure:
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.remoting.common.exchange.ExecuteClientActionResponse

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.