|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.system.ServerUtilities
public class ServerUtilities
Constructor Summary | |
---|---|
ServerUtilities()
|
Method Summary | |
---|---|
static JSONObject |
createOperation(String operationName,
String parameterList,
String supportedOutputFormatsList,
boolean postOnly)
Creates an operation that can be called on a REST resource, using specified name, parameter list and output formats list |
static JSONObject |
createResource(String name,
String description,
boolean isCollection,
boolean isDefaultCollection)
Creates a REST resource based on specified name, description and collection flag |
static Envelope |
getEnvelopeFromJSON(JSONObject jobj)
Retrieves Envelope from JSON |
static IGeometry |
getGeometryFromJSON(JSONObject geometryJSON)
Returns an IGeometry given a JSON Object |
static JSONObject |
getJSONFromEnvelope(Envelope env)
Retrieves JSON from Envelope |
static JSONObject |
getJSONFromFeature(Feature feature)
Returns JSON representation of a Feature object |
static JSONObject |
getJSONFromGeometry(IGeometry geometry)
Returns JSON representation of specified geometry |
static JSONObject |
getJSONFromMultipoint(Multipoint multipoint)
Returns JSON representation of a Multipoint object |
static JSONObject |
getJSONFromPoint(Point point)
Returns JSON representation of a Point object |
static JSONObject |
getJSONFromPolygon(Polygon polygon)
Returns JSON representation of a Polygon object |
static JSONObject |
getJSONFromPolyline(Polyline polyline)
Returns JSON representation of a Polyline object |
static JSONObject |
getJSONFromSR(ISpatialReference sr)
Retrieves JSON from Spatial Reference |
static Multipoint |
getMultipointFromJSON(JSONObject multipointJSON)
Extracts MultiPoint geometry from specified JSONObject |
static Point |
getPointFromJSON(JSONObject pointJSON)
Extracts Point geometry from specified JSONObject |
static Polygon |
getPolygonFomJSON(JSONObject polygonJSON)
Extracts Polygon geometry from specified JSONObject |
static Polyline |
getPolylineFomJSON(JSONObject polylineJSON)
Extracts Polyline geometry from specified JSONObject |
static ILog2 |
getServerLogger()
Returns a handle to ArcGIS Server's log file via the ILog2 interface. |
static IServerUserInfo |
getServerUserInfo()
Returns an IServerUserInfo, which can be used to retrieve security info such as user name and the role the user name belongs to. |
static ISpatialReference |
getSRFromJSON(JSONObject spatialReferenceJSON)
Retrieves spatial reference from JSON |
static ISpatialReference |
getSRFromString(String spatialReferenceString)
Retrieves spatial reference from string This method may throw a runtime exception in case of errors |
static String |
sendError(int codeNumber,
String errorMessageSummary,
String[] errorMessageDetails)
Sends error message back to client in proper JSON format, which is as follows * { "error": { "code": 400, "message": "Cannot perform query. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServerUtilities()
Method Detail |
---|
public static ISpatialReference getSRFromString(String spatialReferenceString) throws Exception
spatialReferenceString
-
Exception
public static ISpatialReference getSRFromJSON(JSONObject spatialReferenceJSON) throws Exception
spatialReferenceJSON
-
Exception
public static JSONObject getJSONFromSR(ISpatialReference sr)
sr
-
public static JSONObject getJSONFromPoint(Point point) throws Exception
point
- com.esri.arcgis.geometry.Point
Exception
public static JSONObject getJSONFromMultipoint(Multipoint multipoint) throws Exception
multipoint
- com.esri.arcgis.geometry.Multipoint
Exception
public static JSONObject getJSONFromPolyline(Polyline polyline) throws Exception
polyline
- com.esri.arcgis.geometry.Polyline
Exception
public static JSONObject getJSONFromPolygon(Polygon polygon) throws Exception
polygon
- com.esri.arcgis.geometry.Polygon
Exception
public static JSONObject getJSONFromFeature(Feature feature) throws Exception
feature
-
Exception
public static JSONObject getJSONFromGeometry(IGeometry geometry) throws Exception
geometry
-
Exception
public static JSONObject getJSONFromEnvelope(Envelope env)
env
-
public static Point getPointFromJSON(JSONObject pointJSON) throws Exception
json
- Input JSON object that contains geometry as sole member. Valid JSON format for Point is:
{
"x" : -118.15, "y" : 33.80, "spatialReference" : {"wkid" : 4326}
}
Exception
public static Multipoint getMultipointFromJSON(JSONObject multipointJSON) throws Exception
multipointJSON
- Input JSON object that contains geometry as sole member. Valid JSON format for Multipoint is:
{
"points" : [ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832] ],
"spatialReference" : {"wkid" : 4326}
}
Exception
public static Polyline getPolylineFomJSON(JSONObject polylineJSON) throws Exception
polylineJSON
- Input JSON object that contains geometry as sole member. Valid JSON format for Polyline is:
{
"paths" : [
[ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832] ],
[ [-97.06326,32.759], [-97.06298,32.755] ]
],
"spatialReference" : {"wkid" : 4326}
}
Exception
public static Polygon getPolygonFomJSON(JSONObject polygonJSON) throws Exception
polygonJSON
- Input JSON object that contains geometry as sole member. Valid JSON format for Polygon is:
{
"rings" : [
[ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832], [-97.06138,32.837] ],
[ [-97.06326,32.759], [-97.06298,32.755], [-97.06153,32.749], [-97.06326,32.759] ]
],
"spatialReference" : {"wkid" : 4326}
}
Exception
public static IGeometry getGeometryFromJSON(JSONObject geometryJSON) throws Exception
geometryJSON
-
Exception
public static Envelope getEnvelopeFromJSON(JSONObject jobj)
jobj
-
public static JSONObject createResource(String name, String description, boolean isCollection, boolean isDefaultCollection)
name
- description
- isCollection
-
public static JSONObject createOperation(String operationName, String parameterList, String supportedOutputFormatsList, boolean postOnly)
operationName
- parameterList
- supportedOutputFormatsList
-
public static String sendError(int codeNumber, String errorMessageSummary, String[] errorMessageDetails)
codeNumber
- - Error code. Could be part of a user defined error hierarchy.message
- - Message containing summary of error for the client application. This cannot be null or invalid.details
- - Error details that are not part of summary. This can be null.
public static IServerUserInfo getServerUserInfo()
public static ILog2 getServerLogger()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |