public class ExtServiceDiscoItem extends RepositoryItemAbstract
ADMINS_ATT, ADMINS_LABEL, OWNER_ATT, OWNER_LABEL
Constructor and Description |
---|
ExtServiceDiscoItem() |
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 |
getElemName() |
String |
getKey()
Returns a unique key for the item in the repository.
|
String |
getOwner()
Returns the owner ID of the item.
|
String |
getType() |
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.
|
protected void |
setKey(String key) |
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.
|
public void addCommandFields(Packet packet)
RepositoryItem
addCommandFields
in interface RepositoryItem
addCommandFields
in class RepositoryItemAbstract
packet
- with empty ad-hoc command to fill with fieldspublic String[] getAdmins()
RepositoryItem
getAdmins
in interface RepositoryItem
getAdmins
in class RepositoryItemAbstract
public void setAdmins(String[] admins)
RepositoryItem
setAdmins
in interface RepositoryItem
setAdmins
in class RepositoryItemAbstract
admins
- is an array with the Item administrators IDs to set for the Item.public String getElemName()
getElemName
in class RepositoryItemAbstract
public String getKey()
RepositoryItem
protected void setKey(String key)
setKey
in class RepositoryItemAbstract
public String getOwner()
RepositoryItem
getOwner
in interface RepositoryItem
getOwner
in class RepositoryItemAbstract
public void setOwner(String owner)
RepositoryItem
setOwner
in interface RepositoryItem
setOwner
in class RepositoryItemAbstract
owner
- is the Item owner ID.public String getType()
public void initFromCommand(Packet packet)
RepositoryItem
initFromCommand
in interface RepositoryItem
initFromCommand
in class RepositoryItemAbstract
packet
- with ad-hoc command filled by the user.public void initFromElement(Element elem)
RepositoryItem
initFromElement
in interface RepositoryItem
initFromElement
in class RepositoryItemAbstract
elem
- XML Element with all the item initialization data.public void initFromPropertyString(String propString)
RepositoryItem
propString
- is a property string to initialize the RepositoryItem.public boolean isAdmin(String id)
RepositoryItem
isAdmin
in interface RepositoryItem
isAdmin
in class RepositoryItemAbstract
id
- is an ID of a person for which we check access permissions.public boolean isOwner(String id)
RepositoryItem
isOwner
in interface RepositoryItem
isOwner
in class RepositoryItemAbstract
id
- is an ID of a person for whom we check access permissions.public Element toElement()
RepositoryItem
toElement
in interface RepositoryItem
toElement
in class RepositoryItemAbstract
public String toPropertyString()
RepositoryItem
Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.