microsoft.exchange.webservices.data
Class Contact

java.lang.Object
  extended by microsoft.exchange.webservices.data.ServiceObject
      extended by microsoft.exchange.webservices.data.Item
          extended by microsoft.exchange.webservices.data.Contact

public class Contact
extends Item

Represents a contact. Properties available on contacts are defined in the ContactSchema class.


Constructor Summary
  Contact(ExchangeService service)
          Initializes an unsaved local instance of .
protected Contact(ItemAttachment parentAttachment)
          Initializes a new instance of the class.
 
Method Summary
static Contact bind(ExchangeService service, ItemId id)
          Binds to an existing contact and loads its first class properties.
static Contact bind(ExchangeService service, ItemId id, PropertySet propertySet)
          Binds to an existing contact and loads the specified set of properties.
 String getAssistantName()
          Gets the contact's assistant name.
 Date getBirthday()
          Gets the contact's assistant name.
 String getBusinessHomePage()
          Gets the business home page of the contact.
 StringList getChildren()
          Gets a list of children for the contact.
 StringList getCompanies()
          Gets a list of companies for the contact.
 String getCompanyName()
          Gets the company name of the contact.
 CompleteName getCompleteName()
          Gets the complete name of the contact.
 FileAttachment getContactPictureAttachment()
          Retrieves the file attachment that holds the contact's picture.
 ContactSource getContactSource()
          Gets the source of the contact.
 String getDepartment()
          Gets the department of the contact.
 String getDisplayName()
          Gets the display name of the contact.
 EmailAddressDictionary getEmailAddresses()
          Gets an indexed list of e-mail addresses for the contact.
 String getFileAs()
          Gets the name under which this contact is filed as.
 FileAsMapping getFileAsMapping()
          Gets a value indicating how the FileAs property should be automatically calculated.
 String getGeneration()
          Gets the generation of the contact.
 String getGivenName()
          Gets the given name of the contact.
 Boolean getHasPicture()
          Gets a value indicating whether this contact has a picture associated with it.
 ImAddressDictionary getImAddresses()
          Gets an indexed list of Instant Messaging addresses for the contact.
 String getInitials()
          Gets the initials of the contact.
 String getJobTitle()
          Gets the contact's job title.
 String getManager()
          Gets the name of the contact's manager.
 String getMiddleName()
          Gets the middle name of the contact.
 String getMileage()
          Gets the mileage for the contact.
protected  ExchangeVersion getMinimumRequiredServerVersion()
          Gets the minimum required server version.
 String getNickName()
          Gets the nick name of the contact.
 String getOfficeLocation()
          Gets the location of the contact's office.
 PhoneNumberDictionary getPhoneNumbers()
          Gets an indexed list of phone numbers for the contact.
 PhysicalAddressDictionary getPhysicalAddresses()
          Gets an indexed list of physical addresses for the contact.
 PhysicalAddressIndex getPostalAddressIndex()
          Gets the index of the contact's postal address.
 String getProfession()
          Gets the contact's profession.
protected  ServiceObjectSchema getSchema()
          Internal method to return the schema associated with this type of object.
 String getSpouseName()
          Gets the name of the contact's spouse.
 String getSurname()
          Gets the surname of the contact.
 Date getWeddingAnniversary()
          Gets the date of the contact's wedding anniversary.
 void removeContactPicture()
          Removes the contact's picture.
 void setAssistantName(String value)
          Sets the assistant name.
 void setBirthday(Date value)
          Sets the birthday.
 void setBusinessHomePage(String value)
          Sets the business home page.
 void setChildren(StringList value)
          Sets the children.
 void setCompanies(StringList value)
          Sets the companies.
 void setCompanyName(String value)
          Sets the company name.
 void setContactPicture(byte[] content)
          Sets the contact's picture using the specified byte array.
 void setContactPicture(InputStream contentStream)
          Sets the contact's picture using the specified stream.
 void setContactPicture(String fileName)
          Sets the contact's picture using the specified file.
 void setDepartment(String value)
          Sets the department.
 void setDisplayName(String value)
          Sets the display name.
 void setFileAs(FileAsMapping value)
          Sets the file as.
 void setFileAs(String value)
          Sets the file as.
 void setGeneration(String value)
          Sets the generation.
 void setGivenName(String value)
          Sets the given name.
 void setInitials(String value)
          Sets the initials.
 void setJobTitle(String value)
          Sets the job title.
 void setManager(String value)
          Sets the manager.
 void setMiddleName(String value)
          Sets the middle name.
 void setMileage(String value)
          Sets the mileage.
 void setNickName(String value)
          Sets the nick name.
 void setOfficeLocation(String value)
          Sets the office location.
 void setPostalAddressIndex(PhysicalAddressIndex value)
          Sets the postal address index.
 void setProfession(String value)
          Sets the profession.
 void setSpouseName(String value)
          Sets the spouse name.
 void setSurname(String value)
          Sets the surname.
 void setWeddingAnniversary(Date value)
          Sets the wedding anniversary.
protected  void validate()
          Validates this instance.
 
Methods inherited from class microsoft.exchange.webservices.data.Item
copy, copy, delete, getAllowedResponseActions, getAttachments, getBody, getCategories, getConversationId, getCulture, getDateTimeCreated, getDateTimeReceived, getDateTimeSent, getDefaultAffectedTaskOccurrences, getDefaultSendCancellationsMode, getDefaultSendInvitationsMode, getDefaultSendInvitationsOrCancellationsMode, getDisplayCc, getDisplayTo, getEffectiveRights, getExtendedProperties, getHasAttachments, getId, getIdPropertyDefinition, getImportance, getInReplyTo, getInternetMessageHeaders, getIsAssociated, getIsDraft, getIsFromMe, getIsNew, getIsReminderSet, getIsResend, getIsSubmitted, getIsUnmodified, getItemClass, getLastModifiedName, getLastModifiedTime, getMimeContent, getParentAttachment, getParentFolderId, getReminderDueBy, getReminderMinutesBeforeStart, getRootItemId, getSensitivity, getSize, getSubject, getUniqueBody, getWebClientEditFormQueryString, getWebClientReadFormQueryString, hasUnprocessedAttachmentChanges, internalCreate, internalDelete, internalLoad, internalUpdate, isAttachment, move, move, removeExtendedProperty, save, save, save, setBody, setCategories, setCulture, setExtendedProperty, setImportance, setInReplyTo, setIsReminderSet, setItemClass, setMimeContent, setReminderDueBy, setReminderMinutesBeforeStart, setSensitivity, setSubject, setSubject, throwIfThisIsAttachment, update
 
Methods inherited from class microsoft.exchange.webservices.data.ServiceObject
addServiceObjectChangedEvent, changed, clearChangeLog, clearServiceObjectChangedEvent, getChangeXmlElementName, getDeleteFieldXmlElementName, getIsCustomDateTimeScopingRequired, getIsTimeZoneHeaderRequired, getLoadedPropertyDefinitions, getObjectFromPropertyDefinition, getPropertyBag, getService, getSetFieldXmlElementName, getXmlElementName, getXmlElementNameOverride, isDirty, isNew, load, load, loadFromXml, loadFromXml, removeServiceObjectChangedEvent, schema, setService, throwIfThisIsNew, throwIfThisIsNotNew, tryGetExtendedProperty, tryGetProperty, tryGetProperty, writeToXml, writeToXmlForUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Contact

public Contact(ExchangeService service)
        throws Exception
Initializes an unsaved local instance of . To bind to an existing contact, use Contact.Bind() instead.

Parameters:
service - the service
Throws:
Exception - the exception

Contact

protected Contact(ItemAttachment parentAttachment)
           throws Exception
Initializes a new instance of the class.

Parameters:
parentAttachment - the parent attachment
Throws:
Exception - the exception
Method Detail

bind

public static Contact bind(ExchangeService service,
                           ItemId id,
                           PropertySet propertySet)
                    throws Exception
Binds to an existing contact and loads the specified set of properties. Calling this method results in a call to EWS.

Parameters:
service - the service
id - the id
propertySet - the property set
Returns:
A Contact instance representing the contact corresponding to the specified Id.
Throws:
Exception - the exception

bind

public static Contact bind(ExchangeService service,
                           ItemId id)
                    throws Exception
Binds to an existing contact and loads its first class properties. Calling this method results in a call to EWS.

Parameters:
service - the service
id - the id
Returns:
A Contact instance representing the contact corresponding to the specified Id.
Throws:
Exception - the exception

getSchema

protected ServiceObjectSchema getSchema()
Internal method to return the schema associated with this type of object.

Overrides:
getSchema in class Item
Returns:
The schema associated with this type of object.

getMinimumRequiredServerVersion

protected ExchangeVersion getMinimumRequiredServerVersion()
Gets the minimum required server version.

Overrides:
getMinimumRequiredServerVersion in class Item
Returns:
Earliest Exchange version in which this service object type is supported.

setContactPicture

public void setContactPicture(byte[] content)
                       throws Exception
Sets the contact's picture using the specified byte array.

Parameters:
content - the new contact picture
Throws:
Exception - the exception

setContactPicture

public void setContactPicture(InputStream contentStream)
                       throws Exception
Sets the contact's picture using the specified stream.

Parameters:
contentStream - the new contact picture
Throws:
Exception - the exception

setContactPicture

public void setContactPicture(String fileName)
                       throws Exception
Sets the contact's picture using the specified file.

Parameters:
fileName - the new contact picture
Throws:
Exception - the exception

getContactPictureAttachment

public FileAttachment getContactPictureAttachment()
                                           throws ServiceLocalException
Retrieves the file attachment that holds the contact's picture.

Returns:
The file attachment that holds the contact's picture.
Throws:
ServiceLocalException - the service local exception

removeContactPicture

public void removeContactPicture()
                          throws Exception
Removes the contact's picture.

Throws:
Exception - the exception

validate

protected void validate()
                 throws ServiceVersionException,
                        Exception
Validates this instance.

Overrides:
validate in class Item
Throws:
ServiceVersionException - the service version exception
Exception - the exception

getFileAs

public String getFileAs()
                 throws ServiceLocalException
Gets the name under which this contact is filed as. FileAs can be manually set or can be automatically calculated based on the value of the FileAsMapping property.

Returns:
the file as
Throws:
ServiceLocalException - the service local exception

setFileAs

public void setFileAs(String value)
               throws Exception
Sets the file as.

Parameters:
value - the new file as
Throws:
Exception - the exception

getFileAsMapping

public FileAsMapping getFileAsMapping()
                               throws ServiceLocalException
Gets a value indicating how the FileAs property should be automatically calculated.

Returns:
the file as mapping
Throws:
ServiceLocalException - the service local exception

setFileAs

public void setFileAs(FileAsMapping value)
               throws Exception
Sets the file as.

Parameters:
value - the new file as
Throws:
Exception - the exception

getDisplayName

public String getDisplayName()
                      throws ServiceLocalException
Gets the display name of the contact.

Returns:
the display name
Throws:
ServiceLocalException - the service local exception

setDisplayName

public void setDisplayName(String value)
                    throws Exception
Sets the display name.

Parameters:
value - the new display name
Throws:
Exception - the exception

getGivenName

public String getGivenName()
                    throws ServiceLocalException
Gets the given name of the contact.

Returns:
the given name
Throws:
ServiceLocalException - the service local exception

setGivenName

public void setGivenName(String value)
                  throws Exception
Sets the given name.

Parameters:
value - the new given name
Throws:
Exception - the exception

getInitials

public String getInitials()
                   throws ServiceLocalException
Gets the initials of the contact.

Returns:
the initials
Throws:
ServiceLocalException - the service local exception

setInitials

public void setInitials(String value)
                 throws Exception
Sets the initials.

Parameters:
value - the new initials
Throws:
Exception - the exception

getMiddleName

public String getMiddleName()
                     throws ServiceLocalException
Gets the middle name of the contact.

Returns:
the middle name
Throws:
ServiceLocalException - the service local exception

setMiddleName

public void setMiddleName(String value)
                   throws Exception
Sets the middle name.

Parameters:
value - the new middle name
Throws:
Exception - the exception

getNickName

public String getNickName()
                   throws ServiceLocalException
Gets the nick name of the contact.

Returns:
the nick name
Throws:
ServiceLocalException - the service local exception

setNickName

public void setNickName(String value)
                 throws Exception
Sets the nick name.

Parameters:
value - the new nick name
Throws:
Exception - the exception

getCompleteName

public CompleteName getCompleteName()
                             throws ServiceLocalException
Gets the complete name of the contact.

Returns:
the complete name
Throws:
ServiceLocalException - the service local exception

getCompanyName

public String getCompanyName()
                      throws ServiceLocalException
Gets the company name of the contact.

Returns:
the company name
Throws:
ServiceLocalException - the service local exception

setCompanyName

public void setCompanyName(String value)
                    throws Exception
Sets the company name.

Parameters:
value - the new company name
Throws:
Exception - the exception

getEmailAddresses

public EmailAddressDictionary getEmailAddresses()
                                         throws ServiceLocalException
Gets an indexed list of e-mail addresses for the contact. For example, to set the first e-mail address, use the following syntax: EmailAddresses[EmailAddressKey.EmailAddress1] = "john.doe@contoso.com"

Returns:
the email addresses
Throws:
ServiceLocalException - the service local exception

getPhysicalAddresses

public PhysicalAddressDictionary getPhysicalAddresses()
                                               throws ServiceLocalException
Gets an indexed list of physical addresses for the contact. For example, to set the first business address, use the following syntax: physical[PhysicalAddressKey.Business] = new PhysicalAddressEntry()

Returns:
the physical addresses
Throws:
ServiceLocalException - the service local exception

getPhoneNumbers

public PhoneNumberDictionary getPhoneNumbers()
                                      throws ServiceLocalException
Gets an indexed list of phone numbers for the contact. For example, to set the home phone number, use the following syntax: PhoneNumbers[PhoneNumberKey.HomePhone] = "phone number"

Returns:
the phone numbers
Throws:
ServiceLocalException - the service local exception

getAssistantName

public String getAssistantName()
                        throws ServiceLocalException
Gets the contact's assistant name.

Returns:
the assistant name
Throws:
ServiceLocalException - the service local exception

setAssistantName

public void setAssistantName(String value)
                      throws Exception
Sets the assistant name.

Parameters:
value - the new assistant name
Throws:
Exception - the exception

getBirthday

public Date getBirthday()
                 throws ServiceLocalException
Gets the contact's assistant name.

Returns:
the birthday
Throws:
ServiceLocalException - the service local exception

setBirthday

public void setBirthday(Date value)
                 throws Exception
Sets the birthday.

Parameters:
value - the new birthday
Throws:
Exception - the exception

getBusinessHomePage

public String getBusinessHomePage()
                           throws ServiceLocalException
Gets the business home page of the contact.

Returns:
the business home page
Throws:
ServiceLocalException - the service local exception

setBusinessHomePage

public void setBusinessHomePage(String value)
                         throws Exception
Sets the business home page.

Parameters:
value - the new business home page
Throws:
Exception - the exception

getChildren

public StringList getChildren()
                       throws ServiceLocalException
Gets a list of children for the contact.

Returns:
the children
Throws:
ServiceLocalException - the service local exception

setChildren

public void setChildren(StringList value)
                 throws Exception
Sets the children.

Parameters:
value - the new children
Throws:
Exception - the exception

getCompanies

public StringList getCompanies()
                        throws ServiceLocalException
Gets a list of companies for the contact.

Returns:
the companies
Throws:
ServiceLocalException - the service local exception

setCompanies

public void setCompanies(StringList value)
                  throws Exception
Sets the companies.

Parameters:
value - the new companies
Throws:
Exception - the exception

getContactSource

public ContactSource getContactSource()
                               throws ServiceLocalException
Gets the source of the contact.

Returns:
the contact source
Throws:
ServiceLocalException - the service local exception

getDepartment

public String getDepartment()
                     throws ServiceLocalException
Gets the department of the contact.

Returns:
the department
Throws:
ServiceLocalException - the service local exception

setDepartment

public void setDepartment(String value)
                   throws Exception
Sets the department.

Parameters:
value - the new department
Throws:
Exception - the exception

getGeneration

public String getGeneration()
                     throws ServiceLocalException
Gets the generation of the contact.

Returns:
the generation
Throws:
ServiceLocalException - the service local exception

setGeneration

public void setGeneration(String value)
                   throws Exception
Sets the generation.

Parameters:
value - the new generation
Throws:
Exception - the exception

getImAddresses

public ImAddressDictionary getImAddresses()
                                   throws ServiceLocalException
Gets an indexed list of Instant Messaging addresses for the contact. For example, to set the first IM address, use the following syntax: ImAddresses[ImAddressKey.ImAddress1] = "john.doe@contoso.com"

Returns:
the im addresses
Throws:
ServiceLocalException - the service local exception

getJobTitle

public String getJobTitle()
                   throws ServiceLocalException
Gets the contact's job title.

Returns:
the job title
Throws:
ServiceLocalException - the service local exception

setJobTitle

public void setJobTitle(String value)
                 throws Exception
Sets the job title.

Parameters:
value - the new job title
Throws:
Exception - the exception

getManager

public String getManager()
                  throws ServiceLocalException
Gets the name of the contact's manager.

Returns:
the manager
Throws:
ServiceLocalException - the service local exception

setManager

public void setManager(String value)
                throws Exception
Sets the manager.

Parameters:
value - the new manager
Throws:
Exception - the exception

getMileage

public String getMileage()
                  throws ServiceLocalException
Gets the mileage for the contact.

Returns:
the mileage
Throws:
ServiceLocalException - the service local exception

setMileage

public void setMileage(String value)
                throws Exception
Sets the mileage.

Parameters:
value - the new mileage
Throws:
Exception - the exception

getOfficeLocation

public String getOfficeLocation()
                         throws ServiceLocalException
Gets the location of the contact's office.

Returns:
the office location
Throws:
ServiceLocalException - the service local exception

setOfficeLocation

public void setOfficeLocation(String value)
                       throws Exception
Sets the office location.

Parameters:
value - the new office location
Throws:
Exception - the exception

getPostalAddressIndex

public PhysicalAddressIndex getPostalAddressIndex()
                                           throws ServiceLocalException
Gets the index of the contact's postal address. When set, PostalAddressIndex refers to an entry in the PhysicalAddresses indexed list.

Returns:
the postal address index
Throws:
ServiceLocalException - the service local exception

setPostalAddressIndex

public void setPostalAddressIndex(PhysicalAddressIndex value)
                           throws Exception
Sets the postal address index.

Parameters:
value - the new postal address index
Throws:
Exception - the exception

getProfession

public String getProfession()
                     throws ServiceLocalException
Gets the contact's profession.

Returns:
the profession
Throws:
ServiceLocalException - the service local exception

setProfession

public void setProfession(String value)
                   throws Exception
Sets the profession.

Parameters:
value - the new profession
Throws:
Exception - the exception

getSpouseName

public String getSpouseName()
                     throws ServiceLocalException
Gets the name of the contact's spouse.

Returns:
the spouse name
Throws:
ServiceLocalException - the service local exception

setSpouseName

public void setSpouseName(String value)
                   throws Exception
Sets the spouse name.

Parameters:
value - the new spouse name
Throws:
Exception - the exception

getSurname

public String getSurname()
                  throws ServiceLocalException
Gets the surname of the contact.

Returns:
the surname
Throws:
ServiceLocalException - the service local exception

setSurname

public void setSurname(String value)
                throws Exception
Sets the surname.

Parameters:
value - the new surname
Throws:
Exception - the exception

getWeddingAnniversary

public Date getWeddingAnniversary()
                           throws ServiceLocalException
Gets the date of the contact's wedding anniversary.

Returns:
the wedding anniversary
Throws:
ServiceLocalException - the service local exception

setWeddingAnniversary

public void setWeddingAnniversary(Date value)
                           throws Exception
Sets the wedding anniversary.

Parameters:
value - the new wedding anniversary
Throws:
Exception - the exception

getHasPicture

public Boolean getHasPicture()
                      throws ServiceLocalException
Gets a value indicating whether this contact has a picture associated with it.

Returns:
the checks for picture
Throws:
ServiceLocalException - the service local exception


Copyright © 2012. All Rights Reserved.