4
4
//** ContactFolder Class
5
5
//******************************************************************************
6
6
/**
7
- * Enter class description here
7
+ * Used to represent a contact folder.
8
8
*
9
9
******************************************************************************/
10
10
11
11
public class ContactsFolder extends Folder {
12
12
13
13
private Connection conn ;
14
14
15
+
15
16
//**************************************************************************
16
17
//** Constructor
17
18
//**************************************************************************
18
- /** Creates a new instance of ContactFolder . */
19
+ /** Creates a new instance of this class . */
19
20
20
21
public ContactsFolder (Connection conn ) throws ExchangeException {
21
22
super ("contacts" , conn );
22
23
this .conn = conn ;
23
24
}
24
25
25
-
26
+
27
+ //**************************************************************************
28
+ //** getContacts
29
+ //**************************************************************************
30
+ /** Returns an array of all contacts found in the contact folder.
31
+ */
26
32
public Contact [] getContacts () throws ExchangeException {
27
33
28
34
java .util .ArrayList <Contact > contacts = new java .util .ArrayList <Contact >();
@@ -43,19 +49,20 @@ public Contact[] getContacts() throws ExchangeException {
43
49
}
44
50
45
51
46
-
52
+ //**************************************************************************
53
+ //** getContacts
54
+ //**************************************************************************
55
+ /** Returns an array of contacts.
56
+ * @param maxEntries Maximum number of items to return.
57
+ * @param offset Item offset. 0 implies no offset.
58
+ */
47
59
public Contact [] getContacts (int numEntries , int offset ) throws ExchangeException {
48
-
49
60
java .util .ArrayList <Contact > contacts = new java .util .ArrayList <Contact >();
50
- org .w3c .dom .NodeList nodes = getItems (numEntries , offset , null ).getElementsByTagName ("t:Contact" );
51
- //org.w3c.dom.NodeList nodes = new javaxt.io.File("/temp/exchange-findItem.xml").getXML().getElementsByTagName("t:Contact");
52
-
53
- int numRecordsReturned = 0 ;
61
+ org .w3c .dom .NodeList nodes = getItems (numEntries , offset , null , null ).getElementsByTagName ("t:Contact" );
54
62
for (int i =0 ; i <nodes .getLength (); i ++){
55
63
org .w3c .dom .Node node = nodes .item (i );
56
64
if (node .getNodeType ()==1 ){
57
65
contacts .add (new Contact (node ));
58
- numRecordsReturned ++;
59
66
}
60
67
}
61
68
return contacts .toArray (new Contact [contacts .size ()]);
@@ -65,8 +72,8 @@ public Contact[] getContacts(int numEntries, int offset) throws ExchangeExceptio
65
72
//**************************************************************************
66
73
//** getContact
67
74
//**************************************************************************
68
- /** GetItem request */
69
-
75
+ /** Returns a contact associated with the given exchangeID.
76
+ */
70
77
public Contact getContact (String exchangeID ) throws ExchangeException {
71
78
return new Contact (exchangeID , conn );
72
79
}
0 commit comments