Package com.microsoft.windowsazure.management.websites.models

Examples of com.microsoft.windowsazure.management.websites.models.WebSpacesListPublishingUsersResponse$User


      // Get the UserService.
      UserServiceInterface userService = user.getService(DfpService.V201308.USER_SERVICE);

      // Get the current user.
      User usr = userService.getCurrentUser();

      System.out.println("User with ID \"" + usr.getId()
          + "\", email \"" + usr.getEmail()
          + "\", and role \"" + usr.getRoleName() + "\" is the current user.");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here


      // Create an array to store local user objects.
      User[] users = new User[emailAndNames.size()];

      for (int i = 0; i < users.length; i++) {
        // Create the new user structure.
        User newUser = new User();
        newUser.setEmail(emailAndNames.get(i)[0]);
        newUser.setName(emailAndNames.get(i)[1]);
        newUser.setRoleId(roleId);
        newUser.setPreferredLocale("en_US");

        users[i] = newUser;
      }

      // Create the users.
      users = userService.createUsers(users);

      if (users != null) {
        for (User newUser : users) {
          System.out.println("A user with ID \"" + newUser.getId()
              + "\", email \"" + newUser.getEmail()
              + "\", and role \"" + newUser.getRoleName() + "\" was created.");
        }
      } else {
        System.out.println("No users created.");
      }
    } catch (Exception e) {
View Full Code Here

      // Set the ID of the user to get.
      Long userId = Long.parseLong("INSERT_USER_ID_HERE");

      // Get the user.
      User usr = userService.getUser(userId);

      if (usr != null) {
        System.out.println("User with ID \"" + usr.getId()
            + "\" email \"" + usr.getEmail()
            + "\", and role \"" + usr.getRoleName() + "\" was found.");
      } else {
        System.out.println("No user found for this ID.");
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

      // Get the UserService.
      UserServiceInterface userService = user.getService(DfpService.V201311.USER_SERVICE);

      // Get the current user.
      User usr = userService.getCurrentUser();

      System.out.println("User with ID \"" + usr.getId()
          + "\", email \"" + usr.getEmail()
          + "\", and role \"" + usr.getRoleName() + "\" is the current user.");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    }

    @Test
    public void listPublishingUsersSuccess() throws Exception {
        // Act
        WebSpacesListPublishingUsersResponse webSpacesListPublishingUsersResponse = webSiteManagementClient.getWebSpacesOperations().listPublishingUsers();

        // Assert
        Assert.assertEquals(200,   webSpacesListPublishingUsersResponse.getStatusCode());
        Assert.assertNotNull( webSpacesListPublishingUsersResponse.getRequestId());

        ArrayList< WebSpacesListPublishingUsersResponse.User> userlist =  webSpacesListPublishingUsersResponse.getUsers();
        for (WebSpacesListPublishingUsersResponse.User user : userlist) {
             Assert.assertNotNull(user.getName());
        }
    }
View Full Code Here

                }
                throw ex;
            }
           
            // Create Result
            WebSpacesListPublishingUsersResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new WebSpacesListPublishingUsersResponse();
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
           
            Element arrayOfstringSequenceElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/2003/10/Serialization/Arrays", "ArrayOfstring");
            if (arrayOfstringSequenceElement != null) {
                for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(arrayOfstringSequenceElement, "http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").size(); i1 = i1 + 1) {
                    org.w3c.dom.Element arrayOfstringElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(arrayOfstringSequenceElement, "http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").get(i1));
                    WebSpacesListPublishingUsersResponse.User stringInstance = new WebSpacesListPublishingUsersResponse.User();
                    result.getUsers().add(stringInstance);
                   
                    String stringInstance2;
                    stringInstance2 = arrayOfstringElement.getTextContent();
                    stringInstance.setName(stringInstance2);
                }
            }
           
            result.setStatusCode(statusCode);
            if (httpResponse.getHeaders("x-ms-request-id").length > 0) {
                result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue());
            }
           
            if (shouldTrace) {
                CloudTracing.exit(invocationId, result);
            }
View Full Code Here

            Form<User> userForm = Form.form(User.class).bind(ImmutableMap.of("email", "e"));
            //#handle-errors
            if (userForm.hasErrors()) {
                return badRequest(views.html.form.render(userForm));
            } else {
                User user = userForm.get();
                return ok("Got user " + user);
            }
            //#handle-errors
        }
View Full Code Here

        //#bind
        Map<String,String> anyData = new HashMap();
        anyData.put("email", "bob@gmail.com");
        anyData.put("password", "secret");

        User user = userForm.bind(anyData).get();
        //#bind

        assertThat(user.email, equalTo("bob@gmail.com"));
        assertThat(user.password, equalTo("secret"));
    }
View Full Code Here

                this.password = password;
            }
        }
        Form<javaguide.forms.u1.User> userForm = Form.form(javaguide.forms.u1.User.class);
        //#fill
        userForm = userForm.fill(new User("bob@gmail.com", "secret"));
        //#fill
        assertThat(userForm.field("email").value(), equalTo("bob@gmail.com"));
        assertThat(userForm.field("password").value(), equalTo("secret"));
    }
View Full Code Here

    public static class Controller1 extends MockJavaAction {
        public Result index() {
            Form<User> userForm = Form.form(User.class);
            //#bind-from-request
            User user = userForm.bindFromRequest().get();
            //#bind-from-request

            return ok(user.email);
        }
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.management.websites.models.WebSpacesListPublishingUsersResponse$User

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.