Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to jclouds, Inc. (jclouds) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. jclouds licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.jclouds.loadbalancer;
 
 import static org.jclouds.rest.RestContextFactory.createContextBuilder;
 import static org.jclouds.util.Throwables2.propagateAuthorizationOrOriginalException;
 
 
 
 
Helper class to instantiate LoadBalancerServiceContext instances.

Author(s):
Adrian Cole
 
 
    private final RestContextFactory contextFactory;

   
Initializes with the default properties built-in to jclouds. This is typically stored in the classpath resource rest.properties

 
       this(new RestContextFactory());
    }

   
Finds definitions in the specified properties.
 
    public LoadBalancerServiceContextFactory(Properties properties) {
       this(new RestContextFactory(properties));
    }

   
Uses the supplied RestContextFactory to create LoadBalancerServiceContexts
 
    public LoadBalancerServiceContextFactory(RestContextFactory restContextFactory) {
       this. = restContextFactory;
    }
 
          LoadBalancerServiceContextBuilder<S, A> builder) {
       try {
          return builder.buildLoadBalancerServiceContext();
       } catch (Exception e) {
          return propagateAuthorizationOrOriginalException(e);
       }
    }

   
 
    public LoadBalancerServiceContext createContext(String providerString identityString credential) {
             .createContextBuilder(provideridentitycredential));
       return buildContextUnwrappingExceptions(builder);
    }

   
 
    public LoadBalancerServiceContext createContext(String providerProperties overrides) {
             .createContextBuilder(provideroverrides));
       return buildContextUnwrappingExceptions(builder);
    }

   
 
    public LoadBalancerServiceContext createContext(String providerIterable<? extends ModulemodulesProperties overrides) {
             .createContextBuilder(providermodulesoverrides));
      return buildContextUnwrappingExceptions(builder);
   }

   
   public LoadBalancerServiceContext createContext(String provider, @Nullable String identity, @Nullable String credential,
         Iterable<? extends Modulemodules) {
            .createContextBuilder(provideridentitycredentialmodules));
      return buildContextUnwrappingExceptions(builder);
   }

   
   public LoadBalancerServiceContext createContext(String provider, @Nullable String identity, @Nullable String credential,
         Iterable<? extends ModulemodulesProperties overrides) {
            .createContextBuilder(provideridentitycredentialmodulesoverrides));
      return buildContextUnwrappingExceptions(builder);
   }

   
   public <S, A> LoadBalancerServiceContext createContext(RestContextSpec<S, A> contextSpec) {
            .cast(createContextBuilder(contextSpec));
      return buildContextUnwrappingExceptions(builder);
   }

   
   public <S, A> LoadBalancerServiceContext createContext(RestContextSpec<S, A> contextSpecProperties overrides) {
            contextSpecoverrides));
      return buildContextUnwrappingExceptions(builder);
   }

   
   public <S, A> LoadBalancerServiceContext createContext(RestContextSpec<S, A> contextSpecIterable<Modulemodules,
         Properties overrides) {
            contextSpecmodulesoverrides));
      return buildContextUnwrappingExceptions(builder);
   }
New to GrepCode? Check out our FAQ X