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 enum
The following enum serves two purposes: 1. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Added constants for the backward compatibilitystatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addError
(com.thortech.xl.orb.dataaccess.tcError poError) Adds the error to this object's error list, and sets the state to ERROR.void
addErrorReceiver
(com.thortech.xl.dataobj.tcErrorReceiver poErrorReceiver) Adds another error receiver to the object's error list.void
addReject
(com.thortech.xl.orb.dataaccess.tcError poReject) Adds the rejection to this object's rejection list.void
Clears all errors and exceptions that are stored in the utility class.void
close()
This method will clean up all resources associated with this object.void
TheejbActivate()
method as required by the EJB specification.
The activate method is called when the instance is activated from its passive" state.void
TheejbPassivate()
method as required by the EJB specification.
The activate method is called when the instance is activated from its "passive" state.void
TheejbRemove()
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.tcDataProvider
Returns the database.static String
This method will return default locale stored in DB as <user.language>_<user.region>javax.ejb.EJBContext
com.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 aMap
object from the provided array oftcMapping
objects.static com.thortech.xl.orb.api.tcMapping[]
getMapping
(Map<String, Object> poMap) Creates atcMapping
array 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.SessionContext
Get the associated session contextgetUnAuthorizedTargetFieldSet
(Map attributeMap, Set<String> retColumnSet) void
removeErrorReceiver
(com.thortech.xl.dataobj.tcErrorReceiver poErrorReceiver) Removes the error receiver from the object's error list.void
Releases the object resources.void
setCountry
(String psCountry) Sets the country.void
setLanguage
(String psLanguage) Sets the language.void
setSessionContext
(javax.ejb.SessionContext newContext) Set the associated session context.void
setVariant
(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:
getDataBase
in 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:
close
in interfacetcUtilityOperationsIntf
-
removeInstance
public void removeInstance()Releases the object resources.- Specified by:
removeInstance
in interfacecom.thortech.xl.orb.api.operations._tcUtilityIntfOperations
- Specified by:
removeInstance
in interfacecom.thortech.xl.server.tcOrbServerObject
-
getName
Returns the name of the client.- Specified by:
getName
in interfacecom.thortech.xl.orb.api.operations._tcUtilityIntfOperations
- Specified by:
getName
in 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:
setLanguage
in interfacecom.thortech.xl.orb.api.operations._tcUtilityIntfOperations
- Specified by:
setLanguage
in 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:
setCountry
in interfacecom.thortech.xl.orb.api.operations._tcUtilityIntfOperations
- Specified by:
setCountry
in 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:
setVariant
in interfacecom.thortech.xl.orb.api.operations._tcUtilityIntfOperations
- Specified by:
setVariant
in 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:
addError
in 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:
addReject
in 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:
addErrorReceiver
in 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:
removeErrorReceiver
in 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:
getErrors
in 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:
getRejections
in 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:
clearErrors
in interfacecom.thortech.xl.orb.api.operations._tcUtilityIntfOperations
-
getMap
Creates aMap
object from the provided array oftcMapping
objects. 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 atcMapping
array 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
-