congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
HttpRequest.setOAuthArguments
Code IndexAdd Tabnine to your IDE (free)

How to use
setOAuthArguments
method
in
org.apache.shindig.gadgets.http.HttpRequest

Best Java code snippets using org.apache.shindig.gadgets.http.HttpRequest.setOAuthArguments (Showing top 20 results out of 315)

origin: com.lmco.shindig/shindig-gadgets

@Test(expected = IllegalArgumentException.class)
public void createKeyWithoutSecurityToken() throws Exception {
 RequestAuthenticationInfo authInfo = newMockAuthInfo(
   true /* isSignOwner */,
   false /* isSignViewer */,
   ImmutableMap.<String, String>of());
 replay(authInfo);
 HttpRequest request = new HttpRequest(DEFAULT_URI)
   .setAuthType(AuthType.SIGNED)
   .setOAuthArguments(new OAuthArguments(authInfo));
 cache.createKey(request);
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

@Test(expected = IllegalArgumentException.class)
public void createKeyWithoutSecurityToken() throws Exception {
 RequestAuthenticationInfo authInfo = newMockAuthInfo(
   true /* isSignOwner */,
   false /* isSignViewer */,
   ImmutableMap.<String, String>of());
 replay(authInfo);
 HttpRequest request = new HttpRequest(DEFAULT_URI)
   .setAuthType(AuthType.SIGNED)
   .setOAuthArguments(new OAuthArguments(authInfo));
 cache.createKey(request);
}
origin: org.apache.shindig/shindig-gadgets

@Test(expected = IllegalArgumentException.class)
public void createKeyWithoutSecurityToken() throws Exception {
 RequestAuthenticationInfo authInfo = newMockAuthInfo(
   true /* isSignOwner */,
   false /* isSignViewer */,
   ImmutableMap.<String, String>of());
 replay(authInfo);
 HttpRequest request = new HttpRequest(DEFAULT_URI)
   .setAuthType(AuthType.SIGNED)
   .setOAuthArguments(new OAuthArguments(authInfo));
 cache.createKey(request);
}
origin: org.apache.shindig/shindig-gadgets

@Test
public void testGenerateUrl_noGadgetDomainCallback() throws Exception {
 HttpRequest request = new HttpRequest(DEST_URL);
 request.setSecurityToken(securityToken);
 request.setOAuthArguments(new OAuthArguments());
 expect(processor.process(eqContext(securityToken, request.getOAuthArguments())))
   .andReturn(gadget);
 expect(lockedDomainService.isGadgetValidForHost("renderinghost", gadget, "default"))
   .andReturn(true);
 expect(oauthUriManager.makeOAuthCallbackUri("default", "renderinghost"))
   .andReturn(null);
 control.replay();
 assertNull(getGenerator().generateCallback(fetcherConfig,
   "http://base/basecallback?foo=bar%20baz", request, responseParams));
 control.verify();
}
origin: com.lmco.shindig/shindig-gadgets

@Test
public void testGenerateUrl_noGadgetDomainCallback() throws Exception {
 HttpRequest request = new HttpRequest(DEST_URL);
 request.setSecurityToken(securityToken);
 request.setOAuthArguments(new OAuthArguments());
 expect(processor.process(eqContext(securityToken, request.getOAuthArguments())))
   .andReturn(gadget);
 expect(lockedDomainService.gadgetCanRender("renderinghost", gadget, "default"))
   .andReturn(true);
 expect(oauthUriManager.makeOAuthCallbackUri("default", "renderinghost"))
   .andReturn(null);
 
 control.replay();
 
 assertNull(getGenerator().generateCallback(fetcherConfig,
   "http://base/basecallback?foo=bar%20baz", request, responseParams));
 
 control.verify();
}

origin: com.lmco.shindig/shindig-gadgets

public static HttpRequest newHttpRequest(GadgetContext context,
  RequestAuthenticationInfo authenticationInfo) throws GadgetException {
 return new HttpRequest(authenticationInfo.getHref())
   .setSecurityToken(context.getToken())
   .setOAuthArguments(new OAuthArguments(authenticationInfo))
   .setAuthType(authenticationInfo.getAuthType())
   .setContainer(context.getContainer())
   .setGadget(context.getUrl())
   .setIgnoreCache(context.getIgnoreCache());
}
origin: org.gatein.shindig/shindig-gadgets

public static HttpRequest newHttpRequest(GadgetContext context,
  RequestAuthenticationInfo authenticationInfo) throws GadgetException {
 return new HttpRequest(authenticationInfo.getHref())
   .setSecurityToken(context.getToken())
   .setOAuthArguments(new OAuthArguments(authenticationInfo))
   .setAuthType(authenticationInfo.getAuthType())
   .setContainer(context.getContainer())
   .setGadget(context.getUrl())
   .setIgnoreCache(context.getIgnoreCache());
}
origin: org.apache.shindig/shindig-gadgets

public static HttpRequest newHttpRequest(GadgetContext context,
  RequestAuthenticationInfo authenticationInfo) throws GadgetException {
 return new HttpRequest(authenticationInfo.getHref())
   .setSecurityToken(context.getToken())
   .setOAuthArguments(new OAuthArguments(authenticationInfo))
   .setOAuth2Arguments(new OAuth2Arguments(authenticationInfo))
   .setAuthType(authenticationInfo.getAuthType())
   .setContainer(context.getContainer())
   .setGadget(context.getUrl())
   .setIgnoreCache(context.getIgnoreCache());
}
origin: org.apache.shindig/shindig-gadgets

/**
 * Send an OAuth GET request to the given URL.
 */
public HttpResponse sendGet(String target) throws Exception {
 HttpRequest request = new HttpRequest(Uri.parse(target));
 request.setOAuthArguments(recallState());
 OAuthRequest dest = createRequest();
 request.setIgnoreCache(ignoreCache);
 request.setSecurityToken(securityToken);
 HttpResponse response = dest.fetch(request);
 saveState(response);
 return response;
}
origin: com.lmco.shindig/shindig-gadgets

/**
 * Send an OAuth GET request to the given URL.
 */
public HttpResponse sendGet(String target) throws Exception {
 HttpRequest request = new HttpRequest(Uri.parse(target));
 request.setOAuthArguments(recallState());
 OAuthRequest dest = createRequest();
 request.setIgnoreCache(ignoreCache);
 request.setSecurityToken(securityToken);
 HttpResponse response = dest.fetch(request);
 saveState(response);
 return response;
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

/**
 * Send an OAuth GET request to the given URL.
 */
public HttpResponse sendGet(String target) throws Exception {
 HttpRequest request = new HttpRequest(Uri.parse(target));
 request.setOAuthArguments(recallState());
 OAuthRequest dest = createRequest();
 request.setIgnoreCache(ignoreCache);
 request.setSecurityToken(securityToken);
 HttpResponse response = dest.fetch(request);
 saveState(response);
 return response;
}
origin: org.apache.shindig/shindig-gadgets

public HttpResponse sendGetWithBody(String target, String type, byte[] body) {
 HttpRequest request = new HttpRequest(Uri.parse(target));
 request.setOAuthArguments(recallState());
 OAuthRequest dest = createRequest();
 if (type != null) {
  request.setHeader("Content-Type", type);
 }
 request.setPostBody(body);
 request.setSecurityToken(securityToken);
 HttpResponse response = dest.fetch(request);
 saveState(response);
 return response;
}
origin: com.lmco.shindig/shindig-gadgets

public HttpResponse sendGetWithBody(String target, String type, byte[] body) {
 HttpRequest request = new HttpRequest(Uri.parse(target));
 request.setOAuthArguments(recallState());
 OAuthRequest dest = createRequest();
 if (type != null) {
  request.setHeader("Content-Type", type);
 }
 request.setPostBody(body);
 request.setSecurityToken(securityToken);
 HttpResponse response = dest.fetch(request);
 saveState(response);
 return response;
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

public HttpResponse sendGetWithBody(String target, String type, byte[] body) {
 HttpRequest request = new HttpRequest(Uri.parse(target));
 request.setOAuthArguments(recallState());
 OAuthRequest dest = createRequest();
 if (type != null) {
  request.setHeader("Content-Type", type);
 }
 request.setPostBody(body);
 request.setSecurityToken(securityToken);
 HttpResponse response = dest.fetch(request);
 saveState(response);
 return response;
}
origin: com.lmco.shindig/shindig-gadgets

/**
 * Send an OAuth POST with binary data in the binary.
 */
public HttpResponse sendRawPost(String target, String type, byte[] body) throws Exception {
 HttpRequest request = new HttpRequest(Uri.parse(target));
 request.setOAuthArguments(recallState());
 OAuthRequest dest = createRequest();
 request.setMethod("POST");
 if (type != null) {
  request.setHeader("Content-Type", type);
 }
 request.setPostBody(body);
 request.setSecurityToken(securityToken);
 HttpResponse response = dest.fetch(request);
 saveState(response);
 return response;
}
origin: org.apache.shindig/shindig-gadgets

/**
 * Send an OAuth POST request to the given URL.
 */
public HttpResponse sendFormPost(String target, String body) throws Exception {
 HttpRequest request = new HttpRequest(Uri.parse(target));
 request.setOAuthArguments(recallState());
 OAuthRequest dest = createRequest();
 request.setMethod("POST");
 request.setPostBody(CharsetUtil.getUtf8Bytes(body));
 request.setHeader("content-type", "application/x-www-form-urlencoded");
 request.setSecurityToken(securityToken);
 HttpResponse response = dest.fetch(request);
 saveState(response);
 return response;
}
origin: com.lmco.shindig/shindig-gadgets

/**
 * Send an OAuth POST request to the given URL.
 */
public HttpResponse sendFormPost(String target, String body) throws Exception {
 HttpRequest request = new HttpRequest(Uri.parse(target));
 request.setOAuthArguments(recallState());
 OAuthRequest dest = createRequest();
 request.setMethod("POST");
 request.setPostBody(CharsetUtil.getUtf8Bytes(body));
 request.setHeader("content-type", "application/x-www-form-urlencoded");
 request.setSecurityToken(securityToken);
 HttpResponse response = dest.fetch(request);
 saveState(response);
 return response;
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

/**
 * Send an OAuth POST request to the given URL.
 */
public HttpResponse sendFormPost(String target, String body) throws Exception {
 HttpRequest request = new HttpRequest(Uri.parse(target));
 request.setOAuthArguments(recallState());
 OAuthRequest dest = createRequest();
 request.setMethod("POST");
 request.setPostBody(CharsetUtil.getUtf8Bytes(body));
 request.setHeader("content-type", "application/x-www-form-urlencoded");
 request.setSecurityToken(securityToken);
 HttpResponse response = dest.fetch(request);
 saveState(response);
 return response;
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

@Test
public void testBadGadget() throws Exception {
 HttpRequest request = new HttpRequest(DEST_URL);
 request.setSecurityToken(securityToken);
 request.setOAuthArguments(new OAuthArguments());
 expect(processor.process(eqContext(securityToken, request.getOAuthArguments())))
   .andThrow(new ProcessingException("doh", HttpServletResponse.SC_BAD_REQUEST));
 control.replay();
 try {
  getGenerator().generateCallback(fetcherConfig, "base", request, responseParams);
  fail("Should have thrown");
 } catch (OAuthRequestException e) {
  assertEquals(OAuthError.UNKNOWN_PROBLEM.name(), e.getError());
 }
 control.verify();
}
origin: com.lmco.shindig/shindig-gadgets

@Test
public void testBadGadget() throws Exception {
 HttpRequest request = new HttpRequest(DEST_URL);
 request.setSecurityToken(securityToken);
 request.setOAuthArguments(new OAuthArguments());
 expect(processor.process(eqContext(securityToken, request.getOAuthArguments())))
   .andThrow(new ProcessingException("doh", HttpServletResponse.SC_BAD_REQUEST));
 
 control.replay();
 
 try {
  getGenerator().generateCallback(fetcherConfig, "base", request, responseParams);
  fail("Should have thrown");
 } catch (OAuthRequestException e) {
  assertEquals(OAuthError.UNKNOWN_PROBLEM.name(), e.getError());
 }
 
 control.verify();
}

org.apache.shindig.gadgets.httpHttpRequestsetOAuthArguments

Popular methods of HttpRequest

  • <init>
    Clone an existing HttpRequest.
  • addHeader
    Add a single header to the request. If a value for the given name is already set, a second value is
  • getAuthType
  • getCacheTtl
  • getContainer
  • getFollowRedirects
  • getGadget
  • getHeader
  • getHeaders
  • getIgnoreCache
  • getMethod
  • getOAuthArguments
  • getMethod,
  • getOAuthArguments,
  • getParam,
  • getParamAsInteger,
  • getPostBody,
  • getPostBodyAsString,
  • getPostBodyLength,
  • getRewriteMimeType,
  • getSecurityToken,
  • getUri

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • startActivity (Activity)
  • compareTo (BigDecimal)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now