Package org.xmlsoap.schemas.soap.envelope

Examples of org.xmlsoap.schemas.soap.envelope.EnvelopeDocument


        sender = senderEmail;
    }

    private EnvelopeDocument createEmptyRequest(final String user)
    {
        EnvelopeDocument request = EnvelopeDocument.Factory.newInstance();
        EnvelopeType envelope = request.addNewEnvelope();
        envelope.addNewHeader().addNewExchangeImpersonation().addNewConnectingSID().setPrincipalName(user);
        return request;
    }
View Full Code Here


     */
    private void createFolders(final String user, final TargetFolderIdType parentFolderId,
                               final String parentFolderName, final List<RequiredFolder> folders)
            throws FailedToCreateFolders
    {
        EnvelopeDocument request = createEmptyRequest(user);
        CreateFolderType createFolder = request.getEnvelope().addNewBody().addNewCreateFolder();
        createFolder.setParentFolderId(parentFolderId);
        NonEmptyArrayOfFoldersType requestedFolders = createFolder.addNewFolders();
        for (RequiredFolder folder : folders)
        {
            // Don't recreate folders that already exist
View Full Code Here

        createFolders(user, parentFolder, parent.toString(), folders);
    }

    public void deleteFolders(final String user, final List<RequiredFolder> folders) throws FailedToDeleteMessage
    {
        EnvelopeDocument request = createEmptyRequest(user);
        DeleteFolderType deleteFolder = request.getEnvelope().addNewBody().addNewDeleteFolder();
        deleteFolder.setDeleteType(DisposalType.HARD_DELETE);
        NonEmptyArrayOfBaseFolderIdsType doomedFolders = deleteFolder.addNewFolderIds();

        for (RequiredFolder folder : folders)
        {
View Full Code Here

        }
    }

    public void deleteEmails(final String user, final List<MessageId> emails) throws FailedToDeleteMessage
    {
        EnvelopeDocument request = createEmptyRequest(user);
        DeleteItemType deleteItem = request.getEnvelope().addNewBody().addNewDeleteItem();
        deleteItem.setDeleteType(DisposalType.HARD_DELETE);
        NonEmptyArrayOfBaseItemIdsType doomedItems = deleteItem.addNewItemIds();
        for (MessageId email : emails)
        {
            String emailId = email.getId();
View Full Code Here

        }
    }

    public void sendMessages(final List<RequiredEmail> emails) throws FailedToCreateMessage
    {
        EnvelopeDocument request = createEmptyRequest(sender);
        CreateItemType createItem = request.getEnvelope().addNewBody().addNewCreateItem();
        createItem.setMessageDisposition(MessageDispositionType.SEND_ONLY);
        NonEmptyArrayOfAllItemsType items = createItem.addNewItems();

        createEmails(emails, request, items);
    }
View Full Code Here

    }


    public void saveDrafts(final String user, final List<RequiredEmail> drafts) throws FailedToCreateMessage
    {
        EnvelopeDocument request = createEmptyRequest(user);
        CreateItemType createItem = request.getEnvelope().addNewBody().addNewCreateItem();
        createItem.addNewSavedItemFolderId().addNewDistinguishedFolderId().setId(DistinguishedFolderIdNameType.DRAFTS);
        createItem.setMessageDisposition(MessageDispositionType.SAVE_ONLY);
        NonEmptyArrayOfAllItemsType items = createItem.addNewItems();

        createEmails(drafts, request, items);
View Full Code Here

        createEmails(drafts, request, items);
    }

    public void sendAndSave(final String user, final List<RequiredEmail> drafts) throws FailedToCreateMessage
    {
        EnvelopeDocument request = createEmptyRequest(user);
        CreateItemType createItem = request.getEnvelope().addNewBody().addNewCreateItem();
        createItem.addNewSavedItemFolderId().addNewDistinguishedFolderId()
                  .setId(DistinguishedFolderIdNameType.SENTITEMS);
        createItem.setMessageDisposition(MessageDispositionType.SEND_AND_SAVE_COPY);
        NonEmptyArrayOfAllItemsType items = createItem.addNewItems();
View Full Code Here

    public HashMap<String, List<MessageId>> findItems(final String user,
                                                      final DistinguishedFolderIdNameType.Enum parent)
            throws FailedToFindMessage
    {
        HashMap<String, List<MessageId>> emailResults = new HashMap<String, List<MessageId>>();
        EnvelopeDocument request = createEmptyRequest(user);
        FindItemType findItem = request.getEnvelope().addNewBody().addNewFindItem();
        findItem.setTraversal(ItemQueryTraversalType.SHALLOW);
        ItemResponseShapeType itemShape = findItem.addNewItemShape();
        itemShape.setBaseShape(DefaultShapeNamesType.DEFAULT);
        // I tried to use ID_ONLY and add some AdditionalProperties, but the
        // schema appears to be screwy and not have FieldURI in there correctly
View Full Code Here

    }

    private void moveMessages(final String user, final TargetFolderIdType targetFolderId,
                              final List<MessageId> messageIds) throws FailedToMoveMessage
    {
        EnvelopeDocument request = createEmptyRequest(user);
        MoveItemType moveItem = request.getEnvelope().addNewBody().addNewMoveItem();
        moveItem.setToFolderId(targetFolderId);
        NonEmptyArrayOfBaseItemIdsType itemIds = moveItem.addNewItemIds();
        for (MessageId messageId : messageIds)
        {
            ItemIdType itemId = itemIds.addNewItemId();
View Full Code Here

            int amtAvailable = responseData.available();

            if (code == HttpURLConnection.HTTP_OK)
            {
                EnvelopeDocument response = EnvelopeDocument.Factory.parse(responseData);

                LOG.trace("SOAP response received from {}.  SOAP envelope:", endpoint);
                LOG.trace(response.toString());

                return response.getEnvelope().getBody();
            }
            else
            {
                LOG.debug("HTTP Error: {}", code);
                throw new HttpErrorException(code);
View Full Code Here

TOP

Related Classes of org.xmlsoap.schemas.soap.envelope.EnvelopeDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.