|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.adapter.secure.GenericSecuredRepository
public class GenericSecuredRepository
An implementation of SecureRepository that wraps a normal Repository, using properties of its items to store access control information as formatted strings. This is a very basic system whose primary purpose is flexibility rather than performance, although some effort has been given towards providing acceptable performance.
This implementation is not intended to provide absolute security, but rather to allow an application the ability to provide security features without having to implement its own access checking.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
protected atg.adapter.secure.WeakItemCache |
mItemCache
A cache of secured repository items indexed by the repository item. |
protected Repository |
mRepository
The repository we're wrapping. |
protected SecurityConfiguration |
mSecurityConfiguration
The security configuration of the repository. |
protected javax.transaction.TransactionManager |
mTransactionManager
The transaction manager to use for transactions while we do repository work. |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
GenericSecuredRepository()
Creates a secured repository that can be used to wrap a normal repository. |
|
GenericSecuredRepository(Repository pRepository,
SecurityConfiguration pConfiguration)
Creates a secured repository that wraps a normal repository. |
Method Summary | |
---|---|
protected void |
checkAccess(GenericSecuredRepositoryItem pItem,
AccessRight pRight)
Checks to see if the specified access is allowed on an item and, if not, throws a RepositorySecurityException that wraps a PermissionDeniedException. |
void |
checkAccess(java.lang.String pDescriptorName,
AccessRight pRight)
Checks to see if the current user has the indicated access right for an item descriptor. |
protected void |
checkAccess(java.lang.String pId,
java.lang.String pDescriptorName,
AccessRight pRight)
Looks up a secured repository item and checks to see if the user has the indicated access right on it. |
protected void |
checkForInvalidRepository()
|
void |
doStartService()
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. |
RepositoryItem[] |
filterItems(RepositoryItem[] pItems,
AccessRight pRight)
Filters out any repository items returned from a query that the user should not be able to access in the indicated mode. |
java.lang.String |
getComponentResourceBundleName()
Get property componentResourceBundleName |
atg.xml.XMLFile |
getConfigurationFile()
Returns the configuration template used to configure the repository. |
java.lang.String |
getDefaultViewName()
Returns the name of the "default" or "root" RepositoryView |
RepositoryItem |
getItem(java.lang.String pId)
Deprecated. |
RepositoryItem |
getItem(java.lang.String pId,
java.lang.String pDescriptorName)
Returns an item in the Repository with the given id. |
RepositoryItemDescriptor |
getItemDescriptor(RepositoryItemDescriptor pDesc)
Returns a RepositoryItemDescriptor accessed with the name of the given descriptor. |
RepositoryItemDescriptor |
getItemDescriptor(java.lang.String pName)
Returns a RepositoryItemDescriptor accessed with the given name. |
java.lang.String[] |
getItemDescriptorNames()
Returns an array of the names of the known RepositoryItemDescriptors. |
RepositoryItem[] |
getItems(java.lang.String[] pIds)
Deprecated. |
RepositoryItem[] |
getItems(java.lang.String[] pIds,
java.lang.String pDescriptorName)
Returns the items with the given ids. |
int |
getQueryEndIndexFactor()
Returns the factor by which queries overshoot when trying to get enough results. |
int |
getQueryMinimumQuerySize()
Returns the minimum guess size when querying with an end index. |
Repository |
getRepository()
Returns the repository that we're wrapping. |
java.lang.String |
getRepositoryDisplayName()
Get property repositoryDisplayName |
java.lang.String |
getRepositoryDisplayNameResource()
Get property repositoryDisplayNameResource |
java.lang.String |
getRepositoryName()
Returns the name of this Repository |
SecurityConfiguration |
getSecurityConfiguration()
Returns the security configuration information for the repository. |
SecurityPolicy |
getSecurityPolicy()
Returns the security policy used for the repository. |
javax.transaction.TransactionManager |
getTransactionManager()
Returns the transaction manager to use for repository interaction. |
RepositoryView |
getView(RepositoryItemDescriptor pDesc)
Returns a RepositoryView accessed with the name of the given descriptor. |
RepositoryView |
getView(java.lang.String pName)
Returns a RepositoryView accessed with the given name. |
java.lang.String[] |
getViewNames()
Returns an array of the names of all contained top-level views |
java.util.Collection |
getWrappedRepositories()
Returns the repository that we're wrapping. |
Repository |
getWrappedRepository()
Returns the repository that we're wrapping. |
atg.xml.tools.XMLToolsFactory |
getXMLToolsFactory()
Returns the tools factory that creates an XML parser for this user authority. |
boolean |
hasAccess(java.lang.String pDescriptorName,
AccessRight pRight)
Checks to see if the current user has the indicated access right for an item descriptor. |
void |
setComponentResourceBundleName(java.lang.String pComponentResourceBundleName)
Set property componentResourceBundleName |
void |
setConfigurationFile(atg.xml.XMLFile pXmlConfiguration)
Changes the configuration template used to configure the repository. |
void |
setQueryEndIndexFactor(int pQueryEndIndexFactor)
Sets the factor by which queries overshoot when trying to get enough results. |
void |
setQueryMinimumQuerySize(int pQueryMinimumQuerySize)
Sets the minimum guess size when querying with an end index. |
void |
setRepository(Repository pRepository)
Changes the repository that we're wrapping. |
void |
setRepositoryDisplayNameResource(java.lang.String pRepositoryDisplayNameResource)
Set property repositoryDisplayNameResource |
void |
setRepositoryName(java.lang.String pName)
Changes the name of the repository. |
void |
setSecurityConfiguration(SecurityConfiguration pSecurityConfiguration)
Changes the security configuration for the repository, which affects the production of access control lists. |
void |
setTransactionManager(javax.transaction.TransactionManager pManager)
Changes the transaction manager to use for repository interaction. |
void |
setXMLToolsFactory(atg.xml.tools.XMLToolsFactory pNewFactory)
Sets the tools factory that will be used to create an XML parser for this user authority. |
java.lang.Object[] |
unwrapArray(java.lang.Object[] pArray)
Takes an array and removes the secured wrappers around its contents. |
java.util.List |
unwrapList(java.util.List pList)
Takes a List and removes the secured wrappers around its contents. |
java.util.Map |
unwrapMap(java.util.Map pMap)
Takes a Map and removes the secured wrappers around its contents. |
java.util.Set |
unwrapSet(java.util.Set pSet)
Takes a Set and removes the secured wrappers around its contents. |
java.lang.Object |
unwrapValue(java.lang.Object pValue)
Takes a secured repository property value and turns it into an unsecured repository property value so we can store it in the underlying repository. |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
protected Repository mRepository
protected javax.transaction.TransactionManager mTransactionManager
protected SecurityConfiguration mSecurityConfiguration
protected atg.adapter.secure.WeakItemCache mItemCache
Constructor Detail |
---|
public GenericSecuredRepository()
public GenericSecuredRepository(Repository pRepository, SecurityConfiguration pConfiguration)
Method Detail |
---|
public atg.xml.XMLFile getConfigurationFile()
public void setConfigurationFile(atg.xml.XMLFile pXmlConfiguration)
public Repository getRepository()
public Repository getWrappedRepository()
getWrappedRepository
in interface atg.repository.RepositoryWrapper
public java.util.Collection getWrappedRepositories()
getWrappedRepositories
in interface atg.repository.RepositoryWrapper
public void setRepository(Repository pRepository)
public void setRepositoryName(java.lang.String pName)
public void setSecurityConfiguration(SecurityConfiguration pSecurityConfiguration)
public javax.transaction.TransactionManager getTransactionManager()
public void setTransactionManager(javax.transaction.TransactionManager pManager)
public atg.xml.tools.XMLToolsFactory getXMLToolsFactory()
public void setXMLToolsFactory(atg.xml.tools.XMLToolsFactory pNewFactory)
public java.lang.String getRepositoryDisplayName()
repositoryDisplayName
getRepositoryDisplayName
in interface atg.repository.DisplayableRepository
public void setRepositoryDisplayNameResource(java.lang.String pRepositoryDisplayNameResource)
repositoryDisplayNameResource
pRepositoryDisplayNameResource
- the name of the resource
that contains the display name for this repositorypublic java.lang.String getRepositoryDisplayNameResource()
repositoryDisplayNameResource
public void setComponentResourceBundleName(java.lang.String pComponentResourceBundleName)
componentResourceBundleName
pComponentResourceBundleName
- the name of the resource
bundle that holds the display name resourcepublic java.lang.String getComponentResourceBundleName()
componentResourceBundleName
public void checkAccess(java.lang.String pDescriptorName, AccessRight pRight) throws RepositoryException
RepositoryException
RepositorySecurityException
,
PermissionDeniedException
public boolean hasAccess(java.lang.String pDescriptorName, AccessRight pRight) throws RepositoryException
RepositoryException
protected void checkAccess(GenericSecuredRepositoryItem pItem, AccessRight pRight) throws RepositoryException
If the item is null, this completes successfully. This allows the caller to call through into the real repository to receive the appropriate repository exception.
RepositoryException
protected void checkAccess(java.lang.String pId, java.lang.String pDescriptorName, AccessRight pRight) throws RepositoryException
RepositoryException
public RepositoryItem[] filterItems(RepositoryItem[] pItems, AccessRight pRight)
public java.lang.Object[] unwrapArray(java.lang.Object[] pArray)
public java.util.List unwrapList(java.util.List pList)
public java.util.Map unwrapMap(java.util.Map pMap)
public java.util.Set unwrapSet(java.util.Set pSet)
public java.lang.Object unwrapValue(java.lang.Object pValue)
protected void checkForInvalidRepository() throws ServiceException
ServiceException
public void doStartService() throws ServiceException
GenericService
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting uppublic java.lang.String getRepositoryName()
getRepositoryName
in interface Repository
public RepositoryItem getItem(java.lang.String pId) throws RepositoryException
The caller must have READ access on the item descriptor or a RepositorySecurityException will be thrown. They must have LIST access on the item or null is returned.
getItem
in interface Repository
pId
- the id of the item to retrieve
RepositoryException
- if there was an error while
attempting to return the RepositoryItempublic RepositoryItem getItem(java.lang.String pId, java.lang.String pDescriptorName) throws RepositoryException
The caller must have READ access on the item descriptor or a RepositorySecurityException will be thrown. They must have LIST access on the item or null is returned.
getItem
in interface Repository
pId
- the id of the item to retrievepDescriptorName
- the name of the item descriptor that contains
this item.
RepositoryException
- if there was an error while
attempting to return the RepositoryItempublic RepositoryItem[] getItems(java.lang.String[] pIds) throws RepositoryException
The caller must have LIST access on each item that is requested or that item's slot will be set to null following this query.
getItems
in interface Repository
RepositoryException
- if there was an error while
attempting to return the RepositoryItemspublic RepositoryItem[] getItems(java.lang.String[] pIds, java.lang.String pDescriptorName) throws RepositoryException
The caller must have READ access on the item descriptor or a RepositorySecurityException will e thrown. They must have LIST access on each item or null is returned in the slots of the respective items.
getItems
in interface Repository
pIds
- the list of idspDescriptorName
- the item descriptor containing these ids
RepositoryException
- if there was an error while
attempting to return the RepositoryItemspublic java.lang.String getDefaultViewName()
getDefaultViewName
in interface Repository
public java.lang.String[] getViewNames()
getViewNames
in interface Repository
getViewNames
in interface RepositoryViewContainer
public RepositoryView getView(java.lang.String pName) throws RepositoryException
getView
in interface Repository
getView
in interface RepositoryViewContainer
pName
- the name of the view to find
RepositoryException
- if there was an error while
attempting to return the RepositoryViewpublic RepositoryView getView(RepositoryItemDescriptor pDesc) throws RepositoryException
Repository
getView
in interface Repository
pDesc
- the descriptor of the view to find
RepositoryException
- if there was an error while
attempting to return the RepositoryViewpublic java.lang.String[] getItemDescriptorNames()
getItemDescriptorNames
in interface Repository
public RepositoryItemDescriptor getItemDescriptor(java.lang.String pName) throws RepositoryException
getItemDescriptor
in interface Repository
pName
- the name of the descriptor to find
RepositoryException
- if there was an error while
attempting to return the RepositoryItemDescriptorpublic RepositoryItemDescriptor getItemDescriptor(RepositoryItemDescriptor pDesc) throws RepositoryException
Repository
getItemDescriptor
in interface Repository
pDesc
- the descriptor to find
RepositoryException
- if there was an error while
attempting to return the RepositoryItemDescriptorpublic SecurityPolicy getSecurityPolicy()
getSecurityPolicy
in interface SecuredRepository
public SecurityConfiguration getSecurityConfiguration()
getSecurityConfiguration
in interface SecuredRepository
public int getQueryEndIndexFactor()
public void setQueryEndIndexFactor(int pQueryEndIndexFactor)
public int getQueryMinimumQuerySize()
public void setQueryMinimumQuerySize(int pQueryMinimumQuerySize)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |