@Override public String doDefault() throws Exception { String crucibleUrl = getCrucibleUrl(); if (crucibleUrl == null) { return SUCCESS; } Request<?> request = requestFactory.createRequest(Request.MethodType.GET, crucibleUrl + CRUCIBLE_METRICS_REST_ENDPOINT); request.addTrustedTokenAuthentication(themeProperties.getSystemAdministrator()); try { metrics = request.execute(); } catch (ResponseException re) { addErrorMessage(getText("crucible.admin.error.response")); log.error("Error communicating with Crucible", re); } return SUCCESS; }
public void execute(Map transientVars, Map args, PropertySet propertySet) throws WorkflowException { Issue issue = (Issue) transientVars.get("issue"); String projectKey = issue.getProjectObject().getKey(); ApplicationLink crucible = appLinksManager.getLinkedApplication(Application.CRUCIBLE.name(), projectKey); Request<?> request = requestFactory.createRequest(Request.MethodType.POST, crucible.getUrl() + CREATE_REVIEW_PATH + "?key=" + crucible.getRemoteKey() + "&issueKey=" + issue.getKey()); request.addTrustedTokenAuthentication(); try { request.execute(); } catch (ResponseException re) { log.error("Error creating code review on Crucible", re); } } }
@Override protected String doExecute() throws Exception { String crucibleUrl = getCrucibleUrl(); if (crucibleUrl == null) { return SUCCESS; } Request<?> request = requestFactory.createRequest(Request.MethodType.PUT, crucibleUrl + CRUCIBLE_METRICS_REST_ENDPOINT); request.addTrustedTokenAuthentication(themeProperties.getSystemAdministrator()); request.setRequestBody(metrics); try { metrics = request.execute(); } catch (ResponseException re) { addErrorMessage(getText("crucible.admin.error.response")); log.error("Error communicating with Crucible", re); } return getRedirect("EditMetrics!Default.jspa?message=crucible.admin.info.metrics.updated"); }
final Request<?> addRequest = requestFactory.createRequest(MethodType.PUT, restUrl + "?application=JIRA&name=jira&primary=true&url=" + jiraUrl); addRequest.addTrustedTokenAuthentication(); if (executeHttpRequest(addRequest)) "?application=" + applicationType.toString() + "&name=" + applicationInstance.getName() + "&primary=" + primary + "&url=" + applicationInstance.getUrl() + properties.toString()); addRemoteAppRequest.addTrustedTokenAuthentication();
request.addRequestParameters("url", baseUrl + JIRA_NOTIFICIATION_URL); request.addTrustedTokenAuthentication(); try
@Override protected String doExecute() throws Exception { if (!hasAdministratePermissionOnProject(key)) { return SECURITY_BREACH; } ApplicationLink appLink = appLinksManager.getLinkedApplication(Application.CRUCIBLE.name(), key); Request<?> request = requestFactory.createRequest(Request.MethodType.PUT, getRestResource(appLink)); request.addTrustedTokenAuthentication(themeProperties.getSystemAdministrator()); request.setRequestBody(XStreamUtils.toXML(projectConfig)); try { request.execute(); } catch (ResponseException re) { addErrorMessage(re.getMessage()); log.error("Error putting crucible project config", re); return INPUT; } return getRedirect("CrucibleProject!ListProjects.jspa?message=crucible.admin.info.updated"); }
request.addRequestParameters("url", JIRA_NOTIFICIATION_URL, "authenticationType", "TRUSTED_APPS", "username", ctx.getUser().getName()); request.addTrustedTokenAuthentication(); try
final String baseUrl = ComponentLocator.getComponent(ApplicationProperties.class).getBaseUrl(); request.addRequestParameters("url", baseUrl + JIRA_NOTIFICIATION_URL); request.addTrustedTokenAuthentication(); try
public String doSynchronize() { final ApplicationLink localLink = appLinksManager.getLinkedApplication(app, getKey()); final String restUrl = localLink.getUrl() + "/plugins/servlet/applinks/projectlinks"; final Request<?> request = requestFactory.createRequest(Request.MethodType.POST, restUrl + "?key=" + localLink.getRemoteKey() + "&application=JIRA"); final ApplicationLink remoteLink = new DefaultApplicationLink("jira", getKey(), null, null); request.setRequestBody(XStreamUtils.toXML(remoteLink)); request.addTrustedTokenAuthentication(); try { request.execute(); } catch (final ResponseException re) { return getRedirect("ViewProject.jspa?message=editprojectlinks.error.synchronize&pid=" + getPid()); } return getRedirect("ViewProject.jspa?message=editprojectlinks.result.synchronized&pid=" + getPid()); }
final ApplicationLink remoteLink = new DefaultApplicationLink("jira", getKey(), null, null); request.setRequestBody(XStreamUtils.toXML(remoteLink)); request.addTrustedTokenAuthentication(); try
request.addTrustedTokenAuthentication(themeProperties.getSystemAdministrator()); try
request.addTrustedTokenAuthentication(); request.addRequestParameters("key", projectKey, "name", projectName, "description", description, "CRUCIBLE_key", AppLinksManager.CR_PREFIX + projectKey);
final Request<?> request = requestFactory.createRequest(MethodType.DELETE, fullUrl); request.addTrustedTokenAuthentication(); request.execute(new ResponseHandler()