p2ps.imp.endpoint
Class EndpointAdvertisementImp
java.lang.Object
p2ps.imp.endpoint.EndpointAdvertisementImp
- All Implemented Interfaces:
- Advertisement, EndpointAdvertisement, java.io.Serializable
- public class EndpointAdvertisementImp
- extends java.lang.Object
- implements EndpointAdvertisement
An advertisement for a pipe endpoint
- Version:
- $Revision: 295 $
- Author:
- Ian Wang
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EndpointAdvertisementImp
public EndpointAdvertisementImp(java.lang.String peerid,
java.lang.String adverid)
- Construct a failed pipe resolution event
EndpointAdvertisementImp
public EndpointAdvertisementImp(Element root)
throws java.io.IOException
getType
public java.lang.String getType()
- Specified by:
getType in interface Advertisement
- Returns:
- the type for this advertisement
getAdvertID
public java.lang.String getAdvertID()
- Specified by:
getAdvertID in interface Advertisement
- Returns:
- the unique id for this advertisement
getPeerID
public java.lang.String getPeerID()
- Specified by:
getPeerID in interface Advertisement
- Returns:
- the id of the peer that created this advertisement
getExpiryDate
public long getExpiryDate()
- Specified by:
getExpiryDate in interface Advertisement
- Returns:
- the expiry date for this advertisement (-1 if not published)
getEndpointURI
public java.net.URI getEndpointURI()
- Specified by:
getEndpointURI in interface EndpointAdvertisement
- Returns:
- the URI of the endpoint
setEndpointURI
public void setEndpointURI(java.net.URI uri)
- Sets URI of the endpoint
- Specified by:
setEndpointURI in interface EndpointAdvertisement
getScheme
public java.lang.String getScheme()
- Specified by:
getScheme in interface EndpointAdvertisement
- Returns:
- the scheme for the endpoint
getPipeID
public java.lang.String getPipeID()
- Specified by:
getPipeID in interface EndpointAdvertisement
- Returns:
- the pipe id for the endpoint (optional)
setPipeID
public void setPipeID(java.lang.String pipeid)
- Set the pipe id for the endpoint (optional)
- Specified by:
setPipeID in interface EndpointAdvertisement
getXMLAdvert
public Element getXMLAdvert()
throws java.io.IOException
- Output the advert as an XML document
- Specified by:
getXMLAdvert in interface Advertisement
- Returns:
- an XML element for advert
- Throws:
java.io.IOException
getXMLEnvelope
public Element getXMLEnvelope(long expdate)
throws java.io.IOException
- Specified by:
getXMLEnvelope in interface Advertisement
- Parameters:
expdate -
- Returns:
- an XML element for the full enveloped advert (returns the same
as getXMLAdvert if no envelope)
- Throws:
java.io.IOException