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

Examples of org.apache.isis.runtimes.dflt.remoting.common.data.Data


                if (parameters2.get(i).getSpecification().isNotCollection()) {
                    encoder.madePersistent(parameterAdapters[i], response.getPersistedParameters()[i]);
                }
            }

            final Data returned = response.getReturn();
            final ObjectAdapter returnedObject = returned instanceof NullData ? null : encoder.decode(returned);

            final ObjectData[] updates = response.getUpdates();
            for (final ObjectData update : updates) {
                if (LOG.isDebugEnabled()) {
View Full Code Here


        final IdentityData target = request.getTarget();
        final String fieldIdentifier = request.getFieldIdentifier();

        log("resolve field " + fieldIdentifier + " - " + dump(target));
        final ResolveFieldResponse response = decorated.resolveField(request);
        final Data result = response.getData();
        log(" <-- data: " + dump(result));
        return response;
    }
View Full Code Here

     * </ul>
     */
    @Override
    public final Data[] encodeActionParameters(final ObjectSpecification[] parameterTypes,
        final ObjectAdapter[] parameters, final KnownObjectsRequest knownObjects) {
        final Data parameterData[] = new Data[parameters.length];
        for (int i = 0; i < parameters.length; i++) {
            final ObjectAdapter parameter = parameters[i];
            final String type = parameterTypes[i].getFullIdentifier();
            parameterData[i] = createParameter(type, parameter, knownObjects);
        }
View Full Code Here

            final ObjectData persistedData = dataFactory.createObjectData(type, objectsOid, true, version);

            final Data[] allContents = data.getFieldContent();
            if (allContents != null) {
                final int contentLength = allContents.length;
                final Data persistentContents[] = new Data[contentLength];
                final ObjectAssociation[] fields = getFieldOrder(object.getSpecification());
                for (int i = 0; i < contentLength; i++) {
                    final Data fieldData = allContents[i];
                    if (fieldData instanceof NullData) {
                        persistentContents[i] = null;
                    } else if (fields[i].isOneToOneAssociation()) {
                        if (fieldData instanceof ObjectData) {
                            final ObjectAdapter fieldReference = fields[i].get(object);
View Full Code Here

     */
    @Override
    public ExecuteServerActionResponse encodeServerActionResult(final ObjectAdapter result,
        final ObjectData[] updatesData, final ReferenceData[] disposedData, final ObjectData persistedTargetData,
        final ObjectData[] persistedParametersData, final String[] messages, final String[] warnings) {
        Data resultData;
        if (result == null) {
            resultData = dataFactory.createNullData("");
        } else if (result.getSpecification().isCollection()) {
            resultData =
                serializer.serializeCollection(result, serverSideRetrievedObjectGraphDepth, new KnownObjectsRequest());
View Full Code Here

            if (fields.length != fieldContent.length) {
                throw new IsisRemoteException("Data received for different number of fields; expected " + fields.length + ", but was " + fieldContent.length);
            }
            for (int i = 0; i < fields.length; i++) {
                final ObjectAssociation field = fields[i];
                final Data fieldData = fieldContent[i];
                if (fieldData == null || field.isNotPersisted()) {
                    LOG.debug("no data for field " + field.getId());
                    continue;
                }
View Full Code Here

    }

    private ObjectAdapter[] decodeParameters(final AuthenticationSession session, final Data[] parameterData, final KnownObjectsRequest knownObjects) {
        final ObjectAdapter[] parameters = new ObjectAdapter[parameterData.length];
        for (int i = 0; i < parameters.length; i++) {
            final Data data = parameterData[i];
            if (data instanceof NullData) {
                continue;
            }

            if (data instanceof IdentityData) {
                parameters[i] = getPersistentObjectAdapter(session, (IdentityData) data);
            } else if (data instanceof ObjectData) {
                parameters[i] = encoderDecoder.decode(data, knownObjects);
            } else if (data instanceof EncodableObjectData) {
                final ObjectSpecification valueSpecification = getSpecificationLoader().loadSpecification(data.getType());
                final String valueData = ((EncodableObjectData) data).getEncodedObjectData();

                final ObjectAdapter value = restoreLeafObject(valueData, valueSpecification);
                /*
                 * ObjectAdapter value =
View Full Code Here

        final ObjectSpecification spec = getSpecification(targetData.getType());
        final ObjectAssociation field = spec.getAssociation(fieldIdentifier);
        final ObjectAdapter targetAdapter = getPersistenceSession().recreateAdapter(targetData.getOid(), spec);

        getPersistenceSession().resolveField(targetAdapter, field);
        final Data data = encoderDecoder.encodeForResolveField(targetAdapter, fieldIdentifier);
        return new ResolveFieldResponse(data);
    }
View Full Code Here

        getTransactionManager().executeWithinTransaction(new TransactionalClosureAbstract() {
            @Override
            public void execute() {
                final ResolveFieldRequest request = new ResolveFieldRequest(getAuthenticationSession(), adapterData, fieldId);
                final ResolveFieldResponse response = serverFacade.resolveField(request);
                final Data data = response.getData();
                encoderDecoder.decode(data);
            }
        });
    }
View Full Code Here

            @Override
            public void execute() {
                final ResolveFieldRequest request =
                    new ResolveFieldRequest(getAuthenticationSession(), adapterData, fieldId);
                final ResolveFieldResponse response = serverFacade.resolveField(request);
                final Data data = response.getData();
                encoderDecoder.decode(data);
            }
        });
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.remoting.common.data.Data

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.