|
"WEBNMS_5 API Docs" | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.nms.util.GenericUtility
public class GenericUtility
Used by many files to access comman methods and static variables .
| Field Summary | |
|---|---|
static long |
dateDiff
|
static java.util.Random |
generator
Used as generator of random numbers for use in HTML UI. |
static java.util.Hashtable |
KeyForCvcVSloginTime
Used to store login time. |
static java.text.SimpleDateFormat |
NmsFormatter
returns the dataFormat of Web NMS |
static int |
offset
Stores the Offset of the time zone. |
static java.lang.String |
seperator
Used as line seperator. |
static java.lang.String |
unAuthorizedString
Contains the error message. |
| Constructor Summary | |
|---|---|
GenericUtility()
|
|
| Method Summary | |
|---|---|
static java.util.Vector |
cleanUp(java.util.Hashtable ht)
This is used for cleanup of Custom Views Vector during regular period of time ("1800000" in long). |
static java.lang.String |
dateString(long date)
Used to get the user readable String format of the given date in long. |
static java.lang.String |
encode(java.lang.String name)
To replace all spaces in a string with |
static java.lang.String |
formatDate(java.util.Date date,
java.text.SimpleDateFormat dateFormat)
formats the date which is read from ClientParameters.conf. |
static java.lang.String |
formatDate(long time,
java.text.SimpleDateFormat dateFormat)
formats the date which is read from ClientParameters.conf. |
static AlertAPI |
getAlertAPI()
This gets the AlertAPI for use by jspdata and servlets. |
static java.awt.Color |
getColor(java.lang.String col)
Used for setting colors based on severity. |
static java.text.DateFormat |
getDateFormat(java.lang.String userName)
To get the date format with timezone set.The timezone to be used is read from the clientparameters.conf file |
static EventAPI |
getEventAPI()
This gets the EventAPI for use by jspdata and servlets. |
static java.lang.String |
getFilePath(java.lang.String menuName,
java.lang.String userName)
Used to get the absolute URL |
static java.lang.String |
getHelpURL(java.lang.String key)
Returns the help URL when the key is given. |
static java.lang.String |
getHtmlColor(java.awt.Color col)
Used to get the HTML string equivalent of the given Color object. |
static MapAPI |
getMapAPI()
This gets the MapAPI for use by jspdata and servlets. |
static java.util.Vector |
getOperationsForUser(java.lang.String userName)
This method is used to get a List of operations authorized for this specified user name. |
static long |
getParsedTime(java.util.Date dt)
getParsedTime:To parse a date string and returns the number of milliseconds |
static PollAPI |
getPollAPI()
This gets the PollAPI for use by jspdata and servlets. |
static java.lang.String |
getStatusColor(int sev)
need to deprecate this method. |
static TopoAPI |
getTopoAPI()
This gets the TopoAPI for use by jspdata and servlets . |
static boolean |
isAuthorized_userName(java.lang.String userName,
java.lang.String dn)
To check if the given userName is an authorized userName. |
static boolean |
isAuthorized(java.lang.String userName,
java.lang.String operation)
Used to check whether the given user is authorized to perform the specified operation |
static boolean |
isAuthorized(java.lang.String userName,
java.lang.String operation,
boolean log)
|
static boolean |
isAuthorized(java.lang.String userName,
java.lang.String operation,
java.util.Properties auditProp)
|
static boolean |
isAuthorized(java.lang.String userName,
java.lang.String operation,
java.util.Properties auditProp,
boolean log)
|
static java.util.Date |
parseDate(java.lang.String str)
Deprecated. use formatDate(long time,SimpleDateFormat dateFormat) instead. |
static java.util.Hashtable |
populateIncrementsVector(java.lang.String userName)
Used to provide the Hashtable containing the incrementation values from conf file for a given user. |
static java.lang.String |
replace(java.lang.String s,
java.lang.String tok,
java.lang.String c)
To replace a particular string with a character. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.text.SimpleDateFormat NmsFormatter
public static int offset
public static long dateDiff
public static final java.lang.String unAuthorizedString
public static final java.lang.String seperator
public static java.util.Hashtable KeyForCvcVSloginTime
public static java.util.Random generator
| Constructor Detail |
|---|
public GenericUtility()
| Method Detail |
|---|
public static TopoAPI getTopoAPI()
public static EventAPI getEventAPI()
public static AlertAPI getAlertAPI()
public static MapAPI getMapAPI()
public static PollAPI getPollAPI()
public static java.awt.Color getColor(java.lang.String col)
col - The string representing the color.
public static java.lang.String getHtmlColor(java.awt.Color col)
col - Color Object.
public static java.lang.String formatDate(long time,
java.text.SimpleDateFormat dateFormat)
time - time in longdateFormat - SimpleDateFormat object
public static java.lang.String formatDate(java.util.Date date,
java.text.SimpleDateFormat dateFormat)
date - Date ObjectdateFormat - SimpleDateFormat
public static java.util.Date parseDate(java.lang.String str)
throws java.text.ParseException
formatDate(long time,SimpleDateFormat dateFormat) instead.
str - a string
java.text.ParseException - :Signals that an error has been reached unexpectedly while parsingpublic static long getParsedTime(java.util.Date dt)
getParsedTime:To parse a date string and returns the number of milliseconds
dt - a Date value
long value - number of millisecondspublic static java.lang.String getStatusColor(int sev)
sev - The number representing the severity.
public static java.lang.String dateString(long date)
date - The date in long.
public static java.util.Vector cleanUp(java.util.Hashtable ht)
ht - The Hashtable which contains the login time.
public static java.lang.String replace(java.lang.String s,
java.lang.String tok,
java.lang.String c)
s - The String to be replaced.tok - The tokenizer.c - The character to be replaced instead of the string.
public static java.util.Hashtable populateIncrementsVector(java.lang.String userName)
userName - The name of the user for whom the incrementation values
have to be known
public static boolean isAuthorized_userName(java.lang.String userName,
java.lang.String dn)
userName - name to be checked.dn - Distinguished name.
public static java.util.Vector getOperationsForUser(java.lang.String userName)
userName - the name of the user for which the operations
list is to be retrived.
public static java.lang.String getFilePath(java.lang.String menuName,
java.lang.String userName)
throws java.io.IOException
menuName - the name of the menuuserName - the name of the user
java.io.IOExceptionpublic static java.lang.String encode(java.lang.String name)
name - The string to be to be changed
public static java.text.DateFormat getDateFormat(java.lang.String userName)
userName - The string gives the user
public static boolean isAuthorized(java.lang.String userName,
java.lang.String operation)
userName - the user name which you want to know the whether the operation is permittedoperation - the operation for which you need to know the whether the user is allowed to do.
public static boolean isAuthorized(java.lang.String userName,
java.lang.String operation,
boolean log)
public static boolean isAuthorized(java.lang.String userName,
java.lang.String operation,
java.util.Properties auditProp)
public static boolean isAuthorized(java.lang.String userName,
java.lang.String operation,
java.util.Properties auditProp,
boolean log)
public static java.lang.String getHelpURL(java.lang.String key)
key - the key for which you want the help URL
|
"WEBNMS_5 API Docs" | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||