Package com.linkedin.restli.server

Examples of com.linkedin.restli.server.UpdateResponse


  {
    CompoundKey c1 = new CompoundKey().append("a", "a1").append("b", 1);
    CompoundKey c2 = new CompoundKey().append("a", "a2").append("b", 2);
    CompoundKey c3 = new CompoundKey().append("a", "a3").append("b", 3);
    Map<CompoundKey, UpdateResponse> results = new HashMap<CompoundKey, UpdateResponse>();
    results.put(c1, new UpdateResponse(HttpStatus.S_202_ACCEPTED));
    results.put(c2, new UpdateResponse(HttpStatus.S_202_ACCEPTED));
    RestLiServiceException restLiServiceException = new RestLiServiceException(HttpStatus.S_404_NOT_FOUND);

    BatchUpdateResult<CompoundKey, Foo> batchUpdateResult = new BatchUpdateResult<CompoundKey, Foo>(results,
                                                                                                    Collections.singletonMap(c3, restLiServiceException));
View Full Code Here


  }

  @Override
  public UpdateResponse update(final Long key, final Greeting entity)
  {
    return new UpdateResponse(HttpStatus.S_404_NOT_FOUND);
  }
View Full Code Here

    Map<CompoundKey, UpdateResponse> responseMap = new HashMap<CompoundKey, UpdateResponse>();
    Map<CompoundKey, RestLiServiceException> errorMap = new HashMap<CompoundKey, RestLiServiceException>();

    for(CompoundKey key : keys)
    {
      responseMap.put(key, new UpdateResponse(HttpStatus.S_201_CREATED));
    }
    return new BatchUpdateResult<CompoundKey, Greeting>(responseMap);
  }
View Full Code Here

    final SettablePromise<UpdateResponse> result = Promises.settable();
    Runnable requestHandler = new Runnable()
    {
      public void run()
      {
        result.done(new UpdateResponse(HttpStatus.S_200_OK));
      }
    };
    scheduler.schedule(requestHandler, DELAY, TimeUnit.MILLISECONDS);
    return result;
  }
View Full Code Here

  }

  @Delete
  public Promise<UpdateResponse> delete(Long key)
  {
    return Promises.value(new UpdateResponse(HttpStatus.S_200_OK));
  }
View Full Code Here

     */
  @Override
  public UpdateResponse delete(ComplexResourceKey<GroupMembershipKey, GroupMembershipParam> id)
  {
    boolean deleted = _app.getMembershipMgr().delete(complexKeyToCompoundKey(id));
    return new UpdateResponse(deleted ? S_204_NO_CONTENT : S_404_NOT_FOUND);
  }
View Full Code Here

    {
      PatchApplier.applyPatch(membership, patch);
    }
    catch (DataProcessingException e)
    {
      return new UpdateResponse(S_400_BAD_REQUEST);
    }

    //validate(membership);

    // we set groupID, memberID based on the URI
    membership.setId(id.getKey());

    _app.getMembershipMgr().save(toGroupMembership(membership));

    return new UpdateResponse(S_204_NO_CONTENT);
  }
View Full Code Here

  public UpdateResponse update(ComplexResourceKey<GroupMembershipKey, GroupMembershipParam> key, ComplexKeyGroupMembership membership) {
    membership.setId(key.getKey());

    _app.getMembershipMgr().save(toGroupMembership(membership));

    return new UpdateResponse(S_204_NO_CONTENT);
  }
View Full Code Here

      public void run()
      {
        try
        {
          _dataProvider.partialUpdate(key, patch);
          result.done(new UpdateResponse(HttpStatus.S_204_NO_CONTENT));
        }
        catch (DataProcessingException e)
        {
          result.done(new UpdateResponse(HttpStatus.S_400_BAD_REQUEST));
        }
      }
    };

    _scheduler.schedule(requestHandler, DELAY, TimeUnit.MILLISECONDS);
View Full Code Here


  @Override
  public UpdateResponse update(Integer id, PatchRequest<GroupContact> request)
  {
    return new UpdateResponse(S_204_NO_CONTENT);
  }
View Full Code Here

TOP

Related Classes of com.linkedin.restli.server.UpdateResponse

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.