|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBaseDatum
org.starhope.appius.sys.admin.Domain
public class Domain
Field Summary | |
---|---|
private String |
code
This code (or identifier) is a four-character string which uniquely represents this Domain among all Star-Hope game domains. |
private com.sun.sgs.app.ManagedReference<Filter> |
filter
|
private String |
resourceBase
This is the URL base under which game resources for this domain are found. |
private static long |
serialVersionUID
|
static long |
TEST_DOMAIN
For unit testing, we want to perform our testing in a "safe" database environment. |
private String |
title
This is the user-visible title of this domain. |
Constructor Summary | |
---|---|
Domain()
Instantiate a new "null" domain object |
Method Summary | |
---|---|
static Domain |
get(org.json.JSONObject object)
Instantiate a Domain object based upon the supplied JSON data |
static Domain |
get(String id)
|
static Domain |
getByIdentifier(String domainIdentifier)
|
String |
getCode()
|
Filter |
getFilter()
|
String |
getResourceBase()
Gets the URI under which resources for this domain should be fetched. |
String |
getTitle()
Gets the (user-visible) title of this Domain |
void |
set(org.json.JSONObject o)
|
void |
setCode(String newCode)
|
void |
setFilter(Filter filter)
Get the filter which applies to global actions in this domain. |
void |
setResourceBase(String newResourceBase)
|
void |
setTitle(String newTitle)
Set the user-visible title of this domain |
org.json.JSONObject |
toJSON()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long TEST_DOMAIN
For unit testing, we want to perform our testing in a "safe" database environment. To that ends, we provide a "magic" domain identified as TEST_DOMAIN. Instantiating a Domain object with this as its ID will perform database tests more-or-less out of the way. Note, however, that database testing should still occur only in a "safe" test database schema in the QA or UAT server(s).
Finally, note that since TEST_DOMAIN is a negative value, it will never conflict with any valid Domain ID. (It's -277, which are my initials on a telephone keypad, BRP)
private static final long serialVersionUID
private String code
private com.sun.sgs.app.ManagedReference<Filter> filter
private String resourceBase
private String title
Constructor Detail |
---|
public Domain()
Method Detail |
---|
public static Domain get(org.json.JSONObject object) throws NotFoundException, RuntimeException, org.json.JSONException
object
- the JSON data
org.json.JSONException
- if the JSON data is badly-formed
RuntimeException
- if something really bad happened
NotFoundException
- if the ID is specified, and it isn't
found in the databasepublic static Domain get(String id) throws RuntimeException, NotFoundException
id
- database ID
NotFoundException
- if the ID doesn't exist in the database
RuntimeException
- if the ID is out of the valid range, or
some other stupid thingpublic static Domain getByIdentifier(String domainIdentifier) throws NotFoundException
domainIdentifier
- the 4-character identifier code for this
domain
NotFoundException
- if the domain can't be found by the
given identifierpublic String getCode()
public Filter getFilter()
public String getResourceBase()
public String getTitle()
public void set(org.json.JSONObject o)
CastsToJSON.set(org.json.JSONObject)
public void setCode(String newCode) throws DataException
newCode
- the new identifier code (4 characters) for this
domain
DataException
- if the identifier attempted isn't 4
uppercase characterspublic void setFilter(Filter filter)
Get the filter which applies to global actions in this domain.
In particular, this is the filter which applies when registering a user name, to prevent stuff like User.setLogin ("fucktard")
For in-game zones, filters are per-zone.
filter
- the new default filter for this domainpublic void setResourceBase(String newResourceBase)
newResourceBase
- The URI prefix/base for resourcespublic void setTitle(String newTitle) throws DataException
newTitle
- the new title for this Domain
DataException
- if the title is over 64 characters or blankpublic org.json.JSONObject toJSON()
org.starhope.appius.util.BaseDatum#toJSON()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |