Skip to content

Commit

Permalink
TEIID-3797 using the term local consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Nov 2, 2015
1 parent 0beb539 commit ebf65c8
Show file tree
Hide file tree
Showing 21 changed files with 127 additions and 129 deletions.
Expand Up @@ -37,7 +37,7 @@ connect
/profile=ha/subsystem=threads/unbounded-queue-thread-pool=teiid-async:add(max-threads=4)

/profile=ha/subsystem=teiid:add(async-thread-pool=teiid-async, distributed-cache-jgroups-stack=udp, resultset-cache-infinispan-container=teiid-cache, preparedplan-cache-infinispan-container=teiid-cache, policy-decider-module=org.jboss.teiid)
/profile=ha/subsystem=teiid/transport=embedded:add()
/profile=ha/subsystem=teiid/transport=local:add()
/profile=ha/subsystem=teiid/transport=odata:add(authentication-security-domain=teiid-security)
/profile=ha/subsystem=teiid/transport=jdbc:add(protocol=teiid, socket-binding=teiid-jdbc, authentication-security-domain=teiid-security)
/profile=ha/subsystem=teiid/transport=odbc:add(protocol=pg, socket-binding=teiid-odbc, authentication-security-domain=teiid-security, ssl-mode=disabled)
Expand Down
Expand Up @@ -33,7 +33,7 @@ connect
/subsystem=threads/unbounded-queue-thread-pool=teiid-async:add(max-threads=4)

/subsystem=teiid:add(async-thread-pool=teiid-async, resultset-cache-infinispan-container=teiid-cache, preparedplan-cache-infinispan-container=teiid-cache, policy-decider-module=org.jboss.teiid)
/subsystem=teiid/transport=embedded:add()
/subsystem=teiid/transport=local:add()
/subsystem=teiid/transport=odata:add(authentication-security-domain=teiid-security)
/subsystem=teiid/transport=jdbc:add(protocol=teiid, socket-binding=teiid-jdbc, authentication-security-domain=teiid-security)
/subsystem=teiid/transport=odbc:add(protocol=pg, socket-binding=teiid-odbc, authentication-security-domain=teiid-security, ssl-mode=disabled)
Expand Down
141 changes: 71 additions & 70 deletions build/kits/jboss-as7/overlay/docs/teiid/teiid-releasenotes.html

Large diffs are not rendered by default.

Expand Up @@ -359,7 +359,7 @@

<authentication security-domain="teiid-security"/>

<transport name="embedded"/>
<transport name="local"/>
<transport name="odata"/>
<transport name="jdbc" protocol="teiid" socket-binding="teiid-jdbc"/>
<transport name="odbc" protocol="pg" socket-binding="teiid-odbc">
Expand Down
4 changes: 2 additions & 2 deletions client/src/main/java/org/teiid/jdbc/JDBCURL.java
Expand Up @@ -62,7 +62,7 @@ private static Map<String, String> buildProps() {
ExecutionProperties.PROP_FETCH_SIZE,
ExecutionProperties.PROP_XML_FORMAT,
ExecutionProperties.PROP_XML_VALIDATION,
EmbeddedProfile.USE_CALLING_THREAD,
LocalProfile.USE_CALLING_THREAD,
ExecutionProperties.DISABLE_LOCAL_TRANSACTIONS,
ExecutionProperties.JDBC4COLUMNNAMEANDLABELSEMANTICS}) {
result.put(key, key);
Expand All @@ -80,7 +80,7 @@ private static Map<String, String> getKnownProperties() {
BaseDataSource.VDB_VERSION,
BaseDataSource.USER_NAME,
BaseDataSource.PASSWORD,
EmbeddedProfile.WAIT_FOR_LOAD,
LocalProfile.WAIT_FOR_LOAD,
TeiidURL.CONNECTION.AUTO_FAILOVER,
TeiidURL.CONNECTION.DISCOVERY_STRATEGY,
TeiidURL.CONNECTION.PASSTHROUGH_AUTHENTICATION,
Expand Down
Expand Up @@ -30,7 +30,7 @@
import org.teiid.net.ServerConnection;


public class EmbeddedProfile implements ConnectionProfile {
public class LocalProfile implements ConnectionProfile {

public static final String USE_CALLING_THREAD = "useCallingThread"; //$NON-NLS-1$
public static final String WAIT_FOR_LOAD = "waitForLoad"; //$NON-NLS-1$
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/org/teiid/jdbc/ModuleHelper.java
Expand Up @@ -50,7 +50,7 @@ static ServerConnection createFromModule(Properties info)
}
final Module module = callerModuleLoader.loadModule(ModuleIdentifier.create("org.jboss.teiid")); //$NON-NLS-1$
Thread.currentThread().setContextClassLoader(module.getClassLoader());
return (ServerConnection)ReflectionHelper.create("org.teiid.transport.LocalServerConnection", Arrays.asList(info, PropertiesUtils.getBooleanProperty(info, EmbeddedProfile.USE_CALLING_THREAD, true)), Thread.currentThread().getContextClassLoader()); //$NON-NLS-1$
return (ServerConnection)ReflectionHelper.create("org.teiid.transport.LocalServerConnection", Arrays.asList(info, PropertiesUtils.getBooleanProperty(info, LocalProfile.USE_CALLING_THREAD, true)), Thread.currentThread().getContextClassLoader()); //$NON-NLS-1$
} catch (ModuleLoadException e) {
throw new ConnectionException(JDBCPlugin.Event.TEIID20008, e, JDBCPlugin.Util.gs(JDBCPlugin.Event.TEIID20008));
} finally {
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/org/teiid/jdbc/StatementImpl.java
Expand Up @@ -681,7 +681,7 @@ boolean useCallingThread() throws SQLException {
if (this.getConnection().getServerConnection() == null || !this.getConnection().getServerConnection().isLocal()) {
return false;
}
String useCallingThread = getExecutionProperty(EmbeddedProfile.USE_CALLING_THREAD);
String useCallingThread = getExecutionProperty(LocalProfile.USE_CALLING_THREAD);
return (useCallingThread == null || Boolean.valueOf(useCallingThread));
}

Expand Down
12 changes: 6 additions & 6 deletions client/src/main/java/org/teiid/jdbc/TeiidDriver.java
Expand Up @@ -70,7 +70,7 @@ public class TeiidDriver implements Driver {
}

private ConnectionProfile socketProfile = new SocketProfile();
private ConnectionProfile embeddedProfile;
private ConnectionProfile localProfile;

public static TeiidDriver getInstance() {
return INSTANCE;
Expand All @@ -94,15 +94,15 @@ public ConnectionImpl connect(String url, Properties info) throws SQLException {

try {
if (conn == ConnectionType.Embedded) {
if (embeddedProfile == null) {
if (localProfile == null) {
try {
getClass().getClassLoader().loadClass("org.jboss.modules.Module"); //$NON-NLS-1$
} catch(ClassNotFoundException e) {
throw new TeiidSQLException(JDBCPlugin.Util.gs("module_load_failed")); //$NON-NLS-1$
}
embeddedProfile = new EmbeddedProfile();
localProfile = new LocalProfile();
}
myConnection = embeddedProfile.connect(url, info);
myConnection = localProfile.connect(url, info);
} else {
myConnection = socketProfile.connect(url, info);
}
Expand All @@ -118,8 +118,8 @@ public ConnectionImpl connect(String url, Properties info) throws SQLException {
return myConnection;
}

public void setEmbeddedProfile(ConnectionProfile embeddedProfile) {
this.embeddedProfile = embeddedProfile;
public void setLocalProfile(ConnectionProfile embeddedProfile) {
this.localProfile = embeddedProfile;
}

public void setSocketProfile(ConnectionProfile socketProfile) {
Expand Down
Expand Up @@ -46,7 +46,7 @@
import org.teiid.client.security.SessionToken;
import org.teiid.core.util.PropertiesUtils;
import org.teiid.dqp.message.RequestID;
import org.teiid.jdbc.EmbeddedProfile;
import org.teiid.jdbc.LocalProfile;
import org.teiid.logging.LogManager;
import org.teiid.metadata.MetadataFactory;
import org.teiid.query.metadata.SystemMetadata;
Expand Down Expand Up @@ -144,7 +144,7 @@ public static void setWorkContext(DQPWorkContext context) {
private boolean admin;
private MetadataFactory metadataFactory;

private transient EmbeddedProfile connectionProfile = new EmbeddedProfile();
private transient LocalProfile connectionProfile = new LocalProfile();

public DQPWorkContext() {
}
Expand Down Expand Up @@ -359,11 +359,11 @@ public MetadataFactory getTempMetadataFactory() {
return this.metadataFactory;
}

public void setConnectionProfile(EmbeddedProfile connectionProfile) {
public void setConnectionProfile(LocalProfile connectionProfile) {
this.connectionProfile = connectionProfile;
}

public EmbeddedProfile getConnectionProfile() {
public LocalProfile getConnectionProfile() {
return connectionProfile;
}

Expand Down
6 changes: 3 additions & 3 deletions engine/src/main/java/org/teiid/query/util/CommandContext.java
Expand Up @@ -64,7 +64,7 @@
import org.teiid.dqp.service.TransactionContext;
import org.teiid.dqp.service.TransactionService;
import org.teiid.jdbc.ConnectionImpl;
import org.teiid.jdbc.EmbeddedProfile;
import org.teiid.jdbc.LocalProfile;
import org.teiid.jdbc.TeiidConnection;
import org.teiid.jdbc.TeiidSQLException;
import org.teiid.logging.LogConstants;
Expand Down Expand Up @@ -1052,10 +1052,10 @@ public static GlobalTableStoreImpl removeSessionScopedStore(SessionMetadata sess

@Override
public TeiidConnection getConnection() throws TeiidSQLException {
EmbeddedProfile ep = getDQPWorkContext().getConnectionProfile();
LocalProfile ep = getDQPWorkContext().getConnectionProfile();
//TODO: this is problematic as the client properties are not conveyed
Properties info = new Properties();
info.put(EmbeddedProfile.DQP_WORK_CONTEXT, getDQPWorkContext());
info.put(LocalProfile.DQP_WORK_CONTEXT, getDQPWorkContext());
String url = "jdbc:teiid:" + getVdbName() + "." + getVdbVersion(); //$NON-NLS-1$ //$NON-NLS-2$
ServerConnection sc;
try {
Expand Down
Expand Up @@ -88,7 +88,6 @@ public static enum Event implements BundleUtil.Event {
TEIID50077,
TEIID50088,
TEIID50089,
TEIID50090, //Missing context
TEIID50091, // rest different # of param count
TEIID50092, // rest procedure execution
TEIID50093,
Expand Down
Expand Up @@ -33,7 +33,7 @@ public class TeiidServiceNames {
public static ServiceName VDB_REPO = ServiceName.JBOSS.append("teiid", "vdb-repository");//$NON-NLS-1$ //$NON-NLS-2$
public static ServiceName TRANSLATOR_BASE = ServiceName.JBOSS.append("teiid", "translator");//$NON-NLS-1$ //$NON-NLS-2$
public static ServiceName TRANSPORT_BASE = ServiceName.JBOSS.append("teiid", "transport");//$NON-NLS-1$ //$NON-NLS-2$
private static ServiceName EMBEDDED_TRANSPORT_BASE = ServiceName.JBOSS.append("teiid", "embedded", "transport");//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
private static ServiceName LOCAL_TRANSPORT_BASE = ServiceName.JBOSS.append("teiid", "local", "transport");//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
public static ServiceName BUFFER_DIR = ServiceName.JBOSS.append("teiid", "buffer.dir");//$NON-NLS-1$ //$NON-NLS-2$
public static ServiceName DATA_DIR = ServiceName.JBOSS.append("teiid", "data.dir");//$NON-NLS-1$ //$NON-NLS-2$
public static ServiceName BUFFER_MGR = ServiceName.JBOSS.append("teiid", "buffer-mgr");//$NON-NLS-1$ //$NON-NLS-2$
Expand Down Expand Up @@ -88,8 +88,8 @@ public static ServiceName transportServiceName(String name) {
return ServiceName.of(TRANSPORT_BASE, name);
}

public static ServiceName embeddedTransportServiceName(String name) {
return EMBEDDED_TRANSPORT_BASE.append(name);
public static ServiceName localTransportServiceName(String name) {
return LOCAL_TRANSPORT_BASE.append(name);
}

public static ServiceName dsListenerServiceName(String vdbName, int version, String name) throws InvalidServiceNameException {
Expand Down
Expand Up @@ -50,7 +50,6 @@
import org.teiid.dqp.service.SessionService;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.net.socket.AuthenticationType;
import org.teiid.transport.ClientServiceRegistry;
import org.teiid.transport.LocalServerConnection;
import org.teiid.transport.SSLConfiguration;
Expand Down Expand Up @@ -107,7 +106,7 @@ protected void performRuntime(final OperationContext context, final ModelNode op
transport.setSocketConfig(buildSocketConfiguration(context, operation));
}
else {
transport.setEmbedded(true);
transport.setLocal(true);
LogManager.logDetail(LogConstants.CTX_SECURITY, IntegrationPlugin.Util.getString("socket_binding_not_defined", transportName)); //$NON-NLS-1$
}

Expand All @@ -128,9 +127,9 @@ protected void performRuntime(final OperationContext context, final ModelNode op
newControllers.add(transportBuilder.install());

// register a JNDI name, this looks hard.
if (transport.isEmbedded() && !isEmbeddedRegistered(transportName)) {
if (transport.isLocal() && !isLocalRegistered(transportName)) {
final ReferenceFactoryService<ClientServiceRegistry> referenceFactoryService = new ReferenceFactoryService<ClientServiceRegistry>();
final ServiceName referenceFactoryServiceName = TeiidServiceNames.embeddedTransportServiceName(transportName).append("reference-factory"); //$NON-NLS-1$
final ServiceName referenceFactoryServiceName = TeiidServiceNames.localTransportServiceName(transportName).append("reference-factory"); //$NON-NLS-1$
final ServiceBuilder<?> referenceBuilder = target.addService(referenceFactoryServiceName,referenceFactoryService);
referenceBuilder.addDependency(TeiidServiceNames.transportServiceName(transportName), ClientServiceRegistry.class, referenceFactoryService.getInjector());
referenceBuilder.setInitialMode(ServiceController.Mode.ACTIVE);
Expand All @@ -147,7 +146,7 @@ protected void performRuntime(final OperationContext context, final ModelNode op
}
}

protected boolean isEmbeddedRegistered(String transportName) {
protected boolean isLocalRegistered(String transportName) {
try {
InitialContext ic = new InitialContext();
ic.lookup(LocalServerConnection.jndiNameForRuntime(transportName));
Expand Down
Expand Up @@ -51,10 +51,10 @@ protected void performRuntime(OperationContext context, ModelNode operation, Mod
if (controller != null) {
TransportService transport = TransportService.class.cast(controller.getValue());

if (transport.isEmbedded()) {
if (transport.isLocal()) {
final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(LocalServerConnection.jndiNameForRuntime(transportName));
context.removeService(bindInfo.getBinderServiceName());
context.removeService(TeiidServiceNames.embeddedTransportServiceName(transportName).append("reference-factory")); //$NON-NLS-1$
context.removeService(TeiidServiceNames.localTransportServiceName(transportName).append("reference-factory")); //$NON-NLS-1$
}
context.removeService(serviceName);
}
Expand Down
Expand Up @@ -72,7 +72,7 @@ public class TransportService extends ClientServiceRegistryImpl implements Servi
private SocketListener socketListener;
private AuthenticationType authenticationType;
private int maxODBCLobSizeAllowed = 5*1024*1024; // 5 MB
private boolean embedded;
private boolean local;
private InetSocketAddress address = null;
private String transportName;

Expand Down Expand Up @@ -140,7 +140,7 @@ public void start(StartContext context) throws StartException {
}
else if (socketConfig.getProtocol() == WireProtocol.pg) {
TeiidDriver driver = new TeiidDriver();
driver.setEmbeddedProfile(new ConnectionProfile() {
driver.setLocalProfile(new ConnectionProfile() {
@Override
public ConnectionImpl connect(String url, Properties info) throws TeiidSQLException {
try {
Expand Down Expand Up @@ -290,11 +290,11 @@ public void setMaxODBCLobSizeAllowed(int lobSize) {
this.maxODBCLobSizeAllowed = lobSize;
}

public void setEmbedded(boolean v) {
this.embedded = v;
public void setLocal(boolean v) {
this.local = v;
}

public boolean isEmbedded() {
return this.embedded;
public boolean isLocal() {
return this.local;
}
}
Expand Up @@ -25,8 +25,8 @@ TEIID50012=Teiid JDBC - Name = {0}, Host = {1}, Port = {2}, SSL = {3}, security
TEIID50039=Teiid JDBC - Name = {0}, Host = {1}, Port = {2} has been shutdown.
TEIID50037=Teiid ODBC - Name = {0}, Host = {1}, Port = {2}, SSL = {3}, security-domains = {4}
TEIID50040=Teiid ODBC - Name = {0}, Host = {1}, Port = {2} has been shutdown.
TEIID50038=Teiid Embedded transport enabled. Bound to: {0}
TEIID50041=Teiid Embedded transport disabled. Local Connections will fail. UnBound : {0}
TEIID50038=Teiid Local transport enabled. Bound to: {0}
TEIID50041=Teiid Local transport disabled. Local Connections will fail. UnBound : {0}
TEIID50002=Teiid Engine stopped {0}
event_distributor_bound=org.teiid.events.EventDistributorFactory is bound to {0} for manual control of Teiid events.
TEIID50019=Re-deploying VDB {0}
Expand All @@ -44,7 +44,7 @@ translator.remove=Remove Translator
TEIID50011=Security enabled for transport "{1}" with security-domain set to {0}
TEIID50006 = Teiid translator "{0}" added.
TEIID50013=Wrong type of protocol supplied
socket_binding_not_defined=Socket binding not specified for transport {0}; only embedded access is granted.
socket_binding_not_defined=Socket binding not specified for transport {0}; only local access is granted.
TEIID50070=Error adding translator from deployment {0}
TEIID50071=Cache Type {0} not found in the configuration
TEIID50018= failed to process VDB archive {0}
Expand All @@ -67,7 +67,6 @@ TEIID50074=VDB has validity errors; failed to deploy - {0}
TEIID50075=No "path" information found to load the FUNCTION model {0}; FUNCTION model must have path information.
TEIID50076=For {0}.{1} VDB, recursive delegation {2} found.
TEIID50077=The translator type "{0}" was not found in configuration; VDB {1}.{2} will not be started until translator is available.
TEIID50090=No context associated. More than likely either pass-through authentication should not be used or there are no security domains defined on the embedded transport.
TEIID50091=The URI parameters defined on procedure {0}, do not match to number of parameters defined on procedure. Correct and reploy VDB to expose this procedure through REST.
TEIID50092=Only result produceing procedures are allowed
TEIID50093=Cache factory not found; Make sure the Infinispan based cache factory is correctly configured for Teiid.
Expand Down
10 changes: 5 additions & 5 deletions odata/src/main/java/org/teiid/odata/LocalClient.java
Expand Up @@ -70,7 +70,7 @@
import org.teiid.core.util.PropertiesUtils;
import org.teiid.jdbc.CallableStatementImpl;
import org.teiid.jdbc.ConnectionImpl;
import org.teiid.jdbc.EmbeddedProfile;
import org.teiid.jdbc.LocalProfile;
import org.teiid.jdbc.PreparedStatementImpl;
import org.teiid.jdbc.TeiidDriver;
import org.teiid.logging.LogConstants;
Expand Down Expand Up @@ -119,11 +119,11 @@ public LocalClient(String vdbName, int vdbVersion, Properties props) {
if (this.initProperties.getProperty(TeiidURL.CONNECTION.PASSTHROUGH_AUTHENTICATION) == null) {
this.initProperties.put(TeiidURL.CONNECTION.PASSTHROUGH_AUTHENTICATION, "true"); //$NON-NLS-1$
}
if (this.initProperties.getProperty(EmbeddedProfile.TRANSPORT_NAME) == null) {
this.initProperties.setProperty(EmbeddedProfile.TRANSPORT_NAME, "odata");
if (this.initProperties.getProperty(LocalProfile.TRANSPORT_NAME) == null) {
this.initProperties.setProperty(LocalProfile.TRANSPORT_NAME, "odata");
}
if (this.initProperties.getProperty(EmbeddedProfile.WAIT_FOR_LOAD) == null) {
this.initProperties.put(EmbeddedProfile.WAIT_FOR_LOAD, "0"); //$NON-NLS-1$
if (this.initProperties.getProperty(LocalProfile.WAIT_FOR_LOAD) == null) {
this.initProperties.put(LocalProfile.WAIT_FOR_LOAD, "0"); //$NON-NLS-1$
}
this.connectionString = sb.toString();
}
Expand Down
10 changes: 5 additions & 5 deletions olingo/src/main/java/org/teiid/olingo/service/LocalClient.java
Expand Up @@ -37,7 +37,7 @@
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.util.PropertiesUtils;
import org.teiid.jdbc.ConnectionImpl;
import org.teiid.jdbc.EmbeddedProfile;
import org.teiid.jdbc.LocalProfile;
import org.teiid.jdbc.PreparedStatementImpl;
import org.teiid.jdbc.TeiidDriver;
import org.teiid.logging.LogConstants;
Expand Down Expand Up @@ -107,11 +107,11 @@ public static ConnectionImpl buildConnection(TeiidDriver driver, String vdbName,
if (props.getProperty(TeiidURL.CONNECTION.PASSTHROUGH_AUTHENTICATION) == null) {
props.setProperty(TeiidURL.CONNECTION.PASSTHROUGH_AUTHENTICATION, "true"); //$NON-NLS-1$
}
if (props.getProperty(EmbeddedProfile.TRANSPORT_NAME) == null) {
props.setProperty(EmbeddedProfile.TRANSPORT_NAME, "odata");
if (props.getProperty(LocalProfile.TRANSPORT_NAME) == null) {
props.setProperty(LocalProfile.TRANSPORT_NAME, "odata");
}
if (props.getProperty(EmbeddedProfile.WAIT_FOR_LOAD) == null) {
props.setProperty(EmbeddedProfile.WAIT_FOR_LOAD, "0"); //$NON-NLS-1$
if (props.getProperty(LocalProfile.WAIT_FOR_LOAD) == null) {
props.setProperty(LocalProfile.WAIT_FOR_LOAD, "0"); //$NON-NLS-1$
}
ConnectionImpl connection = driver.connect(sb.toString(), props);
return connection;
Expand Down

0 comments on commit ebf65c8

Please sign in to comment.