Examples of tokens()


Examples of com.woorea.openstack.keystone.Keystone.tokens()

  /**
   * @param args
   */
  public static void main(String[] args) {
    Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL);
    Access access = keystone.tokens().authenticate(
        new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD))
        .execute();
   
    //use the token in the following requests
    keystone.token(access.getToken().getId());
View Full Code Here

Examples of com.woorea.openstack.keystone.Keystone.tokens()

    Tenants tenants = keystone.tenants().list().execute();
   
    //try to exchange token using the first tenant
    if(tenants.getList().size() > 0) {
     
      access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantId(tenants.getList().get(0).getId()).execute();
     
      //NovaClient novaClient = new NovaClient(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "compute", null, "public"), access.getToken().getId());
      Nova novaClient = new Nova(ExamplesConfiguration.NOVA_ENDPOINT.concat("/").concat(tenants.getList().get(0).getId()));
      novaClient.token(access.getToken().getId());
      //novaClient.enableLogging(Logger.getLogger("nova"), 100 * 1024);
 
View Full Code Here

Examples of com.woorea.openstack.keystone.Keystone.tokens()

   */
  public static void main(String[] args) {
    Keystone keystone = new Keystone(KEYSTONE_AUTH_URL);

    // access with unscoped token
    Access access = keystone
        .tokens()
        .authenticate()
        .withUsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)
        .execute();

View Full Code Here

Examples of com.woorea.openstack.keystone.Keystone.tokens()

    Keystone keystone = new Keystone(props.getKeystoneHost() + ':'
        + props.getKeystonePort() + '/' + props.getOAuthVersion());
    Authentication authentication = new UsernamePassword(
        props.getKeystoneProxyUser(), props.getKeystoneProxyPass());

    Access access = keystone.tokens().authenticate(authentication)
        .execute();

    return access.getToken().getId();
  }
View Full Code Here

Examples of com.woorea.openstack.keystone.v3.Keystone.tokens()

    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

Examples of org.apache.slide.common.UriPath.tokens()

        // check resolve cache first
        ResourceId resourceId = checkResolveCache(uri);
       
        if (resourceId == null) {
            UriPath uriPath = new UriPath(uri.toString());
            String[] segments = uriPath.tokens();
            String rootUriStr = uri.getScope().toString();
            if (!"/".equals(rootUriStr)) {
                rootUriStr += "/";
            }
            String currentUriStr = rootUriStr;
View Full Code Here

Examples of org.apache.slide.common.UriPath.tokens()

        // check resolve cache first
        ResourceId resourceId = checkResolveCache(uri);
       
        if (resourceId == null) {
            UriPath uriPath = new UriPath(uri.toString());
            String[] segments = uriPath.tokens();
            String rootUriStr = uri.getScope().toString();
            if (!"/".equals(rootUriStr)) {
                rootUriStr += "/";
            }
            String currentUriStr = rootUriStr;
View Full Code Here

Examples of org.apache.slide.common.UriPath.tokens()

        // check resolve cache first
        ResourceId resourceId = checkResolveCache(uri);
       
        if (resourceId == null) {
            UriPath uriPath = new UriPath(uri.toString());
            String[] segments = uriPath.tokens();
            String rootUriStr = uri.getScope().toString();
            if (!"/".equals(rootUriStr)) {
                rootUriStr += "/";
            }
            String currentUriStr = rootUriStr;
View Full Code Here

Examples of org.apache.slide.common.UriPath.tokens()

        // check resolve cache first
        ResourceId resourceId = checkResolveCache(uri);
       
        if (resourceId == null) {
            UriPath uriPath = new UriPath(uri.toString());
            String[] segments = uriPath.tokens();
            String rootUriStr = uri.getScope().toString();
            String currentUriStr = rootUriStr;
            Uri currentUri = new Uri(uri.getToken(), uri.getNamespace(), currentUriStr);
            ResourceId currentResourceId = ResourceId.create(currentUri, currentUriStr);
            int start = new UriPath(rootUriStr).tokens().length;
View Full Code Here

Examples of org.apache.slide.common.UriPath.tokens()

        return super.retrieveObject(resourceId);
    }
   
    private void doTLock(Uri uri, ResourceId resourceId, int lockType, int parentLockType) throws TLockedException, ObjectNotFoundException, ServiceAccessException {
        UriPath uriPath = new UriPath(uri.toString());
        String[] segments = uriPath.tokens();
        int start = new UriPath(uri.getScope().toString()).tokens().length;
       
        for (int i = start; i < segments.length; i++) {
            String currentUriStr = uriPath.subUriPath(0, i).toString();
            Uri currentUri = new Uri(uri.getToken(), uri.getNamespace(), currentUriStr);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.