Compoze Software, Inc.

com.compoze.exchange.webdav
Class ContactFolder


java.lang.Object

  |

  +--com.compoze.exchange.webdav.AbstractItem

        |

        +--com.compoze.exchange.webdav.Folder

              |

              +--com.compoze.exchange.webdav.ContactFolder

All Implemented Interfaces:
java.lang.Cloneable, IItem, java.io.Serializable

public class ContactFolder
extends Folder
implements java.io.Serializable

This class extends Folder to represent a folder that primarily contains contact items. This class provides access methods to retrieve collections of contacts. Below is an example of how these methods are used:

  //  Prepare a list of properties to return from the query
  LinkedList returnProps = new LinkedList(Contact.getDefaultProperties());
  returnProps.add(ContactsProperty.EMAIL1);
  returnProps.add(ContactsProperty.BIRTHDAY);
  returnProps.add(ContactsProperty.WEDDING_ANNIVERSARY);

  //  Prepare a filter with fields containing the name "John" set
  ContactFilter filter = new ContactFilter();
  filter.setGivenName("Skip");
  filter.setSurname("O'Grudnick);
  
  //  Sort contacts by surname, given name, and then middle name in ascending order
  SortOrder sortOrder = SortOrder.create(ContactsProperty.SURNAME, SortOrder.ASCENDING);
  tOrder.setSortOrder(ContactsProperty.GIVEN_NAME, SortOrder.ASCENDING);
  sortOrder.setSortOrder(ContactsProperty.MIDDLE_NAME, SortOrder.ASCENDING);

  Contacts contacts = contactFolder.getContacts(returnProps, filter, sortOrder);
 

In the first section of the code we want to specify only the properties we want returned. To do this we instantiate a list and add the properties. There is a set of default properties that are required to return. The default properties are attained by either calling Contact.getProperties() or adding the properties individually.

In the next section of the code we want to query for contacts that match a criteria. To do this we instantiate a ContactFilter object. Within this filter rules are set and when the query is made, only those contacts that match the criteria are returned.

In the last section of the code we want the results sorted. To do this we instantiate a SortOrder object, and set the properties we want to sort by.

See Also:
Serialized Form

Fields inherited from class com.compoze.exchange.webdav.Folder
m_folders, m_iRelDepth, m_messages
 
Constructor Summary
ContactFolder(java.lang.String sName)
          Constructor.
 
Method Summary
 Contacts getContacts()
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, SortOrder, RowRange)
 Contacts getContacts(ContactFolderFilter filter)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, ContactFolderFilter, SortOrder, RowRange)
 Contacts getContacts(ContactFolderFilter filter, SortOrder sortOrder)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, ContactFolderFilter, SortOrder, RowRange)
 Contacts getContacts(java.util.List props)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, SortOrder, RowRange)
 Contacts getContacts(java.util.List props, ContactFolderFilter filter)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, ContactFolderFilter, SortOrder, RowRange)
 Contacts getContacts(java.util.List props, ContactFolderFilter filter, SortOrder sortOrder)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, ContactFolderFilter, SortOrder, RowRange)
 Contacts getContacts(java.util.List properties, ContactFolderFilter filter, SortOrder order, RowRange range)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, ContactFolderFilter, SortOrder, RowRange)
 Contacts getContacts(java.util.List properties, int iScope, ContactFolderFilter filter, SortOrder order, RowRange range)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, int, ContactFolderFilter, SortOrder, RowRange)
 Contacts getContacts(java.util.List props, SortOrder sortOrder)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, SortOrder, RowRange)
 Contacts getContacts(java.util.List properties, SortOrder order, RowRange range)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, SortOrder, RowRange)
 Contacts getContacts(SortOrder sortOrder)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, SortOrder, RowRange)
 Contacts serverGetContacts(java.util.List properties, ContactFolderFilter filter, SortOrder order, RowRange range)
          Queries the server for a list of contacts.
 Contacts serverGetContacts(java.util.List properties, int iScope, ContactFolderFilter filter, SortOrder order, RowRange range)
          Queries the server for a list of contacts.
 Contacts serverGetContacts(java.util.List properties, SortOrder order, RowRange range)
          Queries the server for a list of contacts.
 
Methods inherited from class com.compoze.exchange.webdav.Folder
addItem, addItem, clone, createFilename, deleteItem, deleteItem, equals, getDefaultProperties, getFolder, getFolder, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getFolders, getItems, getItems, getItems, getItems, getItems, getItems, getItems, getItems, getItems, getItems, getItems, getItems, getItems, getItems, getItems, getItems, getItems, getItems, getLocalFolders, getLocalItems, getLocalMessages, getMessageCount, getProperties, getRelativeDepth, getSize, getType, getUnreadCount, getUnreadCount, getUnreadMessageCount, getVisibleCount, getVisibleCount, getVisibleCount, getVisibleCount, hasSubFolders, isDeletedItemsFolder, isDraftsFolder, isInboxFolder, isOutboxFolder, isSentItemsFolder, rename, serverAddItem, serverAddItem, serverDelete, serverDeleteItem, serverDeleteItem, serverGetFolders, serverGetFolders, serverGetFolders, serverGetFolders, serverGetMessageCount, serverGetMessageCount, serverGetMessages, serverGetMessages, serverGetMessages, serverGetUnreadMessageCount, serverRename, serverUpdate, setRelativeDepth, setType, toString
 
Methods inherited from class com.compoze.exchange.webdav.AbstractItem
copy, copy, copy, createFilename, delete, equals, getComment, getContentClass, getCreationDate, getDateLastModified, getDisplayName, getFile, getHRef, getID, getParentFolder, getPermanentURL, getUID, isFolder, isHidden, isReadOnly, isRoot, move, move, move, serverCopyTo, serverCopyTo, serverCopyTo, serverCopyTo, serverGetParentFolder, serverMoveTo, serverMoveTo, serverMoveTo, serverMoveTo, serverUpdate, setComment, setContentClass, setContentClass, setHidden, setReadOnly, setReleased, setType, setUID, update, update, validate
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContactFolder


public ContactFolder(java.lang.String sName)
Constructor.
Parameters:
sName - name of the folder
Method Detail

serverGetContacts


public Contacts serverGetContacts(java.util.List properties,
                                  SortOrder order,
                                  RowRange range)
                           throws ExchangeException
Queries the server for a list of contacts.
Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
order - the order to sort by
range - the range of rows to return
Returns:
a list of Contact or DistributionList objects
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified

serverGetContacts


public Contacts serverGetContacts(java.util.List properties,
                                  ContactFolderFilter filter,
                                  SortOrder order,
                                  RowRange range)
                           throws ExchangeException
Queries the server for a list of contacts.
Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
filter - the conditions to search by
order - the order to sort by
range - the range of rows to return
Returns:
a list of Contact or DistributionList objects
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified

serverGetContacts


public Contacts serverGetContacts(java.util.List properties,
                                  int iScope,
                                  ContactFolderFilter filter,
                                  SortOrder order,
                                  RowRange range)
                           throws ExchangeException
Queries the server for a list of contacts.

If no sort order is provided (order == null), the following sort order is used:

DO NOT SORT BY HttpMailProperty.SUBJECT. This property is not searchable because its value is only calculated when used and not stored in the Exchange store. Use HttpMailProperty.NORMALIZED_SUBJECT or MailHeaderProperty.SUBJECT.

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
iScope - the scope of the search
filter - the conditions to search by
order - the order to sort by
range - the range of rows to return
Returns:
a list of Contact or DistributionList objects
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified

getContacts


public Contacts getContacts(java.util.List properties,
                            SortOrder order,
                            RowRange range)
                     throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, SortOrder, RowRange)

Queries the server for a list of contacts.
Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
order - the order to sort by
range - the range of rows to return
Returns:
a list of Contact or DistributionList objects
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified

getContacts


public Contacts getContacts(java.util.List properties,
                            ContactFolderFilter filter,
                            SortOrder order,
                            RowRange range)
                     throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, ContactFolderFilter, SortOrder, RowRange)

Queries the server for a list of contacts.
Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
filter - the conditions to search by
order - the order to sort by
range - the range of rows to return
Returns:
a list of Contact or DistributionList objects
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified

getContacts


public Contacts getContacts(java.util.List properties,
                            int iScope,
                            ContactFolderFilter filter,
                            SortOrder order,
                            RowRange range)
                     throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, int, ContactFolderFilter, SortOrder, RowRange)

Queries the server for a list of contacts.

If no sort order is provided (order == null), the following sort order is used:

DO NOT SORT BY HttpMailProperty.SUBJECT. This property is not searchable because its value is only calculated when used and not stored in the Exchange store. Use HttpMailProperty.NORMALIZED_SUBJECT or MailHeaderProperty.SUBJECT.

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
iScope - the scope of the search
filter - the conditions to search by
order - the order to sort by
range - the range of rows to return
Returns:
a list of Contact or DistributionList objects
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified

getContacts


public Contacts getContacts()
                     throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, SortOrder, RowRange)

Queries the server for a list of contacts.
Returns:
a list of Contact or DistributionList objects
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used

getContacts


public Contacts getContacts(java.util.List props)
                     throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, SortOrder, RowRange)

Queries the server for a list of contacts.
Parameters:
props - list of properties (see Contact) to have returned from the query
Returns:
a list of Contact or DistributionList objects
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified

getContacts


public Contacts getContacts(java.util.List props,
                            SortOrder sortOrder)
                     throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, SortOrder, RowRange)

Queries the server for a list of contacts.
Parameters:
props - list of properties (see Contact) to have returned from the query
sortOrder - the order to sort by
Returns:
a list of Contact or DistributionList objects
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified

getContacts


public Contacts getContacts(java.util.List props,
                            ContactFolderFilter filter)
                     throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, ContactFolderFilter, SortOrder, RowRange)

Queries the server for a list of contacts.
Parameters:
props - list of properties (see Contact) to have returned from the query
filter - the filter to search by
Returns:
a list of Contact or DistributionList objects
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified

getContacts


public Contacts getContacts(SortOrder sortOrder)
                     throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, SortOrder, RowRange)

Queries the server for a list of contacts.
Parameters:
sortOrder - the order to sort by
Returns:
a list of Contact or DistributionList objects
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used

getContacts


public Contacts getContacts(ContactFolderFilter filter)
                     throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, ContactFolderFilter, SortOrder, RowRange)

Queries the server for a list of contacts.
Parameters:
filter - the filter to search by
Returns:
a list of Contact or DistributionList objects
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used

getContacts


public Contacts getContacts(ContactFolderFilter filter,
                            SortOrder sortOrder)
                     throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, ContactFolderFilter, SortOrder, RowRange)

Queries the server for a list of contacts.
Parameters:
filter - the filter to search by
sortOrder - the order to sort by
Returns:
a list of Contact or DistributionList objects
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used

getContacts


public Contacts getContacts(java.util.List props,
                            ContactFolderFilter filter,
                            SortOrder sortOrder)
                     throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContacts(List, ContactFolderFilter, SortOrder, RowRange)

Queries the server for a list of contacts.
Parameters:
props - list of properties (see Contact) to have returned from the query
filter - the filter to search by
sortOrder - the order to sort by
Returns:
a list of Contact or DistributionList objects
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified

Compoze Software, Inc.

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.