public interface RepositoryItem
Modifier and Type | Method and Description |
---|---|
void |
addCommandFields(Packet packet)
The method is used for handling ad-hoc commands.
|
String[] |
getAdmins()
Returns an array with the Item administrators, that is people IDs who can manage,
configure and control less critical elements of the Item, like changing less critical
configuration settings.
|
String |
getKey()
Returns a unique key for the item in the repository.
|
String |
getOwner()
Returns the owner ID of the item.
|
void |
initFromCommand(Packet packet)
The method used for handling ad-hoc commands.
|
void |
initFromElement(Element elem)
The item can be also initialized from a more complex repositories: XML repository
or SQL database.
|
void |
initFromPropertyString(String propString)
The item can be initialized based on the data loaded from a configuration file.
|
boolean |
isAdmin(String id)
The method checks whether the given id is one of the administrators set for the Item.
|
boolean |
isOwner(String id)
The method checks whether the person with given ID is the Item owner.
|
void |
setAdmins(String[] admins)
Returns an array with the Item administrators, that is people IDs who can manage,
configure and control less critical elements of the Item, like changing less critical
configuration settings.
|
void |
setOwner(String owner)
Set the Item owner.
|
Element |
toElement()
Item data can be stored in a more complex form than a simple property string.
|
String |
toPropertyString()
The item can be initialized based on the data loaded from a configuration file.
|
void addCommandFields(Packet packet)
packet
- with empty ad-hoc command to fill with fieldsString[] getAdmins()
String getKey()
String getOwner()
void initFromCommand(Packet packet)
packet
- with ad-hoc command filled by the user.void initFromElement(Element elem)
elem
- XML Element with all the item initialization data.void initFromPropertyString(String propString)
propString
- is a property string to initialize the RepositoryItem.boolean isAdmin(String id)
id
- is an ID of a person for which we check access permissions.boolean isOwner(String id)
id
- is an ID of a person for whom we check access permissions.void setAdmins(String[] admins)
admins
- is an array with the Item administrators IDs to set for the Item.void setOwner(String owner)
owner
- is the Item owner ID.Element toElement()
String toPropertyString()
Copyright © 2017 "Tigase, Inc.". All rights reserved.