/*
 * @#IntraUserNetworkServiceMessage.java - 2015
 * Copyright bitDubai.com., All rights reserved.
 * You may not modify, use, reproduce or distribute this software.
 * BITDUBAI/CONFIDENTIAL
 */
package com.bitdubai.fermat_dmp_plugin.layer.network_service.intra_user.developer.bitdubai.version_1.structure;



import com.bitdubai.fermat_p2p_api.layer.p2p_communication.Message;
import com.bitdubai.fermat_p2p_api.layer.p2p_communication.MessagesStatus;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.UUID;

/**
 * The Class <code>com.bitdubai.fermat_dmp_plugin.layer._11_network_service.intra_user.developer.bitdubai.version_1.structure.IntraUserNetworkServiceMessage</code>
 * is the implementation of the message<p/>
 * Created by Roberto Requena - (rart3001@gmail.com) on 09/06/15.
 *
 * @version 1.0
 * @since Java JDK 1.7
 */
public class IntraUserNetworkServiceMessage implements Message, Serializable {

    /**
     * Represent the serialVersionUID
     */
    private static final long serialVersionUID = 1L;

    /**
     * Represent the id of the message
     */
    private Long id;

    /**
     * Represent the sender of the message
     */
    private UUID sender;

    /**
     * Represent the receiver of the message
     */
    private UUID receiver;

    /**
     * Represent the textContent
     */
    private String textContent;

    /**
     * Represent the type of the message
     */
    private String typeMessage;

    /**
     * Represent the shipping timestamp of the message
     */
    private Timestamp shippingTimestamp;

    /**
     * Represent the delivery timestamp of the message
     */
    private Timestamp deliveryTimestamp;

    /**
     * Represent the status
     */
    private MessagesStatus status;


    /**
     * Constructor
     */
    public IntraUserNetworkServiceMessage(){
        super();
        this.deliveryTimestamp = null;
        this.id           = null;
        this.receiver     = null;
        this.sender       = null;
        this.shippingTimestamp = new Timestamp(System.currentTimeMillis())  ;
        this.status       = null;
        this.textContent  = null;
        this.typeMessage  = null;
    }

    /**
     * Constructor whit parameters
     */
    public IntraUserNetworkServiceMessage(Timestamp deliveryTimestamp, Long id, UUID receiver, UUID sender, Timestamp shippingTimestamp, MessagesStatus status, String textContent, String typeMessage) {
        super();
        this.deliveryTimestamp = deliveryTimestamp;
        this.id           = id;
        this.receiver     = receiver;
        this.sender       = sender;
        this.shippingTimestamp = shippingTimestamp;
        this.status       = status;
        this.textContent  = textContent;
        this.typeMessage  = typeMessage;
    }

    /**
     * Get the deliveryTimestamp
     *
     * @return Long the delivery time
     */
    public Timestamp getDeliveryTimestamp() {
        return deliveryTimestamp;
    }

    /**
     * Set the deliveryTimestamp
     *
     * @param deliveryTimestamp the delivery time
     */
    public void setDeliveryTimestamp(Timestamp deliveryTimestamp) {
        this.deliveryTimestamp = deliveryTimestamp;
    }

    /**
     * Get the id
     *
     * @return Long the id
     */
    public Long getId() {
        return id;
    }

    /**
     * Set the id
     *
     * @param id the id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * Get the id of the receiver
     *
     * @return UUID the id of the receiver
     */
    public UUID getReceiver() {
        return receiver;
    }

    /**
     * Set the id of the receiver
     *
     * @param receiver the id of the receiver
     */
    public void setReceiver(UUID receiver) {
        this.receiver = receiver;
    }

    /**
     * Get the id of the sender
     *
     * @return the id of the sender
     */
    public UUID getSender() {
        return sender;
    }

    /**
     * Set the id of the sender
     *
     * @param sender the id of the sender
     */
    public void setSender(UUID sender) {
        this.sender = sender;
    }

    /**
     * Get the shipping time
     *
     * @return the shipping time
     */
    public Timestamp getShippingTimestamp() {
        return shippingTimestamp;
    }

    /**
     * Set the shipping time
     *
     * @param shippingTimestamp the shipping time
     */
    public void setShippingTimestamp(Timestamp shippingTimestamp) {
        this.shippingTimestamp = shippingTimestamp;
    }

    /**
     * Get the status
     *
     * @return the status
     */
    @Override
    public MessagesStatus getStatus() {
        return status;
    }

    /**
     * Set the status
     *
     * @param status the status
     */
    public void setStatus(MessagesStatus status) {
        this.status = status;
    }

    /**
     * Get the textContent
     *
     * @return  the textContent
     */
    @Override
    public String getTextContent() {
        return textContent;
    }

    /**
     * Set the textContent
     *
     * @param textContent the textContent
     */
    @Override
    public void setTextContent(String textContent) {
        this.textContent = textContent;
    }

    /**
     * Get the textContent
     *
     * @return the textContent
     */
    public String getTypeMessage() {
        return typeMessage;
    }

    /**
     * Set the type message
     * @param typeMessage the type message
     */
    public void setTypeMessage(String typeMessage) {
        this.typeMessage = typeMessage;
    }
}

@@ -446,16 +446,90 @@
 sStatus;
+%0Aimport com.bitdubai.fermat_p2p_api.layer.p2p_communication.MessagesTypes;
 %0A%0Aimport
@@ -602,16 +602,53 @@
 .UUID;%0A%0A
+import sun.misc.resources.Messages;%0A%0A
 /**%0A * T
@@ -1553,34 +1553,41 @@
 private 
-String typeM
+MessagesTypes m
 essage
+Type
 ;%0A%0A    /
@@ -2285,28 +2285,27 @@
    this.
-typeM
+m
 essage
- 
+Type
  = null;
@@ -2543,34 +2543,41 @@
 ontent, 
-String typeM
+MessagesTypes m
 essage
+Type
 ) %7B%0A    
@@ -2893,34 +2893,33 @@
 his.
-typeM
+m
 essage
-  = typeM
+Type = m
 essage
+Type
 ;%0A  
@@ -5454,29 +5454,36 @@
 lic 
-String get
+Messages
 Type
+s get
 Message
+Type
 () %7B
@@ -5498,27 +5498,27 @@
  return 
-typeM
+m
 essage
+Type
 ;%0A    %7D%0A
@@ -5568,27 +5568,27 @@
  @param 
-typeM
+m
 essage
+Type
  the typ
@@ -5628,38 +5628,45 @@
  set
+Message
 Type
+(
 Message
-(String typeM
+sTypes m
 essage
+Type
 ) %7B%0A
@@ -5682,33 +5682,33 @@
 his.
-typeM
+m
 essage
- = typeM
+Type = m
 essage
+Type
 ;%0A  

Change the messageType field from String to Enum