Class Contact
- java.lang.Object
-
- microsoft.exchange.webservices.data.core.service.ServiceObject
-
- microsoft.exchange.webservices.data.core.service.item.Item
-
- microsoft.exchange.webservices.data.core.service.item.Contact
-
-
Constructor Summary
Constructors Constructor Description Contact(ExchangeService service)Initializes an unsaved local instance ofContact.Contact(ItemAttachment parentAttachment)Initializes a new instance of theContactclass.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Contactbind(ExchangeService service, ItemId id)Binds to an existing contact and loads its first class property.static Contactbind(ExchangeService service, ItemId id, PropertySet propertySet)Binds to an existing contact and loads the specified set of property.StringgetAlias()Gets the Alias from the directoryStringgetAssistantName()Gets the contact's assistant name.DategetBirthday()Gets the contact's assistant name.StringgetBusinessHomePage()Gets the business home page of the contact.StringListgetChildren()Gets a list of children for the contact.StringListgetCompanies()Gets a list of companies for the contact.StringgetCompanyName()Gets the company name of the contact.CompleteNamegetCompleteName()Gets the complete name of the contact.FileAttachmentgetContactPictureAttachment()Retrieves the file attachment that holds the contact's picture.ContactSourcegetContactSource()Gets the source of the contact.StringgetDepartment()Gets the department of the contact.StringgetDirectoryId()Gets the DirectoryID as Guid or DN stringbyte[]getDirectoryPhoto()Gets the Photo from the directoryEmailAddressCollectiongetDirectReports()Get the direct reports mailbox informationStringgetDisplayName()Gets the display name of the contact.EmailAddressDictionarygetEmailAddresses()Gets an indexed list of e-mail addresses for the contact.StringgetFileAs()Gets the name under which this contact is filed as.FileAsMappinggetFileAsMapping()Gets a value indicating how the FileAs property should be automatically calculated.StringgetGeneration()Gets the generation of the contact.StringgetGivenName()Gets the given name of the contact.BooleangetHasPicture()Gets a value indicating whether this contact has a picture associated with it.ImAddressDictionarygetImAddresses()Gets an indexed list of Instant Messaging addresses for the contact.StringgetInitials()Gets the initials of the contact.StringgetJobTitle()Gets the contact's job title.StringgetManager()Gets the name of the contact's manager.EmailAddressgetManagerMailbox()Gets the manager mailbox informationStringgetMiddleName()Gets the middle name of the contact.StringgetMileage()Gets the mileage for the contact.ExchangeVersiongetMinimumRequiredServerVersion()Gets the minimum required server version.byte[][]getMSExchangeCertificate()Gets the MSExchange certificate from the directoryStringgetNickName()Gets the nick name of the contact.StringgetNotes()Get the Notes from the directoryStringgetOfficeLocation()Gets the location of the contact's office.PhoneNumberDictionarygetPhoneNumbers()Gets an indexed list of phone numbers for the contact.StringgetPhoneticFirstName()Gets the funn phonetic name from the directoryStringgetPhoneticFullName()Gets the funn phonetic name from the directoryStringgetPhoneticLastName()Gets the phonetic last name from the directoryPhysicalAddressDictionarygetPhysicalAddresses()Gets an indexed list of physical addresses for the contact.PhysicalAddressIndexgetPostalAddressIndex()Gets the index of the contact's postal address.StringgetProfession()Gets the contact's profession.ServiceObjectSchemagetSchema()Internal method to return the schema associated with this type of object.StringgetSpouseName()Gets the name of the contact's spouse.StringgetSurname()Gets the surname of the contact.byte[][]getUserSMIMECertificate()Gets the User SMIME certificate from the directoryDategetWeddingAnniversary()Gets the date of the contact's wedding anniversary.voidremoveContactPicture()Removes the contact's picture.voidsetAssistantName(String value)Sets the assistant name.voidsetBirthday(Date value)Sets the birthday.voidsetBusinessHomePage(String value)Sets the business home page.voidsetChildren(StringList value)Sets the children.voidsetCompanies(StringList value)Sets the companies.voidsetCompanyName(String value)Sets the company name.voidsetContactPicture(byte[] content)Sets the contact's picture using the specified byte array.voidsetContactPicture(InputStream contentStream)Sets the contact's picture using the specified stream.voidsetContactPicture(String fileName)Sets the contact's picture using the specified file.voidsetDepartment(String value)Sets the department.voidsetDisplayName(String value)Sets the display name.voidsetFileAs(String value)Sets the file as.voidsetFileAs(FileAsMapping value)Sets the file as.voidsetGeneration(String value)Sets the generation.voidsetGivenName(String value)Sets the given name.voidsetInitials(String value)Sets the initials.voidsetJobTitle(String value)Sets the job title.voidsetManager(String value)Sets the manager.voidsetMiddleName(String value)Sets the middle name.voidsetMileage(String value)Sets the mileage.voidsetNickName(String value)Sets the nick name.voidsetOfficeLocation(String value)Sets the office location.voidsetPostalAddressIndex(PhysicalAddressIndex value)Sets the postal address index.voidsetProfession(String value)Sets the profession.voidsetSpouseName(String value)Sets the spouse name.voidsetSurname(String value)Sets the surname.voidsetWeddingAnniversary(Date value)Sets the wedding anniversary.voidvalidate()Validates this instance.-
Methods inherited from class microsoft.exchange.webservices.data.core.service.item.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, getIsTimeZoneHeaderRequired, 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, throwIfThisIsAttachment, update
-
Methods inherited from class microsoft.exchange.webservices.data.core.service.ServiceObject
addServiceObjectChangedEvent, changed, clearChangeLog, clearServiceObjectChangedEvent, getChangeXmlElementName, getDeleteFieldXmlElementName, getIsCustomDateTimeScopingRequired, getLoadedPropertyDefinitions, getObjectFromPropertyDefinition, getPropertyBag, getService, getSetFieldXmlElementName, getXmlElementName, getXmlElementNameOverride, isDirty, isNew, load, load, loadFromXml, loadFromXml, removeServiceObjectChangedEvent, schema, setService, throwIfThisIsNew, throwIfThisIsNotNew, tryGetExtendedProperty, tryGetProperty, tryGetProperty, writeToXml, writeToXmlForUpdate
-
-
-
-
Constructor Detail
-
Contact
public Contact(ExchangeService service) throws Exception
Initializes an unsaved local instance ofContact. To bind to an existing contact, use Contact.Bind() instead.- Parameters:
service- the service- Throws:
Exception- the exception
-
Contact
public Contact(ItemAttachment parentAttachment) throws Exception
Initializes a new instance of theContactclass.- 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 property. Calling this method results in a call to EWS.- Parameters:
service- the serviceid- the idpropertySet- 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 property. Calling this method results in a call to EWS.- Parameters:
service- the serviceid- the id- Returns:
- A Contact instance representing the contact corresponding to the specified Id.
- Throws:
Exception- the exception
-
getSchema
public ServiceObjectSchema getSchema()
Internal method to return the schema associated with this type of object.
-
getMinimumRequiredServerVersion
public ExchangeVersion getMinimumRequiredServerVersion()
Gets the minimum required server version.- Overrides:
getMinimumRequiredServerVersionin classItem- 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
public void validate() throws ServiceVersionException, Exception
Validates this instance.- Overrides:
validatein classItem- Throws:
ServiceVersionException- the service version exceptionException- 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
-
getPhoneticFullName
public String getPhoneticFullName() throws Exception
Gets the funn phonetic name from the directory- Throws:
Exception
-
getPhoneticFirstName
public String getPhoneticFirstName() throws Exception
Gets the funn phonetic name from the directory- Throws:
Exception
-
getPhoneticLastName
public String getPhoneticLastName() throws ServiceLocalException
Gets the phonetic last name from the directory- Throws:
ServiceLocalException
-
getAlias
public String getAlias() throws ServiceLocalException
Gets the Alias from the directory- Throws:
ServiceLocalException
-
getNotes
public String getNotes() throws ServiceLocalException
Get the Notes from the directory- Throws:
ServiceLocalException
-
getDirectoryPhoto
public byte[] getDirectoryPhoto() throws ServiceLocalException
Gets the Photo from the directory- Throws:
ServiceLocalException
-
getUserSMIMECertificate
public byte[][] getUserSMIMECertificate() throws ServiceLocalException
Gets the User SMIME certificate from the directory- Throws:
ServiceLocalException
-
getMSExchangeCertificate
public byte[][] getMSExchangeCertificate() throws ServiceLocalException
Gets the MSExchange certificate from the directory- Throws:
ServiceLocalException
-
getDirectoryId
public String getDirectoryId() throws ServiceLocalException
Gets the DirectoryID as Guid or DN string- Throws:
ServiceLocalException
-
getManagerMailbox
public EmailAddress getManagerMailbox() throws ServiceLocalException
Gets the manager mailbox information- Throws:
ServiceLocalException
-
getDirectReports
public EmailAddressCollection getDirectReports() throws ServiceLocalException
Get the direct reports mailbox information- Throws:
ServiceLocalException
-
-