| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentLinkedQueue<ProtectAction> |
queue |
| Constructor and Description |
|---|
Protection(Output output,
File protectionFile) |
| Modifier and Type | Method and Description |
|---|---|
void |
disable()
Needs to be called to make protection thread empty the queue before program ends
|
Thread |
enqueue(ProtectAction protectAction)
Enqueue a ProtectAction.
|
Set<User> |
getFriends(User owner)
Gets an immutable Set of friends for a user
|
Set<Material> |
getLocks(User owner)
Gets an immutable Set of locked materials for a user
|
Set<Material> |
getProtections(User owner)
Gets an immutable Set of protected materials for a user
|
boolean |
hasAccess(User owner,
Material material,
User user)
Checks whether a user can access an Ownable consisting of the specified material that is owned by the specified owner.
|
boolean |
isFriend(User owner,
User user)
Checks whether owner has declared user as a friend.
|
boolean |
isLocked(User owner,
Material material)
Checks whether the user has locked the access to the material
|
boolean |
isProtected(User owner,
Material material)
Checks whether the material is protected
|
void |
run() |
protected void |
syncedEnqueue(ProtectAction protectAction) |
protected final ConcurrentLinkedQueue<ProtectAction> queue
public Protection(Output output, File protectionFile) throws IOException
IOExceptionpublic boolean hasAccess(User owner, Material material, User user)
owner - the ownermaterial - the materialuser - the userpublic boolean isLocked(User owner, Material material)
owner - the ownermaterial - the materialpublic boolean isFriend(User owner, User user)
owner - the owneruser - the userpublic boolean isProtected(User owner, Material material)
owner - the ownermaterial - the materialpublic Set<User> getFriends(User owner)
owner - the Userpublic Set<Material> getLocks(User owner)
owner - the Userpublic Set<Material> getProtections(User owner)
owner - the Userpublic final Thread enqueue(ProtectAction protectAction)
protectAction - the ProtectActionprotected final void syncedEnqueue(ProtectAction protectAction)
public void disable()
Copyright © 2015. All rights reserved.