Records a restriction on access for one entity, either a profile or an organisation, within an account. Blocks are looked up by the blocked entity together with the account they were raised in, so the same profile can be blocked in one account without being blocked in another. A block can be permanent or expire, which is what the blocked until date controls.
Group: Database Entities
Implements: Serializable
Properties
| Property | Returns | Description |
|---|---|---|
| adminOrg | Organisation | The account the block was raised in. A block only applies within this account, so the lookup of blocks for an entity is always scoped by it. Never null. |
| blockedEntity | BaseEntity | The entity being blocked, which is a profile or an organisation. Never null. |
| blockedUntilDate | Date | The moment the block stops applying. When this is null the block never expires; otherwise it is active only until this date and time. |
| createdBy | Profile | The administrator who raised the block. Null when the block was created automatically rather than by a person. |
| createdDate | Date | When the block was raised, as a timestamp. Never null. |
| id | long | The database identifier of this access block. |
Methods
getId() · getAdminOrg() · setAdminOrg(Organisation adminOrg) · getBlockedEntity() · setBlockedEntity(BaseEntity blockedEntity) · getCreatedBy() · setCreatedBy(Profile createdBy) · getCreatedDate() · setCreatedDate(Date createdDate) · getBlockedUntilDate() · setBlockedUntilDate(Date blockedUntilDate) · isActive(Date now)
getId()
Returns: long
The database identifier of this access block.
getAdminOrg()
Returns: Organisation
The account the block was raised in. A block only applies within this account, so the lookup of blocks for an entity is always scoped by it. Never null.
setAdminOrg(Organisation adminOrg)
Returns: void
Sets the account the block is raised in.
| Parameter | Description |
|---|---|
adminOrg | the account this block belongs to |
getBlockedEntity()
Returns: BaseEntity
The entity being blocked, which is a profile or an organisation. Never null.
setBlockedEntity(BaseEntity blockedEntity)
Returns: void
Sets the entity being blocked.
| Parameter | Description |
|---|---|
blockedEntity | the profile or organisation to block |
getCreatedBy()
Returns: Profile
The administrator who raised the block. Null when the block was created automatically rather than by a person.
setCreatedBy(Profile createdBy)
Returns: void
Sets the administrator who raised the block.
| Parameter | Description |
|---|---|
createdBy | the profile that raised the block, or null if created automatically |
getCreatedDate()
Returns: Date
When the block was raised, as a timestamp. Never null.
setCreatedDate(Date createdDate)
Returns: void
Sets when the block was raised.
| Parameter | Description |
|---|---|
createdDate | the date and time the block was created |
getBlockedUntilDate()
Returns: Date
The moment the block stops applying. When this is null the block never expires; otherwise it is active only until this date and time.
setBlockedUntilDate(Date blockedUntilDate)
Returns: void
Sets the moment the block stops applying.
| Parameter | Description |
|---|---|
blockedUntilDate | the expiry timestamp, or null for a block that never expires |
isActive(Date now)
Returns: boolean
Whether the block still applies at the given moment. A block with no expiry is always active, otherwise it is active while the expiry timestamp is after the given time. The current time is passed in rather than read here, so callers control the clock.
| Parameter | Description |
|---|---|
now | the moment to test the block against |