@RestMethod.Get public void get( ComplexResourceKey<PermitRequest, EmptyRecord> key,
@RestMethod.Get public Message get(String key) { return _db.get(key); }
@RestMethod.Get public Greeting get(Long key) { return _db.get(key); }
@RestMethod.Get public void get( ComplexResourceKey<PermitRequest, EmptyRecord> key,
@RestMethod.Get public Greeting get(Long key, @QueryParam("ignoreProjection") @Optional("false") boolean ignoreProjection)
@RestMethod.Get public ValidationDemo get(final Integer key, @ValidatorParam RestLiDataValidator validator) { // Generate an entity that does not conform to the data schema ValidationDemo.UnionFieldWithInlineRecord union = new ValidationDemo.UnionFieldWithInlineRecord(); union.setMyEnum(myEnum.BARBAR); ValidationDemo validationDemo = new ValidationDemo().setStringA("stringA is readOnly").setUnionFieldWithInlineRecord(union); // Validate the entity ValidationResult result = validator.validateOutput(validationDemo); check(!result.isValid()); String errorMessages = result.getMessages().toString(); check(errorMessages.contains("/stringA :: length of \"stringA is readOnly\" is out of range 1...10")); check(errorMessages.contains("/stringB :: field is required but not found")); // Fix the entity validationDemo.setStringA("abcd").setStringB("stringB"); // Validate the entity again result = validator.validateOutput(validationDemo); check(result.isValid()); return validationDemo; }
/** * @see AssociationResource#get */ @RestMethod.Get public ComplexKeyGroupMembership get(ComplexResourceKey<GroupMembershipKey, GroupMembershipParam> id, @Optional @QueryParam("testParam") GroupMembershipParam param, @Optional @QueryParam("testParamArray") GroupMembershipQueryParamArray paramArray) { // For the purpose of test, if param is present, must contain both int and string // parts and the int param string value must equal the string parameter value. if (param != null) { String stringParam = param.getStringParameter(); Integer intParam = param.getIntParameter(); if (stringParam == null || intParam == null || !stringParam.equals(intParam.toString())) { throw new RestLiServiceException(S_400_BAD_REQUEST, "The values of testParam parameter don't match"); } } return fromGroupMembership(_app.getMembershipMgr().get(complexKeyToCompoundKey(id))); }
@Get public Greeting get(Long key) { return new Greeting().setMessage(key.toString()); }
@RestMethod.Get public ValidationDemo get() { return _returnEntity; }
@RestMethod.Get public Greeting get(Long key) { return null; }
@Get public Message get(String key) { return _db.get(getParentKey() + " " + key); }
@RestMethod.Get public ValidationDemo get(final Integer key) { if (key == 0) { throw new RestLiServiceException(HttpStatus.S_400_BAD_REQUEST); } // Generate an entity that does not conform to the data schema ValidationDemo.UnionFieldWithInlineRecord union = new ValidationDemo.UnionFieldWithInlineRecord(); union.setMyEnum(myEnum.BARBAR); ValidationDemo validationDemo = new ValidationDemo().setStringA("stringA is readOnly").setUnionFieldWithInlineRecord(union); return validationDemo; }
@RestMethod.Get public Promise<Message> get(final ComplexResourceKey<TwoPartKey, TwoPartKey> key) { final SettablePromise<Message> result = Promises.settable(); final Runnable requestHandler = new Runnable() { public void run() { result.done(_dataProvider.get(key)); } }; _scheduler.schedule(requestHandler, DELAY, TimeUnit.MILLISECONDS); return result; }
@RestMethod.Get public void get(String key, @UnstructuredDataWriterParam UnstructuredDataWriter writer) { respondGoodUnstructuredData(writer); } }
@RestMethod.Get public GetResult<Greeting> getWithResult(Long key) { final Greeting value = new Greeting().setMessage("Hello, sorry for the mess"); return new GetResult<Greeting>(value, HttpStatus.S_500_INTERNAL_SERVER_ERROR); }
@RestMethod.Get public Greeting get(Long key, @ProjectionParam MaskTree projection, @PathKeysParam PathKeys keys) { Greeting greeting = createGreeting(projection, keys); greeting.setId(key); return greeting; }
@RestMethod.Get public Greeting get(Long key) { return _impl.get(key); }
@RestMethod.Get public Message get(final CompoundKey key, @QueryParam(value = "array", typeref = CustomStringRef.class) final CustomString[] stringArray) { return new Message().setId(((CustomDouble) key.getPart("src")).toDouble() + "->" + ((URI) key.getPart( "dest")).getHost()) .setMessage(String.format("I need some $20. Array contents %s.", Arrays.asList(stringArray))) .setTone(Tone.SINCERE); } }
@RestMethod.Get public Greeting getGreeting(Long idx, @Optional @QueryParam("auth") String auth, @Optional @QueryParam("testComplex") GroupMembershipParam complexParam) { validateAuth(auth); Greeting g = _impl.get(idx); return g; }
@RestMethod.Get public TwoPartKey get(String key) { PathKeys pathKeys = getContext().getPathKeys(); ComplexResourceKey<TwoPartKey, TwoPartKey> keys = pathKeys.get("keys"); return convert(keys); }