JXTA

net.jxta.impl.protocol
Class LeaseRequestMsg

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

public class LeaseRequestMsg
extends Object

A Leasing Protocol Request Message.


  <xs:complexType name="LeaseRequestMessage">
      <xs:sequence>
          <xs:element name="Credential" type="jxta:Cred" />
          <xs:element name="ClientAdv" minOccurs="0" >
              <xs:complexType>
                  <xs:complexContent>
                      <xs:extension  base="jxta:PA">
                          <xs:attribute name="expiration" use="required" type="xs:unsignedLong" />
                      </xs:extension>
                  </xs:complexContent>
              </xs:complexType>
          </xs:element>
          <xs:element name="Option" minOccurs="0" maxOccurs="unbounded" type="xs:anyType" />
      </xs:sequence>
      <xs:attribute name="client_id" use="required" type="jxta:JXTAID" />
      <xs:attribute name="requested_lease" type="xs:unsignedLong" />
      <xs:attribute name="server_adv_gen" type="jxta:uuid" />
      <xs:attribute name="referral_advs" type="xs:unsignedInt" />
  </xs:complexType>
 

Since:
2.5

Constructor Summary
LeaseRequestMsg()
          New LeaseRequestMsg
LeaseRequestMsg(Element root)
          Construct from a XLMElement
 
Method Summary
 Object clone()
          
 ID getClientID()
          Returns the ID of the client making this request.
 XMLElement getCredential()
          Returns the credential of the client making this request in XML format.
 Document getDocument(MimeMediaType mediaType)
          
static String getMessageType()
          Our DOCTYPE
 int getReferralAdvs()
          Returns the number of referral advertisements requested by the client.
 long getRequestedLease()
          Return the duration of the lease being requested.
 UUID getServerAdvGen()
          Returns the advertisement generation of the server advertisement which is known to the client.
protected  boolean handleElement(XMLElement elem)
           
 void setClientID(ID clientID)
          Sets the ID of the client making this request.
 void setCredential(XMLElement newCred)
          Sets the credential of the client making this request in XML format.
 void setReferralAdvs(int referralAdvs)
          Sets the number of referral advertisements requested by the client.
 void setRequestedLease(long requestedLease)
          Set the duration of the lease being requested.
 void setServerAdvGen(UUID serverAdvGen)
          Sets the advertisement generation of the server advertisement which is known to the client.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeaseRequestMsg

public LeaseRequestMsg()
New LeaseRequestMsg


LeaseRequestMsg

public LeaseRequestMsg(Element root)
Construct from a XLMElement

Method Detail

clone

public Object clone()
             throws CloneNotSupportedException

Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getClientID

public ID getClientID()
Returns the ID of the client making this request.

Returns:
ID of the client.

setClientID

public void setClientID(ID clientID)
Sets the ID of the client making this request.

Parameters:
clientID - ID of the client.

getServerAdvGen

public UUID getServerAdvGen()
Returns the advertisement generation of the server advertisement which is known to the client. May be null to indicate that the client does not have a previous version of the server advertisement.

Returns:
The server advertisement generation.

setServerAdvGen

public void setServerAdvGen(UUID serverAdvGen)
Sets the advertisement generation of the server advertisement which is known to the client. May be null to indicate that the client does not have a previous version of the server advertisement.

Parameters:
serverAdvGen - The server advertisement generation.

getRequestedLease

public long getRequestedLease()
Return the duration of the lease being requested. The duration must be a positive integer or Long.MIN_VALUE which indicates that no lease is being requested.

Returns:
The duration of the lease being requested.

setRequestedLease

public void setRequestedLease(long requestedLease)
Set the duration of the lease being requested. The duration must be a positive integer or Long.MIN_VALUE which indicates that no lease is being requested.

Parameters:
requestedLease - The duration of the lease being requested.

getReferralAdvs

public int getReferralAdvs()
Returns the number of referral advertisements requested by the client. Must be a positive integer or Integer.MIN_VALUE which indicates that the default number is requested.

Returns:
the number of referral advertisements requested by the client.

setReferralAdvs

public void setReferralAdvs(int referralAdvs)
Sets the number of referral advertisements requested by the client. Must be a positive integer or Integer.MIN_VALUE which indicates that the default number is requested.

Parameters:
referralAdvs - The number of referral advertisements requested.

getCredential

public XMLElement getCredential()
Returns the credential of the client making this request in XML format.

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

setCredential

public void setCredential(XMLElement newCred)
Sets the credential of the client making this request in XML format.

Parameters:
newCred - The credential associated with this request 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)

getDocument

public Document getDocument(MimeMediaType mediaType)


JXSE