com.vodafone360.people.engine.content
Class ContentObject

java.lang.Object
  extended by com.vodafone360.people.engine.content.ContentObject

public class ContentObject
extends java.lang.Object

ContentObject is the class for transferring contents It contains the URL for downloads or a link for uploads, the protocol, the transfer direction and status. After it is created it will be processed by the ContentEngine which will, after the transfer is done, pass it over to the Handler implementing the TranferListener.


Nested Class Summary
static class ContentObject.Protocol
          Protocol used for the Transfer.
static class ContentObject.TransferDirection
          TransferDirection determines if the ContentObject is to be uploaded or downloaded.
static class ContentObject.TransferStatus
          The TransferStatus of the ContentObject.
 
Field Summary
private  ExternalResponseObject mExtResponse
          Answer from the Server.
private  java.lang.String mId
          id can be used for some unique ids.
private  java.lang.Object mLink
          Link to an Object.
private  java.io.File mPath
          File to upload or path for saving downloaded content Depends on TransferDirection.
private  ContentObject.Protocol mProtocol
          Member containing the protocol to be used.
private  ContentObject.TransferStatus mStatus
          Actual status of the ContentObject.
private  ContentObject.TransferDirection mTransferDirection
          Member holding the TransferDirection.
private  TransferListener mTransferListener
          TransferLister to be called after transfer for further processing.
private  java.net.URL mUrl
          Url for the download.
private  java.lang.String mUrlParams
          additional params for the transfer.
 
Constructor Summary
ContentObject(java.lang.String id, java.lang.Object link, TransferListener transferListener, ContentObject.TransferDirection transferDirection, ContentObject.Protocol protocol)
          Constructor for the ContentObject.
 
Method Summary
 ContentObject.TransferDirection getDirection()
          Getter for the TransferDirection.
 ExternalResponseObject getExternalResponseObject()
          Getter for the ExternalResponseObject.
 java.lang.String getId()
          Getter for the id.
 java.lang.Object getLink()
          Getter for the Link.
 java.io.File getPath()
          Getter for the path.
 ContentObject.Protocol getProtocol()
          Getter for the Protocol.
 ContentObject.TransferStatus getStatus()
          Getter for the TransferStatus.
 TransferListener getTransferListener()
          Getter for the TransferListener.
 java.net.URL getUrl()
          Getter for the URL.
 java.lang.String getUrlParams()
          Getter for the UrlParams.
 void setExtResponse(ExternalResponseObject extResponse)
          Setter for the ExternalResponse.
 void setPath(java.io.File path)
          Setter for the path.
 void setTransferStatus(ContentObject.TransferStatus status)
          Setter for the TransferStatus.
 void setUrl(java.net.URL url)
          Setter for the URL.
 void setUrlParams(java.lang.String urlParams)
          Setter for the UrlParamas
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mId

private java.lang.String mId
id can be used for some unique ids.


mUrl

private java.net.URL mUrl
Url for the download.


mUrlParams

private java.lang.String mUrlParams
additional params for the transfer.


mPath

private java.io.File mPath
File to upload or path for saving downloaded content Depends on TransferDirection.


mStatus

private ContentObject.TransferStatus mStatus
Actual status of the ContentObject.


mTransferListener

private TransferListener mTransferListener
TransferLister to be called after transfer for further processing.


mTransferDirection

private ContentObject.TransferDirection mTransferDirection
Member holding the TransferDirection.


mLink

private java.lang.Object mLink
Link to an Object. If downloading thumbnails for contacts this field would contain the Contact object for which the thumbnail should be downloaded.


mProtocol

private ContentObject.Protocol mProtocol
Member containing the protocol to be used.


mExtResponse

private ExternalResponseObject mExtResponse
Answer from the Server.

Constructor Detail

ContentObject

ContentObject(java.lang.String id,
              java.lang.Object link,
              TransferListener transferListener,
              ContentObject.TransferDirection transferDirection,
              ContentObject.Protocol protocol)
Constructor for the ContentObject. Only sets the parameters.

Parameters:
id - The unique id, if needed
link - Link to a object
transferListener - TranferListener for this Handler
transferDirection - Upload or download
protocol - Protocol to be used for transfer
Method Detail

getUrlParams

public final java.lang.String getUrlParams()
Getter for the UrlParams.

Returns:
the urlParams

setUrlParams

public final void setUrlParams(java.lang.String urlParams)
Setter for the UrlParamas

Parameters:
urlParams - the urlParams to set.

setExtResponse

public final void setExtResponse(ExternalResponseObject extResponse)
Setter for the ExternalResponse.

Parameters:
extResponse - to be set

getExternalResponseObject

public final ExternalResponseObject getExternalResponseObject()
Getter for the ExternalResponseObject.

Returns:
ExternalResponseObject

getProtocol

public final ContentObject.Protocol getProtocol()
Getter for the Protocol.

Returns:
Protocol used for transfer

getId

public final java.lang.String getId()
Getter for the id.

Returns:
id

getUrl

public final java.net.URL getUrl()
Getter for the URL.

Returns:
URL for the transfer

setUrl

public final void setUrl(java.net.URL url)
Setter for the URL.

Parameters:
url - URL for the transfer

getPath

public final java.io.File getPath()
Getter for the path.

Returns:
Instance of File. Points to a place where the downloaded file should be stored or the to be uploaded file can be found

setPath

public final void setPath(java.io.File path)
Setter for the path.

Parameters:
path - Instance of File. Points to a place where the downloaded file should be stored or the to be uploaded file can be found

getStatus

public final ContentObject.TransferStatus getStatus()
Getter for the TransferStatus.

Returns:
The TransferStatus

setTransferStatus

public final void setTransferStatus(ContentObject.TransferStatus status)
Setter for the TransferStatus.

Parameters:
status - The TransferStatus to set for this object

getTransferListener

public final TransferListener getTransferListener()
Getter for the TransferListener.

Returns:
TransferListener for this handler

getLink

public final java.lang.Object getLink()
Getter for the Link.

Returns:
then Link

getDirection

public final ContentObject.TransferDirection getDirection()
Getter for the TransferDirection.

Returns:
transferDirection


JavaDoc