Package com.ibm.sbt.services.endpoints.js

Examples of com.ibm.sbt.services.endpoints.js.JSReference


  }

  @Override
  public JSReference getAuthenticator(String endpointName, String sbtUrl) {
    Context ctx = Context.get();
    JSReference reference = new JSReference("sbt/authenticator/OAuth");
    StringBuilder b = new StringBuilder();
    RuntimeConstants.get().appendBaseProxyUrl(b, ctx);
    b.append("/");
    b.append(OAClientAuthentication.URL_PATH);
    b.append('/');
    b.append(endpointName);
    String url = b.toString();
    reference.getProperties().put("url", url);
    reference.getProperties().put("loginUi", ctx.getProperty("loginUi"));
    return reference;
  }
View Full Code Here


    /* (non-Javadoc)
     * @see com.ibm.sbt.services.endpoints.Endpoint#getTransport(java.lang.String, java.lang.String)
     */
    @Override
    public JSReference getTransport(String endpointName, String moduleId) {
      return new JSReference(moduleId);
    }
View Full Code Here

            logger.severe(ex.getMessage());
          }
        }
      }
     
      return new JSReference(proxyModuleId);
    }
View Full Code Here

   * (non-Javadoc)
   * @see com.ibm.sbt.services.endpoints.AbstractEndpoint#getTransport(java.lang.String, java.lang.String)
   */
  @Override
  public JSReference getTransport(String endpointName, String moduleId) {
    JSReference reference = new JSReference("sbt/GadgetTransport");
    return reference;
  }
View Full Code Here

          }
    }

    @Override
    public JSReference getAuthenticator(String endpointName, String sbtUrl) {
      JSReference reference = new JSReference("sbt/authenticator/SSO");
      reference.getProperties().put("url", sbtUrl);
      return reference;
    }
View Full Code Here

   * @return
   * @throws LibraryException
   */
  protected JsonReference createAuthenticatorRef(LibraryRequest request, Endpoint endpoint,
      String logicalName) throws LibraryException {
    JSReference authenticator = endpoint.getAuthenticator(logicalName, request.getToolkitJsUrl());
    if (authenticator != null) {
      try {
        Map<String, Object> params = authenticator.getProperties();
        Iterator<String> keys = params.keySet().iterator();
        StringBuilder sb = new StringBuilder();
        String paramName = getModuleParamName(authenticator.getModuleName());
        sb.append("new ").append(paramName).append("({");
        while(keys.hasNext()) {
          String key = keys.next();
          String value = (String)params.get(key);
          sb.append(key).append(":").append(addMakeAbsoluteUrl(value).getRef());
View Full Code Here

   * @return
   * @throws LibraryException
   */
  protected JsonReference createTransportRef(LibraryRequest request, Endpoint endpoint, String logicalName)
      throws LibraryException {
    JSReference transport = getTransport(request, endpoint, logicalName);
    if (transport != null) {
      try {
        String paramValues = JsonGenerator.toJson(JsonJavaFactory.instanceEx,
            transport.getProperties());
        String paramName = getModuleParamName(transport.getModuleName());
        return new JsonReference("new " + paramName + "(" + paramValues + ")");
      } catch (Exception e) {
        throw new LibraryException(e);
      }
    }
View Full Code Here

    return proxyinfo;
  }
 
    @Override
    public JSReference getAuthenticator(String endpointName, String sbtUrl) {
      JSReference reference = new JSReference("sbt/authenticator/Basic");
      reference.getProperties().put("url", sbtUrl);
     
      return reference;
    }
View Full Code Here

  }

  @Override
  public JSReference getAuthenticator(String endpointName, String sbtUrl) {
    Context ctx = Context.get();
    JSReference reference = new JSReference("sbt/authenticator/OAuth");
    StringBuilder b = new StringBuilder();
    RuntimeConstants.get().appendBaseProxyUrl(b, ctx);
    b.append("/");
    b.append(OAClientAuthentication.URL_PATH);
    b.append('/');
    b.append(endpointName);
    String url = b.toString();
    reference.getProperties().put("url", url);
    return reference;
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.ibm.sbt.services.endpoints.AbstractEndpoint#getAuthenticator(java.lang.String)
   */
  @Override
  public JSReference getAuthenticator(String endpointName, String sbtUrl) {
    JSReference reference = new JSReference("sbt/authenticator/GadgetOAuth");
    return reference;
  }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.endpoints.js.JSReference

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.