Examples of KnownObjectsRequest


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

    private ObjectAdapter executeRemotely(final ObjectAdapter targetAdapter, final ObjectAdapter[] parameterAdapters) {
        if (LOG.isDebugEnabled()) {
            LOG.debug(debug("execute remotely", getIdentifier(), targetAdapter, parameterAdapters));
        }

        final KnownObjectsRequest knownObjects = new KnownObjectsRequest();
        final Data[] parameterObjectData = parameterValues(parameterAdapters, knownObjects);
        final ReferenceData targetReference = targetAdapter == null ? null : encoder.encodeActionTarget(targetAdapter, knownObjects);
        ExecuteServerActionResponse response;
        try {
            final ExecuteServerActionRequest request = new ExecuteServerActionRequest(getAuthenticationSession(), ActionType.USER, objectAction.getIdentifier().toNameParmsIdentityString(), targetReference, parameterObjectData);
View Full Code Here

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

                final DummyObjectData movieData = new DummyObjectData(new TestProxyOid(12, true), Movie.class.getName(), true, new TestProxyVersion(4));
                final DummyEncodeableObjectData expectedMovieName = new DummyEncodeableObjectData("War of the Worlds", String.class.getName());
                final DummyReferenceData expectedDirectorRef = new DummyReferenceData(new TestProxyOid(14, true), Person.class.getName(), new TestProxyVersion(8));
                movieData.setFieldContent(new Data[] { expectedDirectorRef, expectedMovieName });

                one(mockEncoder).encodeGraphForChangedObject(movieAdapter, new KnownObjectsRequest());
                will(returnValue(movieData));
                return movieData;
            }

            private DummyObjectData encoderShouldCreateGraphForChangedDirector(final TestProxyAdapter directorAdapter) {
                final DummyObjectData directorData = new DummyObjectData(new TestProxyOid(14, true), Person.class.getName(), true, new TestProxyVersion(8));
                final DummyEncodeableObjectData expectedDirectorName = new DummyEncodeableObjectData("Unknown", String.class.getName());
                directorData.setFieldContent(new Data[] { expectedDirectorName });

                one(mockEncoder).encodeGraphForChangedObject(directorAdapter, new KnownObjectsRequest());
                will(returnValue(directorData));
                return directorData;
            }

            private void distributionShouldExecuteClientActionForBothChangedObjects(final DummyObjectData movieData, final DummyObjectData directorData) {
View Full Code Here

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

        final DummyObjectData data = new DummyObjectData(adapter.getOid(), "none", true, new TestProxyVersion(1));

        // prepare the update data to return
        mockery.checking(new Expectations() {
            {
                one(mockEncoder).decode(data, new KnownObjectsRequest());
                will(returnValue(adapter));

            }
        });
View Full Code Here

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

        final DummyObjectData data = new DummyObjectData(adapter.getOid(), "none", true, new TestProxyVersion(1));

        // restore the object on the server
        mockery.checking(new Expectations() {
            {
                one(mockEncoder).decode(data, new KnownObjectsRequest());
                will(returnValue(adapter));

                one(mockEncoder).encodeIdentityData(adapter);
                will(returnValue(null));
            }
View Full Code Here

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

    // restore
    // ///////////////////////////////////////////////////////

    public ObjectAdapter deserialize(final Data data) {
        if (data instanceof CollectionData) {
            return deserializeCollection((CollectionData) data, new KnownObjectsRequest());
        } else {
            return deserializeObject(data, new KnownObjectsRequest());
        }
    }
View Full Code Here

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

        // although the PersistenceSession will also do xactn mgmt, because we
        // are potentially modifying several objects we should explicitly define
        // the xactn at this level.
        getTransactionManager().startTransaction();
        try {
            final KnownObjectsRequest knownObjects = new KnownObjectsRequest();
            final ObjectAdapter[] persistedObjects = new ObjectAdapter[data.length];
            final ObjectAdapter[] disposedObjects = new ObjectAdapter[data.length];
            final ObjectAdapter[] changedObjects = new ObjectAdapter[data.length];
            for (int i = 0; i < data.length; i++) {
                ObjectAdapter object;
View Full Code Here

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

        if (LOG.isDebugEnabled()) {
            LOG.debug("request executeAction " + actionIdentifier + " on " + targetData + " for " + session);
        }

        final KnownObjectsRequest knownObjects = new KnownObjectsRequest();

        final ObjectAdapter targetAdapter = decodeTargetAdapter(session, targetData, knownObjects);

        final ObjectAction action = targetAdapter.getSpecification().getObjectAction(actionType, actionIdentifier);
        final ObjectAdapter[] parameters = decodeParameters(session, parameterData, knownObjects);
View Full Code Here

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

        Data[] fieldContent;
        final ObjectAssociation[] fields = getFieldOrder(specification);
        fieldContent = new Data[fields.length];

        PersistorUtil.start(adapter, adapter.getResolveState().serializeFrom());
        final KnownObjectsRequest knownObjects = new KnownObjectsRequest();
        for (int i = 0; i < fields.length; i++) {
            if (fields[i].getId().equals(fieldName)) {
                final ObjectAdapter field = fields[i].get(adapter);
                if (field == null) {
                    fieldContent[i] = dataFactory.createNullData(fields[i].getSpecification().getFullIdentifier());
View Full Code Here

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

        Data resultData;
        if (result == null) {
            resultData = dataFactory.createNullData("");
        } else if (result.getSpecification().isCollection()) {
            resultData =
                serializer.serializeCollection(result, serverSideRetrievedObjectGraphDepth, new KnownObjectsRequest());
        } else if (result.getSpecification().isNotCollection()) {
            resultData = encodeCompletePersistentGraph(result);
        } else {
            throw new UnknownTypeException(result);
        }
View Full Code Here

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

            return encode(adapter, clientSideActionParameterGraphDepth, knownObjects);
        }
    }

    private ObjectData encode(final ObjectAdapter adapter, final int depth) {
        return (ObjectData) encode(adapter, depth, new KnownObjectsRequest());
    }
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.