/* (non-Javadoc)
@see com.att.authz.facade.AuthzFacade#getHistoryByRole(com.att.authz.env.AuthzTrans, javax.servlet.http.HttpServletResponse, java.lang.String, int[])
542787
@Override
	public Result<Void> getHistoryByRole(AuthzTrans trans, HttpServletResponse resp, String role, int[] yyyymm, final int sort) {
		StringBuilder sb = new StringBuilder();
		sb.append(GET_HISTORY_ROLE);
		sb.append(' ');
		sb.append(role);
		sb.append(" for ");
		boolean first = true;
		for(int i : yyyymm) {
			if(first) {
			    first = false;
			} else {
			    sb.append(',');
			}
			sb.append(i);
		}
		TimeTaken tt = trans.start(sb.toString(), Env.SUB|Env.ALWAYS);
		try {
			Result<HISTORY> rh = service.getHistoryByRole(trans,role,yyyymm,sort);
			switch(rh.status) {
				case OK: 
					RosettaData<HISTORY> data = historyDF.newData(trans).load(rh.value);
					if(Question.willSpecialLog(trans, trans.user())) {
						Question.logEncryptTrace(trans,data.asString());
					}

					data.to(resp.getOutputStream());
					setContentType(resp,historyDF.getOutType());
					return Result.ok();
				default:
					return Result.err(rh);
			}
		} catch (Exception e) {
			trans.error().log(e,IN,GET_HISTORY_ROLE);
			return Result.err(e);
		} finally {
			tt.done();
		}
	}
674048
@Override
  public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException {
    Long limit = null;
    CurrencyPair currencyPair = null;
    Long offset = null;
    TradeHistoryParamsSorted.Order sort = null;
    if (params instanceof TradeHistoryParamPaging) {
      limit = Long.valueOf(((TradeHistoryParamPaging) params).getPageLength());
    }
    if (params instanceof TradeHistoryParamCurrencyPair) {
      currencyPair = ((TradeHistoryParamCurrencyPair) params).getCurrencyPair();
    }
    if (params instanceof TradeHistoryParamOffset) {
      offset = ((TradeHistoryParamOffset) params).getOffset();
    }
    if (params instanceof TradeHistoryParamsSorted) {
      sort = ((TradeHistoryParamsSorted) params).getOrder();
    }
    CryptonitUserTransaction[] txs =
        getCryptonitUserTransactions(
            limit, currencyPair, offset, sort == null ? null : sort.toString());
    return CryptonitAdapters.adaptTradeHistory(txs);
  }
696394
public static void getHistory() throws Exception{
        Client client = new Client("ProfileName", false);

        // Obtain the 100 history entries starting from offset 0
        History[] history = client.refreshHistory(100, 0);

        client.clearHistory();
    }
284081
public java.util.List<ManagedActionHistoryItem> getManagedActionHistoryItems() {
        if (managedActionHistoryItems == null) {
            managedActionHistoryItems = new com.amazonaws.internal.SdkInternalList<ManagedActionHistoryItem>();
        }
        return managedActionHistoryItems;
    }
1168064
def history(params = {})
      params.select! { |key, _value| @api.history_config[:allowed_params].include? key }

      response = self.class.get(@api.history_config[:url],
                                :query => { :auth_token => @token }.merge(params),
                                :headers => @api.headers
      )

      ErrorHandler.response_code_to_exception_for :user, user_id, response
      response.body
    end
184898
@GET
  @Path("/db/{authorizerName}/roles")
  @Produces(MediaType.APPLICATION_JSON)
  @Consumes(MediaType.APPLICATION_JSON)
  @ResourceFilters(BasicSecurityResourceFilter.class)
  public Response getAllRoles(
      @Context HttpServletRequest req,
      @PathParam("authorizerName") final String authorizerName
  )
  {
    return resourceHandler.getAllRoles(authorizerName);
  }
757119
@Override
	public String[] getRoles(String username) {
		if (user_list.containsKey(username)) {
			return user_list.get(username).toArray(new String[0]);
		} else {
			if (defaultRoles == null) {
				return new String[0];
			} else {
				return defaultRoles;
			}
		}
	}
867383
protected History[] constructHistory(BasicNameValuePair[] params) throws Exception {
        String uri = HISTORY + uriEncode(_profileName);

        try {
            JSONObject response = new JSONObject(doGet(uri, params));
            JSONArray historyArray = response.getJSONArray("history");
            history = new History[historyArray.length()];

            for (int i = 0; i < historyArray.length(); i++) {
                history[i] = new History();
                JSONObject jsonHistory = historyArray.getJSONObject(i);
                if (jsonHistory == null) {
                    continue;
                }

                if (!jsonHistory.isNull("id")) {
                    history[i].setId(jsonHistory.getInt("id"));
                }
                if (!jsonHistory.isNull("profileId")) {
                    history[i].setProfileId(jsonHistory.getInt("profileId"));
                }
                if (!jsonHistory.isNull("clientUUID")) {
                    history[i].setClientUUID(jsonHistory.getString("clientUUID"));
                }
                if (!jsonHistory.isNull("createdAt")) {
                    history[i].setCreatedAt(jsonHistory.getString("createdAt"));
                }
                if (!jsonHistory.isNull("requestType")) {
                    history[i].setRequestType(jsonHistory.getString("requestType"));
                }
                if (!jsonHistory.isNull("requestURL")) {
                    history[i].setRequestURL(jsonHistory.getString("requestURL"));
                }
                if (!jsonHistory.isNull("requestParams")) {
                    history[i].setRequestParams(jsonHistory.getString("requestParams"));
                }
                if (!jsonHistory.isNull("requestPostData")) {
                    history[i].setRequestPostData(jsonHistory.getString("requestPostData"));
                }
                if (!jsonHistory.isNull("requestHeaders")) {
                    history[i].setRequestHeaders(jsonHistory.getString("requestHeaders"));
                }
                if (!jsonHistory.isNull("responseCode")) {
                    history[i].setResponseCode(jsonHistory.getString("responseCode"));
                }
                if (!jsonHistory.isNull("responseHeaders")) {
                    history[i].setResponseHeaders(jsonHistory.getString("responseHeaders"));
                }
                if (!jsonHistory.isNull("responseContentType")) {
                    history[i].setResponseContentType(jsonHistory.getString("responseContentType"));
                }
                if (!jsonHistory.isNull("originalRequestURL")) {
                    history[i].setOriginalRequestURL(jsonHistory.getString("originalRequestURL"));
                }
                if (!jsonHistory.isNull("originalRequestParams")) {
                    history[i].setOriginalRequestParams(jsonHistory.getString("originalRequestParams"));
                }
                if (!jsonHistory.isNull("originalRequestPostData")) {
                    history[i].setOriginalRequestPostData(jsonHistory.getString("originalRequestPostData"));
                }
                if (!jsonHistory.isNull("originalRequestHeaders")) {
                    history[i].setOriginalRequestHeaders(jsonHistory.getString("originalRequestHeaders"));
                }
                if (!jsonHistory.isNull("originalResponseCode")) {
                    history[i].setOriginalResponseCode(jsonHistory.getString("originalResponseCode"));
                }
                if (!jsonHistory.isNull("originalResponseHeaders")) {
                    history[i].setOriginalResponseHeaders(jsonHistory.getString("originalResponseHeaders"));
                }
                if (!jsonHistory.isNull("originalResponseContentType")) {
                    history[i].setResponseContentType(jsonHistory.getString("originalResponseContentType"));
                }
                if (!jsonHistory.isNull("modified")) {
                    history[i].setModified(jsonHistory.getBoolean("modified"));
                }
                if (!jsonHistory.isNull("requestBodyDecoded")) {
                    history[i].setRequestBodyDecoded(jsonHistory.getBoolean("requestBodyDecoded"));
                }
                if (!jsonHistory.isNull("responseBodyDecoded")) {
                    history[i].setResponseBodyDecoded(jsonHistory.getBoolean("responseBodyDecoded"));
                }
                if (!jsonHistory.isNull("extraInfo")) {
                    history[i].setExtraInfoFromString(jsonHistory.getString("extraInfo"));
                }
                /**
                 * To get the json responseData make a call specifically using the id
                 */

                int id = history[i].getId();
                String idUri = uri + "/" + id;
                JSONObject historyId = new JSONObject(doGet(idUri, null));

                String responseData = historyId.getJSONObject("history").getString("responseData");
                history[i].setResponseData(responseData);
                String originalResponseData = historyId.getJSONObject("history").getString("originalResponseData");
                history[i].setOriginalResponseData(originalResponseData);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return history;
    }
1343664
public ActivityRecords history(String streamKey, long start, long end) throws QiniuException {
        if (start <= 0 || end < 0 || (start >= end && end != 0)) {
            throw new QiniuException(new IllegalArgumentException("bad argument" + start + "," + end));
        }
        String path = encodeKey(streamKey) + "/historyactivity?start=" + start;
        if (end != 0) {
            path += "&end=" + end;
        }
        return get(path, ActivityRecords.class);
    }
1115259
def get_account_history_page(address, page, hostport=None, proxy=None):
    
    assert proxy or hostport, 'Need proxy or hostport'
    if proxy is None:
        proxy = connect_hostport(hostport)

    page_schema = {
        'type': 'object',
        'properties': {
            'history': {
                'type': 'array',
                'items': {
                    'type': 'object',
                    'properties': ACCOUNT_SCHEMA_PROPERTIES,
                    'required': ACCOUNT_SCHEMA_REQUIRED,
                },
            },
        },
        'required': [
            'history'
        ],
    }

    schema = json_response_schema(page_schema)

    try:
        resp = proxy.get_account_history(address, page)
        resp = json_validate(schema, resp)
        if json_is_error(resp):
            return resp

    except ValidationError as e:
        if BLOCKSTACK_DEBUG:
            log.exception(e)

        resp = {'error': 'Server response did not match expected schema.  You are likely communicating with an out-of-date Blockstack node.', 'http_status': 502}
        return resp

    except socket.timeout:
        log.error("Connection timed out")
        resp = {'error': 'Connection to remote host timed out.', 'http_status': 503}
        return resp

    except socket.error as se:
        log.error("Connection error {}".format(se.errno))
        resp = {'error': 'Connection to remote host failed.', 'http_status': 502}
        return resp

    except Exception as ee:
        if BLOCKSTACK_DEBUG:
            log.exception(ee)

        log.error("Caught exception while connecting to Blockstack node: {}".format(ee))
        resp = {'error': 'Failed to contact Blockstack node.  Try again with `--debug`.', 'http_status': 500}
        return resp

    return resp['history']
689911
def history(self):
        ''''''
        r = self.obj.api.getDatastreamHistory(self.obj.pid, self.id, format='xml')
        return parse_xml_object(DatastreamHistory, r.content, r.url)
1092710
public static String getHistoryResourceURI(String uri, ServletRequest req) {

        String histUri = uri;
        if (CmsHistoryResourceHandler.isHistoryRequest(req)) {
            String version = req.getParameter(CmsHistoryResourceHandler.PARAM_VERSION);
            histUri = CmsRequestUtil.appendParameter(uri, CmsHistoryResourceHandler.PARAM_VERSION, version);
        }
        return histUri;
    }
501072
public com.google.api.ads.admanager.axis.v201808.ChangeHistoryOperation getOperation() {
        return operation;
    }
654353
public Optional<SingularityTaskHistory> getHistoryForTask(String taskId) {
    final Function<String, String> requestUri = (host) -> String.format(TASK_HISTORY_FORMAT, getApiBase(host), taskId);

    return getSingle(requestUri, "task history", taskId, SingularityTaskHistory.class);
  }
827777
private void logOriginalResponseHistory(
        PluginResponse httpServletResponse, History history) throws URIException {
        RequestInformation requestInfo = requestInformation.get();
        if (requestInfo.handle && requestInfo.client.getIsActive()) {
            logger.info("Storing original response history");
            history.setOriginalResponseHeaders(HttpUtilities.getHeaders(httpServletResponse));
            history.setOriginalResponseCode(Integer.toString(httpServletResponse.getStatus()));
            history.setOriginalResponseContentType(httpServletResponse.getContentType());
            history.setOriginalResponseData(httpServletResponse.getContentString());
            logger.info("Done storing");
        }
    }
324576
public HistoryReference getHistoryReferenceFromNode(Object value) {
		SiteNode node = null;
		if (value instanceof SiteNode) {
			node = (SiteNode) value;
	
			if (node.getHistoryReference() != null) {
				try {
					return node.getHistoryReference();
				} catch (Exception e) {
					log.warn(e.getMessage(), e);
				}
			}
		}
		return null;
	}
329583
@Programmatic
    public List<ApplicationPermission> findByRoleCached(final ApplicationRole role) {
        return queryResultsCache.execute(new Callable<List<ApplicationPermission>>() {
            @Override
            public List<ApplicationPermission> call() throws Exception {
                return findByRole(role);
            }
        }, ApplicationPermissionRepository.class, "findByRoleCached", role);
    }