org.gcube.contentmanagement.baselayer
Class RawContentLocation

java.lang.Object
  extended by org.gcube.contentmanagement.baselayer.RawContentLocation
Direct Known Subclasses:
InMemoryRawContentLocation

public class RawContentLocation
extends java.lang.Object

This class represents an abstract location of logical or physical location of content, e.g. a file. It is up to the implementors of RawFileContentManager to handle it in a way most appropriate for their needs.


Constructor Summary
RawContentLocation()
          Constructs a new location
RawContentLocation(java.lang.String contentid, java.lang.String dataprovider)
          Constructs a new location
RawContentLocation(java.lang.String contentid, java.lang.String dataprovider, long sizeInBytes)
          Constructs a new location
 
Method Summary
 java.lang.String getContentID()
          Returns the ID of the content that uniquely identifies the content for this provider
 java.lang.String getDataprovider()
          Returns the String that identifies the provider.
 long getSize()
          Returns the size of the content represented by this location
 void setContentID(java.lang.String contentID)
          Sets the ID of the content that uniquely identifies the content for this provider
 void setDataprovider(java.lang.String dataprovider)
          Sets the String that identifies the provider.
 void setSize(long size)
          Sets the size of the content represented by this location
 java.lang.String toString()
          Generates a human-readable representation of the content location.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RawContentLocation

public RawContentLocation()
Constructs a new location


RawContentLocation

public RawContentLocation(java.lang.String contentid,
                          java.lang.String dataprovider)
Constructs a new location

Parameters:
contentid - the content ID
dataprovider - the data provider

RawContentLocation

public RawContentLocation(java.lang.String contentid,
                          java.lang.String dataprovider,
                          long sizeInBytes)
Constructs a new location

Parameters:
contentid - the content ID
dataprovider - the data provider
sizeInBytes - the size of the content
Method Detail

getContentID

public java.lang.String getContentID()
Returns the ID of the content that uniquely identifies the content for this provider

Returns:
the content ID

setContentID

public void setContentID(java.lang.String contentID)
Sets the ID of the content that uniquely identifies the content for this provider

Parameters:
contentID - the content ID

getDataprovider

public java.lang.String getDataprovider()
Returns the String that identifies the provider. This String is kept configurable to be able to switch implementations / URLs on reconfiguration time of Storage Management.

Returns:
the provider of the content

setDataprovider

public void setDataprovider(java.lang.String dataprovider)
Sets the String that identifies the provider. This String is kept configurable to be able to switch implementations / URLs on reconfiguration time of Storage Management.

Parameters:
dataprovider - the provider of the content

toString

public java.lang.String toString()
Generates a human-readable representation of the content location.

Overrides:
toString in class java.lang.Object
Returns:
the content location as a string

getSize

public long getSize()
Returns the size of the content represented by this location

Returns:
the size in bytes (if known), otherwise BaseLayerStream.STREAM_LENGTH_IMPLICITE

setSize

public void setSize(long size)
Sets the size of the content represented by this location

Parameters:
size - the size in bytes (if known); if not set because it is unkwown, it is BaseLayerStream.STREAM_LENGTH_IMPLICITE