Package Thor.API.Base
Class tcBaseUtility
java.lang.Object
Thor.API.Base.tcBaseUtility
- All Implemented Interfaces:
com.thortech.xl.dataobj.tcErrorReceiver,com.thortech.xl.orb.api.operations._tcUtilityIntfOperations,com.thortech.xl.server.tcOrbServerObject,tcUtilityOperationsIntf
- Direct Known Subclasses:
tcExportOperationsBean,tcImportOperationsBean
public abstract class tcBaseUtility
extends Object
implements com.thortech.xl.orb.api.operations._tcUtilityIntfOperations, tcUtilityOperationsIntf, com.thortech.xl.server.tcOrbServerObject, com.thortech.xl.dataobj.tcErrorReceiver
Base utility server-side class. All server-side Utility/API classes
must extend from this class. It provides all the base functionality
necessary for a server-side object.
- Author:
- Felix Lipov
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe following enum serves two purposes: 1. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringAdded constants for the backward compatibilitystatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddError(com.thortech.xl.orb.dataaccess.tcError poError) Adds the error to this object's error list, and sets the state to ERROR.voidaddErrorReceiver(com.thortech.xl.dataobj.tcErrorReceiver poErrorReceiver) Adds another error receiver to the object's error list.voidaddReject(com.thortech.xl.orb.dataaccess.tcError poReject) Adds the rejection to this object's rejection list.voidClears all errors and exceptions that are stored in the utility class.voidclose()This method will clean up all resources associated with this object.voidTheejbActivate()method as required by the EJB specification.
The activate method is called when the instance is activated from its passive" state.voidTheejbPassivate()method as required by the EJB specification.
The activate method is called when the instance is activated from its "passive" state.voidTheejbRemove()method as required by the EJB specification.
A container invokes this method before it ends the life of the session object.com.thortech.xl.dataaccess.tcDataProviderReturns the database.static StringThis method will return default locale stored in DB as <user.language>_<user.region>javax.ejb.EJBContextcom.thortech.xl.orb.dataaccess.tcError[]Returns errors that occurred over the course of usage of the class.getMap(com.thortech.xl.orb.api.tcMapping[] paoMapping) Creates aMapobject from the provided array oftcMappingobjects.static com.thortech.xl.orb.api.tcMapping[]getMapping(Map<String, Object> poMap) Creates atcMappingarray from the providedMap.getName()Returns the name of the client.com.thortech.xl.orb.dataaccess.tcError[]Returns rejections that occurred over the course of usage of the class.javax.ejb.SessionContextGet the associated session contextgetUnAuthorizedTargetFieldSet(Map attributeMap, Set<String> retColumnSet) voidremoveErrorReceiver(com.thortech.xl.dataobj.tcErrorReceiver poErrorReceiver) Removes the error receiver from the object's error list.voidReleases the object resources.voidsetCountry(String psCountry) Sets the country.voidsetLanguage(String psLanguage) Sets the language.voidsetSessionContext(javax.ejb.SessionContext newContext) Set the associated session context.voidsetVariant(String psVariant) Sets the variant.
-
Field Details
-
USR_DEFINED_COLUMN_CONSTANT
Added constants for the backward compatibility- See Also:
-
USR_KEY_COL_CODE
- See Also:
-
USR_MANAGER_KEY_COL_CODE
- See Also:
-
USR_MANAGER_LOGIN_COL_CODE
- See Also:
-
USR_MANAGER_LOGIN_LABEL
- See Also:
-
USR_MANAGER_FIRST_NAME_COL_CODE
- See Also:
-
USR_MANAGER_LAST_NAME_COL_CODE
- See Also:
-
USR_MANAGER_DISPLAY_NAME_COL_CODE
- See Also:
-
USR_MANAGER_DISPLAY_NAME_LABEL
- See Also:
-
USR_MANAGER_FIRST_NAME_LABEL
- See Also:
-
USR_MANAGER_LAST_NAME_LABEL
- See Also:
-
OBJECTCLASS_COL_CODE
- See Also:
-
ORGANIZATION_KEY_COL_CODE
- See Also:
-
ORGANIZATION_PARENT_KEY_COL_CODE
- See Also:
-
ORGANIZATION_NAME_COL_CODE
- See Also:
-
ORGANIZATION_PARENT_NAME_COL_CODE
- See Also:
-
PARENTORGNAME
- See Also:
-
ROLE_KEY_COL_CODE
- See Also:
-
ROLE_NAME_COL_CODE
- See Also:
-
USR_MANAGER_FIRST_NAME_COLUMN
- See Also:
-
USR_MANAGER_LAST_NAME_COLUMN
- See Also:
-
USR_MANAGER_LOGIN_COLUMN
- See Also:
-
USERID
- See Also:
-
ORGKEY
- See Also:
-
MANAGERKEY
- See Also:
-
STATUS
- See Also:
-
LKU_GROUP
- See Also:
-
USERKEY
- See Also:
-
ORGNAME
- See Also:
-
ORG_NAME
- See Also:
-
FIRSTNAME
- See Also:
-
LASTNAME
- See Also:
-
DISPLAYNAME
- See Also:
-
USER_ENTITY
- See Also:
-
ALL_ATTR_OB
- See Also:
-
USER_MANAGEMENT
- See Also:
-
DATE_FORMAT_SYS_PROP
- See Also:
-
DEFAULT_DATE_PATTERN
- See Also:
-
DEFAULT_LOCALE
- See Also:
-
-
Constructor Details
-
tcBaseUtility
public tcBaseUtility()Constructor. Necessary for client-side instantiation. -
tcBaseUtility
Base Utility class. Provides basic functionality for all utility classes.- Parameters:
psName- A descriptive name.
-
-
Method Details
-
ejbActivate
TheejbActivate()method as required by the EJB specification.
The activate method is called when the instance is activated from its passive" state. The instance should acquire any resource that it has released earlier in theejbPassivate()method.
This method is called with no transaction context.- Throws:
javax.ejb.EJBException- Thrown if the instance could not perform the function requested by the container because of an system-level error.RemoteException
-
ejbPassivate
TheejbPassivate()method as required by the EJB specification.
The activate method is called when the instance is activated from its "passive" state. The instance should acquire any resource that it has released earlier in theejbActivate()method.
This method is called with no transaction context.- Throws:
javax.ejb.EJBException- Thrown if the instance could not perform the function requested by the container because of an system-level error.RemoteException
-
ejbRemove
TheejbRemove()method as required by the EJB specification.
A container invokes this method before it ends the life of the session object. This happens as a result of a client's invoking a remove operation, or when a container decides to terminate the session object after a timeout.
This method is called with no transaction context.- Throws:
javax.ejb.EJBException- Thrown if the instance could not perform the function requested by the container because of an system-level error.RemoteException
-
setSessionContext
public void setSessionContext(javax.ejb.SessionContext newContext) throws javax.ejb.EJBException Set the associated session context. The container calls this method after the instance creation.
The enterprise bean instance should store the reference to the context object in an instance variable.
This method is called with no transaction context.- Parameters:
newContext-- Throws:
javax.ejb.EJBException- Thrown if the instance could not perform the function requested by the container because of an system-level error.
-
getSessionContext
public javax.ejb.SessionContext getSessionContext()Get the associated session context- Returns:
- SessionContext
-
getEJBContext
public javax.ejb.EJBContext getEJBContext()- Returns:
- EJBContext
-
getDataBase
public com.thortech.xl.dataaccess.tcDataProvider getDataBase()Returns the database. Wraps the method call to retrieve the database in tcObjectManager.- Specified by:
getDataBasein interfacecom.thortech.xl.server.tcOrbServerObject- Returns:
- The database.
-
close
public void close()This method will clean up all resources associated with this object. Called when it will no longer be used.- Specified by:
closein interfacetcUtilityOperationsIntf
-
removeInstance
public void removeInstance()Releases the object resources.- Specified by:
removeInstancein interfacecom.thortech.xl.orb.api.operations._tcUtilityIntfOperations- Specified by:
removeInstancein interfacecom.thortech.xl.server.tcOrbServerObject
-
getName
Returns the name of the client.- Specified by:
getNamein interfacecom.thortech.xl.orb.api.operations._tcUtilityIntfOperations- Specified by:
getNamein interfacetcUtilityOperationsIntf- Returns:
- The name of the client.
-
setLanguage
Sets the language. Used in defining the locality that this utility class represents. Only to be called bytcUtilityIntf.- Specified by:
setLanguagein interfacecom.thortech.xl.orb.api.operations._tcUtilityIntfOperations- Specified by:
setLanguagein interfacetcUtilityOperationsIntf- Parameters:
psLanguage- The language.
-
setCountry
Sets the country. Used in defining the locality that this utility class represents. Only to be called bytcUtilityIntf.- Specified by:
setCountryin interfacecom.thortech.xl.orb.api.operations._tcUtilityIntfOperations- Specified by:
setCountryin interfacetcUtilityOperationsIntf- Parameters:
psCountry- The country.
-
setVariant
Sets the variant. Used in defining the locality that this utility class represents. Only to be called bytcUtilityIntf.- Specified by:
setVariantin interfacecom.thortech.xl.orb.api.operations._tcUtilityIntfOperations- Specified by:
setVariantin interfacetcUtilityOperationsIntf- Parameters:
psVariant- The locality variant.
-
addError
public void addError(com.thortech.xl.orb.dataaccess.tcError poError) Adds the error to this object's error list, and sets the state to ERROR.- Specified by:
addErrorin interfacecom.thortech.xl.dataobj.tcErrorReceiver- Parameters:
poError- The error to add.
-
addReject
public void addReject(com.thortech.xl.orb.dataaccess.tcError poReject) Adds the rejection to this object's rejection list.- Specified by:
addRejectin interfacecom.thortech.xl.dataobj.tcErrorReceiver- Parameters:
poReject- The rejection to add.
-
addErrorReceiver
public void addErrorReceiver(com.thortech.xl.dataobj.tcErrorReceiver poErrorReceiver) Adds another error receiver to the object's error list. Any time an error is added to this object's error list, the error message will also be added to the error receiver specified.- Specified by:
addErrorReceiverin interfacecom.thortech.xl.dataobj.tcErrorReceiver- Parameters:
poErrorReceiver- The error receiver to add.
-
removeErrorReceiver
public void removeErrorReceiver(com.thortech.xl.dataobj.tcErrorReceiver poErrorReceiver) Removes the error receiver from the object's error list. Any new errors added to this object will be not be passed along to the specified error receiver.- Specified by:
removeErrorReceiverin interfacecom.thortech.xl.dataobj.tcErrorReceiver- Parameters:
poErrorReceiver- The error receiver to remove.
-
getErrors
public com.thortech.xl.orb.dataaccess.tcError[] getErrors()Returns errors that occurred over the course of usage of the class.- Specified by:
getErrorsin interfacecom.thortech.xl.orb.api.operations._tcUtilityIntfOperations- Returns:
- An array of errors.
-
getRejections
public com.thortech.xl.orb.dataaccess.tcError[] getRejections()Returns rejections that occurred over the course of usage of the class.- Specified by:
getRejectionsin interfacecom.thortech.xl.orb.api.operations._tcUtilityIntfOperations- Returns:
- An array of rejections.
-
clearErrors
public void clearErrors()Clears all errors and exceptions that are stored in the utility class.- Specified by:
clearErrorsin interfacecom.thortech.xl.orb.api.operations._tcUtilityIntfOperations
-
getMap
Creates aMapobject from the provided array oftcMappingobjects. Useful for the utility classes in executing queries where they need to provide qualifiers.- Parameters:
paoMapping- An array of tcMapping objects, each of which represents a name-value pair.- Returns:
- A Map object containing all the name-value pairs.
-
getMapping
Creates atcMappingarray from the providedMap. Useful for the utility classes in executing queries where they need to provide qualifiers.- Parameters:
poMap- An array of tcMapping objects, each of which represents a name-value pair.- Returns:
- A Map object containing all the name-value pairs.
-
getQueryFilter
public String getQueryFilter(Map<String, Object> moAttributeMap, Vector<String> prepStmtParams) throws tcAPIException- Throws:
tcAPIException
-
getDefaultLocaleCode
This method will return default locale stored in DB as <user.language>_<user.region>- Returns:
- Throws:
Exception
-
getUnAuthorizedTargetFieldSet
public Set<String> getUnAuthorizedTargetFieldSet(Map attributeMap, Set<String> retColumnSet) throws tcAPIException - Parameters:
attributeMap- identifies A map containing a search criteria pertianing to UserretColumnSet- identifies a set of db columns that are required in select clause of API and need to check if they are authorized- Returns:
- A set of unauthorized db columns as per Authorization policy
- Throws:
tcAPIException
-