Overview | Package | Class | Tree | Deprecated | Index | Help
| BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.compoze.collab.exchange
Interface IExchangeContainer

All Known Subinterfaces:
  IExchangeCalendarContainer, IExchangeContactsContainer, IExchangeMailContainer, IExchangeTasksContainer, IMapiCalendarContainer, IWebdavCalendarContainer

public interface IExchangeContainer

Containers of this type are specific to Exchange.

This sample shows a synchronization sample

Sample code:

    /**
     * Tests synchronization (ICS) for a container.
     *
     * @param	container	    the exchange container to synchronize
     * @param	callback	    the callback implementation
     * @throws	CollaborationException	if any framework problems were encountered
     * @throws	IOException	    if any IO exceptions occurred
     */
    public	void	synchronizeContainer
    (
    IExchangeContainer  container,
    ISynchCallback	    callback
    )
    throws	    CollaborationException, IOException
        {
        InputStream in = null;

        Key[]   keys = new Key[]
    	{
    	IItem.ID,
    	IExchangeMessage.SUBJECT
    	};

        // gets the baseline state.  the callback functions are called for each item
        // that changed
        InputStream state = container.synchronize (keys, in, callback);

        // given the new state, save the contents to file
        FileOutputStream fout = new FileOutputStream ("c:\\state.bin");
        int iLen = -1;
        byte[] yBytes = new byte[2048];
        while (-1 != (iLen = state.read (yBytes)))
    	fout.write (yBytes, 0, iLen);

        fout.close ();
        state.close ();

        // some time to delete or change
        try
    	{
    	System.out.println ("You have 10 seconds to change or delete one...");
    	for (int i = 0; i < 10; i++)
    	    {
    	    System.out.print ('.');
    	    Thread.sleep (1000);
    	    }
    	System.out.println ();
    	}
        catch (Exception e)
    	{
    	}

        // use the saved state for the new baseline
        FileInputStream fin = new FileInputStream ("c:\\state.bin");

        state = container.synchronize (keys, fin, callback);

        // resave state

        }

Method Summary
`IAccessControl` | `getAccessControl()` Gets the access control instance for this container.
`java.io.InputStream` | `synchronize(Key[] keys, java.io.InputStream state, ISynchCallback callback)` Performs a synchronization the folder, and returns the information on the changes for the folder.

Method Detail

### synchronize

    public java.io.InputStream synchronize(Key[] keys,
                                           java.io.InputStream state,
                                           ISynchCallback callback)
                                    throws CollaborationException

  Performs a synchronization the folder, and returns the information on the changes for the folder. NOTE: they keys specified are not interpreted as "synchronize changes where these properties changed", rather "when performing synchronization, return these properties for changed items."
  Parameters:
    `keys` - the keys to return when synchronizing
    `state` - an input stream with the state information
    `callback` - the callback used to catalog changes
  Returns:
    a new synchronization state stream; not the same stream passed in
  Throws:
    `CollaborationException` - if there was an error synchronizing

### getAccessControl

    public IAccessControl getAccessControl()
                                    throws CollaborationException

  Gets the access control instance for this container.
  Returns:
    the access control
  Throws:
    `CollaborationException` - if there was an error getting the access control

Overview | Package | Class | Tree | Deprecated | Index | Help
| BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright ©1999-2005 BEA Systems, Inc. All rights reserved.