code: public String getEndpoint() {
      try {
        String endpointString = uri.getPath().split("/")[3];
        if (!endpointString.equals(ENDPOINT_IN) && !endpointString.equals(ENDPOINT_OUT)) {
          throw new IllegalArgumentException(endpointString + " is not a valid context endpoint");
        }
        return endpointString;
      } catch (IndexOutOfBoundsException e) {
        return null;
      }
    }
docs: Returns the context endpoint type.
  
  @return The context endpoint type defined in the URI.