Package com.ibm.sbt.services.client.connections.activities

Examples of com.ibm.sbt.services.client.connections.activities.ActivityService


        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();
       
       
        //fails even when mutexed
        final Object mutex = new Object();

        Thread t1 = new Thread(new Runnable() {

            @Override
            public void run() {
                Activity a;
                try {
                    a = svc.getActivity(uuid);
                   
                    for (int i = 0; i < 10; i++) {
                        a.setCompleted(a.isCompleted());
                        a.setContent("content " + System.currentTimeMillis());
                        synchronized (mutex) {
                            svc.updateActivity(a);
                        }
                    }
                } catch (ClientServicesException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        });
        Thread t2 = new Thread(new Runnable() {

            @Override
            public void run() {
                try {

                    for (int i = 0; i < 10; i++) {
                        ActivityNode activityNode = new ActivityNode(svc);
                        activityNode.setActivityUuid(uuid);
                        //activityNode.setEntryType(type);
                        activityNode.setTitle("Node from Test " + System.currentTimeMillis());
                        activityNode.setContent("Node Content " + System.currentTimeMillis());
                        List<String> tagList = new ArrayList<String>();
                        tagList.add("tag1");
                        tagList.add("tag2");
                        activityNode.setTags(tagList);
                        synchronized (mutex) {
                            activityNode = svc.createActivityNode(activityNode);
                        }
                    }
                } catch (ClientServicesException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
View Full Code Here


    try {
      loginConnections();
    } catch (AuthenticationException e1) {
      e1.printStackTrace();
    }
    this.activityService = new ActivityService();
    Activity activity = new Activity(activityService);
    activity.setTitle("JSPActivity" + System.currentTimeMillis());
    activity.setContent("GoalOfActivity - " + System.currentTimeMillis());
    List<String> tagList = new ArrayList<String>();
    tagList.add("tag1");
View Full Code Here

    this.testActivityID = activity.getActivityUuid();
  }
 
  public void deleteActivity() throws ClientServicesException{
    if(this.activityService ==  null){
      this.activityService = new ActivityService();
    }else if (this.activityService != null){
      this.activityService.deleteActivity(testActivityID, null);
      System.out.println("Activty Deleted");
    }
  }
View Full Code Here

      e.printStackTrace();
      return null;
    }

    if (activityService == null) {
      activityService = new ActivityService(getEndpointName());
    }
    return activityService;
  }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.connections.activities.ActivityService

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.