teiid SVN: r843 - in trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce: connection and 3 other directories.
by teiid-commits@lists.jboss.org
Author: jdoyle
Date: 2009-04-24 16:16:30 -0400 (Fri, 24 Apr 2009)
New Revision: 843
Added:
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/DeletedObject.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/DeletedResult.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/GetDeletedExecutionImpl.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/GetUpdatedExecutionImpl.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/ProcedureExecutionParent.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/ProcedureExecutionParentImpl.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/SalesforceProcedureExecution.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/UpdatedResult.java
Modified:
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/ConnectorState.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/Util.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/connection/SalesforceConnection.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/connection/impl/ConnectionImpl.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/CriteriaVisitor.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/InsertVisitor.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/SelectVisitor.java
Log:
TEIID-244
Adding getUpdated and getDeleted implementations.
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/ConnectorState.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/ConnectorState.java 2009-04-24 16:12:37 UTC (rev 842)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/ConnectorState.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -35,7 +35,6 @@
public static final String PASSWORD = "password";
public static final String URL = "URL";
- ConnectorLogger logger;
String username;
String password;
URL url;
@@ -45,7 +44,6 @@
if (logger == null) {
throw new ConnectorException("Internal Exception: logger is null");
}
- this.logger = logger;
String username = props.getProperty(USERNAME);
if (username != null) {
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/Util.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/Util.java 2009-04-24 16:12:37 UTC (rev 842)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/Util.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -29,12 +29,6 @@
public class Util {
- public static boolean convertStringToBoolean(String value) {
- Boolean retval = (value == null ? Boolean.FALSE : new Boolean(value
- .equalsIgnoreCase(Boolean.TRUE.toString())));
- return retval.booleanValue();
- }
-
public static String stripQutes(String id) {
if((id.startsWith("'") && id.endsWith("'"))) {
id = id.substring(1,id.length()-1);
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/connection/SalesforceConnection.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/connection/SalesforceConnection.java 2009-04-24 16:12:37 UTC (rev 842)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/connection/SalesforceConnection.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -22,23 +22,29 @@
package com.metamatrix.connector.salesforce.connection;
import java.net.URL;
+import java.util.Calendar;
import java.util.List;
import org.teiid.connector.api.ConnectorEnvironment;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.ExecutionContext;
+import org.teiid.connector.api.ProcedureExecution;
import org.teiid.connector.api.ResultSetExecution;
import org.teiid.connector.api.UpdateExecution;
import org.teiid.connector.basic.BasicConnection;
import org.teiid.connector.language.ICommand;
+import org.teiid.connector.language.IProcedure;
import org.teiid.connector.language.IQueryCommand;
import org.teiid.connector.metadata.runtime.RuntimeMetadata;
import com.metamatrix.connector.salesforce.Messages;
import com.metamatrix.connector.salesforce.connection.impl.ConnectionImpl;
import com.metamatrix.connector.salesforce.execution.DataPayload;
+import com.metamatrix.connector.salesforce.execution.DeletedResult;
+import com.metamatrix.connector.salesforce.execution.ProcedureExecutionParentImpl;
import com.metamatrix.connector.salesforce.execution.QueryExecutionImpl;
import com.metamatrix.connector.salesforce.execution.UpdateExecutionParent;
+import com.metamatrix.connector.salesforce.execution.UpdatedResult;
import com.sforce.soap.partner.QueryResult;
public class SalesforceConnection extends BasicConnection {
@@ -87,6 +93,13 @@
}
@Override
+ public ProcedureExecution createProcedureExecution(IProcedure command,
+ ExecutionContext executionContext, RuntimeMetadata metadata)
+ throws ConnectorException {
+ return new ProcedureExecutionParentImpl(command, this, metadata, executionContext, connectorEnv);
+ }
+
+ @Override
public void close() {
}
@@ -124,4 +137,14 @@
public int update(List<DataPayload> updateDataList) throws ConnectorException {
return connection.update(updateDataList);
}
+
+ public UpdatedResult getUpdated(String objectName, Calendar startCalendar,
+ Calendar endCalendar) throws ConnectorException {
+ return connection.getUpdated(objectName, startCalendar, endCalendar);
+ }
+
+ public DeletedResult getDeleted(String objectName, Calendar startCalendar,
+ Calendar endCalendar) throws ConnectorException {
+ return connection.getDeleted(objectName, startCalendar, endCalendar);
+ }
}
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/connection/impl/ConnectionImpl.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/connection/impl/ConnectionImpl.java 2009-04-24 16:12:37 UTC (rev 842)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/connection/impl/ConnectionImpl.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -23,6 +23,8 @@
import java.net.URL;
import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Calendar;
import java.util.List;
import javax.xml.rpc.ServiceException;
@@ -40,8 +42,14 @@
import org.teiid.connector.api.ConnectorLogger;
import com.metamatrix.connector.salesforce.execution.DataPayload;
+import com.metamatrix.connector.salesforce.execution.DeletedObject;
+import com.metamatrix.connector.salesforce.execution.DeletedResult;
+import com.metamatrix.connector.salesforce.execution.UpdatedResult;
import com.sforce.soap.partner.CallOptions;
import com.sforce.soap.partner.DeleteResult;
+import com.sforce.soap.partner.DeletedRecord;
+import com.sforce.soap.partner.GetDeletedResult;
+import com.sforce.soap.partner.GetUpdatedResult;
import com.sforce.soap.partner.LoginResult;
import com.sforce.soap.partner.QueryOptions;
import com.sforce.soap.partner.QueryResult;
@@ -50,6 +58,7 @@
import com.sforce.soap.partner.SforceServiceLocator;
import com.sforce.soap.partner.SoapBindingStub;
import com.sforce.soap.partner.fault.ApiFault;
+import com.sforce.soap.partner.fault.InvalidSObjectFault;
import com.sforce.soap.partner.fault.UnexpectedErrorFault;
import com.sforce.soap.partner.fault.InvalidQueryLocatorFault;
import com.sforce.soap.partner.sobject.SObject;
@@ -280,4 +289,49 @@
return results.length;
}
+ public UpdatedResult getUpdated(String objectType, Calendar startDate, Calendar endDate) throws ConnectorException {
+ try {
+ GetUpdatedResult updated = binding.getUpdated(objectType, startDate, endDate);
+ UpdatedResult result = new UpdatedResult();
+ result.setLatestDateCovered(updated.getLatestDateCovered());
+ result.setIDs(updated.getIds());
+ return result;
+ } catch (InvalidSObjectFault e) {
+ throw new ConnectorException(e.getExceptionMessage());
+ } catch (UnexpectedErrorFault e) {
+ throw new ConnectorException(e.getMessage());
+ } catch (RemoteException e) {
+ throw new ConnectorException(e, e.getMessage());
+ }
+ }
+
+ public DeletedResult getDeleted(String objectName, Calendar startCalendar,
+ Calendar endCalendar) throws ConnectorException {
+ try {
+ GetDeletedResult deleted = binding.getDeleted(objectName, startCalendar, endCalendar);
+ DeletedResult result = new DeletedResult();
+ result.setLatestDateCovered(deleted.getLatestDateCovered());
+ result.setEarliestDateAvailable(deleted.getEarliestDateAvailable());
+ DeletedRecord[] records = deleted.getDeletedRecords();
+ List<DeletedObject> resultRecords = new ArrayList<DeletedObject>();
+ DeletedObject object;
+ if(null !=records) {
+ for (int i = 0; i < records.length; i++) {
+ DeletedRecord record = records[i];
+ object = new DeletedObject();
+ object.setID(record.getId());
+ object.setDeletedDate(record.getDeletedDate());
+ resultRecords.add(object);
+ }
+ }
+ result.setResultRecords(resultRecords);
+ return result;
+ } catch (InvalidSObjectFault e) {
+ throw new ConnectorException(e.getExceptionMessage());
+ } catch (UnexpectedErrorFault e) {
+ throw new ConnectorException(e.getMessage());
+ } catch (RemoteException e) {
+ throw new ConnectorException(e, e.getMessage());
+ }
+ }
}
Added: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/DeletedObject.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/DeletedObject.java (rev 0)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/DeletedObject.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -0,0 +1,22 @@
+package com.metamatrix.connector.salesforce.execution;
+
+import java.util.Calendar;
+
+public class DeletedObject {
+
+ String ID;
+ Calendar deletedDate;
+
+ public String getID() {
+ return ID;
+ }
+ public void setID(String id) {
+ ID = id;
+ }
+ public Calendar getDeletedDate() {
+ return deletedDate;
+ }
+ public void setDeletedDate(Calendar deletedDate) {
+ this.deletedDate = deletedDate;
+ }
+}
Added: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/DeletedResult.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/DeletedResult.java (rev 0)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/DeletedResult.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -0,0 +1,36 @@
+package com.metamatrix.connector.salesforce.execution;
+
+import java.util.Calendar;
+import java.util.List;
+
+public class DeletedResult {
+
+ private Calendar latestDateCovered;
+ private Calendar earliestDateAvailable;
+ private List<DeletedObject> resultRecords;
+
+ public Calendar getLatestDateCovered() {
+ return latestDateCovered;
+ }
+
+ public void setLatestDateCovered(Calendar latestDateCovered) {
+ this.latestDateCovered = latestDateCovered;
+ }
+
+
+ public Calendar getEarliestDateAvailable() {
+ return earliestDateAvailable;
+ }
+
+ public void setEarliestDateAvailable(Calendar earliestDateAvailable) {
+ this.earliestDateAvailable = earliestDateAvailable;
+ }
+
+ public void setResultRecords(List<DeletedObject> resultRecords) {
+ this.resultRecords = resultRecords;
+ }
+
+ public List<DeletedObject> getResultRecords() {
+ return resultRecords;
+ }
+}
Added: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/GetDeletedExecutionImpl.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/GetDeletedExecutionImpl.java (rev 0)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/GetDeletedExecutionImpl.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -0,0 +1,95 @@
+package com.metamatrix.connector.salesforce.execution;
+
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.List;
+
+import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.language.IParameter;
+import org.teiid.connector.language.IProcedure;
+
+/**
+ *
+ * The structure of the getDeleted procedure is:
+ * Salesforce object type: String: IN param
+ * startDate: datatime: IN param
+ * enddate: datetime: IN param
+ * earliestDateAvailable: datetime: OUT param
+ * latestDateCovered: datetime: OUT param
+ * getUpdatedResult: resultset: OUT param
+ *
+ */
+
+public class GetDeletedExecutionImpl implements SalesforceProcedureExecution {
+
+ private static final int EARLIESTDATEAVAILABLE = 4;
+ private static final int RESULT = 5;
+
+ private ProcedureExecutionParent parent;
+
+ private DeletedResult deletedResult;
+ private int resultIndex = 0;
+
+ public GetDeletedExecutionImpl(
+ ProcedureExecutionParent procedureExecutionParent) {
+ this.parent = procedureExecutionParent;
+ }
+
+ @Override
+ public void cancel() {
+ // nothing to do here
+
+ }
+
+ @Override
+ public void close() {
+ // nothing to do here
+
+ }
+
+ @Override
+ public void execute(ProcedureExecutionParent procedureExecutionParent) throws ConnectorException {
+ IProcedure command = parent.getCommand();
+ List<IParameter> params = command.getParameters();
+
+ IParameter object = (IParameter) params.get(OBJECT);
+ String objectName = (String) object.getValue();
+
+ IParameter start = (IParameter) params.get(STARTDATE);
+ Timestamp startTime = (Timestamp) start.getValue();
+ Calendar startCalendar = GregorianCalendar.getInstance();
+ startCalendar.setTime(startTime);
+
+ IParameter end = (IParameter) params.get(ENDDATE);
+ Timestamp endTime = (Timestamp) end.getValue();
+ Calendar endCalendar = GregorianCalendar.getInstance();
+ endCalendar.setTime(endTime);
+
+ deletedResult = parent.getConnection().getDeleted(objectName, startCalendar, endCalendar);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<?> getOutputParameterValues() {
+ List result = new ArrayList();
+ result.add(deletedResult.getLatestDateCovered());
+ result.add(deletedResult.getEarliestDateAvailable());
+ return result;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<?> next() {
+ List result = null;
+ if(deletedResult.getResultRecords() != null && resultIndex < deletedResult.getResultRecords().size()){
+ result = new ArrayList(2);
+ result.add(deletedResult.getResultRecords().get(resultIndex).getID());
+ result.add(deletedResult.getResultRecords().get(resultIndex).getDeletedDate());
+ resultIndex++;
+ }
+ return result;
+ }
+
+}
Added: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/GetUpdatedExecutionImpl.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/GetUpdatedExecutionImpl.java (rev 0)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/GetUpdatedExecutionImpl.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -0,0 +1,86 @@
+package com.metamatrix.connector.salesforce.execution;
+
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.List;
+
+import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.language.IParameter;
+import org.teiid.connector.language.IProcedure;
+
+/**
+ *
+ * The structure of the getUpdated procedure is:
+ * Salesforce object type: String: IN param
+ * startDate: datatime: IN param
+ * enddate: datetime: IN param
+ * latestDateCovered: datetime: OUT param
+ * getUpdatedResult: resultset: OUT param
+ *
+ */
+
+public class GetUpdatedExecutionImpl implements SalesforceProcedureExecution {
+
+ private static final int RESULT = 4;
+
+ private ProcedureExecutionParent parent;
+ private UpdatedResult updatedResult;
+ private int idIndex = 0;
+
+ public GetUpdatedExecutionImpl(
+ ProcedureExecutionParent procedureExecutionParent) {
+ this.parent = procedureExecutionParent;
+ }
+
+ @Override
+ public void cancel() {
+ // nothing to do here
+ }
+
+ @Override
+ public void close() {
+ // nothing to do here
+ }
+
+ @Override
+ public void execute(ProcedureExecutionParent procedureExecutionParent) throws ConnectorException {
+ IProcedure command = parent.getCommand();
+ List<IParameter> params = command.getParameters();
+
+ IParameter object = (IParameter) params.get(OBJECT);
+ String objectName = (String) object.getValue();
+
+ IParameter start = (IParameter) params.get(STARTDATE);
+ Timestamp startTime = (Timestamp) start.getValue();
+ Calendar startCalendar = GregorianCalendar.getInstance();
+ startCalendar.setTime(startTime);
+
+ IParameter end = (IParameter) params.get(ENDDATE);
+ Timestamp endTime = (Timestamp) end.getValue();
+ Calendar endCalendar = GregorianCalendar.getInstance();
+ endCalendar.setTime(endTime);
+
+ updatedResult = parent.getConnection().getUpdated(objectName, startCalendar, endCalendar);
+ }
+
+ @Override
+ public List<?> getOutputParameterValues() {
+ List result = new ArrayList(1);
+ result.add(updatedResult.getLatestDateCovered());
+ return result;
+ }
+
+ @Override
+ public List<?> next() {
+ List result = null;
+ if(updatedResult.getIDs() != null && idIndex < updatedResult.getIDs().length){
+ result = new ArrayList(1);
+ result.add(updatedResult.getIDs()[idIndex]);
+ idIndex++;
+ }
+ return result;
+ }
+
+}
Added: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/ProcedureExecutionParent.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/ProcedureExecutionParent.java (rev 0)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/ProcedureExecutionParent.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -0,0 +1,22 @@
+package com.metamatrix.connector.salesforce.execution;
+
+import org.teiid.connector.api.ConnectorEnvironment;
+import org.teiid.connector.api.ExecutionContext;
+import org.teiid.connector.language.IProcedure;
+import org.teiid.connector.metadata.runtime.RuntimeMetadata;
+
+import com.metamatrix.connector.salesforce.connection.SalesforceConnection;
+
+public interface ProcedureExecutionParent {
+
+ public IProcedure getCommand();
+
+ public ExecutionContext getExecutionContext();
+
+ public RuntimeMetadata getMetadata();
+
+ public SalesforceConnection getConnection();
+
+ public ConnectorEnvironment getConectorEnvironment();
+
+}
Added: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/ProcedureExecutionParentImpl.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/ProcedureExecutionParentImpl.java (rev 0)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/ProcedureExecutionParentImpl.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -0,0 +1,105 @@
+package com.metamatrix.connector.salesforce.execution;
+
+import java.util.List;
+
+import org.teiid.connector.api.ConnectorEnvironment;
+import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.api.DataNotAvailableException;
+import org.teiid.connector.api.ExecutionContext;
+import org.teiid.connector.api.ProcedureExecution;
+import org.teiid.connector.language.IProcedure;
+import org.teiid.connector.metadata.runtime.RuntimeMetadata;
+
+import com.metamatrix.connector.salesforce.connection.SalesforceConnection;
+
+public class ProcedureExecutionParentImpl implements ProcedureExecution, ProcedureExecutionParent {
+
+ private IProcedure command;
+ private ExecutionContext executionContext;
+ private RuntimeMetadata metadata;
+ private SalesforceProcedureExecution execution;
+ private SalesforceConnection connection;
+ private ConnectorEnvironment connectorEnv;
+
+ public ProcedureExecutionParentImpl(IProcedure command,
+ SalesforceConnection connection, RuntimeMetadata metadata, ExecutionContext executionContext, ConnectorEnvironment connectorEnv) {
+ this.setCommand(command);
+ this.setConnection(connection);
+ this.setMetadata(metadata);
+ this.setExecutionContext(executionContext);
+ this.setConnectorEnvironment(connectorEnv);
+ }
+
+ @Override
+ public List<?> getOutputParameterValues() throws ConnectorException {
+ return execution.getOutputParameterValues();
+ }
+
+ @Override
+ public List<?> next() throws ConnectorException, DataNotAvailableException {
+ return execution.next();
+ }
+
+ @Override
+ public void cancel() throws ConnectorException {
+ execution.cancel();
+ }
+
+ @Override
+ public void close() throws ConnectorException {
+ execution.close();
+ }
+
+ @Override
+ public void execute() throws ConnectorException {
+ if(getCommand().getProcedureName().endsWith("getUpdated")) {
+ execution = new GetUpdatedExecutionImpl(this);
+ execution.execute(this);
+ }
+ else if(getCommand().getProcedureName().endsWith("getDeleted")) {
+ execution = new GetDeletedExecutionImpl(this);
+ execution.execute(this);
+ }
+ }
+
+ public void setCommand(IProcedure command) {
+ this.command = command;
+ }
+
+ public IProcedure getCommand() {
+ return command;
+ }
+
+ private void setConnection(SalesforceConnection connection) {
+ this.connection = connection;
+ }
+
+ public SalesforceConnection getConnection() {
+ return connection;
+ }
+
+ private void setExecutionContext(ExecutionContext executionContext) {
+ this.executionContext = executionContext;
+ }
+
+ public ExecutionContext getExecutionContext() {
+ return executionContext;
+ }
+
+ private void setMetadata(RuntimeMetadata metadata) {
+ this.metadata = metadata;
+ }
+
+ public RuntimeMetadata getMetadata() {
+ return metadata;
+ }
+
+ private void setConnectorEnvironment(ConnectorEnvironment connectorEnv) {
+ this.connectorEnv = connectorEnv;
+ }
+
+ public ConnectorEnvironment getConectorEnvironment() {
+ return connectorEnv;
+ }
+
+}
Added: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/SalesforceProcedureExecution.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/SalesforceProcedureExecution.java (rev 0)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/SalesforceProcedureExecution.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -0,0 +1,24 @@
+package com.metamatrix.connector.salesforce.execution;
+
+import java.util.List;
+
+import org.teiid.connector.api.ConnectorException;
+
+public interface SalesforceProcedureExecution {
+
+ static final int OBJECT = 0;
+ static final int STARTDATE = 1;
+ static final int ENDDATE = 2;
+ static final int LATESTDATECOVERED = 3;
+
+ List<?> getOutputParameterValues();
+
+ List<?> next();
+
+ void cancel();
+
+ void close();
+
+ void execute(ProcedureExecutionParent procedureExecutionParent) throws ConnectorException;
+
+}
Added: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/UpdatedResult.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/UpdatedResult.java (rev 0)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/UpdatedResult.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -0,0 +1,25 @@
+package com.metamatrix.connector.salesforce.execution;
+
+import java.util.Calendar;
+
+public class UpdatedResult {
+
+ private Calendar latestDateCovered;
+ private String[] IDs;
+
+ public Calendar getLatestDateCovered() {
+ return latestDateCovered;
+ }
+
+ public void setLatestDateCovered(Calendar latestDateCovered) {
+ this.latestDateCovered = latestDateCovered;
+ }
+
+ public String[] getIDs() {
+ return IDs;
+ }
+
+ public void setIDs(String[] ids) {
+ this.IDs = ids;
+ }
+}
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/CriteriaVisitor.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/CriteriaVisitor.java 2009-04-24 16:12:37 UTC (rev 842)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/CriteriaVisitor.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -170,7 +170,6 @@
private void appendMultiselectIn(Element column, IInCriteria criteria) throws ConnectorException {
StringBuffer result = new StringBuffer();
- IExpression left = criteria.getLeftExpression();
result.append(column.getNameInSource()).append(SPACE);
if(criteria.isNegated()) {
result.append(EXCLUDES).append(SPACE);
@@ -314,7 +313,7 @@
table = group.getMetadataObject();
String supportsQuery = (String) table.getProperties().get(
"Supports Query");
- if (!Util.convertStringToBoolean(supportsQuery)) {
+ if (!Boolean.valueOf(supportsQuery)) {
throw new ConnectorException(
table.getNameInSource()
+ " "
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/InsertVisitor.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/InsertVisitor.java 2009-04-24 16:12:37 UTC (rev 842)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/InsertVisitor.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -38,7 +38,6 @@
public class InsertVisitor extends CriteriaVisitor {
- List<ConnectorException> exceptions = new ArrayList<ConnectorException>();
List<MessageElement> elements = new ArrayList<MessageElement>();
public InsertVisitor(RuntimeMetadata metadata) {
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/SelectVisitor.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/SelectVisitor.java 2009-04-24 16:12:37 UTC (rev 842)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/SelectVisitor.java 2009-04-24 20:16:30 UTC (rev 843)
@@ -84,14 +84,15 @@
selectSymbolIndexToElement.put(index, element);
selectSymbolNameToIndex .put(element.getNameInSource(), index);
String nameInSource = element.getNameInSource();
- if (nameInSource.equalsIgnoreCase("id")) {
- idIndex = index;
- }
if (null == nameInSource || nameInSource.length() == 0) {
exceptions.add(new ConnectorException(
"name in source is null or empty for column "
+ symbol.toString()));
+ continue;
}
+ if (nameInSource.equalsIgnoreCase("id")) {
+ idIndex = index;
+ }
if (!firstTime) {
selectSymbols.append(", ");
} else {
15 years, 4 months
teiid SVN: r842 - in trunk: client/src/main/java/com/metamatrix/admin/api/exception/security and 24 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-04-24 12:12:37 -0400 (Fri, 24 Apr 2009)
New Revision: 842
Removed:
trunk/console/src/main/java/com/metamatrix/common/callback/UnsupportedCallbackException.java
Modified:
trunk/client/src/main/java/com/metamatrix/admin/api/exception/AdminException.java
trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/InvalidSessionException.java
trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/MetaMatrixSecurityException.java
trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/SessionException.java
trunk/client/src/main/java/com/metamatrix/api/exception/query/QueryParserException.java
trunk/common-core/src/main/java/com/metamatrix/api/exception/MetaMatrixException.java
trunk/common-core/src/main/java/com/metamatrix/core/MetaMatrixCoreException.java
trunk/common-core/src/main/java/com/metamatrix/core/MetaMatrixRuntimeException.java
trunk/common-core/src/test/java/com/metamatrix/api/exception/TestMetaMatrixException.java
trunk/common-core/src/test/java/com/metamatrix/common/types/basic/TestTransforms.java
trunk/common-core/src/test/java/com/metamatrix/common/util/crypto/TestEncryptDecrypt.java
trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/AuthorizationException.java
trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/InvalidPrincipalException.java
trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/InvalidUserException.java
trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/MembershipServiceException.java
trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/MetaMatrixAuthenticationException.java
trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/SessionServiceException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/ConfigurationConnectionException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/DuplicateComponentException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidArgumentException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidComponentException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidComponentIDCharacterException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidComponentIDFormatException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidConfigurationException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidDeployedComponentException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidNameException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidPropertyValueException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidStringValueException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidVersionException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/ZeroLengthComponentIDException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/util/ConfigObjectsNotResolvableException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/util/InvalidConfigurationElementException.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/ConfigurationImportExport.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelperImpl.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelperUtil.java
trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/exception/PermissionNodeException.java
trunk/common-internal/src/main/resources/com/metamatrix/common/config/api/resourcetypemodel.xml
trunk/connector-api/src/main/java/org/teiid/connector/api/ConnectorException.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCExecutionException.java
trunk/console/src/main/java/com/metamatrix/common/callback/CallbackHandler.java
trunk/console/src/main/java/com/metamatrix/toolbox/ui/callback/DialogFactoryCallbackHandler.java
trunk/engine/src/test/java/com/metamatrix/query/processor/eval/TestCriteriaEvaluator.java
trunk/engine/src/test/java/com/metamatrix/query/processor/eval/TestExpressionEvaluator.java
trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java
trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestProjectNode.java
trunk/engine/src/test/java/com/metamatrix/query/resolver/TestFunctionResolving.java
trunk/engine/src/test/java/com/metamatrix/query/resolver/TestResolver.java
trunk/engine/src/test/java/com/metamatrix/query/rewriter/TestQueryRewriter.java
trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/ConfigTransactionException.java
trunk/server/src/main/java/com/metamatrix/platform/security/authorization/spi/AuthorizationSourceConnectionException.java
trunk/server/src/main/java/com/metamatrix/platform/security/authorization/spi/AuthorizationSourceException.java
trunk/server/src/main/java/com/metamatrix/platform/security/membership/spi/MembershipSourceException.java
Log:
TEIID-440: The vendor code is captured on the connector. Specially for the JDBC Connector, it will look on the SQLexception and grab the vendor error code, and pass down to any exception that wraps it. The error code is also part of the exception message.
Modified: trunk/client/src/main/java/com/metamatrix/admin/api/exception/AdminException.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/exception/AdminException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/exception/AdminException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -40,17 +40,7 @@
*/
public abstract class AdminException extends MetaMatrixCoreException {
- /**
- * The error code is initialized to this value.
- * <p>An error code of NO_ERROR_CODE indicates
- * no error code has been set.</p>
- */
- public static final int NO_ERROR_CODE = 0;
-
- // An optional error code
- private int errorCode = NO_ERROR_CODE;
-
- // List of Admin exceptions in
+ // List of Admin exceptions in
// case of multiple failure
private List children;
@@ -83,8 +73,7 @@
* @since 4.3
*/
AdminException(int code, String msg) {
- super(msg);
- this.errorCode = code;
+ super(Integer.toString(code), msg);
}
AdminException(String msg, Throwable cause) {
@@ -92,32 +81,10 @@
}
AdminException(int code, String msg, Throwable cause) {
- super(cause, msg);
- this.errorCode = code;
+ super(cause, Integer.toString(code),msg);
}
/**
- * Get the optional error code. Useful for comparing
- * to a known value.
- * @return the error code.
- * @since 4.3
- */
- public int getCode() {
- return this.errorCode;
- }
-
- /**
- * Check whether an error code has been set on
- * this exception.
- * @return <code>true</code> iff the error
- * code differs from {@link #NO_ERROR_CODE}.
- * @since 4.3
- */
- public boolean hasErrorCode() {
- return this.errorCode != NO_ERROR_CODE;
- }
-
- /**
* Determine whether this exception is representing
* mutliple component failures.
* @return <code>true</code> iff this exception contains multiple
@@ -153,12 +120,4 @@
}
children.add(child);
}
-
- /**
- * @see java.lang.Throwable#getMessage()
- * @since 4.3
- */
- public String getMessage() {
- return (this.errorCode != NO_ERROR_CODE ? "Error Code[" + this.errorCode + "] " : "") + super.getMessage(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
}
Modified: trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/InvalidSessionException.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/InvalidSessionException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/InvalidSessionException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -64,8 +64,7 @@
* @param code The error code
*/
public InvalidSessionException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/MetaMatrixSecurityException.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/MetaMatrixSecurityException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/MetaMatrixSecurityException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -51,8 +51,7 @@
* @param code The error code
*/
public MetaMatrixSecurityException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Constructs an instance of the exception with the specified detail message
Modified: trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/SessionException.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/SessionException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/SessionException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -63,8 +63,7 @@
* @param code The error code
*/
public SessionException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/client/src/main/java/com/metamatrix/api/exception/query/QueryParserException.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/api/exception/query/QueryParserException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/client/src/main/java/com/metamatrix/api/exception/query/QueryParserException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -32,10 +32,6 @@
*/
public class QueryParserException extends QueryProcessingException {
- // Error location, if known
- private int line = -1;
- private int column = -1;
-
/**
* No-arg constructor required by Externalizable semantics.
*/
@@ -83,58 +79,4 @@
public QueryParserException( Throwable e, String code, String message ) {
super( e, code, message );
}
-
- /**
- * Set location of error
- * @param line Line error occurred on in input
- * @param column Column error occurred on in input
- */
- public void setErrorLocation(int line, int column) {
- this.line = line;
- this.column = column;
- }
-
- /**
- * Determine if location of error in string being parsed is known. If
- * so, the line and column can be obtained with getLine() and getColumn().
- * @return True if location is known
- */
- public boolean isLocationKnown() {
- return this.line > -1;
- }
-
- /**
- * Get line error occurred on in string being parsed.
- * @return Line error occurred on in input string
- */
- public int getLine() {
- return this.line;
- }
-
- /**
- * Get column error occurred on in string being parsed.
- * @return Column error occurred on in input string
- */
- public int getColumn() {
- return this.column;
- }
-
- /**
- * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
- */
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- super.readExternal(in);
- line = in.readInt();
- column = in.readInt();
- }
-
- /**
- * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
- */
- public void writeExternal(ObjectOutput out) throws IOException {
- super.writeExternal(out);
- out.writeInt(line);
- out.writeInt(column);
- }
-
}
Modified: trunk/common-core/src/main/java/com/metamatrix/api/exception/MetaMatrixException.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/api/exception/MetaMatrixException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-core/src/main/java/com/metamatrix/api/exception/MetaMatrixException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -43,19 +43,7 @@
* performed by this class.</b></p>
*/
public class MetaMatrixException extends MetaMatrixCoreException {
- //############################################################################################################################
- //# Variables #
- //############################################################################################################################
- /** An error code. */
- private String code;
-
- private String msg;
-
- //############################################################################################################################
- //# Constructors #
- //############################################################################################################################
-
/**
* No-arg Constructor
*/
@@ -69,7 +57,6 @@
*/
public MetaMatrixException(final String message) {
super(message);
- setMessage(message);
}
/**
@@ -78,8 +65,7 @@
* @param message The error message
*/
public MetaMatrixException(final String code, final String message) {
- this(message);
- setCode(code);
+ super(code, message);
}
/**
@@ -100,12 +86,6 @@
*/
public MetaMatrixException(final Throwable e, final String message) {
super(e, message);
- if (e instanceof MetaMatrixException) {
- setCode(((MetaMatrixException) e).getCode());
- } else if (e instanceof MetaMatrixRuntimeException) {
- setCode(((MetaMatrixRuntimeException) e).getCode());
- }
- setMessage(message);
}
/**
@@ -117,9 +97,7 @@
* @param message The error message
*/
public MetaMatrixException(final Throwable e, final String code, final String message) {
- this(e, message);
- // Overwrite code set in other ctor from exception.
- setCode(code);
+ super(e, code, message);
}
//############################################################################################################################
@@ -136,15 +114,6 @@
}
/**
- * Get the error code.
- *
- * @return The error code
- */
- public String getCode() {
- return this.code;
- }
-
- /**
* Returns the error message, formatted for output. <P>
*
* The default formatting provided by this method is to prepend the
@@ -195,31 +164,7 @@
return buf.toString();
}
- /* (non-Javadoc)
- * @see java.lang.Throwable#getMessage()
- */
- public String getMessage() {
- return this.msg;
- }
-
/**
- * Set the error code.
- *
- * @param code The error code
- */
- public void setCode(String code) {
- this.code = code;
- }
-
- /**
- * Just set this exceptions' message.
- * @param message
- */
- private void setMessage(String message) {
- this.msg = message;
- }
-
- /**
* Returns a string representation of this class.
*
* @return String representation of instance
@@ -228,23 +173,6 @@
return getFullMessage();
}
-
- /**
- * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
- */
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- code = (String)in.readObject();
- msg = (String)in.readObject();
- }
-
- /**
- * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
- */
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeObject(code);
- out.writeObject(msg);
- }
-
} // END CLASS
Modified: trunk/common-core/src/main/java/com/metamatrix/core/MetaMatrixCoreException.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/core/MetaMatrixCoreException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-core/src/main/java/com/metamatrix/core/MetaMatrixCoreException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -22,8 +22,15 @@
package com.metamatrix.core;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.sql.SQLException;
+import com.metamatrix.api.exception.MetaMatrixException;
+
+
/**
* Exception which occurs if an error occurs within the server that is not
* business-related. For instance, if a service or bean is not available
@@ -31,6 +38,8 @@
*/
public class MetaMatrixCoreException extends Exception {
+ protected String code;
+
public MetaMatrixCoreException() {
}
@@ -38,12 +47,44 @@
super(message);
}
+ public MetaMatrixCoreException(String errorCode, String message) {
+ super(message);
+ this.code = errorCode;
+ }
+
+
public MetaMatrixCoreException(Throwable e) {
- this(e, e.getMessage());
+ this(e, e.getMessage());
}
public MetaMatrixCoreException(Throwable e, String message) {
super(message, e);
+ setCode(e);
}
+ public MetaMatrixCoreException(Throwable e, String errorCode, String message) {
+ super(message, e);
+ this.code = errorCode;
+ }
+
+ public String getCode() {
+ return this.code;
+ }
+
+ private void setCode(Throwable e) {
+ if (e instanceof MetaMatrixCoreException) {
+ this.code = (((MetaMatrixCoreException) e).getCode());
+ } else if (e instanceof MetaMatrixRuntimeException) {
+ this.code = ((MetaMatrixRuntimeException) e).getCode();
+ } else if (e instanceof SQLException) {
+ this.code = Integer.toString(((SQLException)e).getErrorCode());
+ }
+ }
+
+ public String getMessage() {
+ if (code == null || code.length() == 0) {
+ return super.getMessage();
+ }
+ return "Error Code:"+code+" Message:"+super.getMessage(); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
Modified: trunk/common-core/src/main/java/com/metamatrix/core/MetaMatrixRuntimeException.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/core/MetaMatrixRuntimeException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-core/src/main/java/com/metamatrix/core/MetaMatrixRuntimeException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -24,6 +24,7 @@
import java.io.PrintStream;
import java.io.PrintWriter;
+import java.sql.SQLException;
import com.metamatrix.api.exception.MetaMatrixException;
import com.metamatrix.core.util.MetaMatrixExceptionUtil;
@@ -123,10 +124,8 @@
* @param message The error message or a resource bundle key
*/
public MetaMatrixRuntimeException(final Throwable e, final String message) {
- this(e, 0,message);
- if (e instanceof MetaMatrixRuntimeException) {
- setCode(((MetaMatrixRuntimeException)e).getCode());
- }
+ super(message, e);
+ setCode(e);
}
/**
@@ -151,7 +150,7 @@
* @param message The error message
*/
public MetaMatrixRuntimeException(final Throwable e, final String code, final String message) {
- this(e, message);
+ super(message, e);
// Overwrite code set in other ctor from exception.
setCode(code);
}
@@ -202,14 +201,23 @@
*
* @param code The error code
*/
- public void setCode( int code ) {
+ private void setCode( int code ) {
this.code = Integer.toString(code);
}
- public void setCode( String code ) {
+ private void setCode( String code ) {
this.code = code;
}
+ private void setCode(Throwable e) {
+ if (e instanceof MetaMatrixCoreException) {
+ this.code = (((MetaMatrixCoreException) e).getCode());
+ } else if (e instanceof MetaMatrixRuntimeException) {
+ this.code = ((MetaMatrixRuntimeException) e).getCode();
+ } else if (e instanceof SQLException) {
+ this.code = Integer.toString(((SQLException)e).getErrorCode());
+ }
+ }
/**
* Returns a string representation of this class.
Modified: trunk/common-core/src/test/java/com/metamatrix/api/exception/TestMetaMatrixException.java
===================================================================
--- trunk/common-core/src/test/java/com/metamatrix/api/exception/TestMetaMatrixException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-core/src/test/java/com/metamatrix/api/exception/TestMetaMatrixException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -74,7 +74,7 @@
final MetaMatrixException err = new MetaMatrixException("Code", "Test"); //$NON-NLS-1$ //$NON-NLS-2$
assertNull(err.getChild());
assertEquals("Code", err.getCode()); //$NON-NLS-1$
- assertEquals("Test", err.getMessage()); //$NON-NLS-1$
+ assertEquals("Error Code:Code Message:Test", err.getMessage()); //$NON-NLS-1$
}
@@ -83,7 +83,7 @@
final MetaMatrixException err = new MetaMatrixException(child, "Test"); //$NON-NLS-1$
assertSame(child, err.getChild());
assertEquals("propertyValuePhrase", err.getCode()); //$NON-NLS-1$
- assertEquals("Test", err.getMessage()); //$NON-NLS-1$
+ assertEquals("Error Code:propertyValuePhrase Message:Test", err.getMessage()); //$NON-NLS-1$
}
@@ -92,7 +92,7 @@
final MetaMatrixException err = new MetaMatrixException(child, "Code", "Test"); //$NON-NLS-1$ //$NON-NLS-2$
assertSame(child, err.getChild());
assertEquals("Code", err.getCode()); //$NON-NLS-1$
- assertEquals("Test", err.getMessage()); //$NON-NLS-1$
+ assertEquals("Error Code:Code Message:Test", err.getMessage()); //$NON-NLS-1$
}
}
Modified: trunk/common-core/src/test/java/com/metamatrix/common/types/basic/TestTransforms.java
===================================================================
--- trunk/common-core/src/test/java/com/metamatrix/common/types/basic/TestTransforms.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-core/src/test/java/com/metamatrix/common/types/basic/TestTransforms.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -198,7 +198,7 @@
transform.transform("1"); //$NON-NLS-1$
fail("expected exception"); //$NON-NLS-1$
} catch (TransformationException e) {
- assertEquals("Invalid conversion from type class java.lang.Object with value '1' to type class java.sql.Time", e.getMessage()); //$NON-NLS-1$
+ assertEquals("Error Code:ERR.003.029.0025 Message:Invalid conversion from type class java.lang.Object with value '1' to type class java.sql.Time", e.getMessage()); //$NON-NLS-1$
}
}
Modified: trunk/common-core/src/test/java/com/metamatrix/common/util/crypto/TestEncryptDecrypt.java
===================================================================
--- trunk/common-core/src/test/java/com/metamatrix/common/util/crypto/TestEncryptDecrypt.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-core/src/test/java/com/metamatrix/common/util/crypto/TestEncryptDecrypt.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -174,7 +174,7 @@
encryptor.encrypt( "" ); //$NON-NLS-1$
fail("expected exception"); //$NON-NLS-1$
} catch ( CryptoException e ) {
- assertEquals("Attempt to encrypt zero-length cleartext.", e.getMessage()); //$NON-NLS-1$
+ assertEquals("Error Code:ERR.003.030.0073 Message:Attempt to encrypt zero-length cleartext.", e.getMessage()); //$NON-NLS-1$
}
}
@@ -191,7 +191,7 @@
encryptor.encrypt( (String)null );
fail("expected exception"); //$NON-NLS-1$
} catch ( CryptoException e ) {
- assertEquals("Attempt to encrypt null cleartext.", e.getMessage()); //$NON-NLS-1$
+ assertEquals("Error Code:ERR.003.030.0072 Message:Attempt to encrypt null cleartext.", e.getMessage()); //$NON-NLS-1$
}
}
Modified: trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/AuthorizationException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/AuthorizationException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/AuthorizationException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -64,8 +64,7 @@
* @param code The error code
*/
public AuthorizationException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/InvalidPrincipalException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/InvalidPrincipalException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/InvalidPrincipalException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -68,8 +68,7 @@
* @param code The error code
*/
public InvalidPrincipalException(String code, String message) {
- super(message);
- setCode(code);
+ super(code, message);
}
/**
Modified: trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/InvalidUserException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/InvalidUserException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/InvalidUserException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -66,8 +66,7 @@
* @param code The error code
*/
public InvalidUserException(String code, String message) {
- super(message);
- setCode(code);
+ super(code, message);
}
/**
Modified: trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/MembershipServiceException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/MembershipServiceException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/MembershipServiceException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -65,8 +65,7 @@
* @param code The error code
*/
public MembershipServiceException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/MetaMatrixAuthenticationException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/MetaMatrixAuthenticationException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/MetaMatrixAuthenticationException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -65,8 +65,7 @@
* @param code The error code
*/
public MetaMatrixAuthenticationException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/SessionServiceException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/SessionServiceException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/api/exception/security/SessionServiceException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -64,8 +64,7 @@
* @param code The error code
*/
public SessionServiceException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/ConfigurationConnectionException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/ConfigurationConnectionException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/ConfigurationConnectionException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -64,8 +64,7 @@
* @param code The error code
*/
public ConfigurationConnectionException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/DuplicateComponentException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/DuplicateComponentException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/DuplicateComponentException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -64,8 +64,7 @@
* @param code The error code
*/
public DuplicateComponentException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidArgumentException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidArgumentException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidArgumentException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -64,8 +64,7 @@
* @param code The error code
*/
public InvalidArgumentException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidComponentException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidComponentException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidComponentException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -65,8 +65,7 @@
* @param code The error code
*/
public InvalidComponentException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidComponentIDCharacterException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidComponentIDCharacterException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidComponentIDCharacterException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -63,8 +63,7 @@
* @param code The error code
*/
public InvalidComponentIDCharacterException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidComponentIDFormatException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidComponentIDFormatException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidComponentIDFormatException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -64,8 +64,7 @@
* @param code The error code
*/
public InvalidComponentIDFormatException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidConfigurationException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidConfigurationException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidConfigurationException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -64,8 +64,7 @@
* @param code The error code
*/
public InvalidConfigurationException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidDeployedComponentException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidDeployedComponentException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidDeployedComponentException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -64,8 +64,7 @@
* @param code The error code
*/
public InvalidDeployedComponentException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidNameException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidNameException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidNameException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -65,8 +65,7 @@
* @param code The error code
*/
public InvalidNameException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidPropertyValueException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidPropertyValueException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidPropertyValueException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -63,8 +63,7 @@
* @param code The error code
*/
public InvalidPropertyValueException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidStringValueException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidStringValueException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidStringValueException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -65,8 +65,7 @@
* @param code The error code
*/
public InvalidStringValueException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidVersionException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidVersionException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/InvalidVersionException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -64,8 +64,7 @@
* @param code The error code
*/
public InvalidVersionException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/ZeroLengthComponentIDException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/ZeroLengthComponentIDException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/exceptions/ZeroLengthComponentIDException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -63,8 +63,7 @@
* @param code The error code
*/
public ZeroLengthComponentIDException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/util/ConfigObjectsNotResolvableException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/util/ConfigObjectsNotResolvableException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/util/ConfigObjectsNotResolvableException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -30,12 +30,6 @@
public class ConfigObjectsNotResolvableException extends MetaMatrixException{
- private Object notResolvableObject;
-
- // =========================================================================
- // C O N S T R U C T O R S
- // =========================================================================
-
/**
* No-arg costructor required by Externalizable semantics
*/
@@ -48,10 +42,8 @@
*
* @param message The error message
*/
- public ConfigObjectsNotResolvableException( String message, Object notResolvableObject ) {
+ public ConfigObjectsNotResolvableException( String message) {
super( message );
- this.notResolvableObject = notResolvableObject;
-
}
/**
@@ -60,11 +52,8 @@
* @param message The error message
* @param code The error code
*/
- public ConfigObjectsNotResolvableException( String code, String message, Object notResolvableObject ) {
+ public ConfigObjectsNotResolvableException( String code, String message) {
super( code, message );
- this.notResolvableObject = notResolvableObject;
-
-
}
/**
@@ -72,10 +61,8 @@
*
* @param e An exception to chain to this exception
*/
- public ConfigObjectsNotResolvableException( Throwable e, Object notResolvableObject ) {
+ public ConfigObjectsNotResolvableException( Throwable e) {
super(e);
- this.notResolvableObject = notResolvableObject;
-
}
/**
@@ -85,10 +72,8 @@
* @param e An exception to chain to this exception
* @param message The error message
*/
- public ConfigObjectsNotResolvableException( Throwable e, String message, Object notResolvableObject ) {
+ public ConfigObjectsNotResolvableException( Throwable e, String message) {
super(e, message );
- this.notResolvableObject = notResolvableObject;
-
}
/**
@@ -99,33 +84,7 @@
* @param message The error message
* @param code The error code
*/
- public ConfigObjectsNotResolvableException( Throwable e, String code, String message, Object notResolvableObject ) {
+ public ConfigObjectsNotResolvableException( Throwable e, String code, String message) {
super(e, code, message );
- this.notResolvableObject = notResolvableObject;
-
}
-
- public Object getNotResolvableObject() {
- return notResolvableObject;
- }
- /**
- * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
- */
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- super.readExternal(in);
- notResolvableObject = in.readObject();
- }
-
- /**
- * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
- */
- public void writeExternal(ObjectOutput out) throws IOException {
- super.writeExternal(out);
- try {
- out.writeObject(notResolvableObject);
- } catch (Throwable t) {
- out.writeObject(null);
- }
- }
-
}
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/util/InvalidConfigurationElementException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/util/InvalidConfigurationElementException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/util/InvalidConfigurationElementException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -30,12 +30,6 @@
public class InvalidConfigurationElementException extends MetaMatrixException{
- private Object invalidElement;
-
- // =========================================================================
- // C O N S T R U C T O R S
- // =========================================================================
-
/**
* No-Arg Constructor
*/
@@ -47,10 +41,8 @@
*
* @param message The error message
*/
- public InvalidConfigurationElementException( String message, Object invalidElement ) {
+ public InvalidConfigurationElementException( String message) {
super( message );
- this.invalidElement = invalidElement;
-
}
/**
@@ -59,11 +51,8 @@
* @param message The error message
* @param code The error code
*/
- public InvalidConfigurationElementException( String code, String message, Object invalidElement ) {
+ public InvalidConfigurationElementException( String code, String message) {
super( code, message );
- this.invalidElement = invalidElement;
-
-
}
/**
@@ -71,10 +60,8 @@
*
* @param e An exception to chain to this exception
*/
- public InvalidConfigurationElementException( Throwable e, Object invalidElement ) {
+ public InvalidConfigurationElementException( Throwable e) {
super(e);
- this.invalidElement = invalidElement;
-
}
/**
@@ -84,10 +71,8 @@
* @param e An exception to chain to this exception
* @param message The error message
*/
- public InvalidConfigurationElementException( Throwable e, String message, Object invalidElement ) {
+ public InvalidConfigurationElementException( Throwable e, String message) {
super(e, message );
- this.invalidElement = invalidElement;
-
}
/**
@@ -98,33 +83,8 @@
* @param message The error message
* @param code The error code
*/
- public InvalidConfigurationElementException( Throwable e, String code, String message, Object invalidElement ) {
+ public InvalidConfigurationElementException( Throwable e, String code, String message){
super(e, code, message );
- this.invalidElement = invalidElement;
-
}
-
- public Object getInvalidElement() {
- return invalidElement;
- }
-
- /**
- * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
- */
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- super.readExternal(in);
- invalidElement = in.readObject();
- }
- /**
- * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
- */
- public void writeExternal(ObjectOutput out) throws IOException {
- super.writeExternal(out);
- try {
- out.writeObject(invalidElement);
- } catch (Throwable t) {
- out.writeObject(null);
- }
- }
}
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/ConfigurationImportExport.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/ConfigurationImportExport.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/ConfigurationImportExport.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -1295,21 +1295,12 @@
String msg = CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0018, new Object[]
{referencingObject, type, referencedObject} );
- ConfigObjectsNotResolvableException e = new ConfigObjectsNotResolvableException(ErrorMessageKeys.CONFIG_ERR_0018, msg, referencingObject);
+ ConfigObjectsNotResolvableException e = new ConfigObjectsNotResolvableException(ErrorMessageKeys.CONFIG_ERR_0018, msg);
throw e;
}
- private void throwObjectsNotResolvable(Object referencingObject, String type) throws ConfigObjectsNotResolvableException{
- String msg = CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0019, new Object[]
- {referencingObject, type} );
-
- ConfigObjectsNotResolvableException e = new ConfigObjectsNotResolvableException(ErrorMessageKeys.CONFIG_ERR_0019, msg, referencingObject);
-
- throw e;
- }
-
private void checkConfigurationID(ComponentDefn defn, List configurationIDs) throws ConfigObjectsNotResolvableException {
if (!configurationIDs.contains(defn.getConfigurationID())) {
throwObjectsNotResolvable(defn, defn.getConfigurationID(), "configuration object"); //$NON-NLS-1$
@@ -1325,22 +1316,7 @@
}
}
-
-// private void checkForComponentTypeID(ComponentTypeID id, List componentTypeIDs) throws ConfigObjectsNotResolvableException{
-//
-// if (id!=null) {
-// if (!(componentTypeIDs.contains(id))) {
-// throwObjectsNotResolvable(id, "component"); //$NON-NLS-1$
-//
-//// throwConfigObjectsNotResolvableException(id, id);
-// }
-//
-// }
-//
-// }
-
-
protected List[] segregateConfigurationObjects(Collection collection) {
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelperImpl.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelperImpl.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelperImpl.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -548,7 +548,7 @@
Properties props=new Properties();
if (!element.getName().equals(XMLConfig_ElementNames.Header.ELEMENT)) {
- throw new InvalidConfigurationElementException("This is not the header element: " + element.getName() + ".", element); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new InvalidConfigurationElementException("This is not the header element: " + element.getName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
}
List elements = element.getChildren();
@@ -1095,7 +1095,7 @@
Assertion.isNotNull(editor);
if (!element.getName().equals(XMLConfig_ElementNames.Configuration.Host.ELEMENT)) {
- throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0032, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0032, element.getName()), element);
+ throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0032, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0032, element.getName()));
}
if (name == null) {
name = element.getAttributeValue(XMLConfig_ElementNames.Configuration.Host.Attributes.NAME);
@@ -1213,7 +1213,7 @@
Assertion.isNotNull(editor);
if (!element.getName().equals(XMLConfig_ElementNames.Configuration.AuthenticationProviders.Provider.ELEMENT)) {
- throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0033, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0033, element.getName()), element);
+ throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0033, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0033, element.getName()));
}
String name = element.getAttributeValue(XMLConfig_ElementNames.Configuration.AuthenticationProviders.Provider.Attributes.NAME);
@@ -1280,7 +1280,7 @@
Assertion.isNotNull(editor);
if (!element.getName().equals(XMLConfig_ElementNames.Configuration.Resources.Resource.ELEMENT)) {
- throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0034, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0034, element.getName()), element);
+ throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0034, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0034, element.getName()));
}
String name = element.getAttributeValue(XMLConfig_ElementNames.Configuration.Resources.Resource.Attributes.NAME);
@@ -1335,7 +1335,7 @@
Assertion.isNotNull(editor);
if (!element.getName().equals(XMLConfig_ElementNames.ComponentTypes.ComponentType.ELEMENT)) {
- throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0035, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0035, element.getName()), element);
+ throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0035, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0035, element.getName()));
}
// retreive the attributes of this ComponentType from the JDOM element
@@ -1488,7 +1488,7 @@
Assertion.isNotNull(editor);
if (!element.getName().equals(XMLConfig_ElementNames.Configuration.ELEMENT)) {
- throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0038, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0038, element.getName()), element);
+ throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0038, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0038, element.getName()));
}
if (name==null) {
@@ -1572,7 +1572,7 @@
Assertion.isNotNull(editor);
if (!element.getName().equals(XMLConfig_ElementNames.Configuration.ConnectorComponents.ConnectorComponent.ELEMENT)) {
- throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0041, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0041,element.getName()), element);
+ throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0041, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0041,element.getName()));
}
if (name==null) {
@@ -1646,7 +1646,7 @@
Assertion.isNotNull(configID);
if (!element.getName().equals(XMLConfig_ElementNames.Configuration.Services.Service.ELEMENT)) {
- throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0042, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0042,element.getName()), element);
+ throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0042, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0042,element.getName()));
}
if (name==null) {
@@ -1847,7 +1847,7 @@
DeployedComponent component;
if (!element.getName().equals(XMLConfig_ElementNames.Configuration.DeployedService.ELEMENT)) {
- throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0044, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0044,element.getName()), element);
+ throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0044, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0044,element.getName()));
}
String name = element.getAttributeValue(XMLConfig_ElementNames.Configuration.DeployedService.Attributes.NAME);
@@ -1871,7 +1871,7 @@
}
if (type == null) {
- throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0050, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0050, new Object[] {componentTypeIDString, name} ), element);
+ throw new InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0050, CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0050, new Object[] {componentTypeIDString, name} ));
}
ServiceComponentDefnID svcid = null;
@@ -2099,7 +2099,7 @@
Assertion.isNotNull(configID);
if (!element.getName().equals(XMLConfig_ElementNames.Configuration.Process.ELEMENT)) {
- throw new InvalidConfigurationElementException("A Configuration object cannot be created from a JDOM Element type: " + element.getName() + ".", element); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new InvalidConfigurationElementException("A Configuration object cannot be created from a JDOM Element type: " + element.getName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
}
if (name==null) {
@@ -2138,7 +2138,7 @@
public PropertyDefinition createPropertyDefinition(Element element) throws InvalidConfigurationElementException{
if (!element.getName().equals(XMLConfig_ElementNames.ComponentTypes.ComponentType.ComponentTypeDefn.PropertyDefinition.ELEMENT)) {
- throw new InvalidConfigurationElementException("A Configuration object cannot be created from a JDOM Element type: " + element.getName() + ".", element); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new InvalidConfigurationElementException("A Configuration object cannot be created from a JDOM Element type: " + element.getName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -2167,7 +2167,7 @@
try {
mult = Multiplicity.getInstance(multiplicityString);
}catch(MultiplicityExpressionException e) {
- throw new InvalidConfigurationElementException(e, "The PropertyDefinition object: " + nameString + " could not be created because the multiplicity definition: '" + multiplicityString + " is not a valid multiplicity definition.", element); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ throw new InvalidConfigurationElementException(e, "The PropertyDefinition object: " + nameString + " could not be created because the multiplicity definition: '" + multiplicityString + " is not a valid multiplicity definition."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelperUtil.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelperUtil.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelperUtil.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -49,7 +49,7 @@
Properties props=new Properties();
if (!element.getName().equals(XMLConfig_ElementNames.Header.ELEMENT)) {
- throw new InvalidConfigurationElementException("This is not the header element: " + element.getName() + ".", element); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new InvalidConfigurationElementException("This is not the header element: " + element.getName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
}
List elements = element.getChildren();
Modified: trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/exception/PermissionNodeException.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/exception/PermissionNodeException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/exception/PermissionNodeException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -100,20 +100,4 @@
public String getMessage() {
return super.getMessage() + " Resource: " + this.resourceName; //$NON-NLS-1$
}
- /**
- * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
- */
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- super.readExternal(in);
- resourceName = (String)in.readObject();
- }
-
- /**
- * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
- */
- public void writeExternal(ObjectOutput out) throws IOException {
- super.writeExternal(out);
- out.writeObject(resourceName);
- }
-
}
Modified: trunk/common-internal/src/main/resources/com/metamatrix/common/config/api/resourcetypemodel.xml
===================================================================
--- trunk/common-internal/src/main/resources/com/metamatrix/common/config/api/resourcetypemodel.xml 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/common-internal/src/main/resources/com/metamatrix/common/config/api/resourcetypemodel.xml 2009-04-24 16:12:37 UTC (rev 842)
@@ -34,96 +34,38 @@
</Header>
<ComponentTypes>
<ComponentType Name="XATransactionManager" ComponentTypeCode="4" Deployable="false" Deprecated="false" Monitorable="false">
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="metamatrix.xatxnmgr.log_base_dir" DisplayName="Logging Dir" ShortDescription="The relative location to the Host log directory where transaction logs are stored." DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="true" IsMasked="false" IsModifiable="false" IsPreferred="false"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="metamatrix.xatxnmgr.max_timeout" DisplayName="Txn Timeout" ShortDescription="The default timeout (in milliseconds) for transactions." DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="metamatrix.xatxnmgr.max_log_filesize_in_mb" DisplayName="Log File Size(MB)" ShortDescription="Max transaction console log File size" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="metamatrix.xatxnmgr.max_rolled_log_files" DisplayName="Max Log Files" ShortDescription="The Maximum number of rolled console log files to keep" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="metamatrix.xatxnmgr.separate_log" DisplayName="Separate Log" ShortDescription="Merge Txn Log with process log" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="metamatrix.xatxnmgr.txnstatus_port" DisplayName="Recovery Port" ShortDescription="Transaction Recovery Port (0-any available port)" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
- </ComponentTypeDefn>
- <ChangeHistory>
- <Property Name="LastChangedBy">ConfigurationStartup</Property>
- <Property Name="CreatedBy">ConfigurationStartup</Property>
- </ChangeHistory>
+ <PropertyDefinition Name="metamatrix.xatxnmgr.log_base_dir" DisplayName="Logging Dir" ShortDescription="The relative location to the Host log directory where transaction logs are stored." DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="true" IsMasked="false" IsModifiable="false" IsPreferred="false"/>
+ <PropertyDefinition Name="metamatrix.xatxnmgr.max_timeout" DisplayName="Txn Timeout" ShortDescription="The default timeout (in milliseconds) for transactions." DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
+ <PropertyDefinition Name="metamatrix.xatxnmgr.max_log_filesize_in_mb" DisplayName="Log File Size(MB)" ShortDescription="Max transaction console log File size" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
+ <PropertyDefinition Name="metamatrix.xatxnmgr.max_rolled_log_files" DisplayName="Max Log Files" ShortDescription="The Maximum number of rolled console log files to keep" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
+ <PropertyDefinition Name="metamatrix.xatxnmgr.separate_log" DisplayName="Separate Log" ShortDescription="Merge Txn Log with process log" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
+ <PropertyDefinition Name="metamatrix.xatxnmgr.txnstatus_port" DisplayName="Recovery Port" ShortDescription="Transaction Recovery Port (0-any available port)" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
</ComponentType>
<ComponentType Name="JGroups" ComponentTypeCode="4" Deployable="false" Deprecated="false" Monitorable="false">
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="udp.multicast_supported" DisplayName="Multicast Supported" ShortDescription="Indicates if multicast supported." DefaultValue="true" Multiplicity="1" PropertyType="Boolean" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="udp.mcast_messagebus_port" DisplayName="MessageBus Multicast Port" ShortDescription="The multicast port number." DefaultValue="5555" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="udp.mcast_jndi_port" DisplayName="JNDI Registry Multicast Port" ShortDescription="The multicast port number." DefaultValue="5556" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="udp.mcast_addr" DisplayName="Multicast Address" ShortDescription="The multicast address." DefaultValue="224.30.10.10" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="ping.gossip_host" DisplayName="Ping Host Address" ShortDescription="The host address when multicast is not used." DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="ping.gossip_port" DisplayName="Ping Host Port" ShortDescription="The host port when multicast is not used." DefaultValue="5555" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="ping.gossip_refresh" DisplayName="Ping Gossip Refresh" ShortDescription="Indicates how often the gossip server tries to refresh." DefaultValue="15000" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="ping.gossip_timout" DisplayName="Ping Gossip Timeout" ShortDescription="Indicates how soon the gossip server will timeout." DefaultValue="2000" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="ping.gossip_initialmembers" DisplayName="Ping Gossip Initial Num Mbrs" ShortDescription="Indicates the initial size of members to be joined." DefaultValue="3" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="jgroups.other.channel.settings" DisplayName="JGroups Other Settings" ShortDescription="This is the additional settings when creating the JGroups Channel." DefaultValue="MERGE2(min_interval=5000;max_interval=10000):FD_SOCK:VERIFY_SUSPECT(timeout=1500):pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800):UNICAST(timeout=5000):pbcast.STABLE(desired_avg_gossip=20000):FRAG(frag_size=4096;down_thread=false;up_thread=false):pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true):pbcast.STATE_TRANSFER" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ChangeHistory>
- <Property Name="LastChangedBy">ConfigurationStartup</Property>
- <Property Name="CreatedBy">ConfigurationStartup</Property>
- </ChangeHistory>
+ <PropertyDefinition Name="udp.multicast_supported" DisplayName="Multicast Supported" ShortDescription="Indicates if multicast supported." DefaultValue="true" Multiplicity="1" PropertyType="Boolean" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="udp.mcast_messagebus_port" DisplayName="MessageBus Multicast Port" ShortDescription="The multicast port number." DefaultValue="5555" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="udp.mcast_addr" DisplayName="Multicast Address" ShortDescription="The multicast address." DefaultValue="224.30.10.10" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="ping.gossip_host" DisplayName="Ping Host Address" ShortDescription="The host address when multicast is not used." DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="ping.gossip_port" DisplayName="Ping Host Port" ShortDescription="The host port when multicast is not used." DefaultValue="5555" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="ping.gossip_refresh" DisplayName="Ping Gossip Refresh" ShortDescription="Indicates how often the gossip server tries to refresh." DefaultValue="15000" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="ping.gossip_timout" DisplayName="Ping Gossip Timeout" ShortDescription="Indicates how soon the gossip server will timeout." DefaultValue="2000" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="ping.gossip_initialmembers" DisplayName="Ping Gossip Initial Num Mbrs" ShortDescription="Indicates the initial size of members to be joined." DefaultValue="3" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="jgroups.other.channel.settings" DisplayName="JGroups Other Settings" ShortDescription="This is the additional settings when creating the JGroups Channel." DefaultValue="MERGE2(min_interval=5000;max_interval=10000):FD_SOCK:VERIFY_SUSPECT(timeout=1500):pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800):UNICAST(timeout=5000):pbcast.STABLE(desired_avg_gossip=20000):FRAG(frag_size=4096;down_thread=false;up_thread=false):pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true):pbcast.STATE_TRANSFER" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
</ComponentType>
<ComponentType Name="SSL" ComponentTypeCode="4" Deployable="false" Deprecated="false" Monitorable="false">
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="com.metamatrix.ssl.keystore.filename" DisplayName="Keystore Filename" ShortDescription="Name and location of keystore file." DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="com.metamatrix.ssl.keystore.Password" DisplayName="Keystore Password" ShortDescription="Keystore Password" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="false" IsHidden="false" IsMasked="true" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="com.metamatrix.ssl.keystoretype" DisplayName="KeyStore Type" ShortDescription="Keystore Type" DefaultValue="JKS" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="com.metamatrix.ssl.protocol" DisplayName="SSL Protocol" ShortDescription="SLL Protocol" DefaultValue="SSLv3" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="com.metamatrix.ssl.keymanagementalgorithm" DisplayName="Key Management Algorithm" ShortDescription="Key Management Protocol" DefaultValue="SunX509" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="com.metamatrix.ssl.truststore.filename" DisplayName="TrustStore Filename" ShortDescription="Name and location of truststore file." DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="com.metamatrix.ssl.truststore.Password" DisplayName="TrustStore Password" ShortDescription="TrustStore Password" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="false" IsHidden="false" IsMasked="true" IsModifiable="true" IsPreferred="true"/>
- </ComponentTypeDefn>
- <ComponentTypeDefn Deprecated="false">
- <PropertyDefinition Name="com.metamatrix.ssl.authenticationMode" DisplayName="Authentication Mode" ShortDescription="Prefered authentication mode" DefaultValue="1-way" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true">
- <AllowedValue>anonymous</AllowedValue>
- <AllowedValue>1-way</AllowedValue>
- <AllowedValue>2-way</AllowedValue>
- </PropertyDefinition>
- </ComponentTypeDefn>
+ <PropertyDefinition Name="com.metamatrix.ssl.keystore.filename" DisplayName="Keystore Filename" ShortDescription="Name and location of keystore file." DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="com.metamatrix.ssl.keystore.Password" DisplayName="Keystore Password" ShortDescription="Keystore Password" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="false" IsHidden="false" IsMasked="true" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="com.metamatrix.ssl.keystoretype" DisplayName="KeyStore Type" ShortDescription="Keystore Type" DefaultValue="JKS" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="com.metamatrix.ssl.protocol" DisplayName="SSL Protocol" ShortDescription="SLL Protocol" DefaultValue="SSLv3" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="com.metamatrix.ssl.keymanagementalgorithm" DisplayName="Key Management Algorithm" ShortDescription="Key Management Protocol" DefaultValue="SunX509" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="com.metamatrix.ssl.truststore.filename" DisplayName="TrustStore Filename" ShortDescription="Name and location of truststore file." DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="com.metamatrix.ssl.truststore.Password" DisplayName="TrustStore Password" ShortDescription="TrustStore Password" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="false" IsHidden="false" IsMasked="true" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="com.metamatrix.ssl.authenticationMode" DisplayName="Authentication Mode" ShortDescription="Prefered authentication mode" DefaultValue="1-way" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true">
+ <AllowedValue>anonymous</AllowedValue>
+ <AllowedValue>1-way</AllowedValue>
+ <AllowedValue>2-way</AllowedValue>
+ </PropertyDefinition>
</ComponentType>
</ComponentTypes>
-
</ConfigurationDocument>
Modified: trunk/connector-api/src/main/java/org/teiid/connector/api/ConnectorException.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/api/ConnectorException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/connector-api/src/main/java/org/teiid/connector/api/ConnectorException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -47,6 +47,15 @@
public ConnectorException( String message ) {
super( message );
}
+
+ public ConnectorException( String errorCode, String message ) {
+ super( errorCode, message );
+ }
+
+ public ConnectorException( int errorCode, String message ) {
+ super( Integer.toString(errorCode), message );
+ }
+
/**
* Construct an instance from a message and an exception to chain to this one.
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCExecutionException.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCExecutionException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCExecutionException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -33,9 +33,7 @@
public JDBCExecutionException(SQLException error,
TranslatedCommand... commands) {
- super(commands == null ? error.getMessage() : JDBCPlugin.Util
- .getString("JDBCQueryExecution.Error_executing_query__1", //$NON-NLS-1$
+ super(error.getErrorCode(), commands == null ? error.getMessage() : JDBCPlugin.Util.getString("JDBCQueryExecution.Error_executing_query__1", //$NON-NLS-1$
error.getMessage(), Arrays.toString(commands)));
}
-
}
Modified: trunk/console/src/main/java/com/metamatrix/common/callback/CallbackHandler.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/common/callback/CallbackHandler.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/console/src/main/java/com/metamatrix/common/callback/CallbackHandler.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -49,10 +49,9 @@
* and which contain the information requested to be retrieved or displayed.
* @param source the object that is considered the source of the callbacks.
* @throws IOException if an input or output error occurs
- * @throws UnsupportedCallbackException if the implementation of this method
* does not support one or more of the Callbacks specified in the callbacks parameter
*/
- void handle(Callback callback, Object source) throws IOException, UnsupportedCallbackException;
+ void handle(Callback callback, Object source) throws IOException;
}
Deleted: trunk/console/src/main/java/com/metamatrix/common/callback/UnsupportedCallbackException.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/common/callback/UnsupportedCallbackException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/console/src/main/java/com/metamatrix/common/callback/UnsupportedCallbackException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -1,93 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.common.callback;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import com.metamatrix.api.exception.MetaMatrixException;
-
-/**
- * Exception which occurs if an error occurs within the server that is not
- * business-related. For instance, if a service or bean is not available
- * or communication fails.
- */
-public class UnsupportedCallbackException extends MetaMatrixException {
-
- private Callback callback;
-
- /**
- * No-arg costructor required by Externalizable semantics
- */
- public UnsupportedCallbackException() {
- super();
- }
-
- /**
- * Construct an instance with the message specified.
- * @param callback the callback instance that is not supported
- * @param message A message describing the exception
- */
- public UnsupportedCallbackException( Callback callback, String message ) {
- super( message );
- this.callback = callback;
- }
-
- /**
- * Construct an instance from a message and an exception to chain to this one.
- * @param callback the callback instance that is not supported
- * @param e An exception to nest within this one
- * @param message A message describing the exception
- */
- public UnsupportedCallbackException( Callback callback, Exception e, String message ) {
- super( e, message );
- this.callback = callback;
- }
-
- public Callback getCallback() {
- return this.callback;
- }
-
- /**
- * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
- */
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- super.readExternal(in);
- callback = (Callback)in.readObject();
- }
-
- /**
- * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
- */
- public void writeExternal(ObjectOutput out) throws IOException {
- super.writeExternal(out);
- try {
- out.writeObject(callback);
- } catch (Throwable t) {
- out.writeObject(null);
- }
- }
-
-}
-
Modified: trunk/console/src/main/java/com/metamatrix/toolbox/ui/callback/DialogFactoryCallbackHandler.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/toolbox/ui/callback/DialogFactoryCallbackHandler.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/console/src/main/java/com/metamatrix/toolbox/ui/callback/DialogFactoryCallbackHandler.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -40,7 +40,6 @@
import com.metamatrix.common.callback.Callback;
import com.metamatrix.common.callback.CallbackChoices;
import com.metamatrix.common.callback.CallbackHandler;
-import com.metamatrix.common.callback.UnsupportedCallbackException;
import com.metamatrix.common.object.PropertiedObject;
import com.metamatrix.common.object.PropertiedObjectEditor;
import com.metamatrix.common.object.PropertyDefinitionGroup;
@@ -99,10 +98,9 @@
* and which contain the information requested to be retrieved or displayed.
* @param source the object that is considered the source of the callbacks.
* @throws IOException if an input or output error occurs
- * @throws UnsupportedCallbackException if the implementation of this method
* does not support one or more of the Callbacks specified in the callbacks parameter
*/
- public void handle(Callback callback, Object source) throws IOException, UnsupportedCallbackException {
+ public void handle(Callback callback, Object source) throws IOException {
Assertion.isNotNull(callback);
this.currentCallback = callback;
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/eval/TestCriteriaEvaluator.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/eval/TestCriteriaEvaluator.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/eval/TestCriteriaEvaluator.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -502,7 +502,7 @@
try {
helpTestCompareSubqueryCriteria(crit, false, values);
} catch (CriteriaEvaluationException e) {
- assertEquals("The subquery of this compare criteria has to be scalar, but returned more than one value: e1 = (<undefined>)", e.getMessage()); //$NON-NLS-1$
+ assertEquals("Error Code:ERR.015.006.0056 Message:The subquery of this compare criteria has to be scalar, but returned more than one value: e1 = (<undefined>)", e.getMessage()); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/eval/TestExpressionEvaluator.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/eval/TestExpressionEvaluator.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/eval/TestExpressionEvaluator.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -189,7 +189,7 @@
fail("Exception expected"); //$NON-NLS-1$
} catch (MetaMatrixComponentException e){
//this should be a componentexception, since it is unexpected
- assertEquals(e.getMessage(), "Unable to evaluate e2: No value was available"); //$NON-NLS-1$
+ assertEquals(e.getMessage(), "Error Code:ERR.015.006.0033 Message:Unable to evaluate e2: No value was available"); //$NON-NLS-1$
}
}
@@ -307,7 +307,7 @@
helpTestWithValueIterator(expr, values, null);
fail("Expected ExpressionEvaluationException but got none"); //$NON-NLS-1$
} catch (ExpressionEvaluationException e) {
- assertEquals("Unable to evaluate (<undefined>): The command of this scalar subquery returned more than one value: <undefined>", e.getMessage()); //$NON-NLS-1$
+ assertEquals("Error Code:ERR.015.006.0058 Message:Unable to evaluate (<undefined>): Error Code:ERR.015.006.0058 Message:The command of this scalar subquery returned more than one value: <undefined>", e.getMessage()); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -459,7 +459,7 @@
ProcessorPlan plan = getProcedurePlan(userUpdateStr, metadata);
- helpTestProcessFailure(false, plan, dataMgr, "Error processing the AssignmentStatement in stored procedure language, expected to get a single row of data to be assigned to the variable ROWS_UPDATED but got more."); //$NON-NLS-1$
+ helpTestProcessFailure(false, plan, dataMgr, "Error Code:ERR.015.006.0019 Message:Error processing the AssignmentStatement in stored procedure language, expected to get a single row of data to be assigned to the variable ROWS_UPDATED but got more."); //$NON-NLS-1$
}
// error statement
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestProjectNode.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestProjectNode.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestProjectNode.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -246,7 +246,7 @@
Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
Arrays.asList(new Object[] { "2x" }) }; //$NON-NLS-1$
- String expectedMessage = "Unable to evaluate convert(e1, integer): Error while evaluating function convert"; //$NON-NLS-1$
+ String expectedMessage = "ERROR CODE:ERR.015.001.0003 MESSAGE:Unable to evaluate convert(e1, integer): ERROR CODE:ERR.015.001.0003 MESSAGE:Error while evaluating function convert"; //$NON-NLS-1$
helpTestProjectFails(projectElements, data, elements, expectedMessage);
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/resolver/TestFunctionResolving.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/resolver/TestFunctionResolving.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/engine/src/test/java/com/metamatrix/query/resolver/TestFunctionResolving.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -47,7 +47,7 @@
ResolverVisitor.resolveLanguageObject(function, FakeMetadataFactory.example1Cached());
fail("excpetion expected"); //$NON-NLS-1$
} catch (QueryResolverException err) {
- assertEquals("The conversion from char to date is not allowed.", err.getMessage()); //$NON-NLS-1$
+ assertEquals("Error Code:ERR.015.008.0037 Message:The conversion from char to date is not allowed.", err.getMessage()); //$NON-NLS-1$
}
}
@@ -79,7 +79,7 @@
ResolverVisitor.resolveLanguageObject(function, FakeMetadataFactory.example1Cached());
fail("excpetion expected"); //$NON-NLS-1$
} catch (QueryResolverException err) {
- assertEquals("The function 'LCASE(?)' has more than one possible signature.", err.getMessage()); //$NON-NLS-1$
+ assertEquals("Error Code:ERR.015.008.0036 Message:The function 'LCASE(?)' has more than one possible signature.", err.getMessage()); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/resolver/TestResolver.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/resolver/TestResolver.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/engine/src/test/java/com/metamatrix/query/resolver/TestResolver.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -895,11 +895,11 @@
}
public void testUnknownFunction() {
- helpResolveException("SELECT abc(e1) FROM pm1.g1", "The function 'abc(e1)' is an unknown form. Check that the function name and number of arguments is correct."); //$NON-NLS-1$ //$NON-NLS-2$
+ helpResolveException("SELECT abc(e1) FROM pm1.g1", "Error Code:ERR.015.008.0039 Message:The function 'abc(e1)' is an unknown form. Check that the function name and number of arguments is correct."); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testConversionNotPossible() {
- helpResolveException("SELECT dayofmonth('2002-01-01') FROM pm1.g1", "The function 'dayofmonth('2002-01-01')' is a valid function form, but the arguments do not match a known type signature and cannot be converted using implicit type conversions."); //$NON-NLS-1$ //$NON-NLS-2$
+ helpResolveException("SELECT dayofmonth('2002-01-01') FROM pm1.g1", "Error Code:ERR.015.008.0040 Message:The function 'dayofmonth('2002-01-01')' is a valid function form, but the arguments do not match a known type signature and cannot be converted using implicit type conversions."); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testResolveParameters() {
@@ -1667,7 +1667,7 @@
String userUpdateStr = "UPDATE vm1.g1 SET e1='x'"; //$NON-NLS-1$
helpFailUpdateProcedure(procedure, userUpdateStr,
- FakeMetadataObject.Props.UPDATE_PROCEDURE, "The expressions in this criteria are being compared but are of differing types (boolean and date) and no implicit conversion is available: CHANGING.e4 = {d'2000-01-01'}"); //$NON-NLS-1$
+ FakeMetadataObject.Props.UPDATE_PROCEDURE, "Error Code:ERR.015.008.0027 Message:The expressions in this criteria are being compared but are of differing types (boolean and date) and no implicit conversion is available: CHANGING.e4 = {d'2000-01-01'}"); //$NON-NLS-1$
}
// virtual group elements used in procedure(HAS CRITERIA)
@@ -2268,7 +2268,7 @@
procedure = procedure + "ROWS_UPDATED =0;\n"; //$NON-NLS-1$
procedure = procedure + "END\n"; //$NON-NLS-1$
- helpResolveException(procedure, FakeMetadataFactory.example1Cached(), "Unable to resolve update procedure as the virtual group context is ambiguous."); //$NON-NLS-1$
+ helpResolveException(procedure, FakeMetadataFactory.example1Cached(), "Error Code:ERR.015.008.0012 Message:Unable to resolve update procedure as the virtual group context is ambiguous."); //$NON-NLS-1$
}
public void testDefect14912_CreateUpdateProcedure57_FunctionWithElementParamInAssignmentStatement() {
@@ -2337,7 +2337,7 @@
procedure = procedure + "END\n"; //$NON-NLS-1$
QueryMetadataInterface metadata = exampleStoredProcedure(procedure);
- helpResolveException("EXEC pm1.sq1(1)", metadata, "INSERT statement must have the same number of elements and values specified. This statement has 0 elements and 0 values."); //$NON-NLS-1$ //$NON-NLS-2$
+ helpResolveException("EXEC pm1.sq1(1)", metadata, "Error Code:ERR.015.008.0010 Message:INSERT statement must have the same number of elements and values specified. This statement has 0 elements and 0 values."); //$NON-NLS-1$ //$NON-NLS-2$
}
private QueryMetadataInterface exampleStoredProcedure(String procedure) {
@@ -2522,7 +2522,7 @@
}
public void testFailedConversion_defect9725() throws Exception{
- helpResolveException("select * from pm3.g1 where pm3.g1.e4 > {b 'true'}", "The expressions in this criteria are being compared but are of differing types (timestamp and boolean) and no implicit conversion is available: pm3.g1.e4 > TRUE"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpResolveException("select * from pm3.g1 where pm3.g1.e4 > {b 'true'}", "Error Code:ERR.015.008.0027 Message:The expressions in this criteria are being compared but are of differing types (timestamp and boolean) and no implicit conversion is available: pm3.g1.e4 > TRUE"); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
@@ -3043,11 +3043,11 @@
* the group g1 is not known to the order by clause of a union
*/
public void testUnionOrderByFail() {
- helpResolveException("SELECT pm1.g1.e1 FROM pm1.g1 UNION SELECT pm1.g2.e1 FROM pm1.g2 ORDER BY g1.e1", "Element 'g1.e1' in ORDER BY was not found in SELECT clause."); //$NON-NLS-1$ //$NON-NLS-2$
+ helpResolveException("SELECT pm1.g1.e1 FROM pm1.g1 UNION SELECT pm1.g2.e1 FROM pm1.g2 ORDER BY g1.e1", "Error Code:ERR.015.008.0043 Message:Element 'g1.e1' in ORDER BY was not found in SELECT clause."); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testUnionOrderByFail1() {
- helpResolveException("SELECT pm1.g1.e1 FROM pm1.g1 UNION SELECT pm1.g2.e1 FROM pm1.g2 ORDER BY pm1.g1.e1", "Element 'pm1.g1.e1' in ORDER BY was not found in SELECT clause."); //$NON-NLS-1$ //$NON-NLS-2$
+ helpResolveException("SELECT pm1.g1.e1 FROM pm1.g1 UNION SELECT pm1.g2.e1 FROM pm1.g2 ORDER BY pm1.g1.e1", "Error Code:ERR.015.008.0043 Message:Element 'pm1.g1.e1' in ORDER BY was not found in SELECT clause."); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testOrderByPartiallyQualified() {
@@ -3718,7 +3718,7 @@
}
public void testParameterError() throws Exception {
- helpResolveException("EXEC pm1.sp2(1, 2)", metadata, "Incorrect number of parameters specified on the stored procedure pm1.sp2 - expected 1 but got 2"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpResolveException("EXEC pm1.sp2(1, 2)", metadata, "Error Code:ERR.015.008.0007 Message:Incorrect number of parameters specified on the stored procedure pm1.sp2 - expected 1 but got 2"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testUnionOfAliasedLiteralsGetsModified() {
@@ -3845,7 +3845,7 @@
procedure = procedure + "DECLARE string VARIABLES.X = 1;\n"; //$NON-NLS-1$
procedure = procedure + "END\n"; //$NON-NLS-1$
- helpResolveException(procedure, "Unable to resolve element: VARIABLES.X"); //$NON-NLS-1$
+ helpResolveException(procedure, "Error Code:ERR.015.008.0019 Message:Unable to resolve element: VARIABLES.X"); //$NON-NLS-1$
}
public void testCreate() {
@@ -4239,7 +4239,7 @@
public void testLookupWithoutConstant() throws Exception{
String sql = "SELECT lookup('pm1.g1', convert('e3', float), 'e2', e2) FROM pm1.g1"; //$NON-NLS-1$
- helpResolveException(sql, metadata, "The first three arguments for the LOOKUP function must be specified as constants."); //$NON-NLS-1$
+ helpResolveException(sql, metadata, "Error Code:ERR.015.008.0063 Message:The first three arguments for the LOOKUP function must be specified as constants."); //$NON-NLS-1$
}
/**
@@ -4284,19 +4284,19 @@
public void testUpdateError() {
String userUpdateStr = "UPDATE vm1.g2 SET e1='x'"; //$NON-NLS-1$
- helpResolveException(userUpdateStr, metadata, "Update is not allowed on the virtual group vm1.g2: no Update procedure was defined."); //$NON-NLS-1$
+ helpResolveException(userUpdateStr, metadata, "Error Code:ERR.015.008.0009 Message:Update is not allowed on the virtual group vm1.g2: no Update procedure was defined."); //$NON-NLS-1$
}
public void testInsertError() {
String userUpdateStr = "INSERT into vm1.g2 (e1) values ('x')"; //$NON-NLS-1$
- helpResolveException(userUpdateStr, metadata, "Insert is not allowed on the virtual group vm1.g2: no Insert procedure was defined."); //$NON-NLS-1$
+ helpResolveException(userUpdateStr, metadata, "Error Code:ERR.015.008.0009 Message:Insert is not allowed on the virtual group vm1.g2: no Insert procedure was defined."); //$NON-NLS-1$
}
public void testDeleteError() {
String userUpdateStr = "DELETE from vm1.g2 where e1='x'"; //$NON-NLS-1$
- helpResolveException(userUpdateStr, metadata, "Delete is not allowed on the virtual group vm1.g2: no Delete procedure was defined."); //$NON-NLS-1$
+ helpResolveException(userUpdateStr, metadata, "Error Code:ERR.015.008.0009 Message:Delete is not allowed on the virtual group vm1.g2: no Delete procedure was defined."); //$NON-NLS-1$
}
public void testResolveXMLSelect() {
@@ -4306,13 +4306,13 @@
procedure = procedure + "select VARIABLES.X from xmltest.doc1;\n"; //$NON-NLS-1$
procedure = procedure + "END\n"; //$NON-NLS-1$
- helpResolveException(procedure, "Unable to resolve element: VARIABLES.X"); //$NON-NLS-1$
+ helpResolveException(procedure, "Error Code:ERR.015.008.0019 Message:Unable to resolve element: VARIABLES.X"); //$NON-NLS-1$
}
public void testXMLJoinFail() {
String query = "select * from xmltest.doc1, xmltest.doc1"; //$NON-NLS-1$
- helpResolveException(query, "Only one XML document may be specified in the FROM clause of a query."); //$NON-NLS-1$
+ helpResolveException(query, "Error Code:ERR.015.008.0003 Message:Only one XML document may be specified in the FROM clause of a query."); //$NON-NLS-1$
}
public void testExecProjectedSymbols() {
@@ -4417,13 +4417,13 @@
public void testInsertWithoutColumnsFails() {
String sql = "Insert into pm1.g1 values (1, 2)"; //$NON-NLS-1$
- helpResolveException(sql, "INSERT statement must have the same number of elements and values specified. This statement has 4 elements and 2 values."); //$NON-NLS-1$
+ helpResolveException(sql, "Error Code:ERR.015.008.0010 Message:INSERT statement must have the same number of elements and values specified. This statement has 4 elements and 2 values."); //$NON-NLS-1$
}
public void testInsertWithoutColumnsFails1() {
String sql = "Insert into pm1.g1 values (1, 2, 3, 4)"; //$NON-NLS-1$
- helpResolveException(sql, "Exception converting value 3 of type class java.lang.Integer to expected type class java.lang.Boolean"); //$NON-NLS-1$
+ helpResolveException(sql, "Error Code:ERR.003.029.0011 Message:Exception converting value 3 of type class java.lang.Integer to expected type class java.lang.Boolean"); //$NON-NLS-1$
}
public void testInsertWithQueryFails() {
@@ -4472,11 +4472,11 @@
}
public void testNumberedOrderBy1_4_fails() throws Exception {
- helpResolveException("SELECT pm1.g1.e1 as a, avg(e2) as a FROM pm1.g1 ORDER BY 1", "Element 'a' in ORDER BY is ambiguous and may refer to more than one element of SELECT clause."); //$NON-NLS-1$ //$NON-NLS-2$
+ helpResolveException("SELECT pm1.g1.e1 as a, avg(e2) as a FROM pm1.g1 ORDER BY 1", "Error Code:ERR.015.008.0042 Message:Element 'a' in ORDER BY is ambiguous and may refer to more than one element of SELECT clause."); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testNumberedOrderBy6_fails() throws Exception {
- helpResolveException("SELECT a.e1, b.e1 FROM pm1.g1 AS a, pm1.g1 AS b ORDER BY 2", "Element 'e1' in ORDER BY is ambiguous and may refer to more than one element of SELECT clause."); //$NON-NLS-1$ //$NON-NLS-2$
+ helpResolveException("SELECT a.e1, b.e1 FROM pm1.g1 AS a, pm1.g1 AS b ORDER BY 2", "Error Code:ERR.015.008.0042 Message:Element 'e1' in ORDER BY is ambiguous and may refer to more than one element of SELECT clause."); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testResolveOldProcRelational() {
@@ -4500,7 +4500,7 @@
public void testCallableStatementTooManyParameters() throws Exception {
String sql = "{call pm4.spTest9(?, ?)}"; //$NON-NLS-1$
- TestResolver.helpResolveException(sql, FakeMetadataFactory.exampleBQTCached(), "Incorrect number of parameters specified on the stored procedure pm4.spTest9 - expected 1 but got 2"); //$NON-NLS-1$
+ TestResolver.helpResolveException(sql, FakeMetadataFactory.exampleBQTCached(), "Error Code:ERR.015.008.0007 Message:Incorrect number of parameters specified on the stored procedure pm4.spTest9 - expected 1 but got 2"); //$NON-NLS-1$
}
/**
@@ -4535,7 +4535,7 @@
String userUpdateStr = "UPDATE vm1.g1 SET e1=1"; //$NON-NLS-1$
helpFailUpdateProcedure(procedure, userUpdateStr,
- FakeMetadataObject.Props.UPDATE_PROCEDURE, "Cannot set symbol 'pm1.g1.e4' with expected type double to expression 'convert(var1, string)'"); //$NON-NLS-1$
+ FakeMetadataObject.Props.UPDATE_PROCEDURE, "Error Code:ERR.015.008.0041 Message:Cannot set symbol 'pm1.g1.e4' with expected type double to expression 'convert(var1, string)'"); //$NON-NLS-1$
}
// special variable INPUT compared against invalid type
@@ -4550,7 +4550,7 @@
String userUpdateStr = "UPDATE vm1.g1 SET e1='x'"; //$NON-NLS-1$
helpFailUpdateProcedure(procedure, userUpdateStr,
- FakeMetadataObject.Props.UPDATE_PROCEDURE, "Cannot set symbol 'pm1.g1.e2' with expected type integer to expression 'INPUT.e1'"); //$NON-NLS-1$
+ FakeMetadataObject.Props.UPDATE_PROCEDURE, "Error Code:ERR.015.008.0041 Message:Cannot set symbol 'pm1.g1.e2' with expected type integer to expression 'INPUT.e1'"); //$NON-NLS-1$
}
public void testUpdateSetClauseReferenceType() {
@@ -4566,7 +4566,7 @@
public void testNoTypeCriteria() {
String sql = "select * from pm1.g1 where ? = ?"; //$NON-NLS-1$
- helpResolveException(sql, FakeMetadataFactory.example1Cached(), "Expression '? = ?' has a parameter with non-determinable type information. The use of an explicit convert may be necessary."); //$NON-NLS-1$
+ helpResolveException(sql, FakeMetadataFactory.example1Cached(), "Error Code:ERR.015.008.0026 Message:Expression '? = ?' has a parameter with non-determinable type information. The use of an explicit convert may be necessary."); //$NON-NLS-1$
}
public void testReferenceInSelect() {
@@ -4622,7 +4622,7 @@
// ambiguous, should fail
public void testOrderBy_J658d() {
- helpResolveException("SELECT pm1.g1.e1, e2 as x, e3 as x FROM pm1.g1 ORDER BY x, e1 ", "Element 'x' in ORDER BY is ambiguous and may refer to more than one element of SELECT clause."); //$NON-NLS-1$ //$NON-NLS-2$
+ helpResolveException("SELECT pm1.g1.e1, e2 as x, e3 as x FROM pm1.g1 ORDER BY x, e1 ", "Error Code:ERR.015.008.0042 Message:Element 'x' in ORDER BY is ambiguous and may refer to more than one element of SELECT clause."); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testOrderBy_J658e() {
Query resolvedQuery = (Query) helpResolve("SELECT pm1.g1.e1, e2 as x, e3 as e2 FROM pm1.g1 ORDER BY x, e2 "); //$NON-NLS-1$
Modified: trunk/engine/src/test/java/com/metamatrix/query/rewriter/TestQueryRewriter.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/rewriter/TestQueryRewriter.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/engine/src/test/java/com/metamatrix/query/rewriter/TestQueryRewriter.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -411,7 +411,7 @@
QueryRewriter.rewriteCriteria(origCrit, null, null, null);
fail("Expected failure"); //$NON-NLS-1$
} catch(QueryValidatorException e) {
- assertEquals("Error simplifying criteria: PARSEDATE(pm3.g1.e1, '''') = {d'2003-05-01'}", e.getMessage()); //$NON-NLS-1$
+ assertEquals("Error Code:ERR.015.001.0003 Message:Error simplifying criteria: PARSEDATE(pm3.g1.e1, '''') = {d'2003-05-01'}", e.getMessage()); //$NON-NLS-1$
}
}
@@ -1515,8 +1515,9 @@
try {
QueryRewriter.rewriteCriteria(origCrit, null, null, null);
fail("Expected QueryValidatorException due to divide by 0"); //$NON-NLS-1$
- } catch(QueryValidatorException e) {
- assertEquals("Unable to evaluate (5 / 0): Error while evaluating function /", e.getMessage()); //$NON-NLS-1$
+ } catch(QueryValidatorException e) {
+ // looks like message is being wrapped with another exception with same message
+ assertEquals("Error Code:ERR.015.001.0003 Message:Error Code:ERR.015.001.0003 Message:Unable to evaluate (5 / 0): Error Code:ERR.015.001.0003 Message:Error while evaluating function /", e.getMessage()); //$NON-NLS-1$
}
}
@@ -1529,7 +1530,7 @@
QueryRewriter.rewriteCriteria(origCrit, null, null, null);
fail("Expected QueryValidatorException due to invalid string"); //$NON-NLS-1$
} catch(QueryValidatorException e) {
- assertEquals("Unable to convert 'x' of type [string] to the expected type [integer].", e.getMessage()); //$NON-NLS-1$
+ assertEquals("Error Code:ERR.015.009.0004 Message:Unable to convert 'x' of type [string] to the expected type [integer].", e.getMessage()); //$NON-NLS-1$
}
}
Modified: trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/ConfigTransactionException.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/ConfigTransactionException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/ConfigTransactionException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -29,27 +29,13 @@
import com.metamatrix.common.config.api.exceptions.ConfigurationException;
/**
- * Date Oct 10, 2002
- *
- *
* TransactionException exception indicates that the request cannot be
* executed because of an error with the transaction.
*/
public class ConfigTransactionException extends ConfigurationException {
- //the transState indicates the state of the transaction
- private String transState = ""; //$NON-NLS-1$
-
- public void setTransactionState(String code) {
- this.transState = code;
- }
-
- public String getTransactionState() {
- return this.transState;
- }
-
- /**
+ /**
* Construct an instance with the message and error code specified.
*
* @param message A message describing the exception
@@ -81,22 +67,6 @@
super( e, code, message );
}
- /**
- * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
- */
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- super.readExternal(in);
- transState = (String)in.readObject();
- }
-
- /**
- * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
- */
- public void writeExternal(ObjectOutput out) throws IOException {
- super.writeExternal(out);
- out.writeObject(transState);
- }
-
} // END CLASS
Modified: trunk/server/src/main/java/com/metamatrix/platform/security/authorization/spi/AuthorizationSourceConnectionException.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/authorization/spi/AuthorizationSourceConnectionException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/authorization/spi/AuthorizationSourceConnectionException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -66,8 +66,7 @@
* @param code The error code
*/
public AuthorizationSourceConnectionException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/server/src/main/java/com/metamatrix/platform/security/authorization/spi/AuthorizationSourceException.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/authorization/spi/AuthorizationSourceException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/authorization/spi/AuthorizationSourceException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -71,8 +71,7 @@
* @param code The error code
*/
public AuthorizationSourceException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
Modified: trunk/server/src/main/java/com/metamatrix/platform/security/membership/spi/MembershipSourceException.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/membership/spi/MembershipSourceException.java 2009-04-24 13:12:52 UTC (rev 841)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/membership/spi/MembershipSourceException.java 2009-04-24 16:12:37 UTC (rev 842)
@@ -65,8 +65,7 @@
* @param code The error code
*/
public MembershipSourceException( String code, String message ) {
- super( message );
- setCode( code );
+ super( code, message );
}
/**
* Construct an instance with a linked exception, and an error code and
15 years, 4 months
teiid SVN: r841 - trunk/adminshell/src/main/resources/scripts.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-04-24 09:12:52 -0400 (Fri, 24 Apr 2009)
New Revision: 841
Modified:
trunk/adminshell/src/main/resources/scripts/adminapi.bsh
Log:
Teiid 470 - added new method - addVDB that supports passing in the AdminOptions in order to support multiple options
Modified: trunk/adminshell/src/main/resources/scripts/adminapi.bsh
===================================================================
--- trunk/adminshell/src/main/resources/scripts/adminapi.bsh 2009-04-23 22:44:04 UTC (rev 840)
+++ trunk/adminshell/src/main/resources/scripts/adminapi.bsh 2009-04-24 13:12:52 UTC (rev 841)
@@ -76,6 +76,28 @@
}
/**
+ * Import a {@link VDB} file.
+ * <br>A VDB file with internal definitions. This is the default VDB export configuration
+ * begining with MetaMatrix version 4.3.</br>
+ *
+ * @param name
+ * VDB Name
+ * @param vdbFile
+ * byte array of the VDB Archive
+ * @param AdminOptions that defines the options on how to import the vdb and its related connector bindings.
+ * See {@link AdminOptions}.
+ * @throws AdminException
+ * if there's a system error.
+ * @return the {@link VDB} representing the current property values and runtime state.
+ * @since 6.1.0
+ */
+VDB addVDB(String name, byte[] vdb, AdminOptions options) {
+ debug("Adding VDB " + name);
+ checkAdmin();
+ return currentContext().internalAdmin.addVDB(name, vdb, options);
+}
+
+/**
* Export VDB to a file.
*
* @param name
15 years, 4 months
teiid SVN: r840 - trunk/server/src/main/java/com/metamatrix/common/log/reader.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-04-23 18:44:04 -0400 (Thu, 23 Apr 2009)
New Revision: 840
Modified:
trunk/server/src/main/java/com/metamatrix/common/log/reader/DBLogReader.java
Log:
JBEDSP-803 - this is related to the postgres issue, changed to determine the quote at the initialization of the class instead on every call (getDatabaseMetadata() can be expensive is called on every write)
Modified: trunk/server/src/main/java/com/metamatrix/common/log/reader/DBLogReader.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/log/reader/DBLogReader.java 2009-04-23 22:43:10 UTC (rev 839)
+++ trunk/server/src/main/java/com/metamatrix/common/log/reader/DBLogReader.java 2009-04-23 22:44:04 UTC (rev 840)
@@ -38,6 +38,7 @@
import com.metamatrix.common.CommonPlugin;
import com.metamatrix.common.config.CurrentConfiguration;
import com.metamatrix.common.config.JDBCConnectionPoolHelper;
+import com.metamatrix.common.jdbc.JDBCPlatform;
import com.metamatrix.common.util.ErrorMessageKeys;
import com.metamatrix.common.util.PropertiesUtils;
import com.metamatrix.core.util.DateUtil;
@@ -66,12 +67,11 @@
public static final String DEFAULT_TABLE_NAME = "LOGENTRIES";//$NON-NLS-1$
-
-
-
private Properties properties;
protected String tableName;
+
+ protected String quote=null;
@@ -93,12 +93,25 @@
// Get the table name
this.tableName = properties.getProperty(TABLE_PROPERTY_NAME, DEFAULT_TABLE_NAME );
+
+ Connection connection = null;
+ try {
+ connection = getConnection();
+ quote = JDBCPlatform.getIdentifierQuoteString(connection);
+
+ } catch (SQLException e) {
+ throw new MetaMatrixComponentException(e, ErrorMessageKeys.LOG_ERR_0032, CommonPlugin.Util.getString(ErrorMessageKeys.LOG_ERR_0032, ""));
+ } finally {
+ close(connection);
+ }
+
}
protected Connection getConnection() throws SQLException {
return JDBCConnectionPoolHelper.getInstance().getConnection();
+
}
@@ -136,7 +149,7 @@
try {
//get connection
connection = getConnection();
-
+
//get sql
sqlString = createSQL(startTime, endTime, levels, contexts, maxRows);
@@ -175,7 +188,7 @@
// if we do it in LogEntryPropertyNames.ColumnName.EXCEPTION then
// the console breaks.
if (colName.equals(LogEntryPropertyNames.ColumnName.EXCEPTION)) {
- sql.append('"'+colName+'"');
+ sql.append(quote +colName+ quote);
} else {
sql.append(colName);
}
15 years, 4 months
teiid SVN: r839 - trunk/server/src/main/java/com/metamatrix/common/log.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-04-23 18:43:10 -0400 (Thu, 23 Apr 2009)
New Revision: 839
Modified:
trunk/server/src/main/java/com/metamatrix/common/log/DbLogWriter.java
Log:
JBEDSP-803 - this is related to the postgres issue, changed to determine the quote at the initialization of the class instead on every call (getDatabaseMetadata() can be expensive is called on every write)
Modified: trunk/server/src/main/java/com/metamatrix/common/log/DbLogWriter.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/log/DbLogWriter.java 2009-04-23 21:53:29 UTC (rev 838)
+++ trunk/server/src/main/java/com/metamatrix/common/log/DbLogWriter.java 2009-04-23 22:43:10 UTC (rev 839)
@@ -29,6 +29,7 @@
import java.util.Date;
import java.util.Properties;
+import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.CommonPlugin;
import com.metamatrix.common.config.CurrentConfiguration;
import com.metamatrix.common.config.JDBCConnectionPoolHelper;
@@ -164,6 +165,8 @@
private String insert;
private boolean shutdown = false;
+
+ private String quote = null;
public DbLogWriter(Properties properties) {
@@ -223,6 +226,22 @@
} catch(Exception e) {
// ignore and use default
}
+
+ Connection connection = null;
+ try {
+ connection = JDBCConnectionPoolHelper.getInstance().getConnection();
+ quote = JDBCPlatform.getIdentifierQuoteString(connection);
+
+ } catch (SQLException e) {
+ } finally {
+ if( connection != null ) {
+ try {
+ connection.close();
+ } catch (SQLException e) {
+
+ }
+ }
+ }
}
@@ -275,7 +294,6 @@
insertStr.append(COMMA);
insertStr.append( ColumnName.THREAD );
insertStr.append(COMMA);
- String quote = JDBCPlatform.getIdentifierQuoteString(c);
insertStr.append( quote+ ColumnName.EXCEPTION +quote );
insertStr.append(VALUES);
this.insert = insertStr.toString();
15 years, 4 months
teiid SVN: r838 - trunk/server/src/main/java/com/metamatrix/platform/config/util.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-04-23 17:53:29 -0400 (Thu, 23 Apr 2009)
New Revision: 838
Modified:
trunk/server/src/main/java/com/metamatrix/platform/config/util/CurrentConfigHelper.java
Log:
Teiid-464 - to support shared installation, need the ability to override the default property file to load instead of teiid.properties
Modified: trunk/server/src/main/java/com/metamatrix/platform/config/util/CurrentConfigHelper.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/config/util/CurrentConfigHelper.java 2009-04-23 21:26:48 UTC (rev 837)
+++ trunk/server/src/main/java/com/metamatrix/platform/config/util/CurrentConfigHelper.java 2009-04-23 21:53:29 UTC (rev 838)
@@ -25,6 +25,7 @@
package com.metamatrix.platform.config.util;
import java.io.File;
+import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
@@ -45,13 +46,17 @@
public class CurrentConfigHelper {
public void loadMetaMatrixPropertiesIntoSystem() throws Exception {
- loadMetaMatrixPropertiesIntoSystem("metamatrix.properties"); //$NON-NLS-1$
+ loadMetaMatrixPropertiesIntoSystem(CurrentConfiguration.BOOTSTRAP_FILE_NAME); //$NON-NLS-1$
}
public void loadMetaMatrixPropertiesIntoSystem(String filename) throws Exception {
Properties bootstrapProps = new Properties();
InputStream bootstrapPropStream = this.getClass().getClassLoader().getResourceAsStream(filename);
+ if (bootstrapPropStream == null) {
+ bootstrapPropStream = new FileInputStream(new File(filename));
+
+ }
bootstrapProps.load(bootstrapPropStream);
bootstrapProps.remove(CurrentConfiguration.CONFIGURATION_READER_CLASS_PROPERTY_NAME);
15 years, 4 months
teiid SVN: r837 - in trunk/engine/src/test/java: org/teiid/dqp/internal/process and 1 other directory.
by teiid-commits@lists.jboss.org
Author: loleary
Date: 2009-04-23 17:26:48 -0400 (Thu, 23 Apr 2009)
New Revision: 837
Added:
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatementBatchedUpdate.java
Modified:
trunk/engine/src/test/java/com/metamatrix/query/processor/FakeDataManager.java
trunk/engine/src/test/java/com/metamatrix/query/processor/TestVirtualDepJoin.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
Log:
TEIID-532: Added UnitTests to cover BatchedUpdate within PreparedStatement.
Reviewed by: ghelblin
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/FakeDataManager.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/FakeDataManager.java 2009-04-23 21:24:27 UTC (rev 836)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/FakeDataManager.java 2009-04-23 21:26:48 UTC (rev 837)
@@ -23,6 +23,7 @@
package com.metamatrix.query.processor;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -37,11 +38,14 @@
import com.metamatrix.common.log.LogManager;
import com.metamatrix.query.eval.Evaluator;
import com.metamatrix.query.metadata.TempMetadataID;
+import com.metamatrix.query.sql.lang.BatchedUpdateCommand;
import com.metamatrix.query.sql.lang.Command;
+import com.metamatrix.query.sql.lang.CommandContainer;
import com.metamatrix.query.sql.lang.From;
import com.metamatrix.query.sql.lang.ProcedureContainer;
import com.metamatrix.query.sql.lang.Query;
import com.metamatrix.query.sql.lang.SetQuery;
+import com.metamatrix.query.sql.lang.Update;
import com.metamatrix.query.sql.symbol.AliasSymbol;
import com.metamatrix.query.sql.symbol.ElementSymbol;
import com.metamatrix.query.sql.symbol.GroupSymbol;
@@ -71,7 +75,7 @@
private Map blockedState = new HashMap();
// Track history to verify it later
- private Set queries = new HashSet();
+ private List<String> queries = new ArrayList<String>();
public FakeDataManager() {
}
@@ -80,7 +84,7 @@
* Return string form of all queries run against this FDM
* @return List<String>
*/
- public Set getQueries() {
+ public List<String> getQueries() {
return this.queries;
}
@@ -89,6 +93,7 @@
}
public void closeRequest(Object requestID) {
+ // does nothing?
}
public TupleSource registerRequest(Object processorID, Command command, String modelName, String connectorBindingId, int nodeID)
@@ -96,7 +101,18 @@
LogManager.logTrace(LOG_CONTEXT, new Object[]{"Register Request:", command, ",processorID:", processorID, ",model name:", modelName,",TupleSourceID nodeID:",new Integer(nodeID)}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- queries.add(command.toString());
+
+ if ( command instanceof CommandContainer ) {
+ if ( ((CommandContainer) command).getContainedCommands() != null && ((CommandContainer) command).getContainedCommands().size() > 0 ) {
+ for ( Iterator<Command> it = ((CommandContainer) command).getContainedCommands().iterator(); it.hasNext(); ) {
+ this.queries.add(it.next().toString());
+ }
+ } else {
+ this.queries.add(command.toString());
+ }
+ } else {
+ this.queries.add(command.toString());
+ }
if (ReferenceCollectorVisitor.getReferences(command).size() > 0) {
throw new IllegalArgumentException("Found references in the command registered with the DataManager."); //$NON-NLS-1$
@@ -108,8 +124,14 @@
}else if(command instanceof SetQuery) {
SetQuery union = (SetQuery) command;
group = getQueryGroup(union.getProjectedQuery());
- }else if(command instanceof ProcedureContainer){
- group = ((ProcedureContainer)command).getGroup();
+ } else if (command instanceof ProcedureContainer) {
+ group = ((ProcedureContainer) command).getGroup();
+ } else if ( command instanceof BatchedUpdateCommand ) {
+ if ( ((CommandContainer) command).getContainedCommands() != null && ((CommandContainer) command).getContainedCommands().size() > 0 ) {
+ if ( command.getSubCommands().get(0) instanceof Update ) {
+ group = ((Update)command.getSubCommands().get(0)).getGroup();
+ }
+ }
}
Object groupID = group.getMetadataID();
@@ -121,6 +143,13 @@
List projectedSymbols = command.getProjectedSymbols();
int[] columnMap = getColumnMap(elements, projectedSymbols);
+ /*
+ * updateCommands is used to hold a list of commands that
+ * either came from a BatchedUpdateCommand or a signle
+ * command from an Update command.
+ */
+ List<Update> updateCommands = new ArrayList<Update>();
+
// Apply query criteria to tuples
if(command instanceof Query){
Query query = (Query)command;
@@ -150,6 +179,54 @@
tuples = new List[filteredTuples.size()];
filteredTuples.toArray(tuples);
}
+ } else if ( command instanceof Update ) {
+ // add single update command to a list to be executed
+ updateCommands.add((Update)command);
+ } else if ( command instanceof BatchedUpdateCommand ) {
+ if ( ((CommandContainer) command).getContainedCommands() != null && ((CommandContainer) command).getContainedCommands().size() > 0 )
+ // add all update commands to a list to be executed
+ for ( int i = 0; i < ((CommandContainer) command).getContainedCommands().size(); i++ )
+ if ( ((CommandContainer) command).getContainedCommands().get(i) instanceof Update ) {
+ updateCommands.add(((Update) ((CommandContainer) command).getContainedCommands().get(i)));
+ }
+ }
+
+ // if we had update commands added to the list, execute them now
+ if ( updateCommands.size() > 0 ) {
+ List<List<Integer>> filteredTuples = new ArrayList<List<Integer>>();
+ for ( int c = 0; c < updateCommands.size(); c++ ) {
+ Update update = (Update)updateCommands.get(c);
+ if ( update.getCriteria() != null ) {
+ // Build lookupMap from BOTH all the elements and the projected symbols - both may be needed here
+ Map<Object, Integer> lookupMap = new HashMap<Object, Integer>();
+ for(int i=0; i<elements.size(); i++) {
+ Object element = elements.get(i);
+ mapElementToIndex(lookupMap, element, new Integer(i), group);
+ }
+ for(int i=0; i<projectedSymbols.size(); i++) {
+ Object element = projectedSymbols.get(i);
+ mapElementToIndex(lookupMap, element, new Integer(columnMap[i]), group);
+ }
+
+ int updated = 0;
+ for(int i=0; i<tuples.length; i++) {
+ try {
+ if(new Evaluator(lookupMap, null, null).evaluate(update.getCriteria(), tuples[i])) {
+ updated++;
+ }
+ } catch(CriteriaEvaluationException e) {
+ throw new MetaMatrixComponentException(e, e.getMessage());
+ }
+ }
+ List<Integer> updateTuple = new ArrayList<Integer>(1);
+ updateTuple.add( new Integer(updated) );
+ filteredTuples.add(updateTuple);
+ }
+ }
+ tuples = new List[filteredTuples.size()];
+ filteredTuples.toArray(tuples);
+ elements = new ArrayList<Object>(projectedSymbols);
+ columnMap[0] = 0;
}
FakeTupleSource ts= new FakeTupleSource(elements, tuples, projectedSymbols, columnMap);
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/TestVirtualDepJoin.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/TestVirtualDepJoin.java 2009-04-23 21:24:27 UTC (rev 836)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/TestVirtualDepJoin.java 2009-04-23 21:26:48 UTC (rev 837)
@@ -24,6 +24,7 @@
import java.math.BigDecimal;
import java.sql.SQLException;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
@@ -219,7 +220,7 @@
// Second query *will not be run* as no values were passed and dependent side has always false criteria
// So, the list should contain only the first query
- assertEquals(1, dataManager.getQueries().size());
+ assertEquals(3, dataManager.getQueries().size());
}
public void helpTestVirtualDepJoinSourceSelection(boolean setPushdown) throws Exception {
@@ -389,8 +390,13 @@
// Run query
TestProcessor.helpProcess(plan, context, dataManager, expected);
- assertEquals(new HashSet<String>(Arrays.asList("SELECT g_0.id AS c_0, g_0.amount AS c_1 FROM Europe.CustAccts AS g_0 WHERE g_0.id = 100 ORDER BY c_0", "SELECT g_0.id AS c_0, g_0.first AS c_1, g_0.last AS c_2 FROM CustomerMaster.Customers AS g_0 WHERE g_0.first = 'Miles' ORDER BY c_0")), //$NON-NLS-1$ //$NON-NLS-2$
- dataManager.getQueries());
+ List<String> expectedQueries = new ArrayList<String>(6);
+ for (int i = 0; i < 3; i++) {
+ expectedQueries.add("SELECT g_0.id AS c_0, g_0.first AS c_1, g_0.last AS c_2 FROM CustomerMaster.Customers AS g_0 WHERE g_0.first = 'Miles' ORDER BY c_0"); //$NON-NLS-1$
+ expectedQueries.add("SELECT g_0.id AS c_0, g_0.amount AS c_1 FROM Europe.CustAccts AS g_0 WHERE g_0.id = 100 ORDER BY c_0"); //$NON-NLS-1$
+ }
+
+ assertEquals(expectedQueries, dataManager.getQueries());
}
public void testVirtualDepJoinSelects() throws Exception {
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2009-04-23 21:24:27 UTC (rev 836)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2009-04-23 21:26:48 UTC (rev 837)
@@ -80,38 +80,74 @@
}
static void helpTestProcessing(String preparedSql, List values, List[] expected, QueryMetadataInterface metadata, boolean callableStatement) throws Exception {
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- TestProcessor.sampleData1(dataManager);
-
- helpTestProcessing(preparedSql, values, expected, dataManager, metadata, callableStatement);
+ helpTestProcessing(preparedSql, values, expected, (ProcessorDataManager)null, metadata, callableStatement);
}
static void helpTestProcessing(String preparedSql, List values, List[] expected, ProcessorDataManager dataManager, QueryMetadataInterface metadata, boolean callableStatement) throws Exception {
helpTestProcessing(preparedSql, values, expected, dataManager, metadata, callableStatement, false);
}
- static void helpTestProcessing(String preparedSql, List values, List[] expected, ProcessorDataManager dataManager, QueryMetadataInterface metadata, boolean callableStatement, boolean differentPlan) throws Exception {
- TestablePreparedPlanCache prepPlan = new TestablePreparedPlanCache();
- //Create plan
- PreparedStatementRequest plan = TestPreparedStatement.helpGetProcessorPlan(preparedSql, values, new DefaultCapabilitiesFinder(), metadata, prepPlan, SESSION_ID, callableStatement, false);
+ static void helpTestProcessing(String preparedSql, List values, List[] expected, ProcessorDataManager dataManager, QueryMetadataInterface metadata, boolean callableStatement, boolean isSessionSpecific) throws Exception {
+ helpTestProcessing(preparedSql, values, expected, dataManager, (CapabilitiesFinder)null, metadata, (TestablePreparedPlanCache)null, callableStatement, isSessionSpecific, /* isAlreadyCached */false);
+ }
+
+ static public void helpTestProcessing(String preparedSql, List values, List[] expected, ProcessorDataManager dataManager, CapabilitiesFinder capFinder, QueryMetadataInterface metadata, TestablePreparedPlanCache prepPlanCache, boolean callableStatement, boolean isSessionSpecific, boolean isAlreadyCached) throws Exception {
+ TestablePreparedPlanCache pPlanCache = null;
+ CapabilitiesFinder cFinder = null;
+ ProcessorDataManager dManager = null;
+
+ if ( dataManager == null ) {
+ // Construct data manager with data
+ dManager = new FakeDataManager();
+ TestProcessor.sampleData1((FakeDataManager)dManager);
+ } else dManager = dataManager;
+
+ if ( capFinder == null ) cFinder = new DefaultCapabilitiesFinder();
+ else cFinder = capFinder;
+
+ if ( prepPlanCache == null ) pPlanCache = new TestablePreparedPlanCache();
+ else pPlanCache = prepPlanCache;
+
+ // expected cache hit count
+ int exHitCount = -1;
+
+ /*
+ * If the plan is already cached we want our expected hit
+ * count of the cache to be at least 2 because we will
+ * get the plan twice. Otherwise, we want it to be 1.
+ */
+ if ( isAlreadyCached ) {
+ exHitCount = pPlanCache.hitCount + 2;
+ } else {
+ exHitCount = pPlanCache.hitCount + 1;
+ }
+
+ //Create plan or used cache plan if isPlanCached
+ PreparedStatementRequest plan = TestPreparedStatement.helpGetProcessorPlan(preparedSql, values, cFinder, metadata, pPlanCache, SESSION_ID, callableStatement, false);
// Run query
- TestProcessor.helpProcess(plan.processPlan, plan.context, dataManager, expected);
+ TestProcessor.helpProcess(plan.processPlan, plan.context, dManager, expected);
//test cached plan
- plan = TestPreparedStatement.helpGetProcessorPlan(preparedSql, values, new DefaultCapabilitiesFinder(), metadata, prepPlan, SESSION_ID, callableStatement, false);
+ plan = TestPreparedStatement.helpGetProcessorPlan(preparedSql, values, cFinder, metadata, pPlanCache, SESSION_ID, callableStatement, false);
//make sure the plan is only created once
- assertEquals("should reuse the plan", 1, prepPlan.hitCount); //$NON-NLS-1$
+ assertEquals("should reuse the plan", exHitCount, pPlanCache.hitCount); //$NON-NLS-1$
// Run query again
- TestProcessor.helpProcess(plan.processPlan, plan.context, dataManager, expected);
+ TestProcessor.helpProcess(plan.processPlan, plan.context, dManager, expected);
//get the plan again with a new connection
- assertNotNull(TestPreparedStatement.helpGetProcessorPlan(preparedSql, values, new DefaultCapabilitiesFinder(), metadata, prepPlan, 7, callableStatement, false));
+ assertNotNull(TestPreparedStatement.helpGetProcessorPlan(preparedSql, values, cFinder, metadata, pPlanCache, 7, callableStatement, false));
- assertEquals(differentPlan?1:2, prepPlan.hitCount);
+ /*
+ * If the command is not specific to a session we expect
+ * another hit against the cache because we will use the
+ * cached plan, otherwise, a new plan would have been
+ * created and the hit count will be unchanged.
+ */
+ if ( !isSessionSpecific ) exHitCount++;
+ assertEquals(exHitCount, pPlanCache.hitCount);
}
public void testWhere() throws Exception {
@@ -181,14 +217,14 @@
TestOptimizer.checkNodeTypes(plan.processPlan, TestOptimizer.FULL_PUSHDOWN);
}
- private PreparedStatementRequest helpGetProcessorPlan(String preparedSql, List values, PreparedPlanCache prepPlanCache)
+ static public PreparedStatementRequest helpGetProcessorPlan(String preparedSql, List values, PreparedPlanCache prepPlanCache)
throws MetaMatrixComponentException, QueryParserException,
QueryResolverException, QueryValidatorException,
QueryPlannerException {
return helpGetProcessorPlan(preparedSql, values, new DefaultCapabilitiesFinder(), FakeMetadataFactory.example1Cached(), prepPlanCache, SESSION_ID, false, false);
}
- private PreparedStatementRequest helpGetProcessorPlan(String preparedSql, List values,
+ static public PreparedStatementRequest helpGetProcessorPlan(String preparedSql, List values,
PreparedPlanCache prepPlanCache, int conn)
throws MetaMatrixComponentException, QueryParserException,
QueryResolverException, QueryValidatorException,
@@ -209,6 +245,9 @@
request.setPreparedStatement(true);
request.setCallableStatement(callableStatement);
request.setParameterValues(values);
+ if (values != null && values.size() > 0 && values.get(0) instanceof List) {
+ request.setPreparedBatchUpdate(true);
+ }
if (limitResults) {
request.setRowLimit(1);
}
Added: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatementBatchedUpdate.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatementBatchedUpdate.java (rev 0)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatementBatchedUpdate.java 2009-04-23 21:26:48 UTC (rev 837)
@@ -0,0 +1,252 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.dqp.internal.process;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.teiid.dqp.internal.process.TestPreparedStatement.TestablePreparedPlanCache;
+
+import com.metamatrix.query.optimizer.capabilities.BasicSourceCapabilities;
+import com.metamatrix.query.optimizer.capabilities.FakeCapabilitiesFinder;
+import com.metamatrix.query.optimizer.capabilities.SourceCapabilities.Capability;
+import com.metamatrix.query.processor.FakeDataManager;
+import com.metamatrix.query.processor.TestProcessor;
+import com.metamatrix.query.unittest.FakeMetadataFactory;
+
+/**
+ * JUnit TestCase to test planning and caching of <code>PreparedStatement</code>
+ * plans that contain batched updates.
+ *
+ */
+public class TestPreparedStatementBatchedUpdate extends TestCase {
+
+ public TestPreparedStatementBatchedUpdate(String name) {
+ super(name);
+ }
+
+ /**
+ * Test prepared statements that use batched updates using the same prepared
+ * command with varying number of commands in the batch.
+ * <p>
+ * The test verifies that no errors occur when planning the same batched
+ * command SQL with varying number of batched command parameter value sets.
+ * For example, if the first executeBatch() call were to occur with three
+ * batched commands a repeated call with only two batched commands should
+ * not result in an error.
+ * <p>
+ * The test also verifies that a cached version of the PreparedStatement plan
+ * is used on each subsequent execution of the same SQL command even though
+ * the number of batched commands may vary.
+ * <p>
+ * The batched command "UPDATE pm1.g1 SET pm1.g1.e1=?, pm1.g1.e3=? WHERE pm1.g1.e2=?"
+ * will appear as:
+ * <p>
+ * UPDATE pm1.g1 SET pm1.g1.e1='a', pm1.g1.e3=false WHERE pm1.g1.e2=0
+ * UPDATE pm1.g1 SET pm1.g1.e1=null, pm1.g1.e3=false WHERE pm1.g1.e2=1
+ * <p>
+ * UPDATE pm1.g1 SET pm1.g1.e1='a', pm1.g1.e3=false WHERE pm1.g1.e2=0
+ * <p>
+ * UPDATE pm1.g1 SET pm1.g1.e1='a', pm1.g1.e3=false WHERE pm1.g1.e2=0
+ * UPDATE pm1.g1 SET pm1.g1.e1=null, pm1.g1.e3=false WHERE pm1.g1.e2=1
+ * UPDATE pm1.g1 SET pm1.g1.e1='c', pm1.g1.e3=true WHERE pm1.g1.e2=4
+ * UPDATE pm1.g1 SET pm1.g1.e1='b', pm1.g1.e3=true WHERE pm1.g1.e2=5
+ * <p>
+ * The result should be that only one command is in the plan cache and
+ * no plan creation or validation errors will occur.
+ *
+ * @throws Exception
+ */
+ public void testPlanCache_VarNumCmds() throws Exception {
+ // Create query
+ String preparedSql = "UPDATE pm1.g1 SET pm1.g1.e1=?, pm1.g1.e3=? WHERE pm1.g1.e2=?"; //$NON-NLS-1$
+
+ // Create PrepareedPlanCache
+ PreparedPlanCache prepPlanCache = new PreparedPlanCache();
+
+ // batch with two commands
+ ArrayList<ArrayList<Object>> values = new ArrayList<ArrayList<Object>>(2);
+ values.add( new ArrayList<Object>( Arrays.asList( new Object[] { "a", Boolean.FALSE, new Integer(0) } ) ) ); //$NON-NLS-1$
+ values.add( new ArrayList<Object>( Arrays.asList( new Object[] { null, Boolean.FALSE, new Integer(1) } ) ) );
+
+ //Create plan
+ TestPreparedStatement.helpGetProcessorPlan(preparedSql, values, prepPlanCache);
+
+ // batch with one command
+ values = new ArrayList<ArrayList<Object>>(1);
+ values.add( new ArrayList<Object>( Arrays.asList( new Object[] { "a", Boolean.FALSE, new Integer(0) } ) ) ); //$NON-NLS-1$
+
+ //Create plan
+ TestPreparedStatement.helpGetProcessorPlan(preparedSql, values, prepPlanCache);
+
+ // batch with four commands
+ values = new ArrayList<ArrayList<Object>>(4);
+ values.add( new ArrayList<Object>( Arrays.asList( new Object[] { "a", Boolean.FALSE, new Integer(0) } ) ) ); //$NON-NLS-1$
+ values.add( new ArrayList<Object>( Arrays.asList( new Object[] { null, Boolean.FALSE, new Integer(1) } ) ) );
+ values.add( new ArrayList<Object>( Arrays.asList( new Object[] { "c", Boolean.TRUE, new Integer(4) } ) ) ); //$NON-NLS-1$
+ values.add( new ArrayList<Object>( Arrays.asList( new Object[] { "b", Boolean.TRUE, new Integer(5) } ) ) ); //$NON-NLS-1$
+
+ //Create plan
+ TestPreparedStatement.helpGetProcessorPlan(preparedSql, values, prepPlanCache);
+ assertEquals("PreparedPlanCache size is invalid - ", 1, prepPlanCache.getSpaceUsed() ); //$NON-NLS-1$
+ }
+
+ /**
+ * Test prepared statements that use batched updates using the same prepared
+ * command with varying number of commands in the batch.
+ * <p>
+ * The test verifies that no errors occur when planning and executing the
+ * same batched command SQL with varying number of batched command parameter
+ * value sets. For example, if the first executeBatch() call were to occur
+ * with two batched commands a repeated call with only one batched command
+ * should not result in an error during planning or execution.
+ * <p>
+ * The test also verifies that a cached version of the PreparedStatement plan
+ * is used on each subsequent execution of the same SQL command even though
+ * the number of batched commands may vary.
+ * <p>
+ * The test also verifies that the correct SQL is pushed to the data manager
+ * to verify that the parameter substitution occurred and is correct and the
+ * correct number of statements made it to the data manager for the respective
+ * batch.
+ * <p>
+ * The batched command "UPDATE pm1.g1 SET pm1.g1.e1=?, pm1.g1.e3=? WHERE pm1.g1.e2=?"
+ * will appear as:
+ * <p>
+ * UPDATE pm1.g1 SET pm1.g1.e1='a', pm1.g1.e3=false WHERE pm1.g1.e2=0
+ * UPDATE pm1.g1 SET pm1.g1.e1=null, pm1.g1.e3=false WHERE pm1.g1.e2=1
+ * <p>
+ * UPDATE pm1.g1 SET pm1.g1.e1='a', pm1.g1.e3=false WHERE pm1.g1.e2=0
+ * <p>
+ * UPDATE pm1.g1 SET pm1.g1.e1='a', pm1.g1.e3=false WHERE pm1.g1.e2=0
+ * UPDATE pm1.g1 SET pm1.g1.e1=null, pm1.g1.e3=false WHERE pm1.g1.e2=1
+ * UPDATE pm1.g1 SET pm1.g1.e1='c', pm1.g1.e3=true WHERE pm1.g1.e2=4
+ * UPDATE pm1.g1 SET pm1.g1.e1='b', pm1.g1.e3=true WHERE pm1.g1.e2=5
+ * <p>
+ * The result should be that only one command is in the plan cache and
+ * no plan creation, validation, or execution errors will occur and
+ * a predetermined set of queries were executed in the data manager.
+ *
+ * @throws Exception
+ */
+ public void testProcessor_VarNumCmds() throws Exception {
+ // Create query
+ String preparedSql = "UPDATE pm1.g1 SET pm1.g1.e1=?, pm1.g1.e3=? WHERE pm1.g1.e2=?"; //$NON-NLS-1$
+
+ // Create a testable prepared plan cache
+ TestablePreparedPlanCache prepPlanCache = new TestablePreparedPlanCache();
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ TestProcessor.sampleData1(dataManager);
+
+ // Source capabilities must support batched updates
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.BATCHED_UPDATES, true);
+ caps.setCapabilitySupport(Capability.PREPARED_BATCH_UPDATE, false);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ // Something to hold our final query list
+ List<String> finalQueryList = new ArrayList<String>(42);
+
+ // Create expected results
+ // first command should result in 2 rows affected
+ // second command should result in 2 rows affected
+ List<?>[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(2) })
+ };
+
+ // batch with two commands
+ ArrayList<ArrayList<Object>> values = new ArrayList<ArrayList<Object>>(2);
+ values.add(new ArrayList<Object>(Arrays.asList(new Object[] { "a", Boolean.FALSE, new Integer(0) }))); //$NON-NLS-1$
+ values.add(new ArrayList<Object>(Arrays.asList(new Object[] { null, Boolean.FALSE, new Integer(1) })));
+
+ // Add our expected queries to the final query list
+ for ( int i = 0; i < 6; i++ ) {
+ finalQueryList.add(new String("UPDATE pm1.g1 SET e1 = 'a', e3 = FALSE WHERE pm1.g1.e2 = 0")); //$NON-NLS-1$
+ finalQueryList.add(new String("UPDATE pm1.g1 SET e1 = null, e3 = FALSE WHERE pm1.g1.e2 = 1")); //$NON-NLS-1$
+ }
+
+ // Create the plan and process the query
+ TestPreparedStatement.helpTestProcessing(preparedSql, values, expected, dataManager, capFinder, FakeMetadataFactory.example1Cached(), prepPlanCache, false, false, false);
+
+ // Repeat with different number of commands in batch
+ // Create expected results
+ // first command should result in 2 rows affected
+ expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(2) })
+ };
+
+ // batch with one command
+ values = new ArrayList<ArrayList<Object>>(1);
+ values.add(new ArrayList<Object>(Arrays.asList(new Object[] { "a", Boolean.FALSE, new Integer(0) }))); //$NON-NLS-1$
+
+ // Add our expected queries to the final query list
+ for (int i = 0; i < 6; i++) {
+ finalQueryList.add(new String("UPDATE pm1.g1 SET e1 = 'a', e3 = FALSE WHERE pm1.g1.e2 = 0")); //$NON-NLS-1$
+ }
+
+ // Use the cached plan and process the query
+ TestPreparedStatement.helpTestProcessing(preparedSql, values, expected, dataManager, capFinder, FakeMetadataFactory.example1Cached(), prepPlanCache, false, false, true);
+
+ // Repeat with different number of commands in batch
+ // Create expected results
+ // first command should result in 2 rows affected
+ // second command should result in 2 rows affected
+ // third command should result in 0 rows affected
+ // fourth command should result in 0 rows affected
+ expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(0) })
+ };
+
+ // batch with four commands
+ values = new ArrayList<ArrayList<Object>>(4);
+ values.add(new ArrayList<Object>(Arrays.asList(new Object[] { "a", Boolean.FALSE, new Integer(0)} ))); //$NON-NLS-1$
+ values.add(new ArrayList<Object>(Arrays.asList(new Object[] { null, Boolean.FALSE, new Integer(1)} )));
+ values.add(new ArrayList<Object>(Arrays.asList(new Object[] { "c", Boolean.TRUE, new Integer(4)} ))); //$NON-NLS-1$
+ values.add(new ArrayList<Object>(Arrays.asList(new Object[] { "b", Boolean.TRUE, new Integer(5)} ))); //$NON-NLS-1$
+
+ // Add our expected queries to the final query list
+ for (int i = 0; i < 6; i++) {
+ finalQueryList.add(new String("UPDATE pm1.g1 SET e1 = 'a', e3 = FALSE WHERE pm1.g1.e2 = 0")); //$NON-NLS-1$
+ finalQueryList.add(new String("UPDATE pm1.g1 SET e1 = null, e3 = FALSE WHERE pm1.g1.e2 = 1")); //$NON-NLS-1$
+ finalQueryList.add(new String("UPDATE pm1.g1 SET e1 = 'c', e3 = TRUE WHERE pm1.g1.e2 = 4")); //$NON-NLS-1$
+ finalQueryList.add(new String("UPDATE pm1.g1 SET e1 = 'b', e3 = TRUE WHERE pm1.g1.e2 = 5")); //$NON-NLS-1$
+ }
+
+ TestPreparedStatement.helpTestProcessing(preparedSql, values, expected, dataManager, capFinder, FakeMetadataFactory.example1Cached(), prepPlanCache, false, false, true);
+
+ // Verify all the queries that were run
+ assertNotNull(dataManager);
+ assertEquals("Unexpected queries executed -", finalQueryList, dataManager.getQueries()); //$NON-NLS-1$
+ }
+
+}
Property changes on: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatementBatchedUpdate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 4 months
teiid SVN: r836 - trunk/common-internal/src/main/java/com/metamatrix/common/config.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-04-23 17:24:27 -0400 (Thu, 23 Apr 2009)
New Revision: 836
Modified:
trunk/common-internal/src/main/java/com/metamatrix/common/config/CurrentConfiguration.java
Log:
Teiid-464 - to support shared installation, need the ability to override the default property file to load instead of teiid.properties
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/CurrentConfiguration.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/CurrentConfiguration.java 2009-04-23 20:57:07 UTC (rev 835)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/CurrentConfiguration.java 2009-04-23 21:24:27 UTC (rev 836)
@@ -74,7 +74,10 @@
* </p>
*/
public final class CurrentConfiguration {
- private static final String BOOTSTRAP_FILE_PROPERTY = "teiid.bootstrap.file"; //$NON-NLS-1$
+ /*
+ * This property enables the overriding of the default {@link BOOTSTRAP_FILE_NAME}
+ */
+ public static final String BOOTSTRAP_FILE_PROPERTY_OVERRIDE = "teiid.bootstrap.file"; //$NON-NLS-1$
public static final String BOOTSTRAP_FILE_NAME = "teiid.properties"; //$NON-NLS-1$
public static final String CONFIGURATION_READER_CLASS_PROPERTY_NAME = "metamatrix.config.reader"; //$NON-NLS-1$
@@ -331,7 +334,7 @@
Properties bootstrapProps = new Properties(systemBootStrapProps);
InputStream bootstrapPropStream = null;
- String bootstrapfile = systemBootStrapProps.getProperty(BOOTSTRAP_FILE_PROPERTY, BOOTSTRAP_FILE_NAME);
+ String bootstrapfile = systemBootStrapProps.getProperty(BOOTSTRAP_FILE_PROPERTY_OVERRIDE, BOOTSTRAP_FILE_NAME);
try {
bootstrapPropStream = this.getClass().getClassLoader().getResourceAsStream(bootstrapfile);
if (bootstrapPropStream != null) {
15 years, 4 months
teiid SVN: r835 - trunk/engine/src/main/java/com/metamatrix/query/processor/relational.
by teiid-commits@lists.jboss.org
Author: loleary
Date: 2009-04-23 16:57:07 -0400 (Thu, 23 Apr 2009)
New Revision: 835
Modified:
trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalPlan.java
Log:
TEIID-531: Fixed clone() to check outpuCols to prevent NPE.
Reviewed by: ghelblin
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalPlan.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalPlan.java 2009-04-23 18:52:50 UTC (rev 834)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalPlan.java 2009-04-23 20:57:07 UTC (rev 835)
@@ -24,6 +24,7 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -131,7 +132,7 @@
public Object clone(){
RelationalPlan plan = new RelationalPlan((RelationalNode)root.clone());
- plan.setOutputElements(new ArrayList(outputCols));
+ plan.setOutputElements(new ArrayList(( outputCols != null ? outputCols : Collections.EMPTY_LIST )));
return plan;
}
15 years, 4 months
teiid SVN: r834 - trunk/server/src/main/java/com/metamatrix/platform/config/util.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-04-23 14:52:50 -0400 (Thu, 23 Apr 2009)
New Revision: 834
Modified:
trunk/server/src/main/java/com/metamatrix/platform/config/util/CurrentConfigHelper.java
Log:
Teiid-464 - to support shared installation, need the ability to override the default property file to load instead of teiid.properties
Modified: trunk/server/src/main/java/com/metamatrix/platform/config/util/CurrentConfigHelper.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/config/util/CurrentConfigHelper.java 2009-04-23 18:36:01 UTC (rev 833)
+++ trunk/server/src/main/java/com/metamatrix/platform/config/util/CurrentConfigHelper.java 2009-04-23 18:52:50 UTC (rev 834)
@@ -25,7 +25,6 @@
package com.metamatrix.platform.config.util;
import java.io.File;
-import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
@@ -51,7 +50,8 @@
public void loadMetaMatrixPropertiesIntoSystem(String filename) throws Exception {
Properties bootstrapProps = new Properties();
- InputStream bootstrapPropStream = new FileInputStream(new File(filename));
+ InputStream bootstrapPropStream = this.getClass().getClassLoader().getResourceAsStream(filename);
+
bootstrapProps.load(bootstrapPropStream);
bootstrapProps.remove(CurrentConfiguration.CONFIGURATION_READER_CLASS_PROPERTY_NAME);
15 years, 4 months