package ikube.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @author David Turley
 * @version 01.00
 * @since 11-07-2014
 */
@Entity
@SuppressWarnings("serial")
@Inheritance(strategy = InheritanceType.JOINED)
public class IndexableExchange extends Indexable {

    private transient String subject;
    private transient String body;
    private transient String sender;
    private transient String recipient;

    @Column
    @NotNull
    @Pattern(regexp = "^(https?|http?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]", message = "The url must be valid")
    @Attribute(field = false, description = "This is the endpoint url for the web service")
    private String url;

    @Column
    @Size(min = 1, max = 256)
    @Attribute(field = false, description = "This is the userid to login to the server")
    private String userid;

    @Column
    @Size(min = 1, max = 256)
    @Attribute(field = false, description = "This is the password to login to the server")
    private String password;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}

@@ -292,16 +292,109 @@
 ts.Size;
+%0Aimport java.util.Date;%0Aimport ikube.action.index.handler.internet.exchange.IndexableMessage;
 %0A%0A/**%0A *
@@ -1348,419 +1348,1969 @@
    p
-ublic String getUrl() %7B%0A        return url;%0A    %7D%0A%0A    public void setUrl(String url) %7B%0A        this.url = url;%0A    %7D%0A%0A    public String getUserid() %7B%0A        return userid;%0A    %7D%0A%0A    public void setUserid(String userid) %7B%0A        this.userid = userid;%0A    %7D%0A%0A    public String getPassword() %7B%0A        return password;%0A    %7D%0A%0A    public void setPassword(String password) %7B%0A        this.password = password;%0A   
+rivate IndexableMessage indexableMessage;%0A%0A    @Column%0A    @Size(min = 4, max = 60)%0A    @Attribute(field = false, description = %22Resume indexing messages from this user account email onward. Null indicates start from the beginning.%22)%0A    private String resumeIndexFrom;%0A%0A    @Column%0A    @Attribute(field = false, description = %22Resume indexing messages from this user account email message onward. %22 +%0A            %22The message is an unique identifier of last message processed successfully. Null indicates start from the beginning.%22)%0A    private String  resumeIndexFromMessage;%0A%0A    @Column%0A    @Attribute(field = false, description = %22This is the date to start indexing all user email messages from (message send date). Null indicates start from the beginning of time.%22)%0A    private Date   indexFromDate;%0A%0A    public String getUrl() %7B%0A        return url;%0A    %7D%0A%0A    public void setUrl(String url) %7B%0A        this.url = url;%0A    %7D%0A%0A    public String getUserid() %7B%0A        return userid;%0A    %7D%0A%0A    public void setUserid(String userid) %7B%0A        this.userid = userid;%0A    %7D%0A%0A    public String getPassword() %7B%0A        return password;%0A    %7D%0A%0A    public void setPassword(String password) %7B%0A        this.password = password;%0A    %7D%0A%0A    public IndexableMessage getIndexableMessage() %7B%0A        return indexableMessage;%0A    %7D%0A%0A    public void setIndexableMessage(IndexableMessage indexableMessage) %7B%0A        this.indexableMessage = indexableMessage;%0A    %7D%0A%0A    public Date   getIndexFromDate()%7B return indexFromDate; %7D%0A%0A    public String getResumeIndexFrom()%7B return resumeIndexFrom; %7D%0A%0A    public String getResumeIndexFromMessage()%7B return resumeIndexFromMessage; %7D%0A%0A    public void setIndexFromDate(Date indexFromDate)%7B this.indexFromDate = indexFromDate; %7D%0A%0A    public void setResumeIndexFrom(String emailAddress)%7B this.resumeIndexFrom = emailAddress; %7D%0A%0A    public void setResumeIndexFromMessage(String emailMessageId)%7B this.resumeIndexFromMessage = emailMessageId;
  %7D%0A%7D

add exchange client