Beispiel #1
0
 @Override
 public void readMembers(RequestContext ctx, ResourceSink sink) {
   this.fires
       .stream()
       .forEach(
           (e) -> {
             sink.accept(e);
           });
   sink.close();
 }
Beispiel #2
0
 @Override
 public void readMembers(RequestContext ctx, ResourceSink sink) {
   this.resources
       .values()
       .forEach(
           (e) -> {
             sink.accept(e);
           });
   try {
     sink.close();
   } catch (Exception e) {
     e.printStackTrace(); // To change body of catch statement use File | Settings | File
     // Templates.
   }
 }
Beispiel #3
0
  @Override
  public void readMembers(RequestContext ctx, ResourceSink sink) throws Exception {

    ResourceParams resourceParams = ctx.resourceParams();
    if (resourceParams != null && resourceParams.value(TARGET_PARAMETER) != null) {
      String target = resourceParams.value(TARGET_PARAMETER);
      for (Script script : scripts.getByTarget(target)) {
        sink.accept(new ResourceScript(this, script));
      }

    } else {

      for (Script script : scripts.values()) {
        sink.accept(new ResourceScript(this, script));
      }
    }
    sink.close();
  }
Beispiel #4
0
 @Override
 public void readMembers(RequestContext ctx, ResourceSink sink) throws Exception {
   sink.accept(scriptFileResource);
   sink.close();
 }