@Test public void testParseUri() { String uri = "/abbaspour/jobs/d081adc6-c193-48ef-a99a-85c4e5934cfb/stor/abbaspour/stor/treasure_island.txt.0.c8598f52-3c14-451a-9b2f-354579a2d5e8"; ObjectRequest objectRequest = JobGetRequest.fromJobGetHttpRequest(uri); assertNotNull(objectRequest); ObjectName on = objectRequest.objectName; assertNotNull(on); assertEquals("abbaspour", on.owner); assertEquals(ObjectName.Namespace.STOR, on.ns); assertEquals("treasure_island.txt.0.c8598f52-3c14-451a-9b2f-354579a2d5e8", on.name); }
public static ObjectRequest fromJobGetHttpRequest(String uri) { int loc = uri.indexOf("/stor/"); if (loc <= 0) throw new IllegalArgumentException("invalid job get uri: " + uri); String path = uri.substring(loc + 5); Optional<ObjectName> on = ObjectName.of(path); if(! on.isPresent()) throw new IllegalArgumentException("invalid job get path: " + path); return new ObjectRequest(on.get()); }
JobGetRequest extends JobRequest { public static ObjectRequest fromJobGetHttpRequest(String uri) { int loc = uri.indexOf("/stor/"); if (loc <= 0) throw new IllegalArgumentException("invalid job get uri: " + uri); String path = uri.substring(loc + 5); Optional<ObjectName> on = ObjectName.of(path); if(! on.isPresent()) throw new IllegalArgumentException("invalid job get path: " + path); return new ObjectRequest(on.get()); } }
JobGetRequest extends JobRequest { public static ObjectRequest fromJobGetHttpRequest(String uri) { int loc = uri.indexOf("/stor/"); if (loc <= 0) throw new IllegalArgumentException("invalid job get uri: " + uri); String path = uri.substring(loc + 5); Optional<ObjectName> on = ObjectName.of(path); if(! on.isPresent()) throw new IllegalArgumentException("invalid job get path: " + path); return new ObjectRequest(on.get()); } JobGetRequest(FullHttpRequest fullHttpRequest); }
JobGetRequest extends JobRequest { public static ObjectRequest fromJobGetHttpRequest(String uri) { int loc = uri.indexOf("/stor/"); if (loc <= 0) throw new IllegalArgumentException("invalid job get uri: " + uri); String path = uri.substring(loc + 5); Optional<ObjectName> on = ObjectName.of(path); if(! on.isPresent()) throw new IllegalArgumentException("invalid job get path: " + path); return new ObjectRequest(on.get()); } JobGetRequest(FullHttpRequest fullHttpRequest); String getStorageNodeId(); static String getStorageNodeId(String uri); @Override String toString(); static ObjectRequest fromJobGetHttpRequest(String uri); }
JobGetRequest extends JobRequest { public static ObjectRequest fromJobGetHttpRequest(String uri) { int loc = uri.indexOf("/stor/"); if (loc <= 0) throw new IllegalArgumentException("invalid job get uri: " + uri); String path = uri.substring(loc + 5); Optional<ObjectName> on = ObjectName.of(path); if(! on.isPresent()) throw new IllegalArgumentException("invalid job get path: " + path); return new ObjectRequest(on.get()); } JobGetRequest(FullHttpRequest fullHttpRequest); String getStorageNodeId(); static String getStorageNodeId(String uri); @Override String toString(); static ObjectRequest fromJobGetHttpRequest(String uri);  }