src/main/java/io/mantisrx/api/push/PushConnectionDetails.java
public static TARGET_TYPE determineTargetType(final String uri) {
        if (uri.startsWith("/jobconnectbyname") || uri.startsWith("/api/v1/jobconnectbyname")) {
            return TARGET_TYPE.CONNECT_BY_NAME;
        } else if (uri.startsWith("/jobconnectbyid") || uri.startsWith("/api/v1/jobconnectbyid")) {
            return TARGET_TYPE.CONNECT_BY_ID;
        } else if (uri.startsWith("/jobstatus/") || uri.startsWith("/api/v1/jobstatus/")) {
            return TARGET_TYPE.JOB_STATUS;
        } else if (uri.startsWith("/api/v1/jobs/schedulingInfo/")) {
            return TARGET_TYPE.JOB_SCHEDULING_INFO;
        } else if (uri.startsWith("/jobClusters/discoveryInfoStream/")) {
            return TARGET_TYPE.JOB_CLUSTER_DISCOVERY;
        } else if (uri.startsWith("/api/v1/metrics/")) {
            return TARGET_TYPE.METRICS;
        } else {
            throw new IllegalArgumentException("Unable to determine push connection type from URI: " + uri);
        }
    }
/**
     * Determines the connection type for a given push connection.
     *
     * @param uri Request URI as returned by Netty's requestUri() methods. Expects leading slash.
     * @return The CONNECTION_TYPE requested by the URI.
     */
Determines the connection type for a given push connection.
@param uri Request URI as returned by Netty's requestUri() methods. Expects leading slash.
@return The CONNECTION_TYPE requested by the URI.
Determines the connection type for a given push connection . @param uri Request URI as returned by Netty ' s requestUri () methods . Expects leading slash . @return The CONNECTION_TYPE requested by the URI .
public static TARGET_TYPE determineTargetType(final String uri) {
        if (uri.startsWith("/jobconnectbyname") || uri.startsWith("/api/v1/jobconnectbyname")) {
            return TARGET_TYPE.CONNECT_BY_NAME;
        } else if (uri.startsWith("/jobconnectbyid") || uri.startsWith("/api/v1/jobconnectbyid")) {
            return TARGET_TYPE.CONNECT_BY_ID;
        } else if (uri.startsWith("/jobstatus/") || uri.startsWith("/api/v1/jobstatus/")) {
            return TARGET_TYPE.JOB_STATUS;
        } else if (uri.startsWith("/api/v1/jobs/schedulingInfo/")) {
            return TARGET_TYPE.JOB_SCHEDULING_INFO;
        } else if (uri.startsWith("/jobClusters/discoveryInfoStream/")) {
            return TARGET_TYPE.JOB_CLUSTER_DISCOVERY;
        } else if (uri.startsWith("/api/v1/metrics/")) {
            return TARGET_TYPE.METRICS;
        } else {
            throw new IllegalArgumentException("Unable to determine push connection type from URI: " + uri);
        }
    }
public static TARGET_TYPE determineTargetType ( final String uri ) { if ( uri . startsWith ( "/jobconnectbyname" ) || uri . startsWith ( "/api/v1/jobconnectbyname" ) ) { return TARGET_TYPE . CONNECT_BY_NAME ; } else if ( uri . startsWith ( "/jobconnectbyid" ) || uri . startsWith ( "/api/v1/jobconnectbyid" ) ) { return TARGET_TYPE . CONNECT_BY_ID ; } else if ( uri . startsWith ( "/jobstatus/" ) || uri . startsWith ( "/api/v1/jobstatus/" ) ) { return TARGET_TYPE . JOB_STATUS ; } else if ( uri . startsWith ( "/api/v1/jobs/schedulingInfo/" ) ) { return TARGET_TYPE . JOB_SCHEDULING_INFO ; } else if ( uri . startsWith ( "/jobClusters/discoveryInfoStream/" ) ) { return TARGET_TYPE . JOB_CLUSTER_DISCOVERY ; } else if ( uri . startsWith ( "/api/v1/metrics/" ) ) { return TARGET_TYPE . METRICS ; } else { throw new IllegalArgumentException ( "Unable to determine push connection type from URI: " + uri ) ; } }
Determines the connection type for a given push connection.
Determines the connection type for a given push connection .