New endpoints to auto populate edge properties.
[aai/gizmo.git] / src / main / java / org / openecomp / schema / RelationshipSchemaValidator.java
index af20699..e2374be 100644 (file)
@@ -338,4 +338,15 @@ public class RelationshipSchemaValidator {
     return modelEdgeBuilder.build();
   }
 
+    
+  public static String vertexTypeFromUri(String uri) throws CrudException {
+      
+    Matcher matcher = urlPattern.matcher(uri);
+
+    if (!matcher.matches()) {
+      throw new CrudException("Invalid Source/Target Urls", Status.BAD_REQUEST);
+    }
+
+    return matcher.group(2);
+  }
 }