|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.adapter.ActiveSyncUtil
ActiveSyncUtil is a class to assist in writing ActiveSync adapters. It has a mixture of logging and storage methods. As the ActiveSync environment matures, these methods will be updated to keep existing adapters compatible with new runtime environments. This class will be extended regularly to add new functionality so check the javadoc of the most current release for details
Field Summary | |
static java.lang.String |
code_id
|
Constructor Summary | |
ActiveSyncUtil(ActiveSync source)
|
|
ActiveSyncUtil(Resource resource,
ActiveSync source)
|
Method Summary | |
static boolean |
checkOption(ActiveSync source,
java.lang.String attrName)
|
java.lang.String |
getLogFileFullPath()
Deprecated. Make sure the caller can handle null. This is here only to allow old adapters to compile. |
com.waveset.adapter.logging.IActiveSyncLogger |
getLogger()
|
int |
getLogLevel()
|
static int |
getRepetitionCount(ActiveSync source)
The repetition count is a scheduling parameter. |
static TaskSchedule.RepetitionUnit |
getRepetitionUnit(ActiveSync source)
The repetition unit is a scheduling parameter. |
static java.util.Date |
getStartDate(ActiveSync source)
Get the date when this adapter should start to be run |
static java.util.Date |
getStartTime(ActiveSync source)
Get the time when this adapter should run each time it is scheduled |
boolean |
isLogLevelEnabled(int level)
|
boolean |
isStopRequested()
Utility method for ActiveSync resource adapters to check if "stop synchronization" has been requested for the resource. |
static void |
listToStringBuffer(java.util.List list,
java.lang.StringBuffer sb)
Append to the string buffer the list of objects. |
void |
logDebugMap(java.lang.String message,
java.util.Map map)
|
void |
logDebugString(java.lang.String update)
|
void |
logErrorMap(java.lang.String message,
java.util.Map map)
|
void |
logErrorString(java.lang.String update)
|
void |
logException(int level,
java.lang.Throwable th)
|
void |
logInfoMap(java.lang.String message,
java.util.Map map)
|
void |
logInfoString(java.lang.String update)
|
void |
logMap(int level,
java.lang.String message,
java.util.Map map)
|
void |
logResourceException(java.lang.String prefixLine,
java.lang.Throwable th,
ITrace trace,
java.lang.String callingClass,
java.lang.String callingMethod)
Deprecated. as of IdM 7.0 (since ITrace already deprecated). Use logResourceException(String, Throwable, Trace, String, String) instead. |
void |
logResourceException(java.lang.String prefixLine,
java.lang.Throwable th,
Trace trace,
java.lang.String callingMethod)
Utility method to log an exception to the ActiveSync log, as well as an ITrace instance. |
void |
logResourceException(java.lang.String prefixLine,
java.lang.Throwable th,
Trace trace,
java.lang.String callingClass,
java.lang.String callingMethod)
Utility method to log an exception to the ActiveSync log, as well as an ITrace instance. |
void |
logString(int level,
java.lang.String update)
|
void |
logString(int level,
java.lang.String update,
boolean addTimeStamp)
The IActiveSyncLogger methods are delegated to the logger |
void |
logWarningMap(java.lang.String message,
java.util.Map map)
|
void |
logWarningString(java.lang.String update)
|
static void |
mapToStringBuffer(java.util.Map map,
java.lang.StringBuffer sb)
This takes a map and returns a string buffer, handy for logging. |
static java.util.Map |
reconstituteEmptyStrings(java.util.Map map)
Maps, when serialized with empty strings, turn them into nulls. |
boolean |
useLegacyEventGeneration()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
Constructor Detail |
public ActiveSyncUtil(Resource resource, ActiveSync source) throws java.lang.Exception
public ActiveSyncUtil(ActiveSync source) throws java.lang.Exception
Method Detail |
public static void mapToStringBuffer(java.util.Map map, java.lang.StringBuffer sb)
map
- - the map to translate. null or empty maps do not modify
the stringBuffersb
- - The string buffer to append topublic static void listToStringBuffer(java.util.List list, java.lang.StringBuffer sb)
list
- - the list of objects to convertsb
- - the stringbuffer to append the items topublic static java.util.Map reconstituteEmptyStrings(java.util.Map map)
public static java.util.Date getStartDate(ActiveSync source) throws java.text.ParseException, java.lang.Exception
java.text.ParseException
java.lang.Exception
public static java.util.Date getStartTime(ActiveSync source)
public static TaskSchedule.RepetitionUnit getRepetitionUnit(ActiveSync source)
public static int getRepetitionCount(ActiveSync source)
public static boolean checkOption(ActiveSync source, java.lang.String attrName)
public com.waveset.adapter.logging.IActiveSyncLogger getLogger()
public void logString(int level, java.lang.String update, boolean addTimeStamp)
logString
in interface com.waveset.adapter.logging.IActiveSyncLogger
public void logString(int level, java.lang.String update)
logString
in interface com.waveset.adapter.logging.IActiveSyncLogger
public void logErrorString(java.lang.String update)
logErrorString
in interface com.waveset.adapter.logging.IActiveSyncLogger
public void logWarningString(java.lang.String update)
logWarningString
in interface com.waveset.adapter.logging.IActiveSyncLogger
public void logInfoString(java.lang.String update)
logInfoString
in interface com.waveset.adapter.logging.IActiveSyncLogger
public void logDebugString(java.lang.String update)
logDebugString
in interface com.waveset.adapter.logging.IActiveSyncLogger
public void logException(int level, java.lang.Throwable th)
logException
in interface com.waveset.adapter.logging.IActiveSyncLogger
public void logMap(int level, java.lang.String message, java.util.Map map)
logMap
in interface com.waveset.adapter.logging.IActiveSyncLogger
public void logErrorMap(java.lang.String message, java.util.Map map)
logErrorMap
in interface com.waveset.adapter.logging.IActiveSyncLogger
public void logWarningMap(java.lang.String message, java.util.Map map)
logWarningMap
in interface com.waveset.adapter.logging.IActiveSyncLogger
public void logInfoMap(java.lang.String message, java.util.Map map)
logInfoMap
in interface com.waveset.adapter.logging.IActiveSyncLogger
public void logDebugMap(java.lang.String message, java.util.Map map)
logDebugMap
in interface com.waveset.adapter.logging.IActiveSyncLogger
public int getLogLevel()
getLogLevel
in interface com.waveset.adapter.logging.IActiveSyncLogger
public boolean isLogLevelEnabled(int level)
isLogLevelEnabled
in interface com.waveset.adapter.logging.IActiveSyncLogger
public boolean isStopRequested()
public void logResourceException(java.lang.String prefixLine, java.lang.Throwable th, ITrace trace, java.lang.String callingClass, java.lang.String callingMethod)
prefixLine
- (optional) Message to write before the error messages/stack trace.th
- Throwable being loggedtrace
- (optional) ITrace instance used to log the error messages/exceptioncallingClass
- Classname string of the calling class.callingMethod
- Methodname string of the calling method.public void logResourceException(java.lang.String prefixLine, java.lang.Throwable th, Trace trace, java.lang.String callingClass, java.lang.String callingMethod)
prefixLine
- (optional) Message to write before the error messages/stack trace.th
- Throwable being loggedtrace
- (optional) Trace instance used to log the error messages/exceptioncallingClass
- Classname string of the calling class.callingMethod
- Methodname string of the calling method.public void logResourceException(java.lang.String prefixLine, java.lang.Throwable th, Trace trace, java.lang.String callingMethod)
prefixLine
- (optional) Message to write before the error messages/stack trace.th
- Throwable being loggedtrace
- (optional) Trace instance used to log the error messages/exceptioncallingMethod
- Methodname string of the calling method.public boolean useLegacyEventGeneration()
public java.lang.String getLogFileFullPath()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |