|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hackystat.sensorbase.resource.sensorbase.ResponseMessage
public class ResponseMessage
Provides standardized strings and formatting for response codes. This class is intended to make error reporting more uniform and informative. A good error message will always include an explanation for why the operation failed, and what the requested operation was.
Constructor Summary | |
---|---|
ResponseMessage()
|
Method Summary | |
---|---|
(package private) static java.lang.String |
adminOnly(SensorBaseResource resource)
The error message for requests that only the admin can handle. |
(package private) static java.lang.String |
adminOrAuthUserOnly(SensorBaseResource resource,
java.lang.String authUser,
java.lang.String uriUser)
The error message for requests where the authorized user must be the same as the user in the URI string, or the authorized use is the admin (and then the user in the URI string can be anyone). |
(package private) static java.lang.String |
badTimestamp(SensorBaseResource resource,
java.lang.String timestamp)
The error message for requests where a timestamp is not supplied or is not parsable. |
(package private) static java.lang.String |
cannotViewProject(SensorBaseResource resource,
java.lang.String user,
java.lang.String project)
The error message for requests involving projects not owned by the specified user. |
(package private) static java.lang.String |
internalError(SensorBaseResource resource,
java.util.logging.Logger logger,
java.lang.Exception e)
The error message for requests that generate an unspecified internal error. |
(package private) static java.lang.String |
miscError(SensorBaseResource resource,
java.lang.String message)
The error message for miscellaneous "one off" error messages. |
(package private) static java.lang.String |
notProjectOwner(SensorBaseResource resource,
java.lang.String user,
java.lang.String project)
The error message for requests where the requesting user is not the owner. |
(package private) static java.lang.String |
undefinedProject(SensorBaseResource resource,
User user,
java.lang.String project)
The error message for requests involving projects not owned by the specified user. |
(package private) static java.lang.String |
undefinedUser(SensorBaseResource resource,
java.lang.String user)
The error message for unknown users. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResponseMessage()
Method Detail |
---|
static java.lang.String adminOnly(SensorBaseResource resource)
resource
- The resource associated with this request.
static java.lang.String adminOrAuthUserOnly(SensorBaseResource resource, java.lang.String authUser, java.lang.String uriUser)
resource
- The resource associated with this request.authUser
- The authorized user.uriUser
- The user in the URI string.
static java.lang.String internalError(SensorBaseResource resource, java.util.logging.Logger logger, java.lang.Exception e)
resource
- The resource associated with this request.logger
- The logger.e
- The exception.
static java.lang.String miscError(SensorBaseResource resource, java.lang.String message)
resource
- The resource associated with this request.message
- A short string describing the problem.
static java.lang.String undefinedUser(SensorBaseResource resource, java.lang.String user)
resource
- The resource associated with this request.user
- A short string describing the problem.
static java.lang.String undefinedProject(SensorBaseResource resource, User user, java.lang.String project)
resource
- The resource associated with this request.user
- The user.project
- The project.
static java.lang.String cannotViewProject(SensorBaseResource resource, java.lang.String user, java.lang.String project)
resource
- The resource associated with this request.user
- The user.project
- The project.
static java.lang.String notProjectOwner(SensorBaseResource resource, java.lang.String user, java.lang.String project)
resource
- The resource associated with this request.user
- The user.project
- The project
static java.lang.String badTimestamp(SensorBaseResource resource, java.lang.String timestamp)
resource
- The resource associated with this request.timestamp
- The bogus timestamp.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |