orca.sharp
Class Claim

java.lang.Object
  extended by orca.sharp.Claim
All Implemented Interfaces:
java.lang.Cloneable

public class Claim
extends java.lang.Object
implements java.lang.Cloneable


Field Summary
protected  ID claimID
          The globally unique idenitifier of this claim
protected  ID holder
          The globally unique identifier of the holder of the claim
protected  java.security.PublicKey holderKey
          The public key of the holder of this claim
protected  ID issuer
          The globally unique identifier of the issuer of the claim
protected  ID parentID
          The globally unique idenitifer of the parent claim
protected  ResourceClaim rset
          The resources represented by this claim
protected  boolean signed
          Whether this is a signed claim
protected  Term term
          Duration of the term.
protected  java.lang.String xml
          The XML representation of this claim
 
Constructor Summary
protected Claim()
          Creates an empty claim.
  Claim(ID parentID, ID issuer, ID holder, ResourceClaim rset, Term term, java.security.PublicKey holderKey)
          Creates a new unsigned claim
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object o)
           
 Claim extract(int count, Term term, ID newHolderID, java.security.PublicKey holderKey)
          Creates a non-signed subclaim
 void fromXML(org.w3c.dom.Element node)
          Extracts the claim from a DOM tree
 ID getClaimID()
          Returns the identifier of the claim
 ID getHolder()
          Gets the identifier of the holder of the claim
 java.security.PublicKey getHolderKey()
          Returns the public key of the holder of the claim
 ID getIssuer()
          Returns the identifier of the issuer of the claim
 ID getParentID()
          Returns the identifier of the parent claim
 ResourceClaim getResources()
          Returns the ResourceClaim associated with this claim
 Term getTerm()
          Returns the term of the claim
 java.lang.String getXML()
          Returns the xml representation of the signed claim.
 boolean isSigned()
          Checks if the claim is signed
 boolean isSubClaim(Claim claim)
          Checks if the given Claim is a subclaim of this Claim.
 void setClaimID(ID claimID)
          Sets the identifier of the claim
 void setHolder(ID holder)
          Sets the identifier of the holder of the claim
 void setHolderKey(java.security.PublicKey holderKey)
          Sets the public key of the holder of the claim
 void setIssuer(ID issuer)
          Sets the identifier of the issuer of the claim
 void setParentID(ID parentID)
          Sets the identifier of the parent claim
 void setResources(ResourceClaim rset)
          Sets the ResourceClaim associated with this claim
 void setXML(java.lang.String xml)
          Sets the xml representation of the claim
 org.w3c.dom.Element toXML()
          Converts this claim to XML
 void validateClaim()
          Examines the claim fields for consistency
Note: Does not verify the signature.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

claimID

protected ID claimID
The globally unique idenitifier of this claim


parentID

protected ID parentID
The globally unique idenitifer of the parent claim


issuer

protected ID issuer
The globally unique identifier of the issuer of the claim


holder

protected ID holder
The globally unique identifier of the holder of the claim


rset

protected ResourceClaim rset
The resources represented by this claim


term

protected Term term
Duration of the term.


holderKey

protected java.security.PublicKey holderKey
The public key of the holder of this claim


xml

protected java.lang.String xml
The XML representation of this claim


signed

protected boolean signed
Whether this is a signed claim

Constructor Detail

Claim

protected Claim()
Creates an empty claim.


Claim

public Claim(ID parentID,
             ID issuer,
             ID holder,
             ResourceClaim rset,
             Term term,
             java.security.PublicKey holderKey)
Creates a new unsigned claim

Parameters:
parentID -
issuer -
holder -
rset -
term -
holderKey -
Method Detail

isSubClaim

public boolean isSubClaim(Claim claim)
                   throws java.lang.IllegalArgumentException
Checks if the given Claim is a subclaim of this Claim.

Parameters:
claim - the Claim to check
Returns:
true if this Claim contains the given Claim; false otherwise
Throws:
java.lang.IllegalArgumentException - if the given Claim is null

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

extract

public Claim extract(int count,
                     Term term,
                     ID newHolderID,
                     java.security.PublicKey holderKey)
Creates a non-signed subclaim

Parameters:
count - resource units
term - duration of the claim

toXML

public org.w3c.dom.Element toXML()
                          throws java.lang.Exception
Converts this claim to XML

Throws:
java.lang.Exception

fromXML

public void fromXML(org.w3c.dom.Element node)
             throws java.lang.Exception
Extracts the claim from a DOM tree

Parameters:
node -
Throws:
java.lang.Exception

validateClaim

public void validateClaim()
                   throws java.lang.Exception
Examines the claim fields for consistency
Note: Does not verify the signature.

Throws:
java.lang.Exception

getClaimID

public ID getClaimID()
Returns the identifier of the claim


setClaimID

public void setClaimID(ID claimID)
Sets the identifier of the claim


getParentID

public ID getParentID()
Returns the identifier of the parent claim


setParentID

public void setParentID(ID parentID)
Sets the identifier of the parent claim


getIssuer

public ID getIssuer()
Returns the identifier of the issuer of the claim


setIssuer

public void setIssuer(ID issuer)
Sets the identifier of the issuer of the claim


getHolder

public ID getHolder()
Gets the identifier of the holder of the claim


setHolder

public void setHolder(ID holder)
Sets the identifier of the holder of the claim


getResources

public ResourceClaim getResources()
Returns the ResourceClaim associated with this claim


setResources

public void setResources(ResourceClaim rset)
Sets the ResourceClaim associated with this claim


getHolderKey

public java.security.PublicKey getHolderKey()
Returns the public key of the holder of the claim


setHolderKey

public void setHolderKey(java.security.PublicKey holderKey)
Sets the public key of the holder of the claim


getTerm

public Term getTerm()
Returns the term of the claim


isSigned

public boolean isSigned()
Checks if the claim is signed


getXML

public java.lang.String getXML()
Returns the xml representation of the signed claim. Returns null if the claim has not been signed


setXML

public void setXML(java.lang.String xml)
            throws java.lang.Exception
Sets the xml representation of the claim

Throws:
java.lang.Exception


Copyright © 2007 Network/Internet Computing Lab. All Rights Reserved.