|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--jxtaimpl.storage.AnthillResource
This class represents a resource in the Anthill network
| Constructor Summary | |
AnthillResource(Content cont,
String species,
URL pipeId,
String pipeName,
String pipeType)
This is the default constructor. |
|
| Method Summary | |
String |
getAttribute(String name)
Returns the value associated to the specified attribute name, or null if there is no attribute with that name. |
protected Content |
getContent()
This protected method can be invoked in order to obtain the Content instance associated with an AnthillResource. |
long |
getContentLength()
Return the lenght of the content of the resource, if available; otherwise, it returns -1. |
InputStream |
getInputStream()
This method returns an InputStream created starting from the Content this resource refers to. |
Object |
getKey()
Returns the key identifier of the object. |
String |
getName()
Returns the string identifier of the object. |
URL |
getPipeId()
This method returns the ID of the pipe for downloading the resource |
String |
getPipeName()
This method returns the name of the pipe for downloading the resource |
String |
getPipeType()
This method returns the type of the pipe for downloading the resource |
String |
getResourceName()
This method returns the logical name of the resource. |
String |
getSpecies()
This method gets the ant species of the ant that obtained this resource |
long |
size()
Return the space required to store the resource object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AnthillResource(Content cont,
String species,
URL pipeId,
String pipeName,
String pipeType)
cont - The Content instance associate with the resourcespecies - The ant species of the ant requiring this resourcepipeId - This is the JXTA pipeID of the local jxtaimpl.DownloadService
input-pipe waiting for download requests to comepipeName - The pipe's logical namepipeType - The pipe's type (point-to-point, propagate, secure)| Method Detail |
public Object getKey()
net.jxta.share.ContentId instance.
getKey in interface Resourcepublic String getName()
net.jxta.share.ContentId instance
converted to String.
getName in interface Resourcepublic String getResourceName()
getKey
and getName methods.
public String getAttribute(String name)
AnthillResource
is based on the net.jxta.share.Content class. Reflection API is used
for discovering getter methods in the ContentAdvertisement class matching
with the "name" input parameter.
getAttribute in interface Resourcename - the name of the attribute (ContentAdvertisement xml-element)
public InputStream getInputStream()
throws IOException
Content this resource refers to. This method has to
be invoke only locally.
getInputStream in interface ResourceIOExceptionpublic long getContentLength()
getContentLength in interface Resourcepublic long size()
size in interface Resourceprotected Content getContent()
public String getSpecies()
public URL getPipeId()
public String getPipeName()
public String getPipeType()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||