org.alfresco.repo.cache.SimpleCache Java Examples

The following examples show how to use org.alfresco.repo.cache.SimpleCache. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractPropertyValueDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Default constructor.
 * <p>
 * This sets up the DAO accessors to bypass any caching to handle the case where the caches are not
 * supplied in the setters.
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public AbstractPropertyValueDAOImpl()
{
    this.propertyClassDaoCallback = new PropertyClassCallbackDAO();
    this.propertyDateValueCallback = new PropertyDateValueCallbackDAO();
    this.propertyStringValueCallback = new PropertyStringValueCallbackDAO();
    this.propertyDoubleValueCallback = new PropertyDoubleValueCallbackDAO();
    this.propertySerializableValueCallback = new PropertySerializableValueCallbackDAO();
    this.propertyValueCallback = new PropertyValueCallbackDAO();
    this.propertyCallback = new PropertyCallbackDAO();
    
    this.propertyClassCache = new EntityLookupCache<Long, Class<?>, String>(propertyClassDaoCallback);
    this.propertyDateValueCache = new EntityLookupCache<Long, Date, Date>(propertyDateValueCallback);
    this.propertyStringValueCache = new EntityLookupCache<Long, String, Pair<String, Long>>(propertyStringValueCallback);
    this.propertyDoubleValueCache = new EntityLookupCache<Long, Double, Double>(propertyDoubleValueCallback);
    this.propertySerializableValueCache = new EntityLookupCache<Long, Serializable, Serializable>(propertySerializableValueCallback);
    this.propertyValueCache = new EntityLookupCache<Long, Serializable, Serializable>(propertyValueCallback);
    this.propertyCache = new EntityLookupCache<Long, Serializable, Serializable>(propertyCallback);
    
    this.propertyUniqueContextCache = (SimpleCache<CachePucKey, PropertyUniqueContextEntity>)new NullCache();
}
 
Example #2
Source File: NodeServiceTest.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Looks for a key that contains the toString() of the value
 */
private Object findCacheValue(SimpleCache<Serializable, ValueHolder<Serializable>> cache, Serializable key)
{
    Collection<Serializable> keys = cache.getKeys();
    for (Serializable keyInCache : keys)
    {
        String keyInCacheStr = keyInCache.toString();
        String keyStr = key.toString();
        if (keyInCacheStr.endsWith(keyStr))
        {
            Object value = TransactionalCache.getSharedCacheValue(cache, keyInCache);
            return value;
        }
    }
    return null;
}
 
Example #3
Source File: AbstractPropertyValueDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache to use for <b>alf_prop_class</b> lookups (optional).
 * 
 * @param propertyClassCache            the cache of IDs to property classes
 */
public void setPropertyClassCache(SimpleCache<Serializable, Object> propertyClassCache)
{
    this.propertyClassCache = new EntityLookupCache<Long, Class<?>, String>(
            propertyClassCache,
            CACHE_REGION_PROPERTY_CLASS,
            propertyClassDaoCallback);
}
 
Example #4
Source File: RemoteAlfrescoTicketServiceTest.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
protected void setUp() throws Exception
{
    super.setUp();

    this.retryingTransactionHelper = (RetryingTransactionHelper)getServer().getApplicationContext().getBean("retryingTransactionHelper");
    this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService");
    this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService");
    
    this.remoteAlfrescoTicketService = (RemoteAlfrescoTicketService)getServer().getApplicationContext().getBean("remoteAlfrescoTicketService");
    this.remoteCredentialsService = (RemoteCredentialsService)getServer().getApplicationContext().getBean("RemoteCredentialsService");
    this.ticketsCache = (SimpleCache<String, String>)getServer().getApplicationContext().getBean("remoteAlfrescoTicketService.ticketsCache");
    
    // Do the setup as admin
    AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
    
    // Add our local system as a remote service
    remoteAlfrescoTicketService.registerRemoteSystem(TEST_REMOTE_SYSTEM_ID, "http://localhost:8080/alfresco/service/", null);
    
    // Wire up the loop-back connector
    ((RemoteAlfrescoTicketServiceImpl)remoteAlfrescoTicketService).setRemoteConnectorService(
            new LocalWebScriptConnectorServiceImpl(this));
    
    // Ensure the invalid one isn't registered
    remoteAlfrescoTicketService.registerRemoteSystem(INVALID_REMOTE_SYSTEM_ID, null, null);
    
    // Create users
    createUser(USER_ONE);
    createUser(USER_TWO);

    // Do tests as first user
    AuthenticationUtil.setFullyAuthenticatedUser(USER_ONE);
}
 
Example #5
Source File: RoutingContentStoreTest.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
public RandomRoutingContentStore(ContentStore ... stores)
{
    this.stores = new ArrayList<ContentStore>(5);
    for (ContentStore store : stores)
    {
        this.stores.add(store);
    }
    SimpleCache<Pair<String,String>, ContentStore> cache = new DefaultSimpleCache<Pair<String,String>, ContentStore>(11, getClass().getName());
    super.setStoresCache(cache);
}
 
Example #6
Source File: NodeDAOTest.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public void setUp()
{
    ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
    transactionService = serviceRegistry.getTransactionService();
    txnHelper = transactionService.getRetryingTransactionHelper();
    txnHelper.setMinRetryWaitMs(10);
    txnHelper.setRetryWaitIncrementMs(10);
    txnHelper.setMaxRetryWaitMs(50);
    
    nodeDAO = (NodeDAO) ctx.getBean("nodeDAO");
    rootNodesCache = (SimpleCache<Serializable, ValueHolder<Node>>) ctx.getBean("node.rootNodesSharedCache");
}
 
Example #7
Source File: AbstractNodeDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache that maintains the Node QName IDs
 * 
 * @param aspectsCache          the cache
 */
public void setAspectsCache(SimpleCache<NodeVersionKey, Set<QName>> aspectsCache)
{
    this.aspectsCache = new EntityLookupCache<NodeVersionKey, Set<QName>, Serializable>(
            aspectsCache,
            CACHE_REGION_ASPECTS,
            new AspectsCallbackDAO());
}
 
Example #8
Source File: TransactionCleanupTest.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
  @Before
  public void before()
  {
  	ServiceRegistry serviceRegistry = (ServiceRegistry)ctx.getBean("ServiceRegistry");
      NamespaceService namespaceService = serviceRegistry.getNamespaceService();
this.transactionService = serviceRegistry.getTransactionService();
this.authenticationService = (MutableAuthenticationService)ctx.getBean("authenticationService");
this.nodeService = serviceRegistry.getNodeService();
this.searchService = serviceRegistry.getSearchService();
this.nodeDAO = (NodeDAO)ctx.getBean("nodeDAO");
this.nodesCache = (SimpleCache<Serializable, Serializable>) ctx.getBean("node.nodesSharedCache");
      this.worker = (DeletedNodeCleanupWorker)ctx.getBean("nodeCleanup.deletedNodeCleanup");
      this.worker.setMinPurgeAgeDays(0);

  	this.helper = transactionService.getRetryingTransactionHelper();
      authenticationService.authenticate("admin", "admin".toCharArray());
      
StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
NodeRef storeRoot = nodeService.getRootNode(storeRef);
List<NodeRef> nodeRefs = searchService.selectNodes(
        storeRoot, "/app:company_home", null, namespaceService, false);
final NodeRef companyHome = nodeRefs.get(0);

  	RetryingTransactionHelper.RetryingTransactionCallback<NodeRef> createNode = new RetryingTransactionHelper.RetryingTransactionCallback<NodeRef>()
  	{
	@Override
	public NodeRef execute() throws Throwable
	{
		return nodeService.createNode(companyHome, ContentModel.ASSOC_CONTAINS, QName.createQName("test", GUID.generate()), ContentModel.TYPE_CONTENT).getChildRef();
	}
  	};
  	this.nodeRef1 = helper.doInTransaction(createNode, false, true);
  	this.nodeRef2 = helper.doInTransaction(createNode, false, true);
  	this.nodeRef3 = helper.doInTransaction(createNode, false, true);
  	this.nodeRef4 = helper.doInTransaction(createNode, false, true);
  	this.nodeRef5 = helper.doInTransaction(createNode, false, true);
  }
 
Example #9
Source File: UpgradePasswordHashTest.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void setUp() throws Exception
{
    if (AlfrescoTransactionSupport.getTransactionReadState() != TxnReadState.TXN_NONE)
    {
        throw new AlfrescoRuntimeException(
                "A previous tests did not clean up transaction: " +
                AlfrescoTransactionSupport.getTransactionId());
    }
    
    serviceRegistry = (ServiceRegistry)ctx.getBean("ServiceRegistry");

    SimpleCache<String, RepositoryAuthenticationDao.CacheEntry> authenticationCache = (SimpleCache<String, RepositoryAuthenticationDao.CacheEntry>) ctx.getBean("authenticationCache");
    SimpleCache<String, NodeRef> immutableSingletonCache = (SimpleCache<String, NodeRef>) ctx.getBean("immutableSingletonCache");
    TenantService tenantService = (TenantService) ctx.getBean("tenantService");
    compositePasswordEncoder = (CompositePasswordEncoder) ctx.getBean("compositePasswordEncoder");
    PolicyComponent policyComponent = (PolicyComponent) ctx.getBean("policyComponent");

    repositoryAuthenticationDao = new RepositoryAuthenticationDao();
    repositoryAuthenticationDao.setTransactionService(serviceRegistry.getTransactionService());
    repositoryAuthenticationDao.setAuthorityService(serviceRegistry.getAuthorityService());
    repositoryAuthenticationDao.setTenantService(tenantService);
    repositoryAuthenticationDao.setNodeService(serviceRegistry.getNodeService());
    repositoryAuthenticationDao.setNamespaceService(serviceRegistry.getNamespaceService());
    repositoryAuthenticationDao.setCompositePasswordEncoder(compositePasswordEncoder);
    repositoryAuthenticationDao.setPolicyComponent(policyComponent);
    repositoryAuthenticationDao.setAuthenticationCache(authenticationCache);
    repositoryAuthenticationDao.setSingletonCache(immutableSingletonCache);

    upgradePasswordHashWorker = (UpgradePasswordHashWorker)ctx.getBean("upgradePasswordHashWorker");
    nodeService = serviceRegistry.getNodeService();

    AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName());
}
 
Example #10
Source File: AbstractNodeDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache that maintains node ID-NodeRef cross referencing data
 * 
 * @param cache                 the cache
 */
public void setNodesCache(SimpleCache<Serializable, Serializable> cache)
{
    this.nodesCache = new EntityLookupCache<Long, Node, NodeRef>(
            cache,
            CACHE_REGION_NODES,
            new NodesCacheCallbackDAO());
    if (cache instanceof TransactionalCache)
    {
        this.nodesTransactionalCache = (TransactionalCache<Serializable, Serializable>) cache;
    }
}
 
Example #11
Source File: AbstractNodeDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache that maintains the Store root node data
 * 
 * @param cache                 the cache
 */
public void setRootNodesCache(SimpleCache<Serializable, Serializable> cache)
{
    this.rootNodesCache = new EntityLookupCache<StoreRef, Node, Serializable>(
            cache,
            CACHE_REGION_ROOT_NODES,
            new RootNodesCacheCallbackDAO());
}
 
Example #12
Source File: AbstractContentDataDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void setContentUrlCache(SimpleCache<Long, ContentUrlEntity> contentUrlCache)
{
    this.contentUrlCache = new EntityLookupCache<Long, ContentUrlEntity, String>(
            contentUrlCache,
            CACHE_REGION_CONTENT_URL,
            contentUrlCallbackDAO);
}
 
Example #13
Source File: AbstractContentDataDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * @param contentDataCache              the cache of IDs to ContentData and vice versa
 */
public void setContentDataCache(SimpleCache<Long, ContentData> contentDataCache)
{
    this.contentDataCache = new EntityLookupCache<Long, ContentData, Serializable>(
            contentDataCache,
            CACHE_REGION_CONTENT_DATA,
            contentDataCallbackDAO);
}
 
Example #14
Source File: AbstractEncodingDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache that maintains the ID-Encoding mappings and vice-versa (bi-directional)
 * 
 * @param encodingEntityCache        the cache
 */
public void setEncodingEntityCache(SimpleCache<Long, String> encodingEntityCache)
{
    this.encodingEntityCache = new EntityLookupCache<Long, String, String>(
            encodingEntityCache,
            CACHE_REGION_ENCODING,
            new EncodingEntityCallbackDAO());
}
 
Example #15
Source File: AbstractQNameDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache that maintains the ID-Namespace mappings and vice-versa.
 * 
 * @param qnameCache            the cache
 */
public void setQnameCache(SimpleCache<Long, QName> qnameCache)
{
    this.qnameCache = new EntityLookupCache<Long, QName, QName>(
            qnameCache,
            CACHE_REGION_QNAME,
            new QNameCallbackDAO());
}
 
Example #16
Source File: AbstractQNameDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache that maintains the ID-Namespace mappings and vice-versa.
 * 
 * @param namespaceCache        the cache
 */
public void setNamespaceCache(SimpleCache<Long, String> namespaceCache)
{
    this.namespaceCache = new EntityLookupCache<Long, String, String>(
            namespaceCache,
            CACHE_REGION_NAMESPACE,
            new NamespaceCallbackDAO());
}
 
Example #17
Source File: AbstractTenantAdminDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache to use for <b>alf_tenant</b> lookups (optional).
 * 
 * @param tenantEntityCache      the cache of tenantDomains to TenantEntities
 */
public void setTenantEntityCache(SimpleCache<Serializable, Object> tenantEntityCache)
{
    this.tenantEntityCache = new EntityLookupCache<String, TenantEntity, Serializable>(
            tenantEntityCache,
            tenantEntityDaoCallback);
}
 
Example #18
Source File: AbstractLocaleDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache that maintains the ID-Locale mappings and vice-versa (bi-directional)
 * 
 * @param localeEntityCache        the cache
 */
public void setLocaleEntityCache(SimpleCache<Long, String> localeEntityCache)
{
    this.localeEntityCache = new EntityLookupCache<Long, String, String>(
            localeEntityCache,
            CACHE_REGION_LOCALE,
            new LocaleEntityCallbackDAO());
}
 
Example #19
Source File: AbstractPropertyValueDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache to use for <b>alf_prop_root</b> lookups (optional).
 * 
 * @param propertyCache     the cache of IDs to property values
 */
public void setPropertyCache(SimpleCache<Serializable, Object> propertyCache)
{
    this.propertyCache = new EntityLookupCache<Long, Serializable, Serializable>(
            propertyCache,
            CACHE_REGION_PROPERTY,
            propertyCallback);
}
 
Example #20
Source File: AbstractPropertyValueDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache to use for <b>alf_prop_value</b> lookups (optional).
 * 
 * @param propertyValueCache     the cache of IDs to property values
 */
public void setPropertyValueCache(SimpleCache<Serializable, Object> propertyValueCache)
{
    this.propertyValueCache = new EntityLookupCache<Long, Serializable, Serializable>(
            propertyValueCache,
            CACHE_REGION_PROPERTY_VALUE,
            propertyValueCallback);
}
 
Example #21
Source File: AbstractPropertyValueDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache to use for <b>alf_prop_serializable_value</b> lookups (optional).
 * 
 * @param propertySerializableValueCache     the cache of IDs to property values
 */
public void setPropertySerializableValueCache(SimpleCache<Serializable, Object> propertySerializableValueCache)
{
    this.propertySerializableValueCache = new EntityLookupCache<Long, Serializable, Serializable>(
            propertySerializableValueCache,
            CACHE_REGION_PROPERTY_SERIALIZABLE_VALUE,
            propertySerializableValueCallback);
}
 
Example #22
Source File: AbstractAclCrudDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache to use for <b>alf_authority</b> lookups (optional).
 * 
 * @param authorityEntityCache      the cache of IDs to AclEntities
 */
public void setAuthorityEntityCache(SimpleCache<Serializable, Object> authorityEntityCache)
{
    this.authorityEntityCache = new EntityLookupCache<Long, AuthorityEntity, String>(
            authorityEntityCache,
            CACHE_REGION_AUTHORITY,
            authorityEntityDaoCallback);
}
 
Example #23
Source File: AbstractAclCrudDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache to use for <b>alf_permission</b> lookups (optional).
 * 
 * @param permissionEntityCache     the cache of IDs to PermissionEntities
 */
public void setPermissionEntityCache(SimpleCache<Serializable, Object> permissionEntityCache)
{
    this.permissionEntityCache = new EntityLookupCache<Long, PermissionEntity, PermissionEntity>(
            permissionEntityCache,
            CACHE_REGION_PERMISSION,
            permissionEntityDaoCallback);
}
 
Example #24
Source File: AbstractPropertyValueDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache to use for <b>alf_prop_double_value</b> lookups (optional).
 * 
 * @param propertyDoubleValueCache     the cache of IDs to property values
 */
public void setPropertyDoubleValueCache(SimpleCache<Serializable, Object> propertyDoubleValueCache)
{
    this.propertyDoubleValueCache = new EntityLookupCache<Long, Double, Double>(
            propertyDoubleValueCache,
            CACHE_REGION_PROPERTY_DOUBLE_VALUE,
            propertyDoubleValueCallback);
}
 
Example #25
Source File: AbstractPropertyValueDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache to use for <b>alf_prop_string_value</b> lookups (optional).
 * 
 * @param propertyStringValueCache      the cache of IDs to property string values
 */
public void setPropertyStringValueCache(SimpleCache<Serializable, Object> propertyStringValueCache)
{
    this.propertyStringValueCache = new EntityLookupCache<Long, String, Pair<String, Long>>(
            propertyStringValueCache,
            CACHE_REGION_PROPERTY_STRING_VALUE,
            propertyStringValueCallback);
}
 
Example #26
Source File: AbstractPropertyValueDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache to use for <b>alf_prop_date_value</b> lookups (optional).
 * 
 * @param propertyDateValueCache        the cache of IDs to property values
 */
public void setPropertyDateValueCache(SimpleCache<Serializable, Object> propertyDateValueCache)
{
    this.propertyDateValueCache = new EntityLookupCache<Long, Date, Date>(
            propertyDateValueCache,
            CACHE_REGION_PROPERTY_DATE_VALUE,
            propertyDateValueCallback);
}
 
Example #27
Source File: AbstractNodeDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set the cache that maintains the Node property values
 * 
 * @param propertiesCache       the cache
 */
public void setPropertiesCache(SimpleCache<NodeVersionKey, Map<QName, Serializable>> propertiesCache)
{
    this.propertiesCache = new EntityLookupCache<NodeVersionKey, Map<QName, Serializable>, Serializable>(
            propertiesCache,
            CACHE_REGION_PROPERTIES,
            new PropertiesCallbackDAO());
}
 
Example #28
Source File: WebDAVServlet.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Initialize the servlet
 * 
 * @param config ServletConfig
 * @exception ServletException
 */
@SuppressWarnings("unchecked")
public void init(ServletConfig config) throws ServletException
{
    super.init(config);

    // Get service registry        
    WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
    
    // If no context has been initialised, exit silently so config changes can be made
    if (context == null)
    {
        return;
    }
    
    // Get global configuration properties
    WebApplicationContext wc = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
    initParams = (WebDAVInitParameters) wc.getBean(BEAN_INIT_PARAMS);
    
    // Render this servlet permanently unavailable if its enablement property is not set
    if (!initParams.getEnabled())
    {
        logger.info("Marking servlet WebDAV as unavailable!");
        return;
    }
    
    // Get root paths
    
    String storeValue = initParams.getStoreName();
    
    rootPath = initParams.getRootPath();
    
    // Get beans
    
    serviceRegistry = (ServiceRegistry)context.getBean(ServiceRegistry.SERVICE_REGISTRY);
    
    transactionService = serviceRegistry.getTransactionService();
    tenantService = (TenantService) context.getBean("tenantService");
    
    nodeService = (NodeService) context.getBean("NodeService");
    searchService = (SearchService) context.getBean("SearchService");
    namespaceService = (NamespaceService) context.getBean("NamespaceService");
    ActivityPoster poster = (ActivityPoster) context.getBean("activitiesPoster");
    singletonCache = (SimpleCache<String, NodeRef>)context.getBean("immutableSingletonCache");
    
    
    
    // Collaborator used by WebDAV methods to create activity posts.
    activityPoster = new ActivityPosterImpl("WebDAV", poster);
    
    // Create the WebDAV helper
    m_davHelper = (WebDAVHelper) context.getBean("webDAVHelper");
    
    // Initialize the root node
    initializeRootNode(storeValue, rootPath, context, nodeService, searchService, namespaceService, tenantService, transactionService);
    
    // Create the WebDAV methods table
    
    m_davMethods = new Hashtable<String, Class<? extends WebDAVMethod>>();
    
    m_davMethods.put(WebDAV.METHOD_PROPFIND, PropFindMethod.class);
    m_davMethods.put(WebDAV.METHOD_PROPPATCH, PropPatchMethod.class);
    m_davMethods.put(WebDAV.METHOD_COPY, CopyMethod.class);
    m_davMethods.put(WebDAV.METHOD_DELETE, DeleteMethod.class);
    m_davMethods.put(WebDAV.METHOD_GET, GetMethod.class);
    m_davMethods.put(WebDAV.METHOD_HEAD, HeadMethod.class);
    m_davMethods.put(WebDAV.METHOD_LOCK, LockMethod.class);
    m_davMethods.put(WebDAV.METHOD_MKCOL, MkcolMethod.class);
    m_davMethods.put(WebDAV.METHOD_MOVE, MoveMethod.class);
    m_davMethods.put(WebDAV.METHOD_OPTIONS, OptionsMethod.class);
    m_davMethods.put(WebDAV.METHOD_POST, PostMethod.class);
    m_davMethods.put(WebDAV.METHOD_PUT, PutMethod.class);
    m_davMethods.put(WebDAV.METHOD_UNLOCK, UnlockMethod.class);
}
 
Example #29
Source File: CMISAbstractDictionaryService.java    From alfresco-data-model with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setSingletonCache(SimpleCache<String, CMISDictionaryRegistry> singletonCache)
{
    this.cmisRegistryCache = singletonCache;
}
 
Example #30
Source File: RunningActionRestApiTest.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
protected void setUp() throws Exception
{
    super.setUp();
    ApplicationContext appContext = getServer().getApplicationContext();

    nodeService = (NodeService)appContext.getBean("NodeService");
    replicationService = (ReplicationService)appContext.getBean("ReplicationService");
    actionTrackingService = (ActionTrackingService)appContext.getBean("actionTrackingService");
    repositoryHelper = (Repository)appContext.getBean("repositoryHelper");
    transactionService = (TransactionService)appContext.getBean("transactionService");
    executingActionsCache = (SimpleCache<String, ExecutionDetails>)appContext.getBean("executingActionsCache");
    
    MutableAuthenticationService authenticationService = (MutableAuthenticationService)appContext.getBean("AuthenticationService");
    PersonService personService = (PersonService)appContext.getBean("PersonService");
    personManager = new TestPersonManager(authenticationService, personService, nodeService);

    UserTransaction txn = transactionService.getUserTransaction();
    txn.begin();
    
    personManager.createPerson(USER_NORMAL);
    
    // Ensure we start with no replication definitions
    // (eg another test left them behind)
    AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
    for(ReplicationDefinition rd : replicationService.loadReplicationDefinitions())
    {
       replicationService.deleteReplicationDefinition(rd);
    }
    txn.commit();
    
    // Grab a reference to the data dictionary
    dataDictionary = nodeService.getChildByName(
             repositoryHelper.getCompanyHome(),
             ContentModel.ASSOC_CONTAINS,
             "Data Dictionary"
    );
    
    AuthenticationUtil.clearCurrentSecurityContext();
}