You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2014/12/23 05:26:43 UTC
[19/51] [partial] stratos git commit: dropping jclouds 1.8.0 clone
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java
deleted file mode 100644
index 9a3e88e..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.googlecomputeengine.options;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Allows to optionally specify a filter, max results and a page token for <code>listFirstPage()</code> REST methods.
- *
- * @see <a href="https://developers.google.com/compute/docs/reference/v1/operations/listFirstPage"/>
- */
-public class ListOptions extends BaseHttpRequestOptions {
-
- /**
- * Optional. Filter expression for filtering listed resources, in the form filter={expression}. Your {expression}
- * must contain the following:
- * <p/>
- * {@code <field_name> <comparison_string> <literal_string>}
- * <ul>
- * <li>{@code <field_name>}: The name of the field you want to compare. The field name must be valid for the
- * type of resource being filtered. Only atomic field types are supported (string, number,
- * boolean). Array and object fields are not currently supported.</li>
- * <li>{@code <comparison_string>}: The comparison string, either eq (equals) or ne (not equals).</li>
- * <li>{@code <literal_string>}: The literal string value to filter to. The literal value must be valid
- * for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a
- * regular expression using RE2 syntax. The literal value must match the entire field. For example,
- * when filtering instances, name eq my_instance won't work, but name eq .*my_instance will work.</li>
- * </ul>
- * <p/>
- * For example:
- * <p/>
- * {@code filter=status ne RUNNING}
- * <p/>
- * The above filter returns only results whose status field does not equal RUNNING. You can also enclose your
- * literal string in single, double, or no quotes. For example, all three of the following would be valid
- * expressions:
- * <p/>
- * {@code filter=status ne "RUNNING"}<br/>
- * {@code filter=status ne 'RUNNING'}<br/>
- * {@code filter=status ne RUNNING}<br/>
- * <p/>
- * Complex regular expressions can also be used, like the following:
- * {@code name eq '."my_instance_[0-9]+'}
- */
- public ListOptions filter(String filter) {
- this.queryParameters.put("filter", checkNotNull(filter, "filter"));
- return this;
- }
-
- /**
- * Sets Maximum count of results to be returned. Maximum and default value is 100. Acceptable items are 0 to
- * 100, inclusive. (Default: 100)
- */
- public ListOptions maxResults(Integer maxResults) {
- this.queryParameters.put("maxResults", checkNotNull(maxResults, "maxResults") + "");
- return this;
- }
-
- public static class Builder {
-
- /**
- * @see ListOptions#filter(String)
- */
- public ListOptions filter(String filter) {
- return new ListOptions().filter(filter);
- }
-
- /**
- * @see ListOptions#maxResults(Integer)
- */
- public ListOptions maxResults(Integer maxResults) {
- return new ListOptions().maxResults(maxResults);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/options/RouteOptions.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/options/RouteOptions.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/options/RouteOptions.java
deleted file mode 100644
index ec891ce..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/options/RouteOptions.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.googlecomputeengine.options;
-
-import java.net.URI;
-import java.util.Set;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- * Options to create a route.
- *
- * @see org.jclouds.googlecomputeengine.domain.Route
- */
-public class RouteOptions {
-
- private String name;
- private URI network;
- private String destRange;
- private URI nextHopInstance;
- private String nextHopIp;
- private URI nextHopNetwork;
- private URI nextHopGateway;
- private String description;
- private Integer priority;
-
- private ImmutableSet.Builder<String> tags = ImmutableSet.builder();
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getName()
- */
- public String getName() {
- return name;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getName()
- */
- public RouteOptions name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getDescription()
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getDescription()
- */
- public RouteOptions description(String description) {
- this.description = description;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getDestRange()
- */
- public String getDestRange() {
- return destRange;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getDestRange()
- */
- public RouteOptions destRange(String destRange) {
- this.destRange = destRange;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopIp()
- */
- public String getNextHopIp() {
- return nextHopIp;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopIp()
- */
- public RouteOptions nextHopIp(String nextHopIp) {
- this.nextHopIp = nextHopIp;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getPriority()
- */
- public Integer getPriority() {
- return priority;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getPriority()
- */
- public RouteOptions priority(Integer priority) {
- this.priority = priority;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNetwork()
- */
- public RouteOptions network(URI network) {
- this.network = network;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNetwork()
- */
- public URI getNetwork() {
- return network;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopInstance()
- */
- public RouteOptions nextHopInstance(URI nextHopInstance) {
- this.nextHopInstance = nextHopInstance;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopInstance()
- */
- public URI getNextHopInstance() {
- return nextHopInstance;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopNetwork()
- */
- public RouteOptions nextHopNetwork(URI nextHopNetwork) {
- this.nextHopNetwork = nextHopNetwork;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopNetwork()
- */
- public URI getNextHopNetwork() {
- return nextHopNetwork;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopGateway()
- */
- public RouteOptions nextHopGateway(URI nextHopGateway) {
- this.nextHopGateway = nextHopGateway;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopGateway()
- */
- public URI getNextHopGateway() {
- return nextHopGateway;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getTags()
- */
- public Set<String> getTags() {
- return tags.build();
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getTags()
- */
- public RouteOptions addTag(String tag) {
- this.tags.add(tag);
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getTags()
- */
- public RouteOptions tags(Set<String> tags) {
- this.tags = ImmutableSet.builder();
- this.tags.addAll(tags);
- return this;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/GlobalOperationDonePredicate.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/GlobalOperationDonePredicate.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/GlobalOperationDonePredicate.java
deleted file mode 100644
index ac34bcc..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/GlobalOperationDonePredicate.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.googlecomputeengine.predicates;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.config.UserProject;
-import org.jclouds.googlecomputeengine.domain.Operation;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Supplier;
-import com.google.inject.Inject;
-
-/**
- * Tests that a Global Operation is done, returning the completed Operation when it is.
- */
-public class GlobalOperationDonePredicate implements Predicate<AtomicReference<Operation>> {
-
- private final GoogleComputeEngineApi api;
- private final Supplier<String> project;
-
- @Inject
- public GlobalOperationDonePredicate(GoogleComputeEngineApi api, @UserProject Supplier<String> project) {
- this.api = api;
- this.project = project;
- }
-
- @Override
- public boolean apply(AtomicReference<Operation> input) {
- checkNotNull(input, "input");
- Operation current = api.getGlobalOperationApiForProject(project.get()).get(input.get().getName());
- switch (current.getStatus()) {
- case DONE:
- input.set(current);
- return true;
- case PENDING:
- case RUNNING:
- default:
- return false;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/InstancePredicates.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/InstancePredicates.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/InstancePredicates.java
deleted file mode 100644
index 8cde680..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/InstancePredicates.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.googlecomputeengine.predicates;
-
-import org.jclouds.googlecomputeengine.domain.InstanceTemplate.PersistentDisk;
-
-import com.google.common.base.Predicate;
-
-public class InstancePredicates {
-
- public static Predicate<PersistentDisk> isBootDisk() {
- return new Predicate<PersistentDisk>() {
- @Override
- public boolean apply(PersistentDisk input) {
- return input.isBoot();
- }
- };
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/NetworkFirewallPredicates.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/NetworkFirewallPredicates.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/NetworkFirewallPredicates.java
deleted file mode 100644
index 63d2767..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/NetworkFirewallPredicates.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.googlecomputeengine.predicates;
-
-import org.jclouds.googlecomputeengine.domain.Firewall;
-import org.jclouds.googlecomputeengine.domain.Firewall.Rule;
-import org.jclouds.net.domain.IpPermission;
-import org.jclouds.net.domain.IpProtocol;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Range;
-import com.google.common.collect.Sets;
-
-public class NetworkFirewallPredicates {
-
- public static Predicate<Firewall> hasProtocol(final IpProtocol protocol) {
- return new Predicate<Firewall>() {
-
- @Override
- public boolean apply(Firewall fw) {
- for (Rule rule : fw.getAllowed()) {
- if (rule.getIpProtocol().equals(protocol)) {
- return true;
- }
- }
-
- return false;
- }
- };
- }
-
- public static Predicate<Firewall> hasPortRange(final Range<Integer> portRange) {
- return new Predicate<Firewall>() {
-
- @Override
- public boolean apply(Firewall fw) {
- return Iterables.any(fw.getAllowed(), new Predicate<Rule>() {
- @Override
- public boolean apply(Rule input) {
- return input.getPorts().encloses(portRange);
- }
- });
- }
- };
- }
-
- public static Predicate<Firewall> hasSourceTag(final String sourceTag) {
- return new Predicate<Firewall>() {
- @Override
- public boolean apply(Firewall input) {
- return input.getSourceTags() != null && input.getSourceTags().contains(sourceTag);
- }
- };
- }
-
- public static Predicate<Firewall> hasSourceRange(final String sourceRange) {
- return new Predicate<Firewall>() {
- @Override
- public boolean apply(Firewall input) {
- return input.getSourceRanges() != null && input.getSourceRanges().contains(sourceRange);
- }
- };
- }
-
- public static Predicate<Firewall> equalsIpPermission(final IpPermission permission) {
- return new Predicate<Firewall>() {
- @Override
- public boolean apply(Firewall input) {
- return Iterables.elementsEqual(permission.getGroupIds(), input.getSourceTags())
- && Iterables.elementsEqual(permission.getCidrBlocks(), input.getSourceRanges())
- && (input.getAllowed().size() == 1
- && ruleEqualsIpPermission(permission).apply(Iterables.getOnlyElement(input.getAllowed())));
- }
- };
- }
-
- public static Predicate<Firewall> providesIpPermission(final IpPermission permission) {
- return new Predicate<Firewall>() {
- @Override
- public boolean apply(Firewall input) {
- boolean groupsMatchTags = (permission.getGroupIds().isEmpty() && input.getSourceTags().isEmpty())
- || !Sets.intersection(permission.getGroupIds(), input.getSourceTags()).isEmpty();
- boolean cidrsMatchRanges = (permission.getCidrBlocks().isEmpty() && input.getSourceRanges().isEmpty())
- || !Sets.intersection(permission.getCidrBlocks(), input.getSourceRanges()).isEmpty();
- boolean firewallHasPorts = hasProtocol(permission.getIpProtocol()).apply(input)
- && ((permission.getFromPort() == 0 && permission.getToPort() == 0)
- || hasPortRange(Range.closed(permission.getFromPort(), permission.getToPort())).apply(input));
-
- return groupsMatchTags && cidrsMatchRanges && firewallHasPorts;
- }
- };
- }
-
- private static Predicate<Firewall.Rule> ruleEqualsIpPermission(final IpPermission permission) {
- return new Predicate<Rule>() {
- @Override
- public boolean apply(Firewall.Rule input) {
- return permission.getIpProtocol().equals(input.getIpProtocol())
- && ((input.getPorts().isEmpty() && permission.getFromPort() == 0 && permission.getToPort() == 0)
- || (input.getPorts().asRanges().size() == 1
- && permission.getFromPort() == Iterables.getOnlyElement(input.getPorts().asRanges()).lowerEndpoint()
- && permission.getToPort() == Iterables.getOnlyElement(input.getPorts().asRanges()).upperEndpoint()));
- }
- };
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/RegionOperationDonePredicate.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/RegionOperationDonePredicate.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/RegionOperationDonePredicate.java
deleted file mode 100644
index 1f3dee6..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/RegionOperationDonePredicate.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.googlecomputeengine.predicates;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.jclouds.collect.Memoized;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.config.UserProject;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.Region;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Supplier;
-import com.google.inject.Inject;
-
-/**
- * Tests that a Global Operation is done, returning the completed Operation when it is.
- */
-public class RegionOperationDonePredicate implements Predicate<AtomicReference<Operation>> {
-
- private final GoogleComputeEngineApi api;
- private final Supplier<String> project;
- private final Supplier<Map<URI, Region>> regions;
-
- @Inject
- RegionOperationDonePredicate(GoogleComputeEngineApi api, @UserProject Supplier<String> project,
- @Memoized Supplier<Map<URI, Region>> regions) {
- this.api = api;
- this.project = project;
- this.regions = regions;
- }
-
- @Override
- public boolean apply(AtomicReference<Operation> input) {
- checkNotNull(input, "input");
-
- Operation current = api.getRegionOperationApiForProject(project.get())
- .getInRegion(regions.get().get(input.get().getRegion().get()).getName(),
- input.get().getName());
- switch (current.getStatus()) {
- case DONE:
- input.set(current);
- return true;
- case PENDING:
- case RUNNING:
- default:
- return false;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/ZoneOperationDonePredicate.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/ZoneOperationDonePredicate.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/ZoneOperationDonePredicate.java
deleted file mode 100644
index c63c6f3..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/googlecomputeengine/predicates/ZoneOperationDonePredicate.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.googlecomputeengine.predicates;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.jclouds.collect.Memoized;
-import org.jclouds.domain.Location;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.config.UserProject;
-import org.jclouds.googlecomputeengine.domain.Operation;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Supplier;
-import com.google.inject.Inject;
-
-/**
- * Tests that a Zone Operation is done, returning the completed Operation when it is.
- */
-public class ZoneOperationDonePredicate implements Predicate<AtomicReference<Operation>> {
-
- private final GoogleComputeEngineApi api;
- private final Supplier<String> project;
- private final Supplier<Map<URI, ? extends Location>> zones;
-
- @Inject
- ZoneOperationDonePredicate(GoogleComputeEngineApi api, @UserProject Supplier<String> project,
- @Memoized Supplier<Map<URI, ? extends Location>> zones) {
- this.api = api;
- this.project = project;
- this.zones = zones;
- }
-
- @Override
- public boolean apply(AtomicReference<Operation> input) {
- checkNotNull(input, "input");
- Operation current = api.getZoneOperationApiForProject(project.get())
- .getInZone(zones.get().get(input.get().getZone().get()).getId(),
- input.get().getName());
- switch (current.getStatus()) {
- case DONE:
- input.set(current);
- return true;
- case PENDING:
- case RUNNING:
- default:
- return false;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/OAuthApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/OAuthApi.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/OAuthApi.java
deleted file mode 100644
index 12e8fcb..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/OAuthApi.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2;
-
-import java.io.Closeable;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.oauth.v2.config.Authentication;
-import org.jclouds.oauth.v2.domain.Token;
-import org.jclouds.oauth.v2.domain.TokenRequest;
-import org.jclouds.oauth.v2.handlers.OAuthTokenBinder;
-import org.jclouds.rest.AuthorizationException;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Endpoint;
-
-/**
- * Provides access to OAuth via REST api.
- * <p/>
- * Usually this is not directly used by a client, which instead specifies
- * OAuthAuthenticator as a request filter, which in turn uses this class to
- * perform token requests.
- *
- * @see OAuthAsyncApi
- */
-@Endpoint(Authentication.class)
-public interface OAuthApi extends Closeable {
-
- /**
- * Authenticates/Authorizes access to a resource defined in TokenRequest
- * against an OAuth v2 authentication/authorization server.
- *
- * @param tokenRequest
- * specified the principal and the required permissions
- * @return a Token object with the token required to access the resource
- * along with its expiration time
- * @throws AuthorizationException
- * if the principal cannot be authenticated or has no permissions
- * for the specifed resources.
- */
- @Named("authenticate")
- @POST
- @Consumes(MediaType.APPLICATION_JSON)
- Token authenticate(@BinderParam(OAuthTokenBinder.class) TokenRequest tokenRequest) throws AuthorizationException;
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/OAuthApiMetadata.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/OAuthApiMetadata.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/OAuthApiMetadata.java
deleted file mode 100644
index 3ef26e6..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/OAuthApiMetadata.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2;
-
-import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL;
-import static org.jclouds.oauth.v2.config.OAuthProperties.SIGNATURE_OR_MAC_ALGORITHM;
-
-import java.net.URI;
-import java.util.Properties;
-
-import org.jclouds.oauth.v2.config.OAuthHttpApiModule;
-import org.jclouds.oauth.v2.config.OAuthModule;
-import org.jclouds.rest.internal.BaseHttpApiMetadata;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Module;
-
-/**
- * Implementation of {@link ApiMetadata} for OAuth 2 API
- */
-public class OAuthApiMetadata extends BaseHttpApiMetadata<OAuthApi> {
-
- @Override
- public Builder toBuilder() {
- return new Builder().fromApiMetadata(this);
- }
-
- public OAuthApiMetadata() {
- this(new Builder());
- }
-
- protected OAuthApiMetadata(Builder builder) {
- super(builder);
- }
-
- public static Properties defaultProperties() {
- Properties properties = BaseHttpApiMetadata.defaultProperties();
- properties.put(SIGNATURE_OR_MAC_ALGORITHM, "RS256");
- properties.put(PROPERTY_SESSION_INTERVAL, 3600);
- return properties;
- }
-
- public static class Builder extends BaseHttpApiMetadata.Builder<OAuthApi, Builder> {
-
- protected Builder() {
- id("oauth")
- .name("OAuth API")
- .identityName("service_account")
- .credentialName("service_key")
- .documentation(URI.create("TODO"))
- .version("2")
- .defaultProperties(OAuthApiMetadata.defaultProperties())
- .defaultModules(ImmutableSet.<Class<? extends Module>>of(OAuthModule.class, OAuthHttpApiModule.class));
- }
-
- @Override
- public OAuthApiMetadata build() {
- return new OAuthApiMetadata(this);
- }
-
- @Override
- protected Builder self() {
- return this;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/OAuthConstants.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/OAuthConstants.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/OAuthConstants.java
deleted file mode 100644
index 9b140d4..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/OAuthConstants.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2;
-
-import com.google.common.collect.ImmutableMap;
-
-import java.util.Map;
-
-/**
- * The constants for OAuth \
- */
-public final class OAuthConstants {
-
- /**
- * Selected algorithm when a signature or mac isn't required.
- */
- public static final String NO_ALGORITHM = "none";
-
- /**
- * Static mapping between the oauth algorithm name and the Crypto provider signature algorithm name.
- *
- * @see <a href="http://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-06#section-3.1">doc</a>
- * @see org.jclouds.oauth.v2.json.JWTTokenRequestFormat
- */
- public static final Map<String, String> OAUTH_ALGORITHM_NAMES_TO_SIGNATURE_ALGORITHM_NAMES = ImmutableMap
- .<String, String>builder()
- .put("RS256", "SHA256withRSA")
- .put("RS384", "SHA384withRSA")
- .put("RS512", "SHA512withRSA")
- .put("HS256", "HmacSHA256")
- .put("HS384", "HmacSHA384")
- .put("HS512", "HmacSHA512")
- .put("ES256", "SHA256withECDSA")
- .put("ES384", "SHA384withECDSA")
- .put("ES512", "SHA512withECDSA")
- .put(NO_ALGORITHM, NO_ALGORITHM).build();
-
- /**
- * Static mapping between the oauth algorithm name and the Crypto provider KeyFactory algorithm name.
- *
- * @see <a href="http://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-06#section-3.1">doc</a>
- */
- public static final Map<String, String> OAUTH_ALGORITHM_NAMES_TO_KEYFACTORY_ALGORITHM_NAMES = ImmutableMap
- .<String, String>builder()
- .put("RS256", "RSA")
- .put("RS384", "RSA")
- .put("RS512", "RSA")
- .put("HS256", "DiffieHellman")
- .put("HS384", "DiffieHellman")
- .put("HS512", "DiffieHellman")
- .put("ES256", "EC")
- .put("ES384", "EC")
- .put("ES512", "EC")
- .put(NO_ALGORITHM, NO_ALGORITHM).build();
-
- /**
- * The (optional) set of additional claims to use, provided in Map<String,String> form
- */
- public static final String ADDITIONAL_CLAIMS = "jclouds.oauth.additional-claims";
-
- private OAuthConstants() {
- throw new AssertionError("intentionally unimplemented");
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/Authentication.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/Authentication.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/Authentication.java
deleted file mode 100644
index 4f1107a..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/Authentication.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2.config;
-
-
-import javax.inject.Qualifier;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Qualifies OAuth related resources, such as Endpoint.
- *
- * @see org.jclouds.oauth.v2.OAuthAsyncApi
- */
-@Retention(value = RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.TYPE, ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD})
-@Qualifier
-public @interface Authentication {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthAuthenticationModule.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthAuthenticationModule.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthAuthenticationModule.java
deleted file mode 100644
index fb2d413..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthAuthenticationModule.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2.config;
-
-import static org.jclouds.rest.config.BinderUtils.bindHttpApi;
-
-import java.net.URI;
-
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.jclouds.oauth.v2.OAuthApi;
-
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
-import com.google.inject.AbstractModule;
-import com.google.inject.Provides;
-
-/**
- * An OAuth module to be used form other providers.
- */
-public class OAuthAuthenticationModule extends AbstractModule {
-
- @Override
- protected void configure() {
- bindHttpApi(binder(), OAuthApi.class);
- }
-
- /**
- * When oauth is used as a module the oauth endpoint is a normal property
- */
- @Provides
- @Singleton
- @Authentication
- protected Supplier<URI> provideAuthenticationEndpoint(@Named("oauth.endpoint") String endpoint) {
- return Suppliers.ofInstance(URI.create(endpoint));
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthHttpApiModule.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthHttpApiModule.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthHttpApiModule.java
deleted file mode 100644
index 6b4fdf9..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthHttpApiModule.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2.config;
-
-import java.net.URI;
-
-import javax.inject.Singleton;
-
-import org.jclouds.oauth.v2.OAuthApi;
-import org.jclouds.providers.ProviderMetadata;
-import org.jclouds.rest.ConfiguresHttpApi;
-import org.jclouds.rest.config.HttpApiModule;
-
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
-import com.google.inject.Provides;
-
-/**
- * OAuth module to when accessing OAuth stand-alone.
- */
-@ConfiguresHttpApi
-public class OAuthHttpApiModule extends HttpApiModule<OAuthApi> {
-
- @Provides
- @Singleton
- @Authentication
- protected Supplier<URI> provideAuthenticationEndpoint(ProviderMetadata providerMetadata) {
- return Suppliers.ofInstance(URI.create(providerMetadata.getEndpoint()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthModule.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthModule.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthModule.java
deleted file mode 100644
index 11fca2f..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthModule.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2.config;
-
-import com.google.common.base.Function;
-import com.google.common.base.Supplier;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.ImmutableMap;
-import com.google.inject.AbstractModule;
-import com.google.inject.Provides;
-import com.google.inject.TypeLiteral;
-import org.jclouds.oauth.v2.domain.ClaimSet;
-import org.jclouds.oauth.v2.domain.Header;
-import org.jclouds.oauth.v2.domain.OAuthCredentials;
-import org.jclouds.oauth.v2.domain.Token;
-import org.jclouds.oauth.v2.domain.TokenRequest;
-import org.jclouds.oauth.v2.functions.BuildTokenRequest;
-import org.jclouds.oauth.v2.functions.FetchToken;
-import org.jclouds.oauth.v2.functions.OAuthCredentialsSupplier;
-import org.jclouds.oauth.v2.functions.SignOrProduceMacForToken;
-import org.jclouds.oauth.v2.json.ClaimSetTypeAdapter;
-import org.jclouds.oauth.v2.json.HeaderTypeAdapter;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-
-import javax.inject.Named;
-import javax.inject.Singleton;
-import java.lang.reflect.Type;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL;
-
-/**
- * Base OAuth module
- */
-public class OAuthModule extends AbstractModule {
-
-
- @Override
- protected void configure() {
- bind(new TypeLiteral<Function<byte[], byte[]>>() {}).to(SignOrProduceMacForToken.class);
- bind(new TypeLiteral<Map<Type, Object>>() {}).toInstance(ImmutableMap.<Type, Object>of(
- Header.class, new HeaderTypeAdapter(),
- ClaimSet.class, new ClaimSetTypeAdapter()));
- bind(new TypeLiteral<Supplier<OAuthCredentials>>() {}).to(OAuthCredentialsSupplier.class);
- bind(new TypeLiteral<Function<GeneratedHttpRequest, TokenRequest>>() {}).to(BuildTokenRequest.class);
- bind(new TypeLiteral<Function<TokenRequest, Token>>() {}).to(FetchToken.class);
- }
-
- /**
- * Provides a cache for tokens. Cache is time based and by default expires after 59 minutes
- * (the maximum time a token is valid is 60 minutes).
- * This cache and expiry period is system-wide and does not attend to per-instance expiry time
- * (e.g. "expires_in" from Google Compute -- which is set to the standard 3600 seconds).
- */
- // NB: If per-instance expiry time is required, significant refactoring will be needed.
- @Provides
- @Singleton
- public LoadingCache<TokenRequest, Token> provideAccessCache(Function<TokenRequest, Token> getAccess,
- @Named(PROPERTY_SESSION_INTERVAL) long
- sessionIntervalInSeconds) {
- // since the session interval is also the token expiration time requested to the server make the token expire a
- // bit before the deadline to make sure there aren't session expiration exceptions
- sessionIntervalInSeconds = sessionIntervalInSeconds > 30 ? sessionIntervalInSeconds - 30 :
- sessionIntervalInSeconds;
- return CacheBuilder.newBuilder().expireAfterWrite(sessionIntervalInSeconds, TimeUnit.SECONDS).build(CacheLoader
- .from(getAccess));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthProperties.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthProperties.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthProperties.java
deleted file mode 100644
index 7b1bf17..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthProperties.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2.config;
-
-/**
- * Configurable properties for jclouds OAuth
- */
-public class OAuthProperties {
-
- /**
- * The selected signature algorithm to use to sign the requests.
- * <p/>
- * This refers to the name the oauth provider expects, i.e., "RSA
- */
- public static final String SIGNATURE_OR_MAC_ALGORITHM = "jclouds.oauth.signature-or-mac-algorithm";
-
- /**
- * The oauth audience, who this token is intended for. For instance in JWT and for
- * google API's this property maps to: {"aud","https://accounts.google.com/o/oauth2/token"}
- *
- * @see <a href="http://tools.ietf.org/html/draft-jones-json-web-token-04">doc</a>
- */
- public static final String AUDIENCE = "jclouds.oauth.audience";
-
- /**
- * Optional list of comma-separated scopes to use when no OAuthScopes annotation is present.
- */
- public static final String SCOPES = "jclouds.oauth.scopes";
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthScopes.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthScopes.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthScopes.java
deleted file mode 100644
index 57ffd29..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/config/OAuthScopes.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2.config;
-
-import javax.inject.Qualifier;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Used to annotate REST methods/ifaces that use OAuthAuthentication.
- * <p/>
- * Sets the scopes for the token request for that particular method.
- */
-@Retention(value = RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.TYPE, ElementType.METHOD})
-@Qualifier
-public @interface OAuthScopes {
-
- /**
- * @return the OAuth scopes required to access the resource.
- */
- String[] value();
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/ClaimSet.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/ClaimSet.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/ClaimSet.java
deleted file mode 100644
index 5c0b348..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/ClaimSet.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2.domain;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Splitter;
-import com.google.common.collect.ForwardingMap;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-import java.util.Map;
-import java.util.Set;
-
-import static com.google.common.base.Objects.ToStringHelper;
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-
-/**
- * The claimset for the token.
- *
- * @see <a
- * href="https://developers.google.com/accounts/docs/OAuth2ServiceAccount"
- * >doc</a>
- */
-public class ClaimSet extends ForwardingMap<String, String> {
-
- public static Builder builder() {
- return new Builder();
- }
-
- public Builder toBuilder() {
- return builder().fromClaimSet(this);
- }
-
- public static class Builder {
-
- private Set<String> requiredClaims;
- private ImmutableMap.Builder<String, String> claims = new ImmutableMap.Builder<String, String>();
- private long emissionTime;
- private long expirationTime;
-
- public Builder() {
- this(ImmutableSet.<String>of());
- }
-
- /**
- * Constructor that allows to predefine a mandatory set of claims as a comma-separated string, e.g, "iss,iat".
- */
- public Builder(String commaSeparatedRequiredClaims) {
- this(ImmutableSet.copyOf(Splitter.on(",").split(checkNotNull(commaSeparatedRequiredClaims))));
- }
-
- /**
- * Constructor that allows to predefine a mandatory set of claims as a set of strings.
- */
- public Builder(Set<String> requiredClaims) {
- this.requiredClaims = ImmutableSet.copyOf(checkNotNull(requiredClaims));
- }
-
- /**
- * Adds a Claim, i.e. key/value pair, e.g., "scope":"all_permissions".
- */
- public Builder addClaim(String name, String value) {
- claims.put(checkNotNull(name), checkNotNull(value, "value of %s", name));
- return this;
- }
-
- /**
- * @see ClaimSet#getEmissionTime()
- */
- public Builder emissionTime(long emmissionTime) {
- this.emissionTime = emmissionTime;
- return this;
- }
-
- /**
- * @see ClaimSet#getExpirationTime()
- */
- public Builder expirationTime(long expirationTime) {
- this.expirationTime = expirationTime;
- return this;
- }
-
- /**
- * Adds a map containing multiple claims
- */
- public Builder addAllClaims(Map<String, String> claims) {
- this.claims.putAll(checkNotNull(claims));
- return this;
- }
-
- public ClaimSet build() {
- Map<String, String> claimsMap = claims.build();
- checkState(Sets.intersection(claimsMap.keySet(), requiredClaims).size() == requiredClaims.size(),
- "not all required claims were present");
- if (expirationTime == 0) {
- expirationTime = emissionTime + 3600;
- }
- return new ClaimSet(claimsMap, emissionTime, expirationTime);
- }
-
- public Builder fromClaimSet(ClaimSet claimSet) {
- return new Builder().addAllClaims(claimSet.claims).expirationTime(expirationTime).emissionTime(emissionTime);
- }
- }
-
- private final Map<String, String> claims;
- private final long emissionTime;
- private final long expirationTime;
-
- private ClaimSet(Map<String, String> claims, long emissionTime, long expirationTime) {
- this.claims = claims;
- this.emissionTime = emissionTime;
- this.expirationTime = expirationTime;
- }
-
- /**
- * The emission time, in seconds since the epoch.
- */
- public long getEmissionTime() {
- return emissionTime;
- }
-
- /**
- * The expiration time, in seconds since the emission time.
- */
- public long getExpirationTime() {
- return expirationTime;
- }
-
- /**
- * @returns the claims.
- */
- @Override
- protected Map<String, String> delegate() {
- return claims;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode() {
- return Objects.hashCode(claims);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- ClaimSet other = (ClaimSet) obj;
- return equal(claims, other.claims);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected ToStringHelper string() {
- return toStringHelper(this).omitNullValues().add("claims", claims)
- .add("emissionTime", emissionTime).add("expirationTIme", expirationTime);
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/Header.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/Header.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/Header.java
deleted file mode 100644
index c230e1d..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/Header.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2.domain;
-
-import com.google.common.base.Objects;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * The header for the OAuth token, contains the signer algorithm's name and the type of the token
- *
- * @see <a href="https://developers.google.com/accounts/docs/OAuth2ServiceAccount">doc</a>
- */
-public class Header {
-
- public static Builder builder() {
- return new Builder();
- }
-
- public Builder toBuilder() {
- return builder().fromHeader(this);
- }
-
- public static class Builder {
-
- private String signerAlgorithm;
- private String type;
-
- /**
- * @see Header#getSignerAlgorithm()
- */
- public Builder signerAlgorithm(String signerAlgorithm) {
- this.signerAlgorithm = checkNotNull(signerAlgorithm);
- return this;
- }
-
- /**
- * @see Header#getType()
- */
- public Builder type(String type) {
- this.type = checkNotNull(type);
- return this;
- }
-
- public Header build() {
- return new Header(signerAlgorithm, type);
- }
-
- public Builder fromHeader(Header header) {
- return new Builder().signerAlgorithm(header.signerAlgorithm).type(header.type);
- }
- }
-
- private final String signerAlgorithm;
- private final String type;
-
- protected Header(String signerAlgorithm, String type) {
- this.signerAlgorithm = checkNotNull(signerAlgorithm);
- this.type = checkNotNull(type);
- }
-
- /**
- * The name of the algorithm used to compute the signature, e.g., "RS256"
- */
- public String getSignerAlgorithm() {
- return signerAlgorithm;
- }
-
- /**
- * The type of the token, e.g., "JWT"
- */
- public String getType() {
- return type;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Header other = (Header) obj;
- return equal(this.signerAlgorithm, other.signerAlgorithm) && equal(this.type,
- other.type);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode() {
- return Objects.hashCode(signerAlgorithm, type);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected Objects.ToStringHelper string() {
- return toStringHelper(this).omitNullValues().add("signerAlgorithm", signerAlgorithm)
- .add("type", type);
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/OAuthCredentials.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/OAuthCredentials.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/OAuthCredentials.java
deleted file mode 100644
index 78cb402..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/OAuthCredentials.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2.domain;
-
-import com.google.common.base.Objects;
-import org.jclouds.domain.Credentials;
-
-import java.security.PrivateKey;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * Special kind credentials for oauth authentication that includes {@link java.security.PrivateKey} to sign
- * requests.
- */
-public class OAuthCredentials extends Credentials {
-
- public static Builder builder() {
- return new Builder();
- }
-
- public Builder toBuilder() {
- return builder().fromOauthCredentials(this);
- }
-
- public static class Builder extends Credentials.Builder<OAuthCredentials> {
-
- protected PrivateKey privateKey;
-
- /**
- * @see OAuthCredentials#privateKey
- */
- public Builder privateKey(PrivateKey privateKey) {
- this.privateKey = checkNotNull(privateKey);
- return this;
- }
-
- /**
- * @see Credentials#identity
- */
- public Builder identity(String identity) {
- this.identity = checkNotNull(identity);
- return this;
- }
-
- /**
- * @see Credentials#credential
- */
- public Builder credential(String credential) {
- this.credential = credential;
- return this;
- }
-
- public OAuthCredentials build() {
- return new OAuthCredentials(checkNotNull(identity), credential, privateKey);
- }
-
- public Builder fromOauthCredentials(OAuthCredentials credentials) {
- return new Builder().privateKey(credentials.privateKey).identity(credentials.identity)
- .credential(credentials.credential);
- }
- }
-
- /**
- * The private key associated with Credentials#identity.
- * Used to sign token requests.
- */
- public final PrivateKey privateKey;
-
- public OAuthCredentials(String identity, String credential, PrivateKey privateKey) {
- super(identity, credential);
- this.privateKey = privateKey;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- OAuthCredentials other = (OAuthCredentials) obj;
- return equal(this.identity, other.identity) && equal(this.credential,
- other.credential) && equal(this.privateKey,
- other.privateKey);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode() {
- return Objects.hashCode(identity, credential, privateKey);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected Objects.ToStringHelper string() {
- return toStringHelper(this).omitNullValues().add("identity", identity)
- .add("credential", credential != null ? credential.hashCode() : null).add("privateKey",
- privateKey.hashCode());
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/Token.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/Token.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/Token.java
deleted file mode 100644
index a18a7eb..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/Token.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2.domain;
-
-import com.google.common.base.Objects;
-
-import java.beans.ConstructorProperties;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * The oauth token, obtained upon a successful token request and ready to embed in requests.
- */
-public class Token {
-
- public static Builder builder() {
- return new Builder();
- }
-
- public Builder toBuilder() {
- return builder().fromToken(this);
- }
-
- public static class Builder {
-
- private String accessToken;
- private String tokenType;
- private long expiresIn;
-
- /**
- * @see Token#getAccessToken()
- */
- public Builder accessToken(String accessToken) {
- this.accessToken = checkNotNull(accessToken);
- return this;
- }
-
- /**
- * @see Token#getTokenType()
- */
- public Builder tokenType(String tokenType) {
- this.tokenType = checkNotNull(tokenType);
- return this;
- }
-
- /**
- * @see Token#getExpiresIn()
- */
- public Builder expiresIn(long expiresIn) {
- this.expiresIn = expiresIn;
- return this;
- }
-
- public Token build() {
- return new Token(accessToken, tokenType, expiresIn);
- }
-
- public Builder fromToken(Token token) {
- return new Builder().accessToken(token.accessToken).tokenType(token.tokenType).expiresIn(token.expiresIn);
- }
- }
-
- private final String accessToken;
- private final String tokenType;
- private final long expiresIn;
-
- @ConstructorProperties({"access_token", "token_type", "expires_in"})
- protected Token(String accessToken, String tokenType, long expiresIn) {
- this.accessToken = accessToken;
- this.tokenType = tokenType;
- this.expiresIn = expiresIn;
- }
-
- /**
- * The access token obtained from the OAuth server.
- */
- public String getAccessToken() {
- return accessToken;
- }
-
- /**
- * The type of the token, e.g., "Bearer"
- */
- public String getTokenType() {
- return tokenType;
- }
-
- /**
- * In how many seconds this token expires.
- */
- public long getExpiresIn() {
- return expiresIn;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Token other = (Token) obj;
- return equal(this.accessToken, other.accessToken) && equal(this.tokenType,
- other.tokenType) && equal(this.expiresIn,
- other.expiresIn);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode() {
- return Objects.hashCode(accessToken, tokenType, expiresIn);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected Objects.ToStringHelper string() {
- return toStringHelper(this).omitNullValues().add("accessToken", accessToken)
- .add("tokenType", tokenType).add("expiresIn", expiresIn);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/TokenRequest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/TokenRequest.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/TokenRequest.java
deleted file mode 100644
index 7d1a6a4..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/TokenRequest.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2.domain;
-
-import com.google.common.base.Objects;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * A complete token request.
- */
-public class TokenRequest {
-
- public static Builder builder() {
- return new Builder();
- }
-
- public Builder toBuilder() {
- return builder().fromTokenRequest(this);
- }
-
- public static class Builder {
- private Header header;
- private ClaimSet claimSet;
-
- /**
- * @see TokenRequest#getClaimSet()
- */
- public Builder header(Header header) {
- this.header = header;
- return this;
- }
-
- /**
- * @see TokenRequest#getHeader()
- */
- public Builder claimSet(ClaimSet claimSet) {
- this.claimSet = claimSet;
- return this;
- }
-
- public TokenRequest build() {
- return new TokenRequest(header, claimSet);
- }
-
- public Builder fromTokenRequest(TokenRequest tokeRequest) {
- return new Builder().header(tokeRequest.header).claimSet(tokeRequest.claimSet);
- }
- }
-
- private final Header header;
- private final ClaimSet claimSet;
-
- public TokenRequest(Header header, ClaimSet claimSet) {
- this.header = checkNotNull(header);
- this.claimSet = checkNotNull(claimSet);
- }
-
- /**
- * The header of this token request.
- *
- * @see Header
- */
- public Header getHeader() {
- return header;
- }
-
- /**
- * The claim set of this token request.
- *
- * @see ClaimSet
- */
- public ClaimSet getClaimSet() {
- return claimSet;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- TokenRequest other = (TokenRequest) obj;
- return equal(this.header, other.header) && equal(this.claimSet,
- other.claimSet);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode() {
- return Objects.hashCode(header, claimSet);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected Objects.ToStringHelper string() {
- return toStringHelper(this).omitNullValues().add("header", header)
- .add("claimSet", claimSet);
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/TokenRequestFormat.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/TokenRequestFormat.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/TokenRequestFormat.java
deleted file mode 100644
index f4b80c1..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/domain/TokenRequestFormat.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2.domain;
-
-import com.google.inject.ImplementedBy;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.oauth.v2.json.JWTTokenRequestFormat;
-
-import java.util.Set;
-
-/**
- * Transforms a TokenRequest into a specific format (e.g. JWT token)
- */
-@ImplementedBy(JWTTokenRequestFormat.class)
-public interface TokenRequestFormat {
-
- /**
- * Transforms the provided HttpRequest into a particular token request with a specific format.
- */
- <R extends HttpRequest> R formatRequest(R httpRequest, TokenRequest tokenRequest);
-
- /**
- * The name of the type of the token request, e.g., "JWT"
- */
- String getTypeName();
-
- /**
- * The claims that must be present in the token request for it to be valid.
- */
- Set<String> requiredClaims();
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/filters/OAuthAuthenticator.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/filters/OAuthAuthenticator.java b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/filters/OAuthAuthenticator.java
deleted file mode 100644
index e25bc20..0000000
--- a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/main/java/org/jclouds/oauth/v2/filters/OAuthAuthenticator.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.oauth.v2.filters;
-
-import com.google.common.base.Function;
-import com.google.common.cache.LoadingCache;
-import org.jclouds.http.HttpException;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpRequestFilter;
-import org.jclouds.oauth.v2.domain.Token;
-import org.jclouds.oauth.v2.domain.TokenRequest;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import static com.google.common.base.Preconditions.checkState;
-
-/**
- * To be used by client applications to embed an OAuth authentication in their REST requests.
- * <p/>
- * TODO when we're able to use the OAuthAuthentication an this should be used automatically
- */
-@Singleton
-public class OAuthAuthenticator implements HttpRequestFilter {
-
- private Function<GeneratedHttpRequest, TokenRequest> tokenRequestBuilder;
- private Function<TokenRequest, Token> tokenFetcher;
-
- @Inject
- OAuthAuthenticator(Function<GeneratedHttpRequest, TokenRequest> tokenRequestBuilder, LoadingCache<TokenRequest,
- Token> tokenFetcher) {
- this.tokenRequestBuilder = tokenRequestBuilder;
- this.tokenFetcher = tokenFetcher;
- }
-
- @Override
- public HttpRequest filter(HttpRequest request) throws HttpException {
- checkState(request instanceof GeneratedHttpRequest, "request must be an instance of GeneratedHttpRequest");
- GeneratedHttpRequest generatedHttpRequest = GeneratedHttpRequest.class.cast(request);
- TokenRequest tokenRequest = tokenRequestBuilder.apply(generatedHttpRequest);
- Token token = tokenFetcher.apply(tokenRequest);
- return request.toBuilder().addHeader("Authorization", String.format("%s %s",
- token.getTokenType(), token.getAccessToken())).build();
-
- }
-
-
-}