Examples of PersistRequest


Examples of com.tll.common.data.PersistRequest

    m.set(new CharacterPropertyValue("mi", 'm'));
    m.set(new StringPropertyValue("phone", "1112223333"));
    m.set(new StringPropertyValue("postalCode", "48104"));
    m.set(new StringPropertyValue("province", "MI"));

    final ModelPayload p = delegate.persist(new PersistRequest(m, false));
    assert p != null;
    m = p.getModel();
    assert m != null;
    assert m.getId() != null && m.getId().equals("10000") && m.getEntityType() != null
    && m.getEntityType().equals(TestEntityType.ADDRESS);
View Full Code Here

Examples of com.tll.common.data.PersistRequest

    m.set(new StringPropertyValue(Model.ID_PROPERTY, id));
    m.set(new StringPropertyValue("address1", "1 changed street"));
    m.set(new StringPropertyValue("address2", "2 beechange"));
    m.set(new StringPropertyValue("city", "change city"));

    final ModelPayload p = delegate.persist(new PersistRequest(m, true));
    assert p != null;
    m = p.getModel();
    assert m != null;
    assert m.getId() != null && m.getId().equals(id) && m.getEntityType() != null
    && m.getEntityType().equals(TestEntityType.ADDRESS);
View Full Code Here

Examples of com.tll.common.data.PersistRequest

   */
  public final void add(Model model) {
    if(model == null || !model.isNew()) {
      throw new IllegalArgumentException("A non-null and new entity must be specified.");
    }
    final PersistRequest pr = new PersistRequest(model, false);
    modelRequest = pr;
    crudOp = CrudOp.ADD;
  }
View Full Code Here

Examples of com.tll.common.data.PersistRequest

   */
  public final void update(Model dirtyModel) {
    if(dirtyModel == null || dirtyModel.isNew()) {
      throw new IllegalArgumentException("A non-null and non-new entity must be specified.");
    }
    final PersistRequest pr = new PersistRequest(dirtyModel, true);
    modelRequest = pr;
    crudOp = CrudOp.UPDATE;
  }
View Full Code Here

Examples of org.apache.hedwig.server.persistence.PersistRequest

                                                MessageSeqId.newBuilder(msg.getMsgId()).addRemoteComponents(
                                                    RegionSpecificSeqId.newBuilder().setRegion(
                                                        msg.getSrcRegion()).setSeqId(
                                                        msg.getMsgId().getLocalComponent())));
                                        }
                                        pm.persistMessage(new PersistRequest(topic, msg, new Callback<Long>() {
                                            @Override
                                            public void operationFinished(Object ctx, Long resultOfOperation) {
                                                if (LOGGER.isDebugEnabled())
                                                    LOGGER.debug("cross-region recv-fwd succeeded for topic "
                                                                 + topic.toStringUtf8());
View Full Code Here

Examples of org.apache.hedwig.server.persistence.PersistRequest

        }

        Message msgToSerialize = Message.newBuilder(request.getPublishRequest().getMsg()).setSrcRegion(
                                     cfg.getMyRegionByteString()).build();

        PersistRequest persistRequest = new PersistRequest(request.getTopic(), msgToSerialize,
        new Callback<Long>() {
            @Override
            public void operationFailed(Object ctx, PubSubException exception) {
                channel.write(PubSubResponseUtils.getResponseForException(exception, request.getTxnId()));
            }
View Full Code Here

Examples of org.apache.hedwig.server.persistence.PersistRequest

        Message msgToSerialize = Message.newBuilder(request.getPublishRequest().getMsg()).setSrcRegion(
                                     cfg.getMyRegionByteString()).build();

        final long requestTime = MathUtils.now();
        PersistRequest persistRequest = new PersistRequest(request.getTopic(), msgToSerialize,
        new Callback<PubSubProtocol.MessageSeqId>() {
            @Override
            public void operationFailed(Object ctx, PubSubException exception) {
                channel.write(PubSubResponseUtils.getResponseForException(exception, request.getTxnId()));
                pubStats.incrementFailedOps();
View Full Code Here

Examples of org.apache.hedwig.server.persistence.PersistRequest

        MessageSeqId startId = MessageSeqId.newBuilder().setLocalComponent(1).build();

        CountDownLatch l = new CountDownLatch(1);
        Message m = Message.newBuilder().setBody(ByteString.copyFromUtf8(String.valueOf(1))).build();
        TestCallback cb = new TestCallback(l);
        pm.persistMessage(new PersistRequest(topic, m, cb, null));
        assertTrue("Persistence never finished", l.await(10, TimeUnit.SECONDS));

        final CountDownLatch oplatch = new CountDownLatch(3);
        fdm.start();
        fdm.startServingSubscription(topic, subscriber, prefs, startId, dep, filter,
View Full Code Here

Examples of org.apache.hedwig.server.persistence.PersistRequest

            Message m = Message.newBuilder().setBody(ByteString.copyFromUtf8(String.valueOf(i))).build();
            TestCallback cb = new TestCallback(l);
            if (firstCallback == null) {
                firstCallback = cb;
            }
            pm.persistMessage(new PersistRequest(topic, m, cb, null));
        }
        fdm.start();
        assertTrue("Persistence never finished", l.await(10, TimeUnit.SECONDS));
        fdm.startServingSubscription(topic, subscriber, prefs, firstCallback.getId(), dep, filter,
                new Callback<Void>() {
View Full Code Here

Examples of org.apache.hedwig.server.persistence.PersistRequest

                                    MessageSeqId.newBuilder(msg.getMsgId()).addRemoteComponents(
                                        RegionSpecificSeqId.newBuilder().setRegion(
                                            msg.getSrcRegion()).setSeqId(
                                            msg.getMsgId().getLocalComponent())));
                            }
                            pm.persistMessage(new PersistRequest(topic, msg, new Callback<MessageSeqId>() {
                                @Override
                                public void operationFinished(Object ctx, MessageSeqId resultOfOperation) {
                                    if (LOGGER.isDebugEnabled())
                                        LOGGER.debug("[" + myRegion + "] cross-region recv-fwd succeeded for topic "
                                                     + topic.toStringUtf8());
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.