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

Examples of com.ibm.sbt.services.client.connections.communities.CommunityService


   
    /**
     * Default constructor
     */
    public CommunityServiceApp(String url, String user, String password) {
        this.communityService = new CommunityService();
        this.communityService.setEndpoint(createEndpoint(url, user, password));
    }
View Full Code Here


    String password = args[2];
      CommunityServiceApp app = new CommunityServiceApp(url, user, password);
    HashMap<String, String> parameters = new HashMap<String, String>();
    parameters.put("ps", "100"); //100 members will be retrieved at a time. Max is 10,000.
      try {
        CommunityService communityService = app.getCommunityService();
            Collection<Community> communities = communityService.getPublicCommunities();
            for (Iterator<Community> iter = communities.iterator(); iter.hasNext(); ) {
                Community community = iter.next();
                boolean moreMembers = true;
                int page = 1;
               
                System.out.println(community.getTitle());
                do{
                    parameters.put("page", Integer.toString(page));
                    EntityList<Member> members = communityService.getMembers(community.getCommunityUuid(), parameters);
                    for (int i=0; i<members.size(); i++) {
                        System.out.println("    " + members.get(i).getEmail());
                    }
                    if((members.getStartIndex() + members.getItemsPerPage()) <= members.getTotalResults()){
                        moreMembers = true;
View Full Code Here

     */
    public CreateCommunitiesApp(String endpointName, boolean initEnvironment) {
        if(initEnvironment)
            this.initEnvironment();
       
        this.communityService = new CommunityService();
        this.setEndpoint((BasicEndpoint)EndpointFactory.getEndpoint(endpointName));
    }
View Full Code Here

      throws AuthenticationException {
    if (initEnvironment)
      this.initEnvironment();

    this.fileService = new FileService();
    this.communityService = new CommunityService();
    this.setEndpoint((BasicEndpoint) EndpointFactory
        .getEndpoint(endpointName));
  }
View Full Code Here

    }
  }

  public Community createTestCommunity() throws ClientServicesException {
    if (communityService==null){
      communityService = new CommunityService();
    }

    Community community = new Community(communityService, "");
    community.setTitle("JavaTestCommunity " + System.currentTimeMillis());
    community.setContent("Java Community Content");
View Full Code Here

   * @return
   */
  public Community createCommunity(String title, String type, String content, ArrayList<String> tags, boolean retry) {
        Community community = null;
        try {
        CommunityService communityService = new CommunityService();
        long start = System.currentTimeMillis();
         community =  new Community(communityService, "");
         community.setTitle("Test Community 1ab" + System.currentTimeMillis());
         community.setContent("");
        community.setCommunityType("public");
View Full Code Here

   */
  public void deleteCommunity() {
        if (testCommunityID != null) {
            try {
              loginConnections();
                CommunityService communityService = getCommunityService();
                communityService.deleteCommunity(testCommunityID);
            } catch (AuthenticationException pe) {
              if (pe.getCause() != null) {
                pe.getCause().printStackTrace();
              }
                Assert.fail("Error authenicating: " + pe.getMessage());
View Full Code Here

        }
    }
 
  protected CommunityService getCommunityService() {
        if (communityService == null) {
            communityService = new CommunityService(getEndpointName());
        }
        return communityService;
    }
View Full Code Here

    this.failIfAfterDeletionFails = failIfAfterDeletionFails;
  }

  protected CommunityService getCommunityService() {
    if (communityService == null) {
      communityService = new CommunityService(getEndpointName());
    }
    return communityService;
  }
View Full Code Here

  protected Community createCommunity(String title, String type,
      String content, String tags, boolean retry) {
    Community community = null;
    try {
      loginConnections();
      CommunityService communityService = getCommunityService();

      long start = System.currentTimeMillis();
      community = new Community(communityService, "");
      community.setTitle(title);
      community.setCommunityType(type);
      community.setContent(content);
      community.setTags(tags);
      String communityUuid = communityService.createCommunity(community);
      community = communityService.getCommunity(communityUuid);

      long duration = System.currentTimeMillis() - start;
      Trace.log("Created test community: " + communityUuid + " took "
          + duration + "(ms)");
    } catch (AuthenticationException pe) {
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.connections.communities.CommunityService

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.