Konuşma Öğelerini Yönetme

Aspose.Email for Java, Exchange Server’daki konuşma öğelerini yönetmek için kullanılabilir; EWSClient sınıf. Bu sınıf Exchange Web Services’i kullanır; bu hizmetler yalnızca Exchange Server 2007 ve sonraki sürümlerde mevcuttur. Bu makale, nasıl olduğunu gösterir bul, kopyala, taşı ve sil Exchange Server 2010 üzerindeki konuşma öğeleri. Bu bölümdeki tüm özellikler için Microsoft Exchange Server 2010 Service Pack 1 gereklidir.

Konuşmaları Bulma

Exchange Server’da belirli bir klasörden konuşma bilgilerini almak için:

  1. IEWSClient sınıfını kullanarak Exchange Server’a bağlanın.
  2. Bir klasörden tüm konuşma öğelerini bulmak için IEWSClient.findConversations() yöntemini çağırın.
  3. Konuşma öğesi özelliklerini, ID, konuşma konusu ve işaret durumu gibi gösterin.

Aşağıdaki kod örneği, konuşmaları nasıl bulacağınızı gösterir.

IEWSClient client = EWSClient.getEWSClient(mailboxUri, credentials);
System.out.println("Connected to Exchange 2010");

// Find Conversation Items in the Inbox folder
ExchangeConversation[] conversations = client.findConversations(client.getMailboxInfo().getInboxUri());
// Show all conversations
for (ExchangeConversation conversation : conversations) {
    // Display conversation properties like Id and Topic
    System.out.println("Topic: " + conversation.getConversationTopic());
    System.out.println("Flag Status: " + conversation.getFlagStatus());
    System.out.println();
}

Konuşmaları Kopyalama

Konuşmaları bir klasörden diğerine kopyalamak için:

  1. IEWSClient sınıfını kullanarak Exchange Server’a bağlanın.
  2. Konuşma öğesini kaynak klasörden hedef klasöre kopyalamak için IEWSClient.copyConversationItems() yöntemini çağırın.

Aşağıdaki kod örneği, konuşmaların nasıl kopyalanacağını gösterir.

IEWSClient client = EWSClient.getEWSClient(mailboxUri, credentials);
System.out.println("Connected to Exchange 2010");

// Find those Conversation Items in the Inbox folder which we want to copy
ExchangeConversation[] conversations = client.findConversations(client.getMailboxInfo().getInboxUri());
for (ExchangeConversation conversation : conversations) {
    System.out.println("Topic: " + conversation.getConversationTopic());
    // Copy the conversation item based on some condition
    if (conversation.getConversationTopic().contains("test email")) {
        client.copyConversationItems(conversation.getConversationId(), client.getMailboxInfo().getDeletedItemsUri());
        System.out.println("Copied the conversation item to another folder");
    }
}

Konuşmaları Taşıma

Konuşmaları bir klasörden diğerine taşımak için:

  1. IEWSClient sınıfını kullanarak Exchange Server’a bağlanın.
  2. Bir konuşmayı kaynak klasörden hedef klasöre taşımak için IEWSClient.moveConversationItems() yöntemini çağırın.

Aşağıdaki kod örneği, konuşmaların nasıl taşınacağını gösterir.

IEWSClient client = EWSClient.getEWSClient(mailboxUri, credentials);
System.out.println("Connected to Exchange 2010");

// Find those Conversation Items in the Inbox folder which we want to move
ExchangeConversation[] conversations = client.findConversations(client.getMailboxInfo().getInboxUri());

for (ExchangeConversation conversation : conversations) {
    System.out.println("Topic: " + conversation.getConversationTopic());
    // Move the conversation item based on some condition
    if (conversation.getConversationTopic().contains("test email") == true) {
        client.moveConversationItems(conversation.getConversationId(), client.getMailboxInfo().getDeletedItemsUri());
        System.out.println("Moved the conversation item to another folder");
    }
}

Konuşmaları Silme

Bir klasörden konuşmaları silmek için:

  1. IEWSClient sınıfını kullanarak Exchange Server’a bağlanın.
  2. Kaynak klasörden konuşma öğesini silmek için IEWSClient.deleteConversationItems() yöntemini çağırın.

Aşağıdaki kod örneği, konuşmaları nasıl sileceğinizi gösterir.

IEWSClient client = EWSClient.getEWSClient(mailboxUri, credentials);
System.out.println("Connected to Exchange 2010");

// Find those Conversation Items in the Inbox folder which we want to delete
ExchangeConversation[] conversations = client.findConversations(client.getMailboxInfo().getInboxUri());
for (ExchangeConversation conversation : conversations) {
    System.out.println("Topic: " + conversation.getConversationTopic());
    // Delete the conversation item based on some condition
    if (conversation.getConversationTopic().contains("test email") == true) {
        client.deleteConversationItems(conversation.getConversationId());
        System.out.println("Deleted the conversation item");
    }
}