/** * Convert this java object to a String. * @param obj The java object to convert. * @return The object represented as a string. */ public String objectToString(Object obj) { String string = BaseTransport.convertObjectToString(obj); return string; } /**
/** * Convert this encoded string back to a Java Object. * @param string The string to convert. * @return The java object. */ public Object stringToObject(String string) { Object obj = BaseTransport.convertStringToObject(string); return obj; } /**
/** * 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); } /**
/** * 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); } /**
/** * 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(); } }
/** * Receive the next remote message. * pend(don) Need to keep retrying if timeout as some firewalls won't wait forever. * @param strCommand Command to perform remotely. * @return boolean success. */ public BaseMessage receiveRemoteMessage() throws RemoteException { BaseTransport transport = this.createProxyTransport(RECEIVE_REMOTE_MESSAGE); Object strReturn = transport.sendMessageAndGetReply(); Object objReturn = transport.convertReturnObject(strReturn); return (BaseMessage)objReturn; } /**
/** * Constructor. */ public void init(ApplicationProxy appProxy, String strCommand) { super.init(appProxy, strCommand); } /**
/** * Convert the return value to an object (override if this doesn't just to string to object). * @param ojb The returned object to convert. * @return The converted object. */ public Object convertReturnObject(Object obj) { return this.stringToObject((String)obj); } /**
/** * 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); } /**
/** * Convert this java object to a String. * @param obj The java object to convert. * @return The object represented as a string. */ public String objectToString(Object obj) { String string = super.objectToString(obj); string = PropertiesTransport.encode(string); return string; } /**
/** * Release the session and its resources. */ public void freeRemoteSession() throws RemoteException { BaseTransport transport = this.createProxyTransport(FREE_REMOTE_SESSION); transport.sendMessageAndGetReply(); } /**
/** * Constructor. */ public void init(ApplicationProxy appProxy, String strCommand) { m_appProxy = appProxy; m_properties = new Properties(); this.setProperty(REMOTE_COMMAND, strCommand); } /**
/** * 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(); }
/** * Get the database properties (opt). */ public Map<String, Object> getDBProperties() throws DBException, RemoteException { BaseTransport transport = this.createProxyTransport(GET_DB_PROPERTIES); Object strReturn = transport.sendMessageAndGetReply(); Object objReturn = transport.convertReturnObject(strReturn); return (Map)this.checkDBException(objReturn); } /**
/** * Constructor. */ public BaseTransport(ApplicationProxy appProxy, String strCommand) { this(); this.init(appProxy, strCommand); } /**
/** * Convert this encoded string back to a Java Object. * @param string The string to convert. * @return The java object. */ public Object stringToObject(String string) { string = Base64.decode(string); Object obj = super.stringToObject(string); return obj; } /**
/** * 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); } /**
/** * Convert this java object to a String. * @param obj The java object to convert. * @return The object represented as a string. */ public String objectToString(Object obj) { String string = super.objectToString(obj); string = Base64.encode(string); return string; } /**
/** * Close the physical database (usually overridden). */ public void close() throws RemoteException { BaseTransport transport = this.createProxyTransport(CLOSE); transport.sendMessageAndGetReply(); } /**
/** * Create the proxy transport. * @param strCommand The command. * @return The transport. */ public BaseTransport createProxyTransport(String strCommand) { BaseTransport transport = null; if (m_parentProxy != null) transport = m_parentProxy.createProxyTransport(strCommand); transport.setProperty(TARGET, this.getIDPath()); // Only the outermost call will end up with the full path ID. return transport; } /**