Package org.jclouds

Examples of org.jclouds.ContextBuilder.credentials()


          }
          if (profile.getApiversion() != null) {
            contextBuilder.apiVersion(profile.getApiversion());
          }
          if (profile.getIdentity() != null && profile.getCredential() != null) {
            contextBuilder.credentials(profile.getIdentity(), profile.getCredential());
          }
        } else {
          throw new UnsupportedOperationException(
              "Unsupported Blobstore provider: " + profile.getProvider());
        }
View Full Code Here


         this.api = org.jclouds.rest.RestApiMetadata.class.cast(am).getApi();
      } else {
         throw new UnsupportedOperationException("unsupported base type: " + am);
      }
      // isolate tests from eachother, as default credentialStore is static
      return builder.credentials(identity, credential).modules(
               ImmutableSet.of(new ExpectModule(fn), new NullLoggingModule(), new CredentialStoreModule(new CopyInputStreamInputSupplierMap(
                     new ConcurrentHashMap<String, InputSupplier<InputStream>>())), module)).overrides(props)
               .buildInjector();
   }
  
View Full Code Here

         this.api = org.jclouds.rest.RestApiMetadata.class.cast(am).getApi();
      } else {
         throw new UnsupportedOperationException("unsupported base type: " + am);
      }
      // isolate tests from eachother, as default credentialStore is static
      return builder.credentials(identity, credential).modules(
               ImmutableSet.of(new ExpectModule(fn), new NullLoggingModule(), new CredentialStoreModule(new CopyInputStreamInputSupplierMap(
                     new ConcurrentHashMap<String, InputSupplier<InputStream>>())), module)).overrides(props)
               .buildInjector();
   }
  
View Full Code Here

      ContextBuilder builder = pm != null ? ContextBuilder.newBuilder(pm) : ContextBuilder.newBuilder(ApiMetadata.class
            .cast(checkNotNull(createApiMetadata(),
                  "either createApiMetadata or createProviderMetadata must be overridden")));

      return builder.credentials(identity, credential)
            .modules(ImmutableSet.of(new MockModule(), new NullLoggingModule(), createModule()))
            .overrides(setupProperties()).buildInjector();
   }

   /**
 
View Full Code Here

         this.api = org.jclouds.rest.RestApiMetadata.class.cast(am).getApi();
      } else {
         throw new UnsupportedOperationException("unsupported base type: " + am);
      }
      // isolate tests from eachother, as default credentialStore is static
      return builder.credentials(identity, credential)
               .modules(ImmutableSet.of(new ExpectModule(fn), new NullLoggingModule(), new CredentialStoreModule(new ConcurrentHashMap<String, ByteSource>()), module))
               .overrides(props)
               .buildInjector();
   }
  
View Full Code Here

      ContextBuilder builder = pm != null ? ContextBuilder.newBuilder(pm) : ContextBuilder.newBuilder(ApiMetadata.class
            .cast(checkNotNull(createApiMetadata(),
                  "either createApiMetadata or createProviderMetadata must be overridden")));

      return builder.credentials(identity, credential)
            .modules(ImmutableSet.of(new MockModule(), new NullLoggingModule(), createModule()))
            .overrides(setupProperties()).buildInjector();
   }

   /**
 
View Full Code Here

            if (endpoint != null && !endpoint.isEmpty()) {
                builder = builder.endpoint(endpoint);
            }

            builder = builder.credentials(identity, credential);
            builder = builder.overrides(props);
            builder = builder.modules(ImmutableSet.<Module>of(new ManagementLifecycle(BaseManagementContext.INSTANCE)));
            builder = builder.name(providerId).modules(ImmutableSet.<Module>of(new Log4JLoggingModule(), new SshjSshClientModule()));
           
            ComputeServiceContext context = builder.build(ComputeServiceContext.class);
View Full Code Here

      ContextBuilder builder = pm != null ? ContextBuilder.newBuilder(pm) : ContextBuilder.newBuilder(ApiMetadata.class
            .cast(checkNotNull(createApiMetadata(),
                  "either createApiMetadata or createProviderMetadata must be overridden")));

      return builder.credentials(identity, credential)
            .modules(ImmutableSet.of(new MockModule(), new NullLoggingModule(), createModule()))
            .overrides(setupProperties()).buildInjector();
   }

   /**
 
View Full Code Here

         this.api = org.jclouds.rest.RestApiMetadata.class.cast(am).getApi();
      } else {
         throw new UnsupportedOperationException("unsupported base type: " + am);
      }
      // isolate tests from eachother, as default credentialStore is static
      return builder.credentials(identity, credential).modules(
               ImmutableSet.of(new ExpectModule(fn), new NullLoggingModule(), new CredentialStoreModule(new CopyInputStreamInputSupplierMap(
                     new ConcurrentHashMap<String, InputSupplier<InputStream>>())), module)).overrides(props)
               .buildInjector();
   }
  
View Full Code Here

  public static void main(String[] args) {
    // Configure/Authenticate the Dyn Java Messaging client instance
    ProviderMetadata meta = Providers.withId("dyn-messaging");
    ContextBuilder ctx = ContextBuilder.newBuilder(meta);

    ctx.credentials(/* intentionally blank -> */"", "yourapikey");
    DynMessagingApi dyn = ctx.buildApi(DynMessagingApi.class);

    SendMailApi send = dyn.getSendMailApi();
    System.out.println("send : "
        + send.sendMessage("fromperson@example.org",
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.