Package com.ibm.sbt.services.endpoints

Examples of com.ibm.sbt.services.endpoints.BasicEndpoint


 
  /**
   *
   */
  public Endpoint createEndpoint(String url, String user, String password) {
    BasicEndpoint basicEndpoint = null;
    basicEndpoint = new BasicEndpoint();         
    basicEndpoint.setUrl(url);
    basicEndpoint.setForceTrustSSLCertificate(true);
    basicEndpoint.setUser(user);
    basicEndpoint.setPassword(password);
   
    // proxy support
    //basicEndpoint.setHttpProxy("127.0.0.1:8888");
    //basicEndpoint.setUseProxy(true);
   
    // cookie handling
    basicEndpoint.setClientServiceClass("com.ibm.sbt.services.client.CookieStoreClientService");
       
    return basicEndpoint;
  }
View Full Code Here


   
    int numFields = srcActivityNode.getFields().length;

    activityService.moveNode(srcActivityNode.getActivityNodeUuid(), activityB.getActivityUuid());

    BasicEndpoint endpoint = (BasicEndpoint)activityService.getEndpoint();
    try {
      endpoint.logout();
      endpoint.login(TestEnvironment.getSecondaryUserEmail(), TestEnvironment.getSecondaryUserPassword());
    } catch (AuthenticationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

  public void createFileService() {
    String url = System.getProperty("url");
    String user = System.getProperty("user");
    String password = System.getProperty("password");
    if (StringUtil.isNotEmpty(url) && StringUtil.isNotEmpty(user) && StringUtil.isNotEmpty(password)) {
      BasicEndpoint endpoint = new ConnectionsBasicEndpoint();
      endpoint.setUrl(url);
      endpoint.setUser(user);
      endpoint.setPassword(password);
      endpoint.setForceTrustSSLCertificate(true);
     
      fileService = new FileService(endpoint);
      communityService = new CommunityService(endpoint);
    } else {
      fileService = new FileService();
View Full Code Here

 
  @Override
  public void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
    String pathInfo = request.getPathInfo();
      Endpoint endpoint = EndpointFactory.getEndpoint(getEndpointName(pathInfo))//remove hardcoded name ..get second token from path info
      BasicEndpoint basicendpoint = null;
     
      if(endpoint instanceof BasicEndpoint )
      {
        basicendpoint = (BasicEndpoint)endpoint;
     
        String user = request.getParameter(USER_NAME);
        String pswd = request.getParameter(PASSWORD);
         
        //test if auth info is okay ...we need to check if user/password are valid.
        try {
        if(basicendpoint.login(user, pswd, false))
        {
          basicendpoint.setUser(user);
            basicendpoint.setPassword(pswd);
            basicendpoint.writeToStore();
            if(getCallerType(pathInfo).equals(JS_APP)){
              generateCloseScript(request, response, AUTH_ACCEPTED);
            }else if(getCallerType(pathInfo).equals(JAVA_APP)){
              redirectToJavaApp(request, response, AUTH_ACCEPTED );
            }
View Full Code Here

     * @param password
     * @throws AuthenticationException
     */
    public ExportWiki(String url, String user, String password)
            throws AuthenticationException {
        BasicEndpoint basicEndpoint = new BasicEndpoint();
        basicEndpoint.setUrl(url);
        basicEndpoint.setForceTrustSSLCertificate(true);
        basicEndpoint.setUser(user);
        basicEndpoint.setPassword(password);

        this.wikiService = new WikiService();
        this.setEndpoint(basicEndpoint);
    }
View Full Code Here

        }

        System.out.println("running with " + p);
        System.out.println("pass parameters with  -Duser=   -Dpassword=   -Durl=  ");

        BasicEndpoint ep = new BasicEndpoint();
        ep.setUrl(p.get("url"));
        ep.setUser(p.get("user"));
        ep.setPassword(p.get("password"));
        ep.setForceTrustSSLCertificate(true);

        final ActivityService svc = new ActivityService(ep);
        Activity c = new Activity();
        c = svc.createActivity(c);
        final String uuid = c.getActivityUuid();
View Full Code Here

      throws AuthenticationException {
    if (initEnvironment) {
      this.initEnvironment();
    }
   
    BasicEndpoint basicEndpoint = (BasicEndpoint) EndpointFactory.getEndpoint(endpointName);
    if (StringUtil.isNotEmpty(user)) {
      basicEndpoint.login(user, password);
    }

    this.blogService = new BlogService();
    this.setEndpoint(basicEndpoint);
  }
View Full Code Here

    Field aTextField = srcActivityNode.getFields()[0];
   
    // Test move field with unauthorized user
    thrown.expect(ClientServicesException.class);
    thrown.expectMessage("403:Forbidden");
    BasicEndpoint endpoint = (BasicEndpoint)activityService.getEndpoint();
    try {
      endpoint.logout();
      endpoint.login(TestEnvironment.getSecondaryUserEmail(), TestEnvironment.getSecondaryUserPassword());
    } catch (AuthenticationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    ActivityNode an = activityService.moveFieldToEntry(dstActivityNode.getActivityUuid(), aTextField.getFid());

    try {
      endpoint.logout();
      endpoint.login(TestEnvironment.getCurrentUserEmail(), TestEnvironment.getCurrentUserPassword());
    } catch (AuthenticationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

   
    int numFields = srcActivityNode.getFields().length;

    ActivityNode newNode = activityService.copyNode(srcActivityNode.getActivityNodeUuid(), activityB.getActivityUuid());

    BasicEndpoint endpoint = (BasicEndpoint)activityService.getEndpoint();
    try {
      endpoint.logout();
      endpoint.login(TestEnvironment.getSecondaryUsername(), TestEnvironment.getSecondaryUserPassword());
    } catch (AuthenticationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

       
        if (url == null || user == null || password == null) {
          throw new IllegalStateException("Please set VM arguments for: -DServerUrl=https://apps.na.collabservtest.lotus.com -DUserName=<VSR account user> -DPassword=<VSR account password>");
        }
       
      basicEndpoint = new BasicEndpoint();
      basicEndpoint.setUrl(url);
      basicEndpoint.setForceTrustSSLCertificate(true);
      basicEndpoint.setUser(user);
      basicEndpoint.setPassword(password);
      }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.endpoints.BasicEndpoint

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.