Class RestUtils
- java.lang.Object
-
- org.apache.directory.fortress.core.rest.RestUtils
-
public final class RestUtils extends Object
This utility class provides methods that wrap Apache's HTTP Client APIs. This class is thread safe.- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
get(String id, String id2, String id3, String function)
Perform HTTP Get REST request.String
get(String userId, String password, String id, String id2, String id3, String function)
Perform HTTP Get REST request.static RestUtils
getInstance()
static Properties
getProperties(Props inProps)
static Props
getProps(Properties properties)
static String
marshal(FortRequest request)
Marshall the request into an XML String.String
post(String szInput, String function)
Perform an HTTP Post REST operation.String
post(String userId, String password, String szInput, String function)
Perform an HTTP Post REST operation.static FortResponse
unmarshall(String szResponse)
Unmarshall the XML response into its associated Java objects.
-
-
-
Method Detail
-
getInstance
public static RestUtils getInstance()
-
marshal
public static String marshal(FortRequest request) throws RestException
Marshall the request into an XML String.- Parameters:
request
-- Returns:
- String containing xml request
- Throws:
RestException
-
unmarshall
public static FortResponse unmarshall(String szResponse) throws RestException
Unmarshall the XML response into its associated Java objects.- Parameters:
szResponse
-- Returns:
- FortResponse
- Throws:
RestException
-
get
public String get(String userId, String password, String id, String id2, String id3, String function) throws RestException
Perform HTTP Get REST request.- Parameters:
userId
-password
-id
-id2
-id3
-function
-- Returns:
- String containing response
- Throws:
RestException
-
get
public String get(String id, String id2, String id3, String function) throws RestException
Perform HTTP Get REST request.- Parameters:
id
-id2
-id3
-function
-- Returns:
- String containing response
- Throws:
RestException
-
post
public String post(String userId, String password, String szInput, String function) throws RestException
Perform an HTTP Post REST operation.- Parameters:
userId
-password
-szInput
-function
-- Returns:
- String containing response
- Throws:
RestException
-
post
public String post(String szInput, String function) throws RestException
Perform an HTTP Post REST operation.- Parameters:
szInput
-function
-- Returns:
- String containing response
- Throws:
RestException
-
getProperties
public static Properties getProperties(Props inProps)
- Parameters:
inProps
-- Returns:
- Properties
-
getProps
public static Props getProps(Properties properties)
- Parameters:
properties
-- Returns:
- Prop contains name value pairs.
-
-