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

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


                } else {
                    ObjectData[] updates;
                    if (!associatedSpec.isValueOrIsAggregated()) {
                        final IdentityData associateReference = encoder.encodeIdentityData(associateAdapter);
                        final SetAssociationRequest request = new SetAssociationRequest(getAuthenticationSession(), name, targetReference, associateReference);
                        final SetAssociationResponse response = serverFacade.setAssociation(request);
                        updates = response.getUpdates();
                    } else {
                        final EncodableObjectData val = encoder.encodeAsValue(associateAdapter);
                        final SetValueRequest request = new SetValueRequest(getAuthenticationSession(), name, targetReference, val);
                        final SetValueResponse response = serverFacade.setValue(request);
                        updates = response.getUpdates();
                    }
                    encoder.decode(updates);
                }
            } catch (final ConcurrencyException e) {
                throw ProxyUtil.concurrencyException(e);
View Full Code Here


        if (inObject.isPersistent()) {
            try {
                final IdentityData targetReference = encoderDecoder.encodeIdentityData(inObject);
                final IdentityData associateReference = encoderDecoder.encodeIdentityData(referencedAdapter);
                final SetAssociationRequest request = new SetAssociationRequest(getAuthenticationSession(), name, targetReference, associateReference);
                final SetAssociationResponse response = serverFacade.setAssociation(request);
                final ObjectData[] updates = response.getUpdates();
                encoderDecoder.decode(updates);
            } catch (final ConcurrencyException e) {
                throw ProxyUtil.concurrencyException(e);
            } catch (final IsisException e) {
                LOG.error("remote exception: " + e.getMessage(), e);
View Full Code Here

    @Test
    public void testSetAssociation() {
        IsisContext.getTransactionManager().startTransaction();
        final SetAssociationRequest request = new SetAssociationRequest(authenticationSession, "director", movieData, personData);
        final SetAssociationResponse response = server.setAssociation(request);
        final ObjectData[] updates = response.getUpdates();
        IsisContext.getTransactionManager().endTransaction();

        nameField.assertField(movieAdapter, personAdapter.getObject());
        assertEquals(0, updates.length);
    }
View Full Code Here

            ((OneToOneAssociation) association).setAssociation(targetAdapter, associate);
        } else {
            ((OneToManyAssociation) association).addElement(targetAdapter, associate);
        }

        return new SetAssociationResponse(getUpdates());
    }
View Full Code Here

        final String fieldIdentifier = request.getFieldIdentifier();
        final IdentityData targetData = request.getTarget();
        final IdentityData associateData = request.getAssociate();

        log("set association " + fieldIdentifier + indentedNewLine() + "target: " + dump(targetData) + indentedNewLine() + "associate: " + dump(associateData));
        final SetAssociationResponse response = decorated.setAssociation(request);
        final ObjectData[] changes = response.getUpdates();
        log("  <-- changes: " + dump(changes));
        return response;
    }
View Full Code Here

                    if (!associatedSpec.isValueOrIsAggregated()) {
                        final IdentityData associateReference = encoder.encodeIdentityData(associateAdapter);
                        final SetAssociationRequest request =
                            new SetAssociationRequest(getAuthenticationSession(), name, targetReference,
                                associateReference);
                        final SetAssociationResponse response = serverFacade.setAssociation(request);
                        updates = response.getUpdates();
                    } else {
                        final EncodableObjectData val = encoder.encodeAsValue(associateAdapter);
                        final SetValueRequest request =
                            new SetValueRequest(getAuthenticationSession(), name, targetReference, val);
                        final SetValueResponse response = serverFacade.setValue(request);
                        updates = response.getUpdates();
                    }
                    encoder.decode(updates);
                }
            } catch (final ConcurrencyException e) {
                throw ProxyUtil.concurrencyException(e);
View Full Code Here

            try {
                final IdentityData targetReference = encoderDecoder.encodeIdentityData(inObject);
                final IdentityData associateReference = encoderDecoder.encodeIdentityData(referencedAdapter);
                final SetAssociationRequest request =
                    new SetAssociationRequest(getAuthenticationSession(), name, targetReference, associateReference);
                final SetAssociationResponse response = serverFacade.setAssociation(request);
                final ObjectData[] updates = response.getUpdates();
                encoderDecoder.decode(updates);
            } catch (final ConcurrencyException e) {
                throw ProxyUtil.concurrencyException(e);
            } catch (final IsisException e) {
                LOG.error("remote exception: " + e.getMessage(), e);
View Full Code Here

        final IdentityData targetData = request.getTarget();
        final IdentityData associateData = request.getAssociate();

        log("set association " + fieldIdentifier + indentedNewLine() + "target: " + dump(targetData)
            + indentedNewLine() + "associate: " + dump(associateData));
        final SetAssociationResponse response = decorated.setAssociation(request);
        final ObjectData[] changes = response.getUpdates();
        log("  <-- changes: " + dump(changes));
        return response;
    }
View Full Code Here

            ((OneToOneAssociation) association).setAssociation(targetAdapter, associate);
        } else {
            ((OneToManyAssociation) association).addElement(targetAdapter, associate);
        }

        return new SetAssociationResponse(getUpdates());
    }
View Full Code Here

    @Test
    public void testSetAssociation() {
        IsisContext.getTransactionManager().startTransaction();
        final SetAssociationRequest request =
            new SetAssociationRequest(authenticationSession, "director", movieData, personData);
        final SetAssociationResponse response = server.setAssociation(request);
        final ObjectData[] updates = response.getUpdates();
        IsisContext.getTransactionManager().endTransaction();

        nameField.assertField(movieAdapter, personAdapter.getObject());
        assertEquals(0, updates.length);
    }
View Full Code Here

TOP

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

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.