WebLogic Integration


com.bea.lwclient
Class LwcMailbox

java.lang.Object
  |
  +--com.bea.lwclient.LwcMailbox

public class LwcMailbox
extends java.lang.Object
implements LwcMailboxDirectory

The LwcMailboxDirectory manages the creation and removal of mailboxes and message management

Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.

Field Summary
static com.bea.eci.logging.LogOutputStream log
           
 
Constructor Summary
LwcMailbox()
          Default Constructor
LwcMailbox(java.lang.String mbxName)
          Constructor
 
Method Summary
 void addMessage(MessageInfo msginfo, byte[] mesg, boolean filesharing)
          Adds a message to the mailbox.
 void createMailbox(java.lang.String name)
          Create a mailbox with the specified name.
 void expungeMessages()
          Deletes all messages from the mailbox.
static LwcMailbox getInstance()
           
 byte[] getMessage(java.lang.String msgid)
          Returns the payload of the message with the specified id.
 int getMessageCount()
          Returns the number of messages in the mailbox.
 MessageInfo[] getMessageInfos()
          Returns info about all messages in the mailbox.
 byte[][] getNewMessagesContent()
          Returns array of new message contents in given mailbox
 java.lang.String getSender(java.lang.String messageid)
          Returns sender of a particular message in a mailbox
 boolean isExistMailbox(java.lang.String name)
          Returns a boolean true if the mailbox with the specified name exists.
 void listen(java.lang.String outMbox, java.lang.String url)
          Listens for messages coming into the mailbox and sends an XML event to the internal JMS EventQueue.
 void removeMailbox(java.lang.String name)
          Remove the mailbox with the specified name.
 void removeMessage(java.lang.String msgid)
          Removes the message with the specified id from the mailbox.
 void setMessageStatus(java.lang.String msgid, int status)
          Sets the status of the message to the specified value.
static void start()
          This is the entry point for Lwc RMI registry allowing remote File Sharing Client access
 void startup(java.lang.String name, java.util.Hashtable params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static com.bea.eci.logging.LogOutputStream log
Constructor Detail

LwcMailbox

public LwcMailbox()
Default Constructor

LwcMailbox

public LwcMailbox(java.lang.String mbxName)
           throws LwcMailboxException
Constructor

Parameters:
mbxName - Name of the mailbox.
Throws:
LwcMailboxException - If mailbox does not exist.
Method Detail

getInstance

public static LwcMailbox getInstance()


createMailbox

public void createMailbox(java.lang.String name)
                   throws LwcMailboxException,
                          weblogic.rmi.RemoteException
Create a mailbox with the specified name. If a mailbox with the given name exists, existing mailbox is referred.
Specified by:
createMailbox in interface LwcMailboxDirectory

Parameters:
name - Name of the mailbox to create.
Throws:
LwcMailboxException - If mailbox creation fails.
weblogic.rmi.RemoteException -  

removeMailbox

public void removeMailbox(java.lang.String name)
                   throws LwcMailboxException,
                          weblogic.rmi.RemoteException
Remove the mailbox with the specified name.
Specified by:
removeMailbox in interface LwcMailboxDirectory

Parameters:
name - Name of the mailbox to remove.
Throws:
LwcMailboxException - If mailbox removal fails.
weblogic.rmi.RemoteException -  

isExistMailbox

public boolean isExistMailbox(java.lang.String name)
                       throws LwcMailboxException,
                              weblogic.rmi.RemoteException
Returns a boolean true if the mailbox with the specified name exists. If the specified mailbox does not exist (mailbox is null), it returns false.
Specified by:
isExistMailbox in interface LwcMailboxDirectory

Parameters:
name - Name of the mailbox.
Returns:
boolean - true/false
Throws:
LwcMailboxException - If mailbox operation fails.
weblogic.rmi.RemoteException -  

addMessage

public void addMessage(MessageInfo msginfo,
                       byte[] mesg,
                       boolean filesharing)
                throws LwcMailboxException,
                       weblogic.rmi.RemoteException
Adds a message to the mailbox.
Specified by:
addMessage in interface LwcMailboxDirectory

Parameters:
msginfo - Metadata info of the message.
mesg - The message payload.
filesharing - If true file sharing client tries to add message
Throws:
LwcMailboxException - If mailbox operation fails.
weblogic.rmi.RemoteException - - Remote object LwcMailbox not found

removeMessage

public void removeMessage(java.lang.String msgid)
                   throws LwcMailboxException,
                          weblogic.rmi.RemoteException
Removes the message with the specified id from the mailbox.
Specified by:
removeMessage in interface LwcMailboxDirectory

Parameters:
msgid - Identifier of the message to be removed.
Throws:
LwcMailboxException - If mailbox operation fails.
weblogic.rmi.RemoteException -  

getMessageCount

public int getMessageCount()
                    throws LwcMailboxException,
                           weblogic.rmi.RemoteException
Returns the number of messages in the mailbox.
Specified by:
getMessageCount in interface LwcMailboxDirectory

Returns:
int - number of messages.
Throws:
LwcMailboxException - If mailbox operation fails.
weblogic.rmi.RemoteException -  

getMessageInfos

public MessageInfo[] getMessageInfos()
                              throws LwcMailboxException,
                                     weblogic.rmi.RemoteException
Returns info about all messages in the mailbox. If the mailbox is ordered, the returned messages will be sequenced in the same order in which they were added.
Specified by:
getMessageInfos in interface LwcMailboxDirectory

Returns:
MessageInfo[] - Array of message info.
Throws:
LwcMailboxException - If mailbox operation fails.
weblogic.rmi.RemoteException -  

getMessage

public byte[] getMessage(java.lang.String msgid)
                  throws LwcMailboxException,
                         weblogic.rmi.RemoteException
Returns the payload of the message with the specified id.
Specified by:
getMessage in interface LwcMailboxDirectory

Parameters:
msgid - Message id.
Returns:
byte[] - Message payload.
Throws:
LwcMailboxException - If mailbox operation fails.
weblogic.rmi.RemoteException -  

setMessageStatus

public void setMessageStatus(java.lang.String msgid,
                             int status)
                      throws LwcMailboxException,
                             weblogic.rmi.RemoteException
Sets the status of the message to the specified value. Valid status values are MessageInfo.StatusNew and MessageInfo.StatusRead
Specified by:
setMessageStatus in interface LwcMailboxDirectory

Parameters:
msgid - Message id.
status - Message status.
Throws:
LwcMailboxException - If mailbox operation fails.
weblogic.rmi.RemoteException -  

expungeMessages

public void expungeMessages()
                     throws LwcMailboxException,
                            weblogic.rmi.RemoteException
Deletes all messages from the mailbox.
Specified by:
expungeMessages in interface LwcMailboxDirectory

Throws:
LwcMailboxException - If mailbox operation fails.
weblogic.rmi.RemoteException -  

listen

public void listen(java.lang.String outMbox,
                   java.lang.String url)
            throws weblogic.rmi.RemoteException
Listens for messages coming into the mailbox and sends an XML event to the internal JMS EventQueue.
Specified by:
listen in interface LwcMailboxDirectory

Parameters:
outMbox - outgoing mailbox name.
url - Weblogic URL for JNDI context lookup.

getSender

public java.lang.String getSender(java.lang.String messageid)
                           throws LwcMailboxException,
                                  weblogic.rmi.RemoteException
Returns sender of a particular message in a mailbox
Specified by:
getSender in interface LwcMailboxDirectory

Parameters:
messageid - Unique Message Identifier.
Returns:
String sender name

getNewMessagesContent

public byte[][] getNewMessagesContent()
                               throws LwcMailboxException,
                                      weblogic.rmi.RemoteException
Returns array of new message contents in given mailbox
Specified by:
getNewMessagesContent in interface LwcMailboxDirectory

Returns:
byte[][] array of new message content in bytes

startup

public void startup(java.lang.String name,
                    java.util.Hashtable params)
             throws java.lang.Exception


start

public static void start()
                  throws java.lang.Exception
This is the entry point for Lwc RMI registry allowing remote File Sharing Client access


WebLogic Integration

WebLogic Integration (WLI)