Package com.groupon.odo.proxylib.models

Examples of com.groupon.odo.proxylib.models.EndpointOverride


     * @param results
     * @return
     * @throws Exception
     */
    private EndpointOverride getEndpointOverrideFromResultSet(ResultSet results) throws Exception {
        EndpointOverride endpoint = new EndpointOverride();
        endpoint.setPathId(results.getInt(Constants.GENERIC_ID));
        endpoint.setPath(results.getString(Constants.PATH_PROFILE_ACTUAL_PATH));
        endpoint.setBodyFilter(results.getString(Constants.PATH_PROFILE_BODY_FILTER));
        endpoint.setPathName(results.getString(Constants.PATH_PROFILE_PATHNAME));
        endpoint.setContentType(results.getString(Constants.PATH_PROFILE_CONTENT_TYPE));
        endpoint.setRequestType(results.getInt(Constants.PATH_PROFILE_REQUEST_TYPE));
        endpoint.setRepeatNumber(results.getInt(Constants.REQUEST_RESPONSE_REPEAT_NUMBER));
        endpoint.setGroupIds(results.getString(Constants.PATH_PROFILE_GROUP_IDS));
        endpoint.setRequestEnabled(results.getBoolean(Constants.REQUEST_RESPONSE_REQUEST_ENABLED));
        endpoint.setResponseEnabled(results.getBoolean(Constants.REQUEST_RESPONSE_RESPONSE_ENABLED));
        endpoint.setClientUUID(results.getString(Constants.GENERIC_CLIENT_UUID));
        endpoint.setProfileId(results.getInt(Constants.GENERIC_PROFILE_ID));
        endpoint.setGlobal(results.getBoolean(Constants.PATH_PROFILE_GLOBAL));
        return endpoint;
    }
View Full Code Here


     *
     * @param pathId
     * @return
     */
    public EndpointOverride getPath(int pathId, String clientUUID, String[] filters) throws Exception {
        EndpointOverride endpoint = null;
        PreparedStatement statement = null;
        ResultSet results = null;

        try (Connection sqlConnection = sqlService.getConnection()) {
            String queryString = this.getPathSelectString();
            queryString += " AND " + Constants.DB_TABLE_PATH + "." + Constants.GENERIC_ID + "=" + pathId + ";";
            statement = sqlConnection.prepareStatement(queryString);
            statement.setString(1, clientUUID);

            results = statement.executeQuery();

            if (results.next()) {
                endpoint = this.getEndpointOverrideFromResultSet(results);
                endpoint.setFilters(filters);
            }

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
View Full Code Here

            statement.setString(1, clientUUID);
            statement.setInt(2, profileId);

            results = statement.executeQuery();
            while (results.next()) {
                EndpointOverride endpoint = this.getEndpointOverrideFromResultSet(results);
                endpoint.setFilters(filters);
                properties.add(endpoint);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
View Full Code Here

    @RequestMapping(value = "/api/path/{pathId}", method = RequestMethod.DELETE)
    public
    @ResponseBody
    HashMap<String, Object> deletePath(Model model, @PathVariable int pathId,
                                       @RequestParam(value = "clientUUID", defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
        EndpointOverride currentPath = PathOverrideService.getInstance().getPath(pathId);
        int profileId = currentPath.getProfileId();

        // remove the path
        logger.info("Removing path {}", pathId);
        PathOverrideService.getInstance().removePath(pathId);
View Full Code Here

TOP

Related Classes of com.groupon.odo.proxylib.models.EndpointOverride

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.