Package com.logicaldoc.core.ticket

# Class Ticket

java.lang.Object
com.logicaldoc.core.PersistentObject
com.logicaldoc.core.ticket.Ticket

All Implemented Interfaces:
  `Serializable`

@Entity public class Ticket extends PersistentObject
Represents ticket, most of the time this is used to model download tickets.

Author:
  Michael Scholz, Marco Meschieri
See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`DOWNLOAD`
`static final int`
`PSW_RECOVERY`
`static final int`
`VIEW`

### Fields inherited from class com.logicaldoc.core.PersistentObject

`DELETED_CODE_DEFAULT, DELETED_CODE_STRONG, id`

## Constructor Summary

Constructors
Constructor
Description
`Ticket()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
`int`
`getCount()`
`String`
`getDecodedPassword()`
`long`
`getDocId()`
`Date`
`getExpired()`
`Integer`
`getExpireHours()`
`Integer`
`getMaxCount()`
`Integer`
`getMaxViews()`
`String`
`getPassword()`
`String`
`getSuffix()`
`String`
`getTicketId()`
`int`
`getType()`
`String`
`getUrl()`
`long`
`getUserId()`
`int`
`getViews()`
`int`
`hashCode()`
`boolean`
`isEnabled()`
`boolean`
`isTicketExpired()`
`boolean`
`isTicketViewExpired()`
`void`
`setCount(int count)`
`void`
`setDecodedPassword(String pwd)`
Sets the password and encode it
`void`
`setDocId(long docId)`
`void`
`setEnabled(boolean enabled)`
`void`
`setExpired(Date expired)`
`void`
`setExpireHours(Integer expireHours)`
`void`
`setMaxCount(Integer maxCount)`
`void`
`setMaxViews(Integer maxViews)`
`void`
`setPassword(String pwd)`
`void`
`setSuffix(String suffix)`
`void`
`setTicketId(String ticketId)`
`void`
`setType(int type)`
`void`
`setUrl(String url)`
`void`
`setUserId(long userId)`
`void`
`setViews(int views)`

### Methods inherited from class com.logicaldoc.core.PersistentObject

`getCreation, getDeleted, getId, getLastModified, getRecordVersion, getTenantId, setCreation, setDeleted, setId, setLastModified, setRecordVersion, setTenantId, toString`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### DOWNLOAD

public static final int DOWNLOAD

See Also:
  - Constant Field Values

### PSW_RECOVERY

public static final int PSW_RECOVERY

See Also:
  - Constant Field Values

### VIEW

public static final int VIEW

See Also:
  - Constant Field Values

## Constructor Details

### Ticket

public Ticket()

## Method Details

### getDocId

public long getDocId()

### setDocId

public void setDocId(long docId)

### getTicketId

public String getTicketId()

Returns:
  Returns the ticketId.

### setTicketId

public void setTicketId(String ticketId)

Parameters:
  `ticketId` - The ticketId to set.

### getUserId

public long getUserId()

### setUserId

public void setUserId(long userId)

### getType

public int getType()

### setType

public void setType(int type)

### getExpired

public Date getExpired()

### setExpired

public void setExpired(Date expired)

### getCount

public int getCount()

### setCount

public void setCount(int count)

### isTicketExpired

public boolean isTicketExpired()

### isTicketViewExpired

public boolean isTicketViewExpired()

### getSuffix

public String getSuffix()

### setSuffix

public void setSuffix(String suffix)

### getUrl

public String getUrl()

### setUrl

public void setUrl(String url)

### getMaxCount

public Integer getMaxCount()

### setMaxCount

public void setMaxCount(Integer maxCount)

### isEnabled

public boolean isEnabled()

### setEnabled

public void setEnabled(boolean enabled)

### getViews

public int getViews()

### setViews

public void setViews(int views)

### getMaxViews

public Integer getMaxViews()

### setMaxViews

public void setMaxViews(Integer maxViews)

### getExpireHours

public Integer getExpireHours()

### setExpireHours

public void setExpireHours(Integer expireHours)

### getPassword

public String getPassword()

### setPassword

public void setPassword(String pwd)

### setDecodedPassword

public void setDecodedPassword(String pwd) throws NoSuchAlgorithmException
Sets the password and encode it

Parameters:
  `pwd` - The password in readable format
Throws:
  `NoSuchAlgorithmException` - Crypting error

### getDecodedPassword

public String getDecodedPassword()

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `PersistentObject`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `PersistentObject`