p2ps.imp.endpoint
Class EndpointResolverAdvertisementImp
java.lang.Object
p2ps.imp.endpoint.EndpointResolverAdvertisementImp
- All Implemented Interfaces:
- Advertisement, EndpointResolverAdvertisement, java.io.Serializable
- public class EndpointResolverAdvertisementImp
- extends java.lang.Object
- implements EndpointResolverAdvertisement
An implementation of the Pipe Advertisement interface
- 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 |
EndpointResolverAdvertisementImp
public EndpointResolverAdvertisementImp(java.lang.String advertid,
java.lang.String peerid)
EndpointResolverAdvertisementImp
public EndpointResolverAdvertisementImp(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)
getEndpointURIs
public java.net.URI[] getEndpointURIs()
- Specified by:
getEndpointURIs in interface EndpointResolverAdvertisement
- Returns:
- the endpointuri of the resolver in terms of the specified transport
protocol
setEndpointURIs
public void setEndpointURIs(java.net.URI[] uri)
- Sets the endpointuri for this resolver
- Specified by:
setEndpointURIs in interface EndpointResolverAdvertisement
getEndpointSchemes
public java.lang.String[] getEndpointSchemes()
- Specified by:
getEndpointSchemes in interface EndpointResolverAdvertisement
- Returns:
- the pipe types handled by the resolver
setEndpointSchemes
public void setEndpointSchemes(java.lang.String[] types)
- Sets the pipe types for this advert
- Specified by:
setEndpointSchemes in interface EndpointResolverAdvertisement
getResolverForPeerIDs
public java.lang.String[] getResolverForPeerIDs()
- Specified by:
getResolverForPeerIDs in interface EndpointResolverAdvertisement
- Returns:
- the peer ids of the peers handled by the resolver
setResolverForPeerIDs
public void setResolverForPeerIDs(java.lang.String[] peerids)
- Sets the transport protocol for this advert
- Specified by:
setResolverForPeerIDs in interface EndpointResolverAdvertisement
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