public class ResourceLinkShareKey
extends java.lang.Object
A share key is a value which is generated to enable a different resource link to be treated as equivalent to the issuing resource link.
Constructor and Description |
---|
ResourceLinkShareKey(ResourceLink resourceLink,
java.lang.String id)
Construct a share key for a resource link with a specified ID (may be null if
a random ID is to be generated).
|
Modifier and Type | Method and Description |
---|---|
boolean |
delete()
Delete the resource link share key from the database.
|
java.util.Calendar |
getExpires()
Returns the date/time when the share key expires.
|
java.lang.String |
getId()
Returns the share key value.
|
java.lang.Integer |
getLength()
Returns the length to use when generating an ID.
|
java.lang.Integer |
getLife()
Returns the life of the share key (the period of time after creation when
the share key will automatically expire).
|
java.lang.String |
getPrimaryConsumerKey()
Returns the consumer key for the resource link which issued the share key.
|
java.lang.String |
getPrimaryResourceLinkId()
Returns the resource link ID for the resource link which issued the share key.
|
void |
initialise()
Initialise the resource link share key.
|
boolean |
isAutoApprove()
Returns
true if a used share key should be automatically approved
and be given access to the issuing resource link. |
boolean |
save()
Save the resource link share key to the database.
|
void |
setAutoApprove(boolean autoApprove)
Sets whether the share key should be automatically approved when used.
|
void |
setExpires(java.util.Calendar expires)
Set the expiry date/time.
|
void |
setLength(java.lang.Integer length)
Set the length to use when generating a random ID value.
|
void |
setPrimaryConsumerKey(java.lang.String primaryConsumerKey)
Set consumer key representing the issuing resource link.
|
void |
setPrimaryResourceLinkId(java.lang.String primaryResourceLinkId)
Set ID for the issuing resource link.
|
public ResourceLinkShareKey(ResourceLink resourceLink, java.lang.String id)
resourceLink
- ResourceLink objectid
- share key valuepublic final void initialise()
public boolean save()
true
if the share key was successfully savedpublic boolean delete()
true
if the share key was successfully deletedpublic java.lang.String getId()
public java.lang.Integer getLength()
public void setLength(java.lang.Integer length)
length
- public java.lang.Integer getLife()
public java.util.Calendar getExpires()
public void setExpires(java.util.Calendar expires)
expires
- expiry date/timepublic boolean isAutoApprove()
true
if a used share key should be automatically approved
and be given access to the issuing resource link.true
if the share key is to be auto-approved when usedpublic void setAutoApprove(boolean autoApprove)
autoApprove
- true
if the share key should be auto approvedpublic java.lang.String getPrimaryConsumerKey()
public void setPrimaryConsumerKey(java.lang.String primaryConsumerKey)
primaryConsumerKey
- primary consumer keypublic java.lang.String getPrimaryResourceLinkId()
public void setPrimaryResourceLinkId(java.lang.String primaryResourceLinkId)
primaryResourceLinkId
- primary resource link ID