Package org.jclouds.openstack.keystone.v2_0.functions.internal.ParseUsers

Examples of org.jclouds.openstack.keystone.v2_0.functions.internal.ParseUsers.Users


      Optional<? extends UserAdminApi> userAdminApiExtension = keystoneApi.getUserAdminApi();

      if (userAdminApiExtension.isPresent()) {
         System.out.format("    UserAdminApi is present%n");

         UserAdminApi userAdminApi = userAdminApiExtension.get();
         CreateUserOptions userOptions = CreateUserOptions.Builder
               .tenant(tenant.getId())
               .email("new.email@example.com");
         User user = userAdminApi.create("newUser", "newPassword", userOptions);

         System.out.format("    %s%n", user);
      } else {
         System.out.format("    UserAdminApi is *not* present%n");
         System.exit(1);
View Full Code Here


         this.api = checkNotNull(api, "api");
      }

      @Override
      protected Function<Object, IterableWithMarker<Tenant>> markerToNextForCallingArg0(final String ignored) {
         final TenantApi tenantApi = api.getTenantApi().get();
         return new Function<Object, IterableWithMarker<Tenant>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<Tenant> apply(Object input) {
               return IterableWithMarker.class.cast(tenantApi.list(marker(input.toString())));
            }

            @Override
            public String toString() {
               return "listTenants()";
View Full Code Here

         this.api = checkNotNull(api, "api");
      }

      @Override
      protected Function<Object, IterableWithMarker<Tenant>> markerToNextForArg0(Optional<Object> ignored) {
         final TenantApi tenantApi = api.getTenantApi().get();
         return new Function<Object, IterableWithMarker<Tenant>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<Tenant> apply(Object input) {
               PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
               return IterableWithMarker.class.cast(tenantApi.list(paginationOptions));
            }

            @Override
            public String toString() {
               return "listTenants()";
View Full Code Here

         this.api = checkNotNull(api, "api");
      }

      @Override
      protected Function<Object, IterableWithMarker<Tenant>> markerToNextForArg0(Optional<Object> ignored) {
         final TenantApi tenantApi = api.getTenantApi().get();
         return new Function<Object, IterableWithMarker<Tenant>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<Tenant> apply(Object input) {
               PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
               return IterableWithMarker.class.cast(tenantApi.list(paginationOptions));
            }

            @Override
            public String toString() {
               return "listTenants()";
View Full Code Here

         this.api = checkNotNull(api, "api");
      }

      @Override
      protected Function<Object, IterableWithMarker<Tenant>> markerToNextForCallingArg0(final String ignored) {
         final TenantApi tenantApi = api.getTenantApi().get();
         return new Function<Object, IterableWithMarker<Tenant>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<Tenant> apply(Object input) {
               return IterableWithMarker.class.cast(tenantApi.list(marker(input.toString())));
            }

            @Override
            public String toString() {
               return "listTenants()";
View Full Code Here

         this.api = checkNotNull(api, "api");
      }

      @Override
      protected Function<Object, IterableWithMarker<User>> markerToNextForCallingArg0(final String ignored) {
         final UserApi userApi = api.getUserApi().get();
         return new Function<Object, IterableWithMarker<User>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<User> apply(Object input) {
               return IterableWithMarker.class.cast(userApi.list(marker(input.toString())));
            }

            @Override
            public String toString() {
               return "listUsers()";
View Full Code Here

         this.api = checkNotNull(api, "api");
      }

      @Override
      protected Function<Object, IterableWithMarker<User>> markerToNextForArg0(Optional<Object> ignored) {
         final UserApi userApi = api.getUserApi().get();
         return new Function<Object, IterableWithMarker<User>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<User> apply(Object input) {
               PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
               return IterableWithMarker.class.cast(userApi.list(paginationOptions));
            }

            @Override
            public String toString() {
               return "listUsers()";
View Full Code Here

         this.api = checkNotNull(api, "api");
      }

      @Override
      protected Function<Object, IterableWithMarker<User>> markerToNextForArg0(Optional<Object> ignored) {
         final UserApi userApi = api.getUserApi().get();
         return new Function<Object, IterableWithMarker<User>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<User> apply(Object input) {
               PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
               return IterableWithMarker.class.cast(userApi.list(paginationOptions));
            }

            @Override
            public String toString() {
               return "listUsers()";
View Full Code Here

         this.api = checkNotNull(api, "api");
      }

      @Override
      protected Function<Object, IterableWithMarker<User>> markerToNextForCallingArg0(final String ignored) {
         final UserApi userApi = api.getUserApi().get();
         return new Function<Object, IterableWithMarker<User>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<User> apply(Object input) {
               return IterableWithMarker.class.cast(userApi.list(marker(input.toString())));
            }

            @Override
            public String toString() {
               return "listUsers()";
View Full Code Here

      assertEquals(users.get("users"), expectedUsers);
   }

   public void testParseUsers() throws JsonSyntaxException, IOException {
      String json = Strings2.toStringAndClose(getClass().getResourceAsStream("/user_list.json"));
      Users users = gson.fromJson(json, Users.class);
      assertEquals(users.toSet(), expectedUsers);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.keystone.v2_0.functions.internal.ParseUsers.Users

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.