Package com.woorea.openstack.keystone.v3.model

Examples of com.woorea.openstack.keystone.v3.model.Token$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

  /**
   * @param args
   */
  public static void main(String[] args) {
    Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL);
   
    Authentication auth = new Authentication();
    auth.setIdentity(Identity.password(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD));
   
    OpenStackResponse response = keystone.tokens().authenticate(auth).request();
   
    String tokenId = response.header("X-Subject-Token");
   
    Token token = response.getEntity(Token.class);
   
View Full Code Here

  private final EndpointsResource ENDPOINTS;
 
  public Keystone(String endpoint, OpenStackClientConnector connector) {
    super(endpoint, connector);
    TOKENS = new TokensResource(this);
    DOMAINS = new DomainsResource(this);
    PROJECTS = new ProjectsResource(this);
    USERS = new UsersResource(this);
    ROLES = new RolesResource(this);
    SERVICES = new ServicesResource(this);
    ENDPOINTS = new EndpointsResource(this);
View Full Code Here

    DOMAINS = new DomainsResource(this);
    PROJECTS = new ProjectsResource(this);
    USERS = new UsersResource(this);
    ROLES = new RolesResource(this);
    SERVICES = new ServicesResource(this);
    ENDPOINTS = new EndpointsResource(this);
  }
View Full Code Here

 
  public Keystone(String endpoint, OpenStackClientConnector connector) {
    super(endpoint, connector);
    TOKENS = new TokensResource(this);
    DOMAINS = new DomainsResource(this);
    PROJECTS = new ProjectsResource(this);
    USERS = new UsersResource(this);
    ROLES = new RolesResource(this);
    SERVICES = new ServicesResource(this);
    ENDPOINTS = new EndpointsResource(this);
  }
View Full Code Here

    super(endpoint, connector);
    TOKENS = new TokensResource(this);
    DOMAINS = new DomainsResource(this);
    PROJECTS = new ProjectsResource(this);
    USERS = new UsersResource(this);
    ROLES = new RolesResource(this);
    SERVICES = new ServicesResource(this);
    ENDPOINTS = new EndpointsResource(this);
  }
View Full Code Here

    TOKENS = new TokensResource(this);
    DOMAINS = new DomainsResource(this);
    PROJECTS = new ProjectsResource(this);
    USERS = new UsersResource(this);
    ROLES = new RolesResource(this);
    SERVICES = new ServicesResource(this);
    ENDPOINTS = new EndpointsResource(this);
  }
View Full Code Here

TOP

Related Classes of com.woorea.openstack.keystone.v3.model.Token$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.