private Collection<Endpoint> getEndpoints(DataService dSrv, Operation operation) { Collection<Endpoint> x = dSrv.getEndpoints(operation); if ( x == null || x.isEmpty() ) { if ( operation == Operation.GSP_R ) x = dSrv.getEndpoints(Operation.GSP_RW); else if ( operation == Operation.Quads_R ) x = dSrv.getEndpoints(Operation.Quads_RW); } return x; }
private Collection<Endpoint> getEndpoints(DataService dSrv, Operation operation) { Collection<Endpoint> x = dSrv.getEndpoints(operation); if ( x == null || x.isEmpty() ) { if ( operation == Operation.GSP_R ) x = dSrv.getEndpoints(Operation.GSP_RW); else if ( operation == Operation.Quads_R ) x = dSrv.getEndpoints(Operation.Quads_RW); } return x; }
/** * Test whether there is a configuration that allows this action as the operation * given. Ignores the operation in the action which is set due to parsing - it * might be "quads" which is the generic operation when just the dataset is * specified. */ private boolean isEnabled(HttpAction action, Operation operation) { // Disregard the operation name of the action. DataService dSrv = action.getDataService(); if ( dSrv == null ) return false; return !dSrv.getEndpoints(operation).isEmpty(); } }
/** * Test whether there is a configuration that allows this action as the operation * given. Ignores the operation in the action which is set due to parsing - it * might be "quads" which is the generic operation when just the dataset is * specified. */ private boolean isEnabled(HttpAction action, Operation operation) { // Disregard the operation name of the action. DataService dSrv = action.getDataService(); if ( dSrv == null ) return false; return !dSrv.getEndpoints(operation).isEmpty(); } }
private static Map<String, List<String>> description(DataAccessPointRegistry reg) { Map<String, List<String>> desc = new LinkedHashMap<>(); reg.forEach((ds,dap)->{ List<String> endpoints = new ArrayList<>(); desc.put(ds, endpoints); DataService dSrv = dap.getDataService(); dSrv.getOperations().forEach((op)->{ dSrv.getEndpoints(op).forEach(ep-> { String x = ep.getName(); if ( x.isEmpty() ) x = "quads"; endpoints.add(x); }); }); }); return desc; }
private static Map<String, List<String>> description(DataAccessPointRegistry reg) { Map<String, List<String>> desc = new LinkedHashMap<>(); reg.forEach((ds,dap)->{ List<String> endpoints = new ArrayList<>(); desc.put(ds, endpoints); DataService dSrv = dap.getDataService(); dSrv.getOperations().forEach((op)->{ dSrv.getEndpoints(op).forEach(ep-> { String x = ep.getName(); if ( x.isEmpty() ) x = "quads"; endpoints.add(x); }); }); }); return desc; }
private static Map<String, List<String>> description(DataAccessPointRegistry reg) { Map<String, List<String>> desc = new LinkedHashMap<>(); reg.forEach((ds,dap)->{ List<String> endpoints = new ArrayList<>(); desc.put(ds, endpoints); DataService dSrv = dap.getDataService(); dSrv.getOperations().forEach((op)->{ dSrv.getEndpoints(op).forEach(ep-> { String x = ep.getEndpoint(); if ( x.isEmpty() ) x = "quads"; endpoints.add(x); }); }); }); return desc; }
private static Map<String, List<String>> description(DataAccessPointRegistry reg) { Map<String, List<String>> desc = new LinkedHashMap<>(); reg.forEach((ds,dap)->{ List<String> endpoints = new ArrayList<>(); desc.put(ds, endpoints); DataService dSrv = dap.getDataService(); dSrv.getOperations().forEach((op)->{ dSrv.getEndpoints(op).forEach(ep-> { String x = ep.getName(); if ( x.isEmpty() ) x = "quads"; endpoints.add(x); }); }); }); return desc; }
private static Map<String, List<String>> description(DataAccessPointRegistry reg) { Map<String, List<String>> desc = new LinkedHashMap<>(); reg.forEach((ds,dap)->{ List<String> endpoints = new ArrayList<>(); desc.put(ds, endpoints); DataService dSrv = dap.getDataService(); dSrv.getOperations().forEach((op)->{ dSrv.getEndpoints(op).forEach(ep-> { String x = ep.getName(); if ( x.isEmpty() ) x = "quads"; endpoints.add(x); }); }); }); return desc; }
public void print(String string) { System.out.flush() ; if ( string == null ) string = "DataAccessPointRegistry" ; System.out.println("== "+string) ; this.forEach((k,ref)->{ System.out.printf(" (key=%s, ref=%s)\n", k, ref.getName()) ; ref.getDataService().getOperations().forEach((op)->{ ref.getDataService().getEndpoints(op).forEach(ep->{ System.out.printf(" %s : %s\n", op, ep.getName()) ; }); }); }) ; }
public void print(String string) { System.out.flush() ; if ( string == null ) string = "DataAccessPointRegistry" ; System.out.println("== "+string) ; this.forEach((k,ref)->{ System.out.printf(" (key=%s, ref=%s)\n", k, ref.getName()) ; ref.getDataService().getOperations().forEach((op)->{ ref.getDataService().getEndpoints(op).forEach(ep->{ System.out.printf(" %s : %s\n", op, ep.getName()) ; }); }); }) ; }
if ( ! dataService.getEndpoints(Operation.GSP_RW).isEmpty() || ! dataService.getEndpoints(Operation.Quads_RW).isEmpty() ) { } else if ( ! dataService.getEndpoints(Operation.GSP_R).isEmpty() || ! dataService.getEndpoints(Operation.Quads_R).isEmpty() ) {
hasAuthenticationUse = dataAccessPoints.keys().stream() .map(name-> dataAccessPoints.get(name).getDataService()) .flatMap(dSrv->dSrv.getEndpoints().stream()) .anyMatch(ep->ep.getAuthPolicy()!=null);
hasAuthenticationUse = dataAccessPoints.keys().stream() .map(name-> dataAccessPoints.get(name).getDataService()) .flatMap(dSrv->dSrv.getEndpoints().stream()) .anyMatch(ep->ep.getAuthPolicy()!=null);
public static void describe(JsonBuilder builder, DataAccessPoint access) { builder.startObject() ; builder.key(ServerConst.dsName).value(access.getName()) ; builder.key(ServerConst.dsState).value(access.getDataService().isAcceptingRequests()) ; builder.key(ServerConst.dsService) ; builder.startArray() ; for ( Operation operation : access.getDataService().getOperations() ) { List<Endpoint> endpoints = access.getDataService().getEndpoints(operation) ; describe(builder, operation, endpoints) ; } builder.finishArray() ; builder.finishObject() ; }
public static void describe(JsonBuilder builder, DataAccessPoint access) { builder.startObject() ; builder.key(ServerConst.dsName).value(access.getName()) ; builder.key(ServerConst.dsState).value(access.getDataService().isAcceptingRequests()) ; builder.key(ServerConst.dsService) ; builder.startArray() ; for ( Operation operation : access.getDataService().getOperations() ) { List<Endpoint> endpoints = access.getDataService().getEndpoints(operation) ; describe(builder, operation, endpoints) ; } builder.finishArray() ; builder.finishObject() ; }
dap.getDataService().getEndpoints().forEach(ep->{ if ( ep.getAuthPolicy()!=null ) { JettyLib.addPathConstraint(csh, DataAccessPoint.canonical(name)+"/"+ep.getName());
dap.getDataService().getEndpoints().forEach(ep->{ if ( ep.getAuthPolicy()!=null ) { JettyLib.addPathConstraint(csh, DataAccessPoint.canonical(name)+"/"+ep.getName());
private static void statsDataset(JsonBuilder builder, DataAccessPoint access) { // Object started builder.key(access.getName()) ; DataService dSrv = access.getDataService() ; builder.startObject("counters") ; builder.key(CounterName.Requests.getName()).value(dSrv.getCounters().value(CounterName.Requests)) ; builder.key(CounterName.RequestsGood.getName()).value(dSrv.getCounters().value(CounterName.RequestsGood)) ; builder.key(CounterName.RequestsBad.getName()).value(dSrv.getCounters().value(CounterName.RequestsBad)) ; builder.key(ServerConst.endpoints).startObject("endpoints") ; for ( Operation operName : dSrv.getOperations() ) { List<Endpoint> endpoints = access.getDataService().getEndpoints(operName) ; for ( Endpoint endpoint : endpoints ) { // Endpoint names are unique for a given service. builder.key(endpoint.getName()) ; builder.startObject() ; operationCounters(builder, endpoint); builder.key(ServerConst.operation).value(operName.getName()) ; builder.key(ServerConst.description).value(operName.getDescription()); builder.finishObject() ; } } builder.finishObject("endpoints") ; builder.finishObject("counters") ; }
private static void statsDataset(JsonBuilder builder, DataAccessPoint access) { // Object started builder.key(access.getName()) ; DataService dSrv = access.getDataService() ; builder.startObject("counters") ; builder.key(CounterName.Requests.getName()).value(dSrv.getCounters().value(CounterName.Requests)) ; builder.key(CounterName.RequestsGood.getName()).value(dSrv.getCounters().value(CounterName.RequestsGood)) ; builder.key(CounterName.RequestsBad.getName()).value(dSrv.getCounters().value(CounterName.RequestsBad)) ; builder.key(ServerConst.endpoints).startObject("endpoints") ; for ( Operation operName : dSrv.getOperations() ) { List<Endpoint> endpoints = access.getDataService().getEndpoints(operName) ; for ( Endpoint endpoint : endpoints ) { // Endpoint names are unique for a given service. builder.key(endpoint.getName()) ; builder.startObject() ; operationCounters(builder, endpoint); builder.key(ServerConst.operation).value(operName.getName()) ; builder.key(ServerConst.description).value(operName.getDescription()); builder.finishObject() ; } } builder.finishObject("endpoints") ; builder.finishObject("counters") ; }