@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("customLongArray") public List<Greeting> customLongArray(@QueryParam(value="ls", typeref=CustomLongRef.class) CustomLong[] ls) { return Collections.emptyList(); }
@Finder("searchReturnNullList") public List<Greeting> searchReturnNullList(@PagingContextParam PagingContext ctx, @QueryParam("tone") Tone tone) { if (tone == Tone.INSULTING) { //return a null list return null; } else { //return a list with a null element in it final List<Greeting> greetings = new ArrayList<Greeting>(); greetings.add(null); greetings.add(DB.get(1)); return greetings; } }
@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)); } }; } }
@Finder("repeatedGreetings") public List<Greeting> serveRepeatedGreeting(@QueryParam(value="repeat", typeref=CustomLongRef.class) CustomLong l) { List<Greeting> result = new ArrayList<Greeting>(); Greeting g = new Greeting(); g.setId(1); StringBuilder msg = new StringBuilder(); for(long i=0;i < l.toLong(); i++) { msg.append("hello world "); } g.setMessage(msg.toString()); result.add(g); return result; }
@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 Promise<List<Greeting>> search(@QueryParam("what") final String s) { final SettablePromise<List<Greeting>> result = Promises.settable(); Runnable requestHandler = new Runnable() { public void run() { result.done(Arrays.asList(new Greeting().setMessage(s))); } }; scheduler.schedule(requestHandler, DELAY, TimeUnit.MILLISECONDS); return result; }
@Finder("search") public List<Greeting> search(@PagingContextParam PagingContext ctx, @QueryParam("tone") @Optional Tone tone, @QueryParam("complexQueryParam") @Optional Greeting complexQueryParam) { return _impl.search(ctx, tone); }
@Finder("finder") public List<Greeting> finder(@QueryParam("array") ComplexArray array) { array.getArray(); array.getNext().getArray(); List<Greeting> list = new ArrayList<Greeting>(); list.add(DEFAULT_GREETING); return list; }
/** * Example javadoc */ @TestMethod(doc = "For integration tests only.") @Finder("prefix") public Promise<List<Message>> prefix(@QueryParam("prefix")final String prefix) { final SettablePromise<List<Message>> result = Promises.settable(); final Runnable requestHandler = new Runnable() { public void run() { result.done(_dataProvider.findByPrefix(prefix)); } }; _scheduler.schedule(requestHandler, DELAY, TimeUnit.MILLISECONDS); return result; }
@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()); }
@Finder("searchReturnNullCollectionList") public CollectionResult<Greeting, SearchMetadata> searchReturnNullCollectionList(@PagingContextParam PagingContext ctx, @QueryParam("tone") Tone tone) { if (tone == Tone.INSULTING) { //return a null CollectionResult return null; } else if (tone == Tone.SINCERE) { //return a CollectionResult with a null list return new CollectionResult<Greeting, SearchMetadata>(null); } else { //return a CollectionResult with a list that has a null element in it final List<Greeting> greetings = new ArrayList<Greeting>(); greetings.add(null); greetings.add(DB.get(1)); return new CollectionResult<Greeting, SearchMetadata>(greetings); } }