-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial import of Redis Connector for Dell Boomi.
- Loading branch information
0 parents
commit 2592427
Showing
46 changed files
with
2,267 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea | ||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright 2020 Sonos, Inc. | ||
|
||
Licensed 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> | ||
<output url="file://$MODULE_DIR$/target/classes" /> | ||
<output-test url="file://$MODULE_DIR$/target/test-classes" /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> | ||
<excludeFolder url="file://$MODULE_DIR$/target" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.boomi.connsdk:connector-sdk-api:2.3.0" level="project" /> | ||
<orderEntry type="library" name="Maven: com.boomi.connsdk:connector-sdk-util:2.3.0" level="project" /> | ||
<orderEntry type="library" scope="TEST" name="Maven: com.boomi.connsdk:connector-sdk-test-util:2.3.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.boomi:common-sdk:1.1.7" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.boomi.util:boomi-util:2.3.8" level="project" /> | ||
<orderEntry type="library" name="Maven: io.lettuce:lettuce-core:6.0.0.RC1" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.51.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.51.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.51.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.51.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.51.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.51.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.8.RELEASE" level="project" /> | ||
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" /> | ||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.7.0-RC1" level="project" /> | ||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.7.0-RC1" level="project" /> | ||
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" /> | ||
<orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" /> | ||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.7.0-RC1" level="project" /> | ||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.7.0-RC1" level="project" /> | ||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.7.0-RC1" level="project" /> | ||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.7.0-RC1" level="project" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Set-Location (Split-Path $MyInvocation.MyCommand.Path) | ||
mvn install:install-file "-Dfile=./lib/connector-sdk-test-util-2.3.0.jar" "-DgroupId=com.boomi.connsdk" "-DartifactId=connector-sdk-test-util" "-Dversion=2.3.0" "-Dpackaging=jar" | ||
mvn install:install-file "-Dfile=./lib/connector-sdk-api-2.3.0.jar" "-DgroupId=com.boomi.connsdk" "-DartifactId=connector-sdk-api" "-Dversion=2.3.0" "-Dpackaging=jar" | ||
mvn install:install-file "-Dfile=./lib/connector-sdk-util-2.3.0.jar" "-DgroupId=com.boomi.connsdk" "-DartifactId=connector-sdk-util" "-Dversion=2.3.0" "-Dpackaging=jar" | ||
mvn install:install-file "-Dfile=./lib/common-sdk-1.1.7.jar" "-DgroupId=com.boomi" "-DartifactId=common-sdk" "-Dversion=1.1.7" "-Dpackaging=jar" |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Set-Location (Split-Path $MyInvocation.MyCommand.Path) | ||
mvn package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
<?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.sonos.boomi.connector</groupId> | ||
<artifactId>RedisConnector</artifactId> | ||
<version>0.1</version> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>1.7</maven.compiler.source> | ||
<maven.compiler.target>1.7</maven.compiler.target> | ||
<maven.assembly.plugin.version>2.6</maven.assembly.plugin.version> | ||
<connector.sdk.version>2.7.0</connector.sdk.version> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.boomi.connsdk</groupId> | ||
<artifactId>connector-sdk-api</artifactId> | ||
<version>2.3.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.boomi.util</groupId> | ||
<artifactId>boomi-util</artifactId> | ||
<version>2.3.8</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.boomi</groupId> | ||
<artifactId>common-sdk</artifactId> | ||
<version>1.1.7</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.boomi.connsdk</groupId> | ||
<artifactId>connector-sdk-util</artifactId> | ||
<version>2.3.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.boomi.connsdk</groupId> | ||
<artifactId>connector-sdk-ws</artifactId> | ||
<version>${connector.sdk.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.boomi.connsdk</groupId> | ||
<artifactId>connector-sdk-test-util</artifactId> | ||
<version>2.3.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.lettuce</groupId> | ||
<artifactId>lettuce-core</artifactId> | ||
<version>6.0.0.RC1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<version>RELEASE</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.boomi.connsdk</groupId> | ||
<artifactId>connector-sdk-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.boomi.connsdk</groupId> | ||
<artifactId>connector-sdk-util</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.boomi.connsdk</groupId> | ||
<artifactId>connector-sdk-test-util</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.boomi</groupId> | ||
<artifactId>common-sdk</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.boomi.util</groupId> | ||
<artifactId>boomi-util</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.lettuce</groupId> | ||
<artifactId>lettuce-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<version>${maven.assembly.plugin.version}</version> | ||
<configuration combine.self="override"> | ||
<descriptors> | ||
<descriptor>src/main/assembly/assembly.xml</descriptor> | ||
</descriptors> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>8</source> | ||
<target>8</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<assembly> | ||
<id>-car</id> | ||
<formats> | ||
<format>zip</format> | ||
</formats> | ||
<includeBaseDirectory>false</includeBaseDirectory> | ||
<componentDescriptors> | ||
<componentDescriptor>dependency.xml</componentDescriptor> | ||
</componentDescriptors> | ||
<fileSets> | ||
<fileSet> | ||
<outputDirectory>META-INF</outputDirectory> | ||
<includes> | ||
<include>connector-config.xml</include> | ||
<include>connector-descriptor.xml</include> | ||
<include>connector.xml</include> | ||
</includes> | ||
<directory>target/classes</directory> | ||
</fileSet> | ||
</fileSets> | ||
</assembly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<component> | ||
<dependencySets> | ||
<dependencySet> | ||
<outputDirectory>/lib</outputDirectory> | ||
<includes> | ||
<include>*</include> | ||
</includes> | ||
<useTransitiveFiltering>true</useTransitiveFiltering> | ||
</dependencySet> | ||
</dependencySets> | ||
</component> |
84 changes: 84 additions & 0 deletions
84
src/main/java/com/sonos/boomi/connector/redis/RedisBrowser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Copyright 2020 Sonos, Inc. | ||
* | ||
* Licensed 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 com.sonos.boomi.connector.redis; | ||
|
||
import com.boomi.connector.api.*; | ||
import com.boomi.connector.util.BaseBrowser; | ||
import com.boomi.connector.util.BaseConnection; | ||
import com.sonos.boomi.connector.redis.object.RedisObjectTypes; | ||
|
||
import java.util.Collection; | ||
|
||
/** | ||
* Implementation of BaseBrowser that provides Browse and Test Connection support to Boomi | ||
*/ | ||
public class RedisBrowser extends BaseBrowser implements ConnectionTester { | ||
|
||
/** | ||
* @param context BrowseContext to provide to {@link com.boomi.connector.util.BaseBrowser} | ||
*/ | ||
protected RedisBrowser(BrowseContext context) { | ||
super(context); | ||
} | ||
|
||
/** | ||
* @param connection Connection to provide to {@link com.boomi.connector.util.BaseBrowser} | ||
*/ | ||
protected RedisBrowser(BaseConnection<BrowseContext> connection) { | ||
super(connection); | ||
} | ||
|
||
/** | ||
* @return Returns all object types loaded from object type metadata resource file | ||
*/ | ||
@Override | ||
public ObjectTypes getObjectTypes() { | ||
return RedisObjectTypes.getInstance().getBoomiTypes(); | ||
} | ||
|
||
/** | ||
* @param s Object type used when searching for object definitions to return | ||
* @param collection Roles to use when searching for object definitions to return | ||
* @return Returns a new instance of {@link com.boomi.connector.api.ObjectDefinitions} containing all definitions | ||
* for the object type and roles | ||
*/ | ||
@Override | ||
public ObjectDefinitions getObjectDefinitions(String s, Collection<ObjectDefinitionRole> collection) { | ||
OperationType operationType = getContext().getOperationType(); | ||
String customType = getContext().getCustomOperationType(); | ||
return RedisObjectTypes | ||
.getInstance() | ||
.getObjectType(s) | ||
.toObjectDefinitions(operationType.name(), customType, collection); | ||
} | ||
|
||
/** | ||
* Tests the Redis connection by executing a PING command | ||
*/ | ||
@Override | ||
public void testConnection() { | ||
RedisConnection connection = (RedisConnection) getConnection(); | ||
try { | ||
String pong = connection.getConnection().sync().ping(); | ||
if (!"PONG".equals(pong)) { | ||
throw new ConnectorException("Connection did not respond to PING with 'PONG'"); | ||
} | ||
} finally { | ||
connection.closeConnection(); | ||
} | ||
} | ||
} |
Oops, something went wrong.