/** * Add this method param to the param list. * @param strParam The param name. * @param strValue The param value. */ public void addParam(String strParam, Map<String,Object> properties) { this.addParam(strParam, (Object)properties); } /**
/** * Add this method param to the param list. * @param strParam The param name. * @param strValue The param value. */ public void addParam(String strParam, boolean bValue) { this.addParam(strParam, bValue ? Constants.TRUE : Constants.FALSE); } /**
/** * Add this method param to the param list. * @param strParam The param name. * @param strValue The param value. */ public void addParam(String strParam, int iValue) { this.addParam(strParam, Integer.toString(iValue)); } /**
/** * Update this filter with this new information. * @param messageFilter The message filter I am updating. * @param properties New filter information (ie, bookmark=345). */ public void updateRemoteFilterProperties(BaseMessageFilter messageFilter, Object[][] properties, Map<String,Object> propFilter) throws RemoteException { BaseTransport transport = this.createProxyTransport(REMOVE_REMOTE_MESSAGE_FILTER); transport.addParam(FILTER, messageFilter); // Don't use COMMAND transport.addParam(PROPERTIES, properties); transport.addParam(MAP, propFilter); transport.sendMessageAndGetReply(); } }
/** * Add this method param to the param list. * @param strParam The param name. * @param strValue The param value. */ public void addParam(String strParam, Object obj) { String strValue = this.objectToString(obj); this.addParam(strParam, strValue); } /**
/** * Create a new remote receive queue. * @param strQueueName The queue name. * @param strQueueType The queue type (see MessageConstants). */ public RemoteReceiveQueue createRemoteReceiveQueue(String strQueueName, String strQueueType) throws RemoteException { BaseTransport transport = this.createProxyTransport(CREATE_REMOTE_RECEIVE_QUEUE); transport.addParam(MessageConstants.QUEUE_NAME, strQueueName); transport.addParam(MessageConstants.QUEUE_TYPE, strQueueType); String strID = (String)transport.sendMessageAndGetReply(); return new ReceiveQueueProxy(this, strID); } /**
/** * Create a new remote send queue. * @param strQueueName The queue name. * @param strQueueType The queue type (see MessageConstants). */ public RemoteSendQueue createRemoteSendQueue(String strQueueName, String strQueueType) throws RemoteException { BaseTransport transport = this.createProxyTransport(CREATE_REMOTE_SEND_QUEUE); transport.addParam(MessageConstants.QUEUE_NAME, strQueueName); transport.addParam(MessageConstants.QUEUE_TYPE, strQueueType); String strID = (String)transport.sendMessageAndGetReply(); return new SendQueueProxy(this, strID); } /**
/** * Set a table property. * @param strProperty The key to set. * @param strValue The value to set it to. */ public void setRemoteProperty(String strProperty, String strValue) throws RemoteException { BaseTransport transport = this.createProxyTransport(SET_REMOTE_PROPERTY); transport.addParam(KEY, strProperty); transport.addParam(VALUE, strValue); Object strReturn = transport.sendMessageAndGetReply(); /*Object objReturn = */transport.convertReturnObject(strReturn); //x this.checkException(objReturn); } /**
/** * Send a remote message. * @param message The message to send. */ public void sendMessage(Message message) throws RemoteException { BaseTransport transport = this.createProxyTransport(SEND_MESSAGE); transport.addParam(MESSAGE, message); // Don't use COMMAND transport.sendMessageAndGetReply(); }
/** * Update the current record. * @param The data to update. * @exception Exception File exception. */ public void set(Object data, int iOpenMode) throws DBException, RemoteException { BaseTransport transport = this.createProxyTransport(SET); transport.addParam(DATA, data); transport.addParam(OPEN_MODE, iOpenMode); Object strReturn = transport.sendMessageAndGetReply(); Object objReturn = transport.convertReturnObject(strReturn); this.checkDBException(objReturn); } /**
/** * Add add this data to the file. * @param data A vector object containing the raw data for the record. * @return A bookmark if there is no penalty (otherwise returns null). * @exception DBException File exception. */ public Object add(Object data, int iOpenMode) throws DBException, RemoteException { BaseTransport transport = this.createProxyTransport(ADD); transport.addParam(DATA, data); transport.addParam(OPEN_MODE, iOpenMode); Object strReturn = transport.sendMessageAndGetReply(); Object objReturn = transport.convertReturnObject(strReturn); return this.checkDBException(objReturn); } /**
/** * Delete the current record. * @param - This is a dummy param, because this call conflicts with a call in EJBHome. * @exception Exception File exception. */ public void remove(Object data, int iOpenMode) throws DBException, RemoteException { BaseTransport transport = this.createProxyTransport(REMOVE); transport.addParam(DATA, data); transport.addParam(OPEN_MODE, iOpenMode); Object strReturn = transport.sendMessageAndGetReply(); Object objReturn = transport.convertReturnObject(strReturn); this.checkDBException(objReturn); } /**
/** * Build a new remote session and initialize it. * NOTE: This is convenience method to create a task below the current APPLICATION (not below this task) * @param properties to create the new remote task * @return The remote Task. */ public RemoteTask createRemoteTask(Map<String, Object> properties) throws RemoteException { // Note: This new task's parent is MY application! BaseTransport transport = this.createProxyTransport(CREATE_REMOTE_TASK); // Don't use my method yet, since I don't have the returned ID transport.addParam(PROPERTIES, properties); String strID = (String)transport.sendMessageAndGetReply(); return new TaskProxy((ApplicationProxy)m_parentProxy, strID); // Note the parent is MY PARENT not ME. (just like the remote hierarchy) } /**
/** * Make a thin FieldList for this table. * Usually used for special queries that don't have a field list available. * @return The new serialized fieldlist. */ public org.jbundle.thin.base.db.FieldList makeFieldList(String strFieldsToInclude) throws RemoteException { BaseTransport transport = this.createProxyTransport(MAKE_FIELD_LIST); transport.addParam(FIELDS, strFieldsToInclude); Object strReturn = transport.sendMessageAndGetReply(); Object objReturn = transport.convertReturnObject(strReturn); return (org.jbundle.thin.base.db.FieldList)objReturn; } /**
/** * Build a new remote session and initialize it. * @param parentSessionObject The parent session for this new session (if null, parent = me). * @param strSessionClassName The class name of the remote session to build. */ public RemoteBaseSession makeRemoteSession(String strSessionClassName) throws RemoteException { BaseTransport transport = this.createProxyTransport(MAKE_REMOTE_SESSION); transport.addParam(NAME, strSessionClassName); String strClassAndID = (String)transport.sendMessageAndGetReply(); return this.checkForSession(strClassAndID); } /**
/** * Constructor. * This constructor auto-sends the task proxy construction info. * @throws RemoteException TODO */ public TaskProxy(ApplicationProxy parentProxy, Map<String,Object> properties) throws RemoteException { this(); BaseTransport transport = parentProxy.createProxyTransport(CREATE_REMOTE_TASK); // Don't use my method yet, since I don't have the returned ID transport.addParam(PROPERTIES, properties); String strID = (String)transport.sendMessageAndGetReply(); this.init(parentProxy, strID); } /**
/** Link the filter to this remote session. * This is a special method that is needed because the remote link is passed a remote reference to the session * even though it is in the same JVM. What you need to do in your implementation is lookup the message filter * and call messageFilter.linkRemoteSession(this); See RemoteSession Object for the Only implementation. * @param messageFilter A serialized copy of the messageFilter to link this session to. */ public org.jbundle.thin.base.message.BaseMessageFilter setupRemoteSessionFilter(org.jbundle.thin.base.message.BaseMessageFilter messageFilter) throws RemoteException { BaseTransport transport = this.createProxyTransport(SETUP_REMOTE_SESSION_FILTER); transport.addParam(FILTER, messageFilter); // Don't use COMMAND Object strReturn = transport.sendMessageAndGetReply(); Object objReturn = transport.convertReturnObject(strReturn); return (org.jbundle.thin.base.message.BaseMessageFilter)objReturn; } }
/** * Get the database properties. * @return The database properties object (Always non-null). */ public void setDBProperties(Map<String, Object> properties) throws DBException, RemoteException { BaseTransport transport = this.createProxyTransport(SET_DB_PROPERTIES); transport.addParam(PROPERTIES, properties); Object strReturn = transport.sendMessageAndGetReply(); Object objReturn = transport.convertReturnObject(strReturn); this.checkDBException(objReturn); } }
/** * Get the DATA_SOURCE_HANDLE to the last modified or added record. * @param iHandleType The type of handle to use. * @return The handle of the last modified record. */ public Object getLastModified(int iHandleType) throws DBException, RemoteException { BaseTransport transport = this.createProxyTransport(GET_LAST_MODIFIED); transport.addParam(TYPE, iHandleType); Object strReturn = transport.sendMessageAndGetReply(); Object objReturn = transport.convertReturnObject(strReturn); return this.checkDBException(objReturn); } /**
/** * Get/Make this remote database session for this table session. * @param properties The client database properties (Typically for transaction support). */ public RemoteDatabase getRemoteDatabase(Map<String, Object> properties) throws RemoteException { BaseTransport transport = this.createProxyTransport(GET_REMOTE_DATABASE); transport.addParam(PROPERTIES, properties); String strRemoteDatabaseID = (String)transport.sendMessageAndGetReply(); // See if I have this one already DatabaseProxy dbProxy = ((TaskProxy)this.getParentProxy()).getDatabaseProxy(strRemoteDatabaseID); if (dbProxy == null) dbProxy = new DatabaseProxy((TaskProxy)this.getParentProxy(), strRemoteDatabaseID); // This will add it to my list return dbProxy; } }