MT - fixes for new MT interceptor (create/login tenant admin, get stores)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10995 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2008-09-23 22:48:08 +00:00
parent f65ad654b2
commit 40e706f14f
7 changed files with 154 additions and 33 deletions

View File

@@ -60,20 +60,17 @@ public class MultiTServiceImpl implements TenantService
{
this.tenantsCache = tenantsCache;
}
public NodeRef getName(NodeRef nodeRef)
{
// Check that all the passed values are not null
ParameterCheck.mandatory("NodeRef", nodeRef);
if (nodeRef == null) { return null; }
return new NodeRef(nodeRef.getStoreRef().getProtocol(), getName(nodeRef.getStoreRef().getIdentifier()), nodeRef.getId());
}
public NodeRef getName(NodeRef inNodeRef, NodeRef nodeRef)
{
// Check that all the passed values are not null
ParameterCheck.mandatory("InNodeRef", inNodeRef);
ParameterCheck.mandatory("NodeRef", nodeRef);
if (inNodeRef == null || nodeRef == null) { return null; }
int idx = inNodeRef.getStoreRef().getIdentifier().lastIndexOf(SEPARATOR);
if (idx != -1)
@@ -87,16 +84,14 @@ public class MultiTServiceImpl implements TenantService
public StoreRef getName(StoreRef storeRef)
{
// Check that all the passed values are not null
ParameterCheck.mandatory("StoreRef", storeRef);
if (storeRef == null) { return null; }
return new StoreRef(storeRef.getProtocol(), getName(storeRef.getIdentifier()));
}
public ChildAssociationRef getName(ChildAssociationRef childAssocRef)
{
// Check that all the passed values are not null
ParameterCheck.mandatory("ChildAssocRef", childAssocRef);
if (childAssocRef == null) { return null; }
return new ChildAssociationRef(
childAssocRef.getTypeQName(),
@@ -109,8 +104,7 @@ public class MultiTServiceImpl implements TenantService
public AssociationRef getName(AssociationRef assocRef)
{
// Check that all the passed values are not null
ParameterCheck.mandatory("assocRef", assocRef);
if (assocRef == null) { return null; }
return new AssociationRef(
getName(assocRef.getSourceRef()),
@@ -121,10 +115,10 @@ public class MultiTServiceImpl implements TenantService
public StoreRef getName(String username, StoreRef storeRef)
{
// Check that all the passed values are not null
ParameterCheck.mandatory("StoreRef", storeRef);
if (storeRef == null) { return null; }
if (username != null) {
if (username != null)
{
int idx = username.lastIndexOf(SEPARATOR);
if ((idx > 0) && (idx < (username.length()-1)))
{
@@ -241,24 +235,21 @@ public class MultiTServiceImpl implements TenantService
public NodeRef getBaseName(NodeRef nodeRef)
{
// Check that all the passed values are not null
ParameterCheck.mandatory("NodeRef", nodeRef);
if (nodeRef == null) { return null; }
return new NodeRef(nodeRef.getStoreRef().getProtocol(), getBaseName(nodeRef.getStoreRef().getIdentifier()), nodeRef.getId());
}
public StoreRef getBaseName(StoreRef storeRef)
{
// Check that all the passed values are not null
ParameterCheck.mandatory("StoreRef", storeRef);
if (storeRef == null) { return null; }
return new StoreRef(storeRef.getProtocol(), getBaseName(storeRef.getIdentifier()));
}
public ChildAssociationRef getBaseName(ChildAssociationRef childAssocRef)
{
// Check that all the passed values are not null
ParameterCheck.mandatory("ChildAssocRef", childAssocRef);
if (childAssocRef == null) { return null; }
return new ChildAssociationRef(childAssocRef.getTypeQName(),
getBaseName(childAssocRef.getParentRef()),