JXTA

net.jxta.impl.protocol
Class LeaseResponseMsg

java.lang.Object
  extended by net.jxta.impl.protocol.LeaseResponseMsg

public class LeaseResponseMsg
extends Object

A Leasing Protocol Response Message.


 
   
     
     
       
         
           
              
             
           
         
       
     
     
       
         
           
             
           
         
       
     
   
   
   
 
 

Since:
JXTA 2.4

Constructor Summary
LeaseResponseMsg()
          New LeaseResponseMsg
LeaseResponseMsg(Element root)
          Construct from a StructuredDocument
 
Method Summary
 void addReferralAdv(RdvAdvertisement referralAdv, long referralAdvExp)
          Adds a referral advertisement to the collection of referral advertisements.
 void addReferralAdvs(List<RdvAdvertisement> referralAdvs, List<Long> referralAdvExps)
          Adds referral advertisements to the collection of referral advertisements.
 void clearReferralAdvs()
          Clears the list of referral advertisements.
 Object clone()
          
 XMLElement getCredential()
          Returns the credential of the server providing this response in XML format.
 Document getDocument(MimeMediaType mediaType)
          
static String getMessageType()
          Our DOCTYPE
 long getOfferedLease()
          Returns the lease being offered.
 Long[] getReferralAdvExps()
          Returns an ordered list of the referral advertisements expirations.
 RdvAdvertisement[] getReferralAdvs()
          Returns an ordered list of the referral advertisements.
 RdvAdvertisement getServerAdv()
          Returns the advertisement of the server providing this response.
 long getServerAdvExp()
          Returns the advertisement expiration duration of the server's advertisement.
 UUID getServerAdvGen()
          Returns the advertisement generation of the server's advertisement.
 ID getServerID()
          Returns the ID of the server providing this response.
protected  boolean handleElement(XMLElement elem)
          Process an element of the message XML document.
 void setCredential(XMLElement newCred)
          Sets the credential of the server providing this response in XML format.
 void setOfferedLease(long offeredLease)
          Sets the lease being offered.
 void setServerAdv(RdvAdvertisement serverAdv, UUID serverAdvGen, long serverAdvExp)
          Sets the server advertisement and the associated advertisement generation and expiration.
 void setServerID(ID serverID)
          Sets the ID of the server providing this response.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeaseResponseMsg

public LeaseResponseMsg()
New LeaseResponseMsg


LeaseResponseMsg

public LeaseResponseMsg(Element root)
Construct from a StructuredDocument

Parameters:
root - the element
Method Detail

clone

public Object clone()
             throws CloneNotSupportedException

Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getServerID

public ID getServerID()
Returns the ID of the server providing this response.

Returns:
ID of the server.

setServerID

public void setServerID(ID serverID)
Sets the ID of the server providing this response.

Parameters:
serverID - ID of the server.

getServerAdv

public RdvAdvertisement getServerAdv()
Returns the advertisement of the server providing this response.

Returns:
The servers advertisement.

getServerAdvGen

public UUID getServerAdvGen()
Returns the advertisement generation of the server's advertisement.

Returns:
The advertisement generation of the server's advertisement.

getServerAdvExp

public long getServerAdvExp()
Returns the advertisement expiration duration of the server's advertisement. Must be a positive integer.

Returns:
The advertisement expiration duration of the server's advertisement.

setServerAdv

public void setServerAdv(RdvAdvertisement serverAdv,
                         UUID serverAdvGen,
                         long serverAdvExp)
Sets the server advertisement and the associated advertisement generation and expiration.

Parameters:
serverAdv - The servers advertisement.
serverAdvGen - The advertisement generation of the server's advertisement. Must be a positive integer.
serverAdvExp - The advertisement expiration duration of the server's advertisement.

getReferralAdvs

public RdvAdvertisement[] getReferralAdvs()
Returns an ordered list of the referral advertisements.

Returns:
An ordered list of the referral advertisements.

getReferralAdvExps

public Long[] getReferralAdvExps()
Returns an ordered list of the referral advertisements expirations. The order of the expirations matches the order of advertisements returned by getReferralAdvs(). Each entry is a positive integer.

Returns:
An ordered list of the referral advertisements expirations.

addReferralAdv

public void addReferralAdv(RdvAdvertisement referralAdv,
                           long referralAdvExp)
Adds a referral advertisement to the collection of referral advertisements. The advertisement is added at the end of the ordered list.

Parameters:
referralAdv - The referral advertisement.
referralAdvExp - The expiration time of the referral advertisement. The value must be a positive integer.

addReferralAdvs

public void addReferralAdvs(List<RdvAdvertisement> referralAdvs,
                            List<Long> referralAdvExps)
Adds referral advertisements to the collection of referral advertisements. The advertisements are added at the end of the ordered list.

Parameters:
referralAdvs - The referral advertisements.
referralAdvExps - The expiration times of the referral advertisement. The values must be a positive integer.

clearReferralAdvs

public void clearReferralAdvs()
Clears the list of referral advertisements.


getOfferedLease

public long getOfferedLease()
Returns the lease being offered. The value must be greater than or equal to zero or the constant Long.MIN_VALUE which indicates that no lease is being offered.

Returns:
The lease being offered.

setOfferedLease

public void setOfferedLease(long offeredLease)
Sets the lease being offered. The value must be greater than or equal to zero or the constant Long.MIN_VALUE which indicates that no lease is being offered.

Parameters:
offeredLease - The lease being offered.

getCredential

public XMLElement getCredential()
Returns the credential of the server providing this response in XML format.

Returns:
The credential associated with this response if any. May be null to indicate that no credential was provided.

setCredential

public void setCredential(XMLElement newCred)
Sets the credential of the server providing this response in XML format.

Parameters:
newCred - The credential associated with this response if any. May be null to indicate that no credential is being provided.

getMessageType

public static String getMessageType()
Our DOCTYPE

Returns:
the type of this message.

handleElement

protected boolean handleElement(XMLElement elem)
Process an element of the message XML document.

Parameters:
elem - The element to process.
Returns:
If true then the element was processed otherwise false.

getDocument

public Document getDocument(MimeMediaType mediaType)


JXSE