public class BRMUtility extends Object
Constructor and Description |
---|
BRMUtility() |
Modifier and Type | Method and Description |
---|---|
static ParamInfo |
buildErrorParameters(FList errFlist,
ParamInfo errorParamterInfo)
Builds ParamInfo object recursively for each error field instance in the
FList
|
static void |
closeConnectionWithoutTimeOut(PortalContext ctx)
close the connection
|
static PortalContext |
getConnection() |
static PortalContext |
getConnectionWithoutTimeOut()
Creates and returns single connection createConnections(int size) and
getNewConnection(String name) uses this method to create a connection.
|
static Path |
getFilePath(String filePath)
Converts a path string to a Path object.
|
static Path |
getFilePath(URI uri)
Converts the given URI to a Path object.
|
static String |
getInfranetFilePath()
Get Infranet.properties file path.
|
static String |
getPropertyValue(String propertyKey)
Get property value for the given key.
|
static boolean |
getRecordFailureFlag()
Retrieves record failure flag configured in the Configurations.xml file.
|
static String |
getStringWithParameterValues(String message,
Object... params)
Returns the string modified with parameters values
|
static int |
getTimeOutConfiguration()
Returns the timeOut value configured in the Configurations.xml file if
timeOut is configured return its value otherwise return -1
|
static String |
getTypeFromRestId(ResourceRef ref)
Convenience method to extract the BRM Poid "type" from the given
ResourceRef's id field.
|
static String |
getTypeFromRestId(String restId)
Convenience method to extract the BRM Poid "type" from the given REST ID.
|
static String |
getUserHome()
Returns user.home of system property.
|
static Boolean |
isPoid(String id)
check if given id is BRM Poid or not
|
static boolean |
isValidURL(String URL)
Check the given URL is valid or not.
|
static Poid |
poidFromRestId(ResourceRef ref) |
static Poid |
poidFromRestId(String restId)
Given a restID, create and return the corresponding Poid
|
static void |
populateError(ErrorConstants error,
Response.Status status)
Populate the error passed with status code.
|
static void |
releaseBadConnection(PortalContext ctx) |
static void |
releaseConnection(PortalContext ctx) |
static String |
restIdFromPoid(Poid poid)
Given a Poid, returns a format that can be passed via web services.
|
public static String restIdFromPoid(Poid poid)
poid
- The Poid to convertpublic static Poid poidFromRestId(String restId)
restId
- In the form 0.0.0.1+-account+123456public static Poid poidFromRestId(ResourceRef ref)
public static String getTypeFromRestId(ResourceRef ref)
ref
- Type of this REST ID will be returnedpublic static String getTypeFromRestId(String restId)
restId
- Type of this REST ID will be returnedpublic static PortalContext getConnection() throws DeterminateException
DeterminateException
public static void releaseConnection(PortalContext ctx)
public static void releaseBadConnection(PortalContext ctx)
public static ParamInfo buildErrorParameters(FList errFlist, ParamInfo errorParamterInfo) throws EBufException
errFlist
- error FListerrorParamterInfo
- ParamInfo objectEBufException
public static String getStringWithParameterValues(String message, Object... params)
message
- String with parameters ex: You must provide a valid {0} to
create a serviceparams
- parameters to be substituted ex: idpublic static int getTimeOutConfiguration()
public static String getInfranetFilePath()
public static String getPropertyValue(String propertyKey)
propertyKey
- public static boolean isValidURL(String URL)
URL
- public static Path getFilePath(String filePath)
filePath
- public static Path getFilePath(URI uri)
uri
- public static String getUserHome()
public static PortalContext getConnectionWithoutTimeOut() throws DeterminateException
DeterminateException
public static void closeConnectionWithoutTimeOut(PortalContext ctx)
ctx
- public static void populateError(ErrorConstants error, Response.Status status)
error
- status
- public static Boolean isPoid(String id) throws UnsupportedEncodingException
id
- UnsupportedEncodingException
public static boolean getRecordFailureFlag()