Skip to content

Commit

Permalink
SWARM-1172: add a fraction for integrate teiid product (thorntail#420)
Browse files Browse the repository at this point in the history
* SWARM-1172: add a fraction for integrate teiid product

* SWARM-1172: change the config api version to consistence with upstream

* SWARM-1172: change teiid config api version to match the central
  • Loading branch information
kylinsoong authored and bobmcwhirter committed Mar 16, 2017
1 parent dfa87f2 commit 2443857
Show file tree
Hide file tree
Showing 15 changed files with 755 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fractions/teiid/module.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
org.jboss.teiid
org.jboss.teiid.rest-service
org.wildfly.swarm.configuration.teiid export=true
org.wildfly.swarm.infinispan
151 changes: 151 additions & 0 deletions fractions/teiid/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
<?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>
<parent>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm</artifactId>
<version>2017.4.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<artifactId>teiid</artifactId>
<name>Teiid</name>
<description>A data virtualization system that allows applications to use data from multiple, heterogeneous data stores.</description>

<packaging>jar</packaging>

<properties>
<swarm.fraction.stability>stable</swarm.fraction.stability>
<swarm.fraction.tags>Data</swarm.fraction.tags>
</properties>


<dependencies>
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>container</artifactId>
</dependency>

<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>infinispan</artifactId>
</dependency>

<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>jca</artifactId>
</dependency>

<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>teiid-config-api</artifactId>
</dependency>


<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>provided</scope>
</dependency>

<!-- -->
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-core-feature-pack</artifactId>
<type>zip</type>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-servlet-feature-pack</artifactId>
<type>zip</type>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-feature-pack</artifactId>
<type>zip</type>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-wildfly-integration-feature-pack</artifactId>
<type>zip</type>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>rest-service-feature-pack</artifactId>
<type>zip</type>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.jboss.teiid.connectors</groupId>
<artifactId>feature-pack-swagger</artifactId>
<type>zip</type>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-client-feature-pack</artifactId>
<type>zip</type>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>


</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/**
* Copyright 2015-2016 Red Hat, Inc, and individual contributors.
*
* 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 org.wildfly.swarm.teiid;

import org.wildfly.swarm.config.Teiid;
import org.wildfly.swarm.config.runtime.AttributeDocumentation;
import org.wildfly.swarm.config.teiid.Transport;
import org.wildfly.swarm.spi.api.Defaultable;
import org.wildfly.swarm.spi.api.Fraction;
import org.wildfly.swarm.spi.api.annotations.Configurable;
import org.wildfly.swarm.spi.api.annotations.MarshalDMR;
import org.wildfly.swarm.spi.api.annotations.WildFlyExtension;

import static org.wildfly.swarm.spi.api.Defaultable.integer;
import static org.wildfly.swarm.teiid.TeiidProperties.DEFAULT_JDBC_PORT;
import static org.wildfly.swarm.teiid.TeiidProperties.DEFAULT_ODBC_PORT;
import static org.wildfly.swarm.teiid.TeiidProperties.PREPARED_INFINISPAN_CACHE_CONTAINER_NAME;
import static org.wildfly.swarm.teiid.TeiidProperties.RESULTSET_INFINISPAN_CACHE_CONTAINER_NAME;
import static org.wildfly.swarm.teiid.TeiidProperties.PREPARED_INFINISPAN_CACHE_NAME;
import static org.wildfly.swarm.teiid.TeiidProperties.RESULTSET_INFINISPAN_CACHE_NAME;
import static org.wildfly.swarm.teiid.TeiidProperties.JDBC_TRANSPORT_NAME;
import static org.wildfly.swarm.teiid.TeiidProperties.JDBC_SOCKET_BINDING_NAME;
import static org.wildfly.swarm.teiid.TeiidProperties.ODBC_TRANSPORT_NAME;
import static org.wildfly.swarm.teiid.TeiidProperties.ODBC_SOCKET_BINDING_NAME;

@MarshalDMR
@WildFlyExtension(module = "org.jboss.teiid", classname = "org.teiid.jboss.TeiidExtension")
public class TeiidFraction extends Teiid<TeiidFraction> implements Fraction<TeiidFraction> {

private static final long serialVersionUID = -6070901334377803127L;

@Configurable("swarm.teiid.jdbc.port")
@AttributeDocumentation("Set the port for the default JDBC socket listener")
private Defaultable<Integer> jdbcPort = integer(DEFAULT_JDBC_PORT);

@Configurable("swarm.teiid.odbc.port")
@AttributeDocumentation("Set the port for the default ODBC socket listener")
private Defaultable<Integer> odbcPort = integer(DEFAULT_ODBC_PORT);

public TeiidFraction() {

}

@Override
public TeiidFraction applyDefaults() {
return jdbcTransport();
}

public TeiidFraction jdbcTransport() {
return transport(JDBC_TRANSPORT_NAME, t -> t.socketBinding(JDBC_SOCKET_BINDING_NAME).protocol(Transport.Protocol.TEIID));
}

public TeiidFraction odbcTransport() {
return transport(ODBC_TRANSPORT_NAME, t -> t.socketBinding(ODBC_SOCKET_BINDING_NAME).protocol(Transport.Protocol.TEIID));
}

public TeiidFraction jdbcPort(int jdbcPort) {
this.jdbcPort.set(jdbcPort);
return this;
}

public int jdbcPort() {
return this.jdbcPort.get();
}

public TeiidFraction odbcPort(int jdbcPort) {
this.odbcPort.set(jdbcPort);
return this;
}

public int odbcPort() {
return this.odbcPort.get();
}

@Override
public String preparedplanCacheInfinispanContainer() {
if (super.preparedplanCacheInfinispanContainer() == null) {
super.preparedplanCacheInfinispanContainer(PREPARED_INFINISPAN_CACHE_CONTAINER_NAME);
}
return super.preparedplanCacheInfinispanContainer();
}

@Override
public String preparedplanCacheName() {
if (super.preparedplanCacheName() == null) {
super.preparedplanCacheName(PREPARED_INFINISPAN_CACHE_NAME);
}
return super.preparedplanCacheName();
}

@Override
public String resultsetCacheInfinispanContainer() {
if (super.resultsetCacheInfinispanContainer() == null) {
super.resultsetCacheInfinispanContainer(RESULTSET_INFINISPAN_CACHE_CONTAINER_NAME);
}
return super.resultsetCacheInfinispanContainer();
}

@Override
public String resultsetCacheName() {
if (super.resultsetCacheName() == null) {
super.resultsetCacheName(RESULTSET_INFINISPAN_CACHE_NAME);
}
return super.resultsetCacheName();
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Copyright 2015-2016 Red Hat, Inc, and individual contributors.
*
* 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 org.wildfly.swarm.teiid;

public interface TeiidProperties {

int DEFAULT_JDBC_PORT = 31000;
int DEFAULT_ODBC_PORT = 35432;

String JDBC_SOCKET_BINDING_NAME = "teiid-jdbc";
String ODBC_SOCKET_BINDING_NAME = "teiid-odbc";

String JDBC_TRANSPORT_NAME = "jdbc";
String ODBC_TRANSPORT_NAME = "odbc";

String PREPARED_INFINISPAN_CACHE_CONTAINER_NAME = "teiid-cache";
String RESULTSET_INFINISPAN_CACHE_CONTAINER_NAME = "teiid-cache";
String PREPARED_INFINISPAN_CACHE_NAME = "preparedplan";
String RESULTSET_INFINISPAN_CACHE_NAME = "resultset";
String RESULTSET_REPL_INFINISPAN_CACHE_NAME = "resultset-repl";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* Copyright 2015-2016 Red Hat, Inc, and individual contributors.
*
* 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 org.wildfly.swarm.teiid;

import java.io.IOException;
import java.io.InputStream;

import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.Assignable;

/**
* Provide a way to deploy vdb xml
* @author kylin
*
*/
public interface VDBArchive extends Assignable, Archive<VDBArchive> {

/**
* Form a VDBArchive by a -vdb.xml name, the -vdb.xml either can be under class path, or under current folder
* @param name
* @return
*/
VDBArchive vdb(String name) throws IOException;

/**
* Form a VDBArchive by a -vdb.xml by InputStream
* @param in
* @return
*/
VDBArchive vdb(InputStream in) throws IOException;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Copyright 2015-2016 Red Hat, Inc, and individual contributors.
*
* 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 org.wildfly.swarm.teiid;

import java.io.InputStream;

import org.jboss.shrinkwrap.api.asset.Asset;

public class VDBAsset implements Asset {

private InputStream in;

public VDBAsset(InputStream in) {
this.in = in;
}

@Override
public InputStream openStream() {
return in;
}

}
Loading

0 comments on commit 2443857

Please sign in to comment.