Skip to content

Commit

Permalink
Merge pull request #30 from indigo-dc/devel
Browse files Browse the repository at this point in the history
Update authorization header builders
  • Loading branch information
Alfonso Pérez authored Jun 16, 2016
2 parents a33e0fc + 0e3c917 commit 4889e03
Show file tree
Hide file tree
Showing 51 changed files with 1,084 additions and 1,104 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The javadoc for this project can be found here: [Javadoc](http://indigo-dc.githu
1.1 REQUISITES
--------------
This project has been created with maven.
To compile it you will need at least **Apache Maven 3.0.5** and **Java 1.7**.
To compile it you will need at least **Apache Maven 3.0.5** and **Java 1.8**.
Maven will take care of downloading all the extra dependencies needed for the project.

1.2 INSTALLING
Expand Down Expand Up @@ -57,3 +57,17 @@ InfrastructureUri newInfrastructureUri = im.createInfrastructure(readFile(TOSCA_
im.destroyInfrastructure(getInfrastructureId());
```
The 'im' client always returns a POJO with the information of the call. If an error occurs, an **ImClientErrorException** is thrown. This exception contains the error message and the error code returned by the server.

### 1.4.3 Create authorization headers
Since version 0.4.5 the infrastructure manager allows to use the **AuthorizationHeader** class and different builders to create the authorization headers.
The usage is as follows:
```
AuthorizationHeader ah = new AuthorizationHeader();
Credentials imCred = ImCredentials.buildCredentials().withUsername("user").withPassword("pass");
Credentials vmrcCred = VmrcCredentials.buildCredentials().withUsername("user").withPassword("pass").withHost("host");
Credentials dummyCred = DummyCredential.buildCredentials();
ah.addCredential(imCred);
ah.addCredential(vmrcCred);
ah.addCredential(dummyCred);
InfrastructureManager im = new InfrastructureManager("IM_ENDPOINT", ah);
```
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>es.upv.i3m.grycap</groupId>
<artifactId>im-java-api</artifactId>
<version>0.4.5</version>
<version>0.4.6</version>
<name>IM Java API</name>
<description>Java client for the REST API of the IM</description>

Expand All @@ -16,7 +16,7 @@
<apache-commons.version>3.4</apache-commons.version>
<junit.version>4.12</junit.version>
<log4j.version>1.2.17</log4j.version>
<java.version>7</java.version>
<java.version>8</java.version>
<maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
<maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
<mockserver-netty.version>3.10.4</mockserver-netty.version>
Expand Down
Loading

0 comments on commit 4889e03

Please sign in to comment.