本文整理汇总了Java中microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet类的典型用法代码示例。如果您正苦于以下问题:Java BasePropertySet类的具体用法?Java BasePropertySet怎么用?Java BasePropertySet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BasePropertySet类属于microsoft.exchange.webservices.data.core.enumeration.property包,在下文中一共展示了BasePropertySet类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convert
import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //导入依赖的package包/类
public EwsMessage convert() throws MessagingException, ServiceLocalException, UnsupportedEncodingException {
message = new EwsMessage(
session,
msgnr,
emailMessage);
try {
// emailMessage.load();
PropertySet oPropSetForBodyText = new PropertySet(BasePropertySet.FirstClassProperties);
oPropSetForBodyText.add(ItemSchema.MimeContent);
emailMessage.load(oPropSetForBodyText);
} catch (Exception e) {
throw new MessagingException(e.getMessage(), e);
}
byte[] bContent = emailMessage.getMimeContent().getContent();
ByteArrayInputStream stream = new ByteArrayInputStream(bContent);
message.createFromStream(stream);
setAllHeaders();
return message;
}
示例2: getUnreadMessageCount
import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //导入依赖的package包/类
@Override
public synchronized int getUnreadMessageCount() throws MessagingException {
ItemView unreadView = new ItemView(ITEM_VIEW_MAX_ITEMS);
PropertySet setIdOnly = new PropertySet(BasePropertySet.IdOnly);
unreadView.setPropertySet(setIdOnly);
SearchFilter unreadFilter = new SearchFilter.SearchFilterCollection(LogicalOperator.And,
new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, Boolean.FALSE));
FindItemsResults<Item> findResults;
try {
findResults = getService().findItems(folder.getId(), unreadFilter, unreadView);
} catch (Exception e) {
throw new MessagingException(e.getMessage());
}
return findResults.getTotalCount();
}
示例3: isRequestedProperty
import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //导入依赖的package包/类
/**
* Checks if is requested property.
*
* @param propertyDefinition the property definition
* @return true, if is requested property
*/
private boolean isRequestedProperty(PropertyDefinition propertyDefinition) {
// If no requested property set, then property wasn't requested.
if (this.requestedPropertySet == null) {
return false;
}
// If base property set is all first-class property, use the
// appropriate list of
// property definitions to see if this property was requested.
// Otherwise, property had
// to be explicitly requested and needs to be listed in
// AdditionalProperties.
if (this.requestedPropertySet.getBasePropertySet() == BasePropertySet.FirstClassProperties) {
List<PropertyDefinition> firstClassProps =
this.onlySummaryPropertiesRequested ? this
.getOwner().getSchema().getFirstClassSummaryProperties() :
this.getOwner().getSchema().getFirstClassProperties();
return firstClassProps.contains(propertyDefinition) ||
this.requestedPropertySet.contains(propertyDefinition);
} else {
return this.requestedPropertySet.contains(propertyDefinition);
}
}
示例4: getMessages
import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //导入依赖的package包/类
@Override
public List<Message> getMessages(int start, int end, Date earliestDate, @Nullable MessageRetrievalListener<Message> listener)
throws MessagingException {
ArrayList<Message> messages = new ArrayList<>();
try {
ItemView view = new ItemView(end - start, start);
view.getOrderBy().add(ItemSchema.DateTimeReceived, SortDirection.Ascending);
view.setPropertySet(new PropertySet(BasePropertySet.IdOnly));
FindItemsResults<Item> results = folder.findItems(view);
List<Item> items = results.getItems();
int count = items.size();
for (int i = 0; i < items.size(); i++) {
String uid = items.get(i).getId().getUniqueId();
if (listener != null)
listener.messageStarted(uid, i, count);
EwsMessage message = new EwsMessage(uid, this);
messages.add(message);
if (listener != null)
listener.messageFinished(message, i, count);
}
} catch (Exception e) {
throw new MessagingException("Failed to fetch messages", e);
}
return messages;
}
示例5: getContentStream
import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //导入依赖的package包/类
@Override
protected InputStream getContentStream() throws MessagingException {
try {
PropertySet oPropSetForBodyText = new PropertySet(BasePropertySet.FirstClassProperties);
oPropSetForBodyText.add(ItemSchema.MimeContent);
emailMessage.load(oPropSetForBodyText);
byte[] lContent = emailMessage.getMimeContent().getContent();
return new ByteArrayInputStream(lContent);
} catch (Exception e) {
throw new MessagingException(e.getMessage());
}
}
示例6: createInstance
import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //导入依赖的package包/类
@Override
public Map<BasePropertySet, String> createInstance() {
Map<BasePropertySet, String> result = new
HashMap<BasePropertySet, String>();
result.put(BasePropertySet.IdOnly,
BasePropertySet.IdOnly
.getBaseShapeValue());
result.put(BasePropertySet.FirstClassProperties,
BasePropertySet.FirstClassProperties
.getBaseShapeValue());
return result;
}
示例7: PropertySet
import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //导入依赖的package包/类
/**
* Initializes a new instance of PropertySet.
*
* @param basePropertySet The base property set to base the property set upon.
* @param additionalProperties Additional property to include in the property set. Property
* definitions are available as static members from schema
* classes (for example, EmailMessageSchema.Subject,
* AppointmentSchema.Start, ContactSchema.GivenName, etc.)
*/
public PropertySet(BasePropertySet basePropertySet,
Iterator<PropertyDefinitionBase> additionalProperties) {
this.basePropertySet = basePropertySet;
if (null != additionalProperties) {
while (additionalProperties.hasNext()) {
this.additionalProperties.add(additionalProperties.next());
}
}
}
示例8: createReadonlyPropertySet
import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //导入依赖的package包/类
/**
* Creates a read-only PropertySet.
*
* @param basePropertySet The base property set.
* @return PropertySet
*/
private static PropertySet createReadonlyPropertySet(
BasePropertySet basePropertySet) {
PropertySet propertySet = new PropertySet(basePropertySet);
propertySet.isReadOnly = true;
return propertySet;
}
示例9: getPropertySetFromBasePropertySet
import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //导入依赖的package包/类
/**
* Implements an implicit conversion between
* PropertySet and BasePropertySet.
*
* @param basePropertySet The BasePropertySet value to convert from.
* @return A PropertySet instance based on the specified base property set.
*/
public static PropertySet getPropertySetFromBasePropertySet(BasePropertySet
basePropertySet) {
return new PropertySet(basePropertySet);
}
示例10: getBasePropertySet
import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //导入依赖的package包/类
/**
* Gets the base property set, the property set is based upon.
*
* @return the base property set
*/
public BasePropertySet getBasePropertySet() {
return this.basePropertySet;
}
示例11: getDefaultPropertySetMap
import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //导入依赖的package包/类
/**
* Maps BasePropertySet values to EWS's BaseShape values.
*
* @return the base property set
*/
public static LazyMember<Map<BasePropertySet, String>> getDefaultPropertySetMap() {
return PropertySet.defaultPropertySetMap;
}
示例12: setBasePropertySet
import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //导入依赖的package包/类
/**
* Sets the base property set, the property set is based upon.
*
* @param basePropertySet Base property set.
*/
public void setBasePropertySet(BasePropertySet basePropertySet) {
this.throwIfReadonly();
this.basePropertySet = basePropertySet;
}