Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
Signed-off-by: John Sullivan <john.sullivan@bullhorn.com>
  • Loading branch information
johnsully83 committed Feb 12, 2016
0 parents commit e2d1820
Show file tree
Hide file tree
Showing 549 changed files with 200,730 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .gitignore
@@ -0,0 +1,20 @@
*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/.settings
/target
/*.classpath
/*.project

#intelliJ files
*.iml
.idea/*
22 changes: 22 additions & 0 deletions LICENSE
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2015 Bullhorn

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

88 changes: 88 additions & 0 deletions README.md
@@ -0,0 +1,88 @@
# sdk-rest
A Java client library for working with the Bullhorn REST API. Handles authentication and objectifies API operations.

## Available as a Maven dependency

### Add dependency to your pom file

```xml

<dependency>
<groupId>com.bullhorn</groupId>
<artifactId>sdk-rest</artifactId>
<version>1.0</version>
</dependency>
```


## Basic setup:

Provide your credentials and instantiate StandardBullhornApiRest:
```java
RestApiSettings creds = new RestApiSettings();
creds.setPassword("apipassword");
creds.setRestAuthorizeUrl("rest.authorizeUrl");
creds.setRestClientId("rest.clientId");
creds.setRestClientSecret("rest.clientSecret"));
creds.setRestLoginUrl(env.getProperty("rest.loginUrl");
creds.setRestSessionMinutesToLive("rest.sessionMinutesToLive");
creds.setRestTokenUrl("rest.tokenUrl");
creds.setUsername("apiusername");
BullhornData bullhornData = new StandardBullhornData(creds);
```




## Use with Spring Boot

Add a configuration class:
```java
@Configuration
@PropertySource("classpath:application-${spring.profiles.active}.properties")
public class AppConfig {

@Autowired
private Environment env;

@Bean
public static PropertySourcesPlaceholderConfigurer propertyPlaceholderConfigurer() {
return new PropertySourcesPlaceholderConfigurer();
}

/**
* Provide your credentials and instantiate {@link StandardBullhornData} with those.
* @return
*/
@Profile({ "staging", "production" })
@Bean
public BullhornData bullhornData() {

RestApiSettings creds = new RestApiSettings();
creds.setPassword(env.getProperty("apipassword"));
creds.setRestAuthorizeUrl(env.getProperty("rest.authorizeUrl"));
creds.setRestClientId(env.getProperty("rest.clientId"));
creds.setRestClientSecret(env.getProperty("rest.clientSecret"));
creds.setRestLoginUrl(env.getProperty("rest.loginUrl"));
creds.setRestSessionMinutesToLive(env.getProperty("rest.sessionMinutesToLive"));
creds.setRestTokenUrl(env.getProperty("rest.tokenUrl"));
creds.setUsername(env.getProperty("apiusername"));
return new StandardBullhornData(creds);

}

/**
* Using {@link MockBullhornData} for testing purposes. This implementation of {@link BullhornData} uses test data stored in local
* text files.
*
* @return
*/
@Profile("testing")
@Bean
public BullhornData mockBullhornData() {

return new MockBullhornData();

}
}
```
265 changes: 265 additions & 0 deletions pom.xml
@@ -0,0 +1,265 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bullhorn</groupId>
<artifactId>sdk-rest</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jackson.version>2.7.1</jackson.version>
<org.springframework.version>4.2.4.RELEASE</org.springframework.version>
<additionalparam>-Xdoclint:none</additionalparam>
</properties>

<name>Bullhorn REST SDK</name>
<description>The Bullhorn REST SDK provides simple authentication to the Bullhorn REST APIs as well as wrapper objects for the API itself and all domain objects. It is typically used for integrating or customizing the BULLHORN CRM platform.</description>
<url>https://github.com/bullhorn/sdk-rest</url>
<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>

<developers>
<developer>
<name>John Sullivan</name>
<email>john.sullivan@bullhorn.com</email>
<organization>Bullhorn</organization>
<organizationUrl>http://www.bullhorn.com/</organizationUrl>
</developer>
</developers>

<scm>
<connection>scm:git:git@github.com:bullhorn/sdk-rest.git</connection>
<developerConnection>scm:git:git@github.com:bullhorn/sdk-rest.git</developerConnection>
<url>git@github.com:bullhorn/sdk-rest.git</url>
</scm>

<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework.version}</version>
<scope>test</scope>
</dependency>
<!-- Dependencies needed for REST -->
<!-- Joda Time -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20151123</version>
</dependency>

<!-- Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>

<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>

<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.2</version>
</dependency>

<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>

<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>2.4.5</version>
</dependency>

<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.2.3.Final</version>
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>

<!-- kryo used for object deep clone -->
<dependency>
<groupId>com.esotericsoftware.kryo</groupId>
<artifactId>kryo</artifactId>
<version>2.24.0</version>
</dependency>

<dependency>
<groupId>de.javakaffee</groupId>
<artifactId>kryo-serializers</artifactId>
<version>0.37</version>
</dependency>

</dependencies>

<build>
<finalName>bullhorn-data</finalName>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
<source>1.8</source>
<target>1.8</target>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.9.0-01</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.3.4-01</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<argLine>-Xms512m -Xmx1024m -XX:MaxPermSize=512m</argLine>
<excludes>
<exclude>**/Test*closure*.java</exclude>
<exclude>**/TestUtil.java</exclude>
<exclude>**/TestEntities.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit e2d1820

Please sign in to comment.