Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2015-01-12 Thread Ignasi Barrera
Pushed to master as [6e1a037](https://git-wip-us.apache.org/repos/asf?p=jclouds-labs.git;a=commit;h=6e1a0376f837e2dfe765758333e09761ff39b9b4). Thanks @devcsrj! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-69549285

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2015-01-12 Thread Ignasi Barrera
Closed #72. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#event-217286348

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2015-01-11 Thread Pongstr
:+1: Great job @devcsrj --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-69529415

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2015-01-09 Thread Ignasi Barrera
+ } + + @Test + public void testGetNonExistingDataCenter() throws Exception { + MockWebServer server = mockWebServer(); + server.enqueue(new MockResponse().setResponseCode(500).setBody(payloadFromResource(/fault-404.xml))); + + ProfitBricksApi pbApi =

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2015-01-09 Thread Ignasi Barrera
Thanks! There is just one minor comment. If you squash the commits I'll merge the PR. Great job! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-69406661

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2015-01-05 Thread Ignasi Barrera
+ pbApi.close(); + server.shutdown(); + } + } + + @Test + public void testGetNonExistingContainer() throws Exception { + MockWebServer server = mockWebServer(); + server.enqueue(new

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2015-01-05 Thread Ignasi Barrera
+ @XMLResponseParser(DataCenterInfoResponseHandler.class) + DataCenter clearDataCenter(@PayloadParam(id) String identifier); + + /** +* Deletes an Virtual Data Center. If a previous request on the target data center is still in progress, the data +* center is going to be

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2015-01-05 Thread Ignasi Barrera
+ server.enqueue(new MockResponse().setBody(payloadInProcess)); + server.enqueue(new MockResponse().setBody(payloadAvailable)); + + server.enqueue(new MockResponse().setBody(payloadAvailable)); + + ProfitBricksApi pbApi = api(server.getUrl(rootUrl)); + +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2015-01-05 Thread Ignasi Barrera
+ MockWebServer server = mockWebServer(); + server.enqueue(new MockResponse().setBody(payloadFromResource(/datacenter/datacenters.xml))); + + ProfitBricksApi pbApi = api(server.getUrl(rootUrl)); + DataCenterApi api = pbApi.dataCenterApi(); + + try { +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2015-01-05 Thread Ignasi Barrera
+ assertEquals(dataCenter.version(), 1); + } finally { + pbApi.close(); + server.shutdown(); + } + } + + @Test + public void testCreateDataCenterWithIllegalArguments() throws Exception { + String[] names = {JCl@ouds, JC|ouds, ^clouds, }; +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2015-01-05 Thread Reijhanniel Jearl Campos
+ assertEquals(dataCenter.version(), 1); + } finally { + pbApi.close(); + server.shutdown(); + } + } + + @Test + public void testCreateDataCenterWithIllegalArguments() throws Exception { + String[] names = {JCl@ouds, JC|ouds, ^clouds, }; +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-23 Thread Ignasi Barrera
+ +import javax.ws.rs.core.MediaType; + +import org.jclouds.http.HttpRequest; +import org.jclouds.rest.MapBinder; + +import com.google.common.base.Strings; + +import org.jclouds.io.MutableContentMetadata; +import org.jclouds.io.payloads.BaseMutableContentMetadata; + +public abstract

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-23 Thread Ignasi Barrera
+ * 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.profitbricks.binder.datacenter; + +import static java.lang.String.format; +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-23 Thread Ignasi Barrera
+ * 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.profitbricks.binder.datacenter; + +import static java.lang.String.format; +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-23 Thread Ignasi Barrera
+ this.state = state; + return this; + } + + public Builder location(Location location) { + this.location = location; + return this; + } + + public Builder version(int version) { + this.version = version; + return this; + } + +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-23 Thread Ignasi Barrera
+ * 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

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-23 Thread Ignasi Barrera
+ // ignore + } finally { + if (in != null) { +in.reset(); +Payload payload = Payloads.newInputStreamPayload(in); +contentMetadataCodec.fromHeaders(payload.getContentMetadata(), originalResponse.getHeaders()); +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-23 Thread Ignasi Barrera
+ this.faultHandler = faultHandler; + } + + @Override + protected HttpResponse invoke(HttpURLConnection connection) throws IOException, InterruptedException { + HttpResponse originalResponse = super.invoke(connection); + HttpResponse.Builder? responseBuilder =

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-23 Thread Ignasi Barrera
+ assertNotNull(dataCenter); + } + + @Test(expectedExceptions = ResourceNotFoundException.class) + public void testGetNonExistingDataCenter() { + api.dataCenterApi().getDataCenter(random-non-existing-id); + } + + @Test + public void

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-23 Thread Ignasi Barrera
Nice job @devcsrj! There are only minor comments. Thanks! Once the missing tests are added this will be good to go! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-68004052

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-23 Thread Reijhanniel Jearl Campos
+ * 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

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-23 Thread Reijhanniel Jearl Campos
+ this.state = state; + return this; + } + + public Builder location(Location location) { + this.location = location; + return this; + } + + public Builder version(int version) { + this.version = version; + return this; + } + +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-22 Thread Reijhanniel Jearl Campos
Hi @nacx , the above commits addresses your initial comments. Assuming they're okay, what's left are the MockTests and test for custom predicate. Thanks for the continuous feedback! --- Reply to this email directly or view it on GitHub:

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-21 Thread Ignasi Barrera
+ .defaultProperties(ProfitBricksApiMetadata.defaultProperties()) + .defaultModules(ImmutableSet.Class? extends Moduleof(ProfitBricksHttpApiModule.class)); + } + + @Override + public ProfitBricksApiMetadata build() { + return new

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; +modelVersion4.0.0/modelVersion +parent +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ * 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.profitbricks;

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ .defaultProperties(ProfitBricksApiMetadata.defaultProperties()) + .defaultModules(ImmutableSet.Class? extends Moduleof(ProfitBricksHttpApiModule.class)); + } + + @Override + public ProfitBricksApiMetadata build() { + return new

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ .defaultProperties(ProfitBricksApiMetadata.defaultProperties()) + .defaultModules(ImmutableSet.Class? extends Moduleof(ProfitBricksHttpApiModule.class)); + } + + @Override + public ProfitBricksApiMetadata build() { + return new

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ +import static com.google.common.base.Preconditions.checkNotNull; +import static java.lang.String.format; + +import java.util.Map; + +import javax.ws.rs.core.MediaType; + +import org.jclouds.http.HttpRequest; +import org.jclouds.rest.MapBinder; + +import

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ +public abstract class BaseProfitBricksRequestBinderT implements MapBinder { + + protected final StringBuilder requestBuilder; + protected String paramName; + + public BaseProfitBricksRequestBinder() { + this.requestBuilder = new StringBuilder(255); + } + + @Override +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+import com.google.common.base.Strings; + +public abstract class BaseProfitBricksRequestBinderT implements MapBinder { + + protected final StringBuilder requestBuilder; + protected String paramName; + + public BaseProfitBricksRequestBinder() { + this.requestBuilder = new

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+import static com.google.common.base.Preconditions.checkNotNull; +import static java.lang.String.format; + +import java.util.Map; + +import javax.ws.rs.core.MediaType; + +import org.jclouds.http.HttpRequest; +import org.jclouds.rest.MapBinder; + +import com.google.common.base.Strings;

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ T payload = (T) obj; + + return createRequest(request, createPayload(payload)); + } + + @Override + public R extends HttpRequest R bindToRequest(R request, Object input) { + throw new UnsupportedOperationException(Not supported yet.); + } + + protected

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ + checkNotNull(paramName, Initialize 'paramName' in constructor); + Object obj = checkNotNull(postParams.get(paramName), format(Param '%s' cannot be null., paramName)); + T payload = (T) obj; + + return createRequest(request, createPayload(payload)); + } + +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ @Override + public R extends HttpRequest R bindToRequest(R request, Object input) { + throw new UnsupportedOperationException(Not supported yet.); + } + + protected abstract String createPayload(T payload); + + protected String ifNotEmpty(String pattern, Object param) { +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ + protected String ifNotEmpty(String pattern, Object param) { + try { + return Strings.isNullOrEmpty((String) param) ? : String.format(pattern, param); + } catch (ClassCastException ex) { + return Strings.isNullOrEmpty(param.toString()) ? :

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+import org.jclouds.rest.annotations.Fallback; +import org.jclouds.rest.annotations.MapBinder; +import org.jclouds.rest.annotations.Payload; +import org.jclouds.rest.annotations.PayloadParam; +import org.jclouds.rest.annotations.RequestFilters; +import

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+* @return Returns a list of all Virtual Data Centers created by the user, including ID, name and version number. +*/ + @POST + @Payload(ws:getAllDataCenters/) + @XMLResponseParser(DataCenterListResponseHandler.class) + @Fallback(Fallbacks.EmptyListOnNotFoundOr404.class) +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ /** +* @param identifier Virtual Data Center identifier +* @return Returns information about an existing virtual data center's state and configuration. +*/ + @POST + @Payload(ws:getDataCenterdataCenterId{id}/dataCenterId/ws:getDataCenter) +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+*/ + @POST + @Payload(ws:clearDataCenterdataCenterId{id}/dataCenterId/ws:clearDataCenter) + @XMLResponseParser(DataCenterInfoResponseHandler.class) + DataCenter clearDataCenter(@PayloadParam(id) String identifier) throws HttpResponseException; + + /** +* Deletes an

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+import org.jclouds.rest.ResourceNotFoundException; + +/** + * Parse ProfitBricks API errors and set the appropriate exception. + */ +@Singleton +public class ProfitBricksHttpErrorHandler implements HttpErrorHandler { + + @Override + public void handleError(final HttpCommand command,

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
++ soapenv:Header/ ++ soapenv:Body; + + private final String SOAP_SUFFIX = /soapenv:Body/soapenv:Envelope; + + @Override + public HttpRequest filter(HttpRequest request) throws HttpException { + checkNotNull(request.getPayload(), HTTP Request must contain payload

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ * 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

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ * limitations under the License. + */ +package org.jclouds.profitbricks.http.parser.datacenter; + +import javax.inject.Inject; + +import org.jclouds.date.DateCodecFactory; +import org.jclouds.profitbricks.domain.DataCenter; +import

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+package org.jclouds.profitbricks.http.parser.datacenter; + +import org.jclouds.date.DateCodecFactory; +import org.jclouds.profitbricks.domain.DataCenter; +import org.jclouds.profitbricks.domain.Location; +import org.jclouds.profitbricks.domain.ProvisioningState; +import

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ +import org.jclouds.date.DateCodecFactory; +import org.jclouds.profitbricks.domain.DataCenter; +import org.jclouds.profitbricks.domain.Location; +import org.jclouds.profitbricks.domain.ProvisioningState; +import org.xml.sax.SAXException; + +import com.google.common.collect.Lists;

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ */ +package org.jclouds.profitbricks.http.parser.state; + +import org.jclouds.date.DateCodecFactory; +import org.jclouds.profitbricks.domain.ProvisioningState; +import org.jclouds.profitbricks.http.parser.BaseProfitBricksResponseHandler; +import org.xml.sax.SAXException; + +import

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ + DataCenter fetchedDc = api.getDataCenterApi().getDataCenter(dcId); + + assertNotNull(fetchedDc); + assertEquals(newName, fetchedDc.name()); + } + + @Test(dependsOnMethods = testUpdateDataCenter) + public void testClearDataCenter() { + DataCenter dataCenter =

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
@devcsrj I've added the comments. The code looks very good, and you've followed the advice of other PRs. Many thanks for that! :) This way we can set a good base line so upcoming PRs are easier to review and to get merged. Apart from the inline comments, there are a couple things missing that

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Reijhanniel Jearl Campos
+ * 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

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-17 Thread Ignasi Barrera
Thanks @devcsrj! I'll have a look at the PR this week so you can move forward. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-67297972

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-16 Thread Reijhanniel Jearl Campos
Here is the output from: codemvn clean install -pl profitbricks -Plive/code https://gist.github.com/devcsrj/3e8e4d8c5dd1add32ede#file-pb-dc-api-live-test-L151 --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-67273666

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-15 Thread Reijhanniel Jearl Campos
Hi: To progress this PR, I decided to strip down the implementation and move forward with smaller iterations. The above implements the ProfitBricks DataCenter API. I hope that the code review would be less painful from now on. :) - RJ --- Reply to this email directly or view it on GitHub:

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-31 Thread Adrian Cole
+/** + * Designates connection between {@link org.jclouds.compute.ComputeService} API and + * {@link org.jclouds.profitbricks.ProfitBricksApi} API. + */ +@Singleton +public class PBComputeServiceAdapter implements ComputeServiceAdapterServer, Hardware, Image, DataCenter { + +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-31 Thread Adrian Cole
+/** + * Designates connection between {@link org.jclouds.compute.ComputeService} API and + * {@link org.jclouds.profitbricks.ProfitBricksApi} API. + */ +@Singleton +public class PBComputeServiceAdapter implements ComputeServiceAdapterServer, Hardware, Image, DataCenter { + +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+See the License for the specific language governing permissions and +limitations under the License. + +-- +project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation=http://maven.apache.org/POM/4.0.0

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; + modelVersion4.0.0/modelVersion + parent +groupIdorg.apache.jclouds.labs/groupId

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+import com.google.common.base.Strings; + +public abstract class BaseProfitBricksRequestBinder implements MapBinder { + + protected final StringBuilder requestBuilder; + + public BaseProfitBricksRequestBinder() { + this.requestBuilder = new StringBuilder(255); + } + +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+import java.nio.charset.Charset; + +import javax.inject.Inject; +import javax.inject.Singleton; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Unmarshaller; +import javax.xml.soap.MessageFactory; +import javax.xml.soap.SOAPException; +import javax.xml.soap.SOAPMessage; +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+import javax.xml.bind.JAXBContext; +import javax.xml.bind.Unmarshaller; +import javax.xml.soap.MessageFactory; +import javax.xml.soap.SOAPException; +import javax.xml.soap.SOAPMessage; + +import org.jclouds.xml.internal.JAXBParser; + +/** + * Custom parser for SOAP. + */ +@Singleton

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+ * 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

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+ * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.profitbricks.binders.loadbalancer; + +import static com.google.common.base.Preconditions.checkNotNull; +import static java.lang.String.format; +import static

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+/** + * Designates connection between {@link org.jclouds.compute.ComputeService} API and + * {@link org.jclouds.profitbricks.ProfitBricksApi} API. + */ +@Singleton +public class PBComputeServiceAdapter implements ComputeServiceAdapterServer, Hardware, Image, DataCenter { + +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+ final MapString, String meta = template.getOptions().getUserMetadata(); + final StorageApi storageApi = pbApi.getStorageApi(); + + vdcWaitingPredicate.apply(locationId); + // Create actual server + CreateServerRequest serverToCreate =

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+ + @Resource + @Named(ComputeServiceConstants.COMPUTE_LOGGER) + protected Logger logger = Logger.NULL; + + protected ProfitBricksApi pbApi; + protected FunctionTemplate, CreateServerRequest templateToServer; + + private final PredicateString vdcWaitingPredicate; + private

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+ checkDataCenterState(locationId); + logger.trace( connecting storage '%s' to server '%s', storageId, createdServerId); + storageApi.connectStorageToServer( + Storage.connectingBuilder() + .serverId(createdServerId) +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+ createdServerId, + defaultCredentials + ); + } + + private void checkDataCenterState(String locationId) { + checkState(pbApi.getDataCenterApi().getDataCenterState(locationId).getReturn() == ProvisioningState.AVAILABLE, + Data

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+ +import org.jclouds.collect.Memoized; +import org.jclouds.compute.domain.Hardware; +import org.jclouds.compute.domain.TemplateBuilder; +import org.jclouds.compute.domain.internal.TemplateBuilderImpl; +import org.jclouds.compute.options.TemplateOptions; +import

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+ * 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 + * + *

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+ */ +package org.jclouds.profitbricks.compute.domain.internal; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.jclouds.profitbricks.compute.domain.internal.ProvisioningStatusAware.DATACENTER; +import static

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+public class PBHttpApiModule extends HttpApiModuleProfitBricksApi { + + @Override + protected void bindErrorHandlers() { + bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(ProfitBricksHttpErrorHandler.class); +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
@devcsrj wow. you have written some nice code! good job. So I made some comments, and I have a general one, considering our direction as late is to remove as much domain (value) object burden as possible. I noticed that you are using string binders on the way out and jaxb on the way in. JAXB

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+ * 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.profitbricks;

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Reijhanniel Jearl Campos
+ * 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

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+ * 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

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
@devcsrj ps my goal in this review was to help ensure the provider can get out of labs, not to poke little holes. We are in the process of cleaning up docker, azure, and google providers, and I noticed your pull request hasn't yet been merged. great time to clean things up! When in doubt, look

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Reijhanniel Jearl Campos
+ * 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 + * + *

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
+ * 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 + * + *

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Adrian Cole
Gulp. Whoops! Ok well I will keep an eye on things to help you cross the finish line! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-61212734

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread Reijhanniel Jearl Campos
+/** + * Designates connection between {@link org.jclouds.compute.ComputeService} API and + * {@link org.jclouds.profitbricks.ProfitBricksApi} API. + */ +@Singleton +public class PBComputeServiceAdapter implements ComputeServiceAdapterServer, Hardware, Image, DataCenter { + +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread CloudBees pull request builder plugin
[jclouds-labs-pull-requests #372](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/372/) FAILURE Looks like there's a problem with this pull request --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-61219813

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread CloudBees pull request builder plugin
[jclouds-labs-pull-requests #373](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/373/) SUCCESS This pull request looks good --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-61219899

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread BuildHive
[jclouds » jclouds-labs #1844](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1844/) FAILURE Looks like there's a problem with this pull request [(what's this?)](https://www.cloudbees.com/what-is-buildhive) --- Reply to this email directly or view it on GitHub:

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-30 Thread BuildHive
[jclouds » jclouds-labs #1845](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1845/) SUCCESS This pull request looks good [(what's this?)](https://www.cloudbees.com/what-is-buildhive) --- Reply to this email directly or view it on GitHub:

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-24 Thread CloudBees pull request builder plugin
[jclouds-labs-pull-requests #345](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/345/) SUCCESS This pull request looks good --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-60358527

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-24 Thread BuildHive
[jclouds » jclouds-labs #1766](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1766/) SUCCESS This pull request looks good [(what's this?)](https://www.cloudbees.com/what-is-buildhive) --- Reply to this email directly or view it on GitHub:

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-12 Thread Andrew Phillips
Hi @devcsrj! Thanks for sticking with this for so long! I'd briefly like to step back from the code for a second and get a better understanding of the background to the PR: * are you adding this based on user demand, or to provide a Java client, or for some other reason? * do you know what

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-12 Thread Reijhanniel Jearl Campos
Hi @demobox : ul liQ1: The company I am in uses PB as IaaS provider, and seeing that jclouds doesn't support PB yet, I created this PR. I wanted to contribute to an open-source project (my first actually. :D) which I told @nacx via email. I was interested in the concept of icloud provider

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-08 Thread CloudBees pull request builder plugin
[jclouds-labs-pull-requests #303](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/303/) FAILURE Looks like there's a problem with this pull request --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-58461358

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-08 Thread BuildHive
[jclouds » jclouds-labs #1660](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1660/) FAILURE Looks like there's a problem with this pull request [(what's this?)](https://www.cloudbees.com/what-is-buildhive) --- Reply to this email directly or view it on GitHub:

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-08 Thread CloudBees pull request builder plugin
[jclouds-labs-pull-requests #304](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/304/) SUCCESS This pull request looks good --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-58462030

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-10-08 Thread BuildHive
[jclouds » jclouds-labs #1661](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1661/) SUCCESS This pull request looks good [(what's this?)](https://www.cloudbees.com/what-is-buildhive) --- Reply to this email directly or view it on GitHub:

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-09-25 Thread Andrew Phillips
@devcsrj Could you kindly rebase this PR so it's in a mergable state? I'll try to free up some cycles to help with the review. Thanks! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-56784756

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-09-25 Thread BuildHive
[jclouds » jclouds-labs #1557](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1557/) FAILURE Looks like there's a problem with this pull request [(what's this?)](https://www.cloudbees.com/what-is-buildhive) --- Reply to this email directly or view it on GitHub:

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-09-25 Thread CloudBees pull request builder plugin
[jclouds-labs-pull-requests #262](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/262/) FAILURE Looks like there's a problem with this pull request --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-56798993

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-09-25 Thread BuildHive
[jclouds » jclouds-labs #1558](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1558/) SUCCESS This pull request looks good [(what's this?)](https://www.cloudbees.com/what-is-buildhive) --- Reply to this email directly or view it on GitHub:

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-09-25 Thread CloudBees pull request builder plugin
[jclouds-labs-pull-requests #263](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/263/) SUCCESS This pull request looks good --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-56803947

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-09-25 Thread Reijhanniel Jearl Campos
Hi @demobox ! Thanks for the time. I think the PR now is in mergeable state. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72#issuecomment-56804050

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-09-25 Thread Jeremy Daggett
+See the License for the specific language governing permissions and +limitations under the License. + +-- +project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation=http://maven.apache.org/POM/4.0.0

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-09-25 Thread Jeremy Daggett
+import org.jclouds.profitbricks.features.LoadBalancerApi; +import org.jclouds.profitbricks.features.NicApi; +import org.jclouds.profitbricks.features.PublicIpApi; +import org.jclouds.profitbricks.features.RomDriveApi; +import org.jclouds.profitbricks.features.SnapshotApi; +import

  1   2   >