public abstract class RepositoryItemAbstract extends Object implements RepositoryItem
Modifier and Type | Field and Description |
---|---|
static String |
ADMINS_ATT
Field description
|
static String |
ADMINS_LABEL
Field description
|
static String |
OWNER_ATT
Field description
|
static String |
OWNER_LABEL
Field description
|
Constructor and Description |
---|
RepositoryItemAbstract() |
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.
|
abstract String |
getElemName()
Method description
|
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.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getKey, initFromPropertyString, toPropertyString
public static final String ADMINS_ATT
public static final String ADMINS_LABEL
public static final String OWNER_ATT
public static final String OWNER_LABEL
public abstract String getElemName()
public void addCommandFields(Packet packet)
RepositoryItem
addCommandFields
in interface RepositoryItem
packet
- with empty ad-hoc command to fill with fieldspublic String[] getAdmins()
RepositoryItem
getAdmins
in interface RepositoryItem
public String getOwner()
RepositoryItem
getOwner
in interface RepositoryItem
public void initFromCommand(Packet packet)
RepositoryItem
initFromCommand
in interface RepositoryItem
packet
- with ad-hoc command filled by the user.public void initFromElement(Element elem)
RepositoryItem
initFromElement
in interface RepositoryItem
elem
- XML Element with all the item initialization data.public boolean isAdmin(String id)
RepositoryItem
isAdmin
in interface RepositoryItem
id
- is an ID of a person for which we check access permissions.public boolean isOwner(String id)
RepositoryItem
isOwner
in interface RepositoryItem
id
- is an ID of a person for whom we check access permissions.public void setAdmins(String[] admins)
RepositoryItem
setAdmins
in interface RepositoryItem
admins
- is an array with the Item administrators IDs to set for the Item.public void setOwner(String owner)
RepositoryItem
setOwner
in interface RepositoryItem
owner
- is the Item owner ID.public Element toElement()
RepositoryItem
toElement
in interface RepositoryItem
Copyright © 2017 "Tigase, Inc.". All rights reserved.