@Finder("latestFlowStatus") public List<FlowStatus> getLatestFlowStatus(@Context PagingContext context, @QueryParam("flowId") FlowId flowId) { LOG.info("getLatestFlowStatus called with flowGroup " + flowId.getFlowGroup() + " flowName " + flowId.getFlowName()); org.apache.gobblin.service.monitoring.FlowStatus latestFlowStatus = _flowStatusGenerator.getLatestFlowStatus(flowId.getFlowName(), flowId.getFlowGroup()); if (latestFlowStatus != null) { return Collections.singletonList(convertFlowStatus(latestFlowStatus)); } // will return 404 status code return null; }
@Finder("empty") public List<Greeting> emptyFinder(@QueryParam("array") EmptyArray array, @QueryParam("map") EmptyMap map) { return Collections.emptyList(); }
@Finder("customLong") public List<Greeting> customLong(@QueryParam(value="l", typeref=CustomLongRef.class) CustomLong l) { return Collections.emptyList(); }
@Finder("date") public List<Greeting> date(@QueryParam(value="d", typeref=DateRef.class) Date d) { return Collections.emptyList(); }
@Finder("calendars") public List<Greeting> calendars(@QueryParam(value="calendars", typeref=CalendarRef.class) Calendar[] calendars) { return Collections.emptyList(); }
@Finder("ip") public List<Greeting> ip(@QueryParam(value="ip", typeref=IPAddressSimple.class) InetAddress ip) { return Collections.emptyList(); }
@Finder("calendar") public List<Greeting> calendar(@QueryParam(value="calendar", typeref=CalendarRef.class) Calendar calendar) { return Collections.emptyList(); }
@Finder("prefix") public List<Message> prefix(@QueryParam("prefix") String prefix) { return _dataProvider.findByPrefix(prefix); }
@Finder("finderTaskNullList") public Task<List<Greeting>> finderTaskNullList(@PagingContextParam final PagingContext a, @QueryParam("tone") final Tone b) { return new BaseTask<List<Greeting>>() { protected Promise<List<Greeting>> run(final com.linkedin.parseq.Context context) throws Exception { //Depending on the tone, we return a null list or a list with a null element return Promises.value(searchReturnNullList(a, b)); } }; } }
@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; }
@Finder("search") public List<Group> search(@PagingContextParam PagingContext pagingContext, @QueryParam("keywords") @Optional String keywords, @QueryParam("nameKeywords") @Optional String nameKeywords, @QueryParam("groupID") @Optional Integer groupID) { return getGroupMgr().search(keywords, nameKeywords, groupID, pagingContext.getStart(), pagingContext.getCount()); }
@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.Create public CreateResponse create(Greeting entity, @QueryParam("isNullId") @Optional("false") boolean isNullId) { entity.setId(_idSeq.incrementAndGet()); _db.put(entity.getId(), entity); if (isNullId) { return new CreateResponse(null, HttpStatus.S_201_CREATED); } return new CreateResponse(entity.getId()); }
@Finder("searchWithDefault") public List<Greeting> searchWithDefault(@PagingContextParam PagingContext ctx, @QueryParam("tone") @Optional("FRIENDLY") Tone tone) { return search(ctx, tone); }
@RestMethod.Delete public UpdateResponse deleteGreeting(Long key, @Optional @QueryParam("auth") String auth) { validateAuth(auth); return _impl.delete(key); }
@RestMethod.PartialUpdate public UpdateResponse updateGreeting(Long key, PatchRequest<Greeting> patch, @Optional @QueryParam("auth") String auth) { validateAuth(auth); return _impl.update(key, patch); }
@RestMethod.Update public UpdateResponse updateGreeting(Long key, Greeting entity, @Optional @QueryParam("auth") String auth) { validateAuth(auth); return _impl.update(key, entity); }
@RestMethod.Create public CreateResponse createGreeting(Greeting entity, @Optional @QueryParam("auth") String auth) { validateAuth(auth); return _impl.create(entity, false); }
@Finder("latestFlowStatus") public List<FlowStatus> getLatestFlowStatus(@Context PagingContext context, @QueryParam("flowId") FlowId flowId) { LOG.info("getLatestFlowStatus called with flowGroup " + flowId.getFlowGroup() + " flowName " + flowId.getFlowName()); gobblin.service.monitoring.FlowStatus latestFlowStatus = _flowStatusGenerator.getLatestFlowStatus(flowId.getFlowName(), flowId.getFlowGroup()); if (latestFlowStatus != null) { return Collections.singletonList(convertFlowStatus(latestFlowStatus)); } // will return 404 status code return null; }
@Finder("manager") public List<Group> findByManager(@PagingContextParam PagingContext pagingContext, @QueryParam("managerMemberID") int memberID) { return getGroupMgr().findByManager(memberID, pagingContext.getStart(), pagingContext.getCount()); }