husted 2002/11/20 18:06:17
Modified: scaffold/src/java/org/apache/commons/scaffold/util
StorageBean.java ProcessBeanBase.java
ProcessBean.java
Log:
+ StorageBeanBase: Add support for reading command parameters from
a *.param line for each query.
+ StorageBean*: Add paramList property (to ease migration to Commons.SQL)
+ StorageBean*,ProcessBean*: Move Remote* properties to ProcessBean.
+ StorageBeanBase: isNew: change to use String or Number validation
when value is not null; store: Fix to use isNew.
Revision Changes Path
1.7 +16 -3
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/StorageBean.java
Index: StorageBean.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/StorageBean.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- StorageBean.java 31 Oct 2002 14:27:45 -0000 1.6
+++ StorageBean.java 21 Nov 2002 02:06:16 -0000 1.7
@@ -2,6 +2,7 @@
import java.util.Collection;
+import java.util.List;
import java.util.Map;
import org.apache.commons.scaffold.lang.ParameterException;
@@ -9,7 +10,7 @@
import org.apache.commons.scaffold.lang.ResourceException;
-// --------------------------------------------------------------------
+// ------------------------------------------------------------------------ 78
/**
* Describes an implementation of standard Store, Retrieve, and Delete
@@ -130,13 +131,25 @@
/**
* [:TODO: Javadoc]
*/
- public Object[] getParameters(String command);
+ public Object[] getParameters(String command) throws ResourceException;
/**
* [:TODO: Javadoc]
*/
public void setParameters(Object[] parameters);
+
+
+ /**
+ * [:TODO: Javadoc]
+ */
+ public List getParamList(String command) throws ResourceException;
+
+
+ /**
+ * [:TODO: Javadoc]
+ */
+ public void setParamList(List parameters);
/**
1.7 +49 -1
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/ProcessBeanBase.java
Index: ProcessBeanBase.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/ProcessBeanBase.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ProcessBeanBase.java 31 Oct 2002 14:27:45 -0000 1.6
+++ ProcessBeanBase.java 21 Nov 2002 02:06:16 -0000 1.7
@@ -7,6 +7,7 @@
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.scaffold.lang.ChainedException;
+// ------------------------------------------------------------------------ 78
/**
* Base implementation of ProcessBean with default functionality.
@@ -35,6 +36,53 @@
public void setLocale(Locale locale) {
this.locale = locale;
+ }
+
+
+ /**
+ * The remoteNode for this bean instance, if any.
+ */
+ private Integer remoteNode = null;
+
+
+ public Integer getRemoteNode() {
+ return this.remoteNode;
+ }
+
+
+ public void setRemoteNode(Integer remoteNode) {
+ this.remoteNode = remoteNode;
+ }
+
+
+ /**
+ * Set the remoteNode using a String in
+ * the format usually given
+ * by the REMOTE_ADDR CGI variable, or
+ * ServletRequest.getRemoteAddr().
+ * NOTE: <b>not implemented; returns 0</b>.
+ * @returns An Integer value based on RemoteAddr string.
+ */
+ public void setRemoteAddr(String remoteAddr) {
+
+ setRemoteNode(new Integer(0)); // :FIXME:
+
+ }
+
+
+ /**
+ * Return the String representation
+ * of an IP address expressed
+ * as an Integer, into the format usually given
+ * by the REMOTE_ADDR CGI variable, or
+ * ServletRequest.getRemoteAddr().
+ * NOTE: <b>not implemented; returns zeros.</b>
+ * @returns An Integer value based on RemoteAddr string.
+ */
+ public String getRemoteAddr() {
+
+ return new String("000.000.000.000"); // :FIXME:
+
}
1.5 +16 -1
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/ProcessBean.java
Index: ProcessBean.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/ProcessBean.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ProcessBean.java 31 Oct 2002 14:27:45 -0000 1.4
+++ ProcessBean.java 21 Nov 2002 02:06:16 -0000 1.5
@@ -51,6 +51,21 @@
/**
+ * Return the network address of the client for this bean instance.
+ * <p>
+ * @return the network address.
+ */
+ public Integer getRemoteNode();
+
+
+ /**
+ * Set the network address of the client for this bean instance.
+ * @param remoteNode The new remoteNode.
+ */
+ public void setRemoteNode(Integer remoteNode);
+
+
+ /**
* The remote server object for this bean instance, if any.
* <p>
* This is often an application-scope object that can be used
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>