edu.wisc.my.webproxy.beans.http
Class PersistedCookieImpl

java.lang.Object
  extended by edu.wisc.my.webproxy.beans.http.PersistedCookieImpl
All Implemented Interfaces:
ICookie, Serializable

public class PersistedCookieImpl
extends Object
implements ICookie, Serializable

PersistedCookieImpl is an embeddable, JPA-persistable implementation of ICookie. This implementation is intended for use by the JPA implementation of IWebProxyState and should closely mirror the information available from an HttpClient cookie instance.

Author:
Jen Bourey, jbourey@unicon.net
See Also:
Serialized Form

Constructor Summary
PersistedCookieImpl(String name, String domain)
           
 
Method Summary
 boolean equals(Object obj)
           
 String getComment()
          Returns the comment describing the purpose of this cookie, or null if no such comment has been defined.
 Date getCreated()
           
 String getDomain()
          Returns domain attribute of the cookie.
 Date getExpiryDate()
          Returns the expiration Date of the cookie, or null if none exists.
 String getName()
          Return the name.
 String getPath()
          Returns the path attribute of the cookie
 Date getUpdated()
           
 String getValue()
           
 int getVersion()
          Returns the version of the cookie specification to which this cookie conforms.
 int hashCode()
           
 boolean isExpired()
          Returns true if this cookie has expired.
 boolean isSecure()
           
protected  void onCreate()
           
protected  void onUpdate()
           
 void setComment(String comment)
          Sets the comment used to describe the cookie's purpose.
 void setExpiryDate(Date expiryDate)
          Sets expiration date.
 void setPath(String path)
          Sets the path attribute.
 void setSecure(boolean secure)
          Sets the secure attribute of the cookie.
 void setValue(String value)
          Set the value.
 void setVersion(int version)
          Sets the version of the cookie specification to which this cookie conforms.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PersistedCookieImpl

public PersistedCookieImpl(String name,
                           String domain)
Method Detail

onCreate

protected void onCreate()

onUpdate

protected void onUpdate()

isExpired

public boolean isExpired()
Description copied from interface: ICookie
Returns true if this cookie has expired.

Specified by:
isExpired in interface ICookie
Returns:
true if the cookie has expired.

getName

public String getName()
Description copied from interface: ICookie
Return the name.

Specified by:
getName in interface ICookie
Returns:
String name The name
See Also:
#setName(String)

getValue

public String getValue()
Specified by:
getValue in interface ICookie

setValue

public void setValue(String value)
Description copied from interface: ICookie
Set the value.

Specified by:
setValue in interface ICookie

getPath

public String getPath()
Description copied from interface: ICookie
Returns the path attribute of the cookie

Specified by:
getPath in interface ICookie
Returns:
The value of the path attribute.
See Also:
ICookie.setPath(java.lang.String)

setPath

public void setPath(String path)
Description copied from interface: ICookie
Sets the path attribute.

Specified by:
setPath in interface ICookie
See Also:
ICookie.getPath()

getDomain

public String getDomain()
Description copied from interface: ICookie
Returns domain attribute of the cookie.

Specified by:
getDomain in interface ICookie
Returns:
the value of the domain attribute
See Also:
#setDomain(java.lang.String)

getExpiryDate

public Date getExpiryDate()
Description copied from interface: ICookie
Returns the expiration Date of the cookie, or null if none exists.

Specified by:
getExpiryDate in interface ICookie
Returns:
Expiration Date, or null.
See Also:
ICookie.setExpiryDate(java.util.Date)

setExpiryDate

public void setExpiryDate(Date expiryDate)
Description copied from interface: ICookie
Sets expiration date.

Specified by:
setExpiryDate in interface ICookie
See Also:
ICookie.getExpiryDate()

getComment

public String getComment()
Description copied from interface: ICookie
Returns the comment describing the purpose of this cookie, or null if no such comment has been defined.

Specified by:
getComment in interface ICookie
Returns:
comment
See Also:
ICookie.setComment(String)

setComment

public void setComment(String comment)
Description copied from interface: ICookie
Sets the comment used to describe the cookie's purpose.

Specified by:
setComment in interface ICookie
See Also:
ICookie.getComment()

isSecure

public boolean isSecure()
Specified by:
isSecure in interface ICookie
Returns:
true if this cookie should only be sent over secure connections.
See Also:
ICookie.setSecure(boolean)

setSecure

public void setSecure(boolean secure)
Description copied from interface: ICookie
Sets the secure attribute of the cookie.

When true the cookie should only be sent using a secure protocol (https). This should only be set when the cookie's originating server used a secure protocol to set the cookie's value.

Specified by:
setSecure in interface ICookie
See Also:
#getSecure()

getVersion

public int getVersion()
Description copied from interface: ICookie
Returns the version of the cookie specification to which this cookie conforms.

Specified by:
getVersion in interface ICookie
Returns:
the version of the cookie.
See Also:
ICookie.setVersion(int)

setVersion

public void setVersion(int version)
Description copied from interface: ICookie
Sets the version of the cookie specification to which this cookie conforms.

Specified by:
setVersion in interface ICookie
See Also:
ICookie.getVersion()

getCreated

public Date getCreated()
Specified by:
getCreated in interface ICookie
Returns:
When this cookie was originally created

getUpdated

public Date getUpdated()
Specified by:
getUpdated in interface ICookie
Returns:
The last time this cookie was updated

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2010 Jasig. All Rights Reserved.