Returns redirect information for the given ID

@param id ID of redirect
@return ServerRedirect
@throws Exception exception
355693
public ServerRedirect getRedirect(int id) throws Exception {
        PreparedStatement queryStatement = null;
        ResultSet results = null;

        try (Connection sqlConnection = sqlService.getConnection()) {
            queryStatement = sqlConnection.prepareStatement(
                "SELECT * FROM " + Constants.DB_TABLE_SERVERS +
                    " WHERE " + Constants.GENERIC_ID + " = ?"
            );
            queryStatement.setInt(1, id);
            results = queryStatement.executeQuery();
            if (results.next()) {
                ServerRedirect curServer = new ServerRedirect(results.getInt(Constants.GENERIC_ID),
                                                              results.getString(Constants.SERVER_REDIRECT_REGION),
                                                              results.getString(Constants.SERVER_REDIRECT_SRC_URL),
                                                              results.getString(Constants.SERVER_REDIRECT_DEST_URL),
                                                              results.getString(Constants.SERVER_REDIRECT_HOST_HEADER));
                curServer.setProfileId(results.getInt(Constants.GENERIC_PROFILE_ID));

                return curServer;
            }
            logger.info("Did not find the ID: {}", id);
        } catch (SQLException e) {
            throw e;
        } finally {
            try {
                if (results != null) {
                    results.close();
                }
            } catch (Exception e) {
            }
            try {
                if (queryStatement != null) {
                    queryStatement.close();
                }
            } catch (Exception e) {
            }
        }
        return null;
    }
19562
public ServerRedirect updateServerRedirectHost(int serverMappingId, String hostHeader) {
        ServerRedirect redirect = new ServerRedirect();
        BasicNameValuePair[] params = {
            new BasicNameValuePair("hostHeader", hostHeader),
            new BasicNameValuePair("profileIdentifier", this._profileName)
        };
        try {
            JSONObject response = new JSONObject(doPost(BASE_SERVER + "/" + serverMappingId + "/host", params));
            redirect = getServerRedirectFromJSON(response);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
        return redirect;
    }
1128332
public int getInvertedListId(String id) throws Exception {
		int iid = getInternalId(id);
		if (iid == -1) {
			throw new Exception("Id does not exist!");
		}

		DatabaseEntry key = new DatabaseEntry();
		IntegerBinding.intToEntry(iid, key);
		DatabaseEntry data = new DatabaseEntry();
		if ((iidToIvfpqDB.get(null, key, data, null) == OperationStatus.SUCCESS)) {
			TupleInput input = TupleBinding.entryToInput(data);
			int listId = input.readInt();
			return listId;
		} else {
			throw new Exception("Id does not exist!");
		}
	}
100709
public BoxRequestsFolder.GetTrashedFolder getTrashedFolderRequest(String id) {
        BoxRequestsFolder.GetTrashedFolder request = new BoxRequestsFolder.GetTrashedFolder(id, getTrashedFolderUrl(id), mSession);
        return request;
    }
681184
public static Domain get(final String id) throws ParseException, Exception {
        final BandwidthClient client = BandwidthClient.getInstance();
        return get(client, id); 
    }
714275
public Map<String, Object> loadById(String id) {
        final String sid = sessionPrefix + ":" + id;
        try {
            return this.executor.execute(new RedisCallback<Map<String, Object>>() {
                public Map<String, Object> execute(Jedis jedis) {
                    String session = jedis.get(sid);
                    if (!Strings.isNullOrEmpty(session)) {
                        return serializer.deserialize(session);
                    }
                    return Collections.emptyMap();
                }
            });
        } catch (Exception e) {
            log.error("failed to load session(key={}), cause:{}", sid, Throwables.getStackTraceAsString(e));
            throw new SessionException("load session failed", e);
        }
    }
607966
public void deleteRedirect(int id) {
        try {
            sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVERS +
                                         " WHERE " + Constants.GENERIC_ID + " = " + id + ";");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
757625
public static Method tryGetMethod(String id) {
    if (id.length() != NAME_LEN) {
      // we use it to fast discard the request without doing map lookup
      return null;
    }
    return idToMethod.get(id);
  }
292206
public function getRoute($id)
    {
        try {
            return $this->service->getRoute($id);
        } catch (ServiceException $e) {
            throw new ClientException('[SERVICE] ' . $e->getMessage());
        }
    }
1121564
private Response<SearchResult> searchForServiceById(final Long id) throws LdapException {
        val filter = LdapUtils.newLdaptiveSearchFilter(this.searchFilter,
            LdapUtils.LDAP_SEARCH_FILTER_DEFAULT_PARAM_NAME, CollectionUtils.wrap(id.toString()));
        return LdapUtils.executeSearchOperation(this.connectionFactory, this.baseDn, filter);
    }
460192
public static vrid get(nitro_service service, Long id) throws Exception{
		vrid obj = new vrid();
		obj.set_id(id);
		vrid response = (vrid) obj.get_resource(service);
		return response;
	}
751649
public GetIndividualProfilesRequest withIndividualId(final int id) {
        this.id = id;
        this.password = new char[0];
        this.login = this.accountNumber = this.routingNumber = null;
        return this;
    }
904257
public OvhRedirectionGlobal domain_redirection_id_GET(String domain, String id) throws IOException {
		String qPath = "/email/domain/{domain}/redirection/{id}";
		StringBuilder sb = path(qPath, domain, id);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhRedirectionGlobal.class);
	}
493228
@SuppressWarnings("unchecked")
    public <T extends AbstractJaxb> T getById(String id) {
        Object obj = GetByIdUtil.getById(id, this);
        return (T) obj;
    }
651336
def resource_redirect(id):
    '''
    
    '''
    resource = get_resource(id)
    return redirect(resource.url.strip()) if resource else abort(404)
816294
public static String urlEncodeId(String id) throws InvalidRequestException {
    try {
      return urlEncode(id);
    } catch (UnsupportedEncodingException e) {
      throw new InvalidRequestException(String.format(
          "Unable to encode `%s` in the url to %s. "
          + "Please contact support@stripe.com for assistance.", id, CHARSET),
          null, null, null, 0, e);
    }
  }
771769
public Server getServerById(final String id) {
        for (Server server : SERVERS) {
            if (server.getId().equals(id)) {
                return server;
            }
        }

        return null;
    }