org.apache.commons.logging.Log.debug() - java examples

Here are the examples of the java api org.apache.commons.logging.Log.debug() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

155 Examples 7

19 View Complete Implementation : FileWipingContentCleanerListener.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
public void beforeDelete(ContentStore sourceStore, String contentUrl) throws ContentIOException {
    // First check if the content is present at all
    ContentReader reader = sourceStore.getReader(contentUrl);
    if (reader != null && reader.exists()) {
        // Call to implementation's shred
        if (logger.isDebugEnabled()) {
            logger.debug("About to shread: \n" + "   URL:    " + contentUrl + "\n" + "   Source: " + sourceStore);
        }
        try {
            shred(reader);
        } catch (Throwable e) {
            logger.error("Content shredding failed: \n" + "   URL:    " + contentUrl + "\n" + "   Source: " + sourceStore + "\n" + "   Reader: " + reader, e);
        }
    } else {
        logger.error("Content no longer exists.  Unable to shred: \n" + "   URL:    " + contentUrl + "\n" + "   Source: " + sourceStore);
    }
}

19 View Complete Implementation : AbstractAuditDAOImpl.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/*
     * alf_audit_application
     */
public AuditApplicationInfo getAuditApplication(String application) {
    AuditApplicationEnreplacedy enreplacedy = getAuditApplicationByName(application);
    if (enreplacedy == null) {
        return null;
    } else {
        AuditApplicationInfo appInfo = new AuditApplicationInfo();
        appInfo.setId(enreplacedy.getId());
        appInfo.setname(application);
        appInfo.setModelId(enreplacedy.getAuditModelId());
        appInfo.setDisabledPathsId(enreplacedy.getDisabledPathsId());
        // Done
        if (logger.isDebugEnabled()) {
            logger.debug("Found existing audit application: \n" + "  " + appInfo);
        }
        return appInfo;
    }
}

19 View Complete Implementation : RegexHomeFolderProvider.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
private Pattern getPattern(String patternString) {
    if (patternString == null || patternString.trim().length() == 0)
        return null;
    Pattern pattern;
    try {
        pattern = Pattern.compile(patternString);
        logger.debug("Successfully compiled patternString : " + patternString);
    } catch (PatternSyntaxException pse) {
        throw new PersonException("Pattern string :" + patternString + " does not compile", pse);
    }
    return pattern;
}

19 View Complete Implementation : RenditionNodeManager.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * This method determines whether or not orphaning of the old rendition is required.
 *
 * @return <code>true</code> if orphaning is required, else <code>false</code>.
 */
private boolean isOrphaningRequired() {
    boolean result = isOrphaningRequiredWithoutLog();
    if (logger.isDebugEnabled()) {
        StringBuilder msg = new StringBuilder();
        msg.append("The old rendition does ");
        if (result == false) {
            msg.append("not ");
        }
        msg.append("require orphaning.");
        logger.debug(msg.toString());
    }
    return result;
}

19 View Complete Implementation : AbstractExportTester.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
private void dumpSchema() {
    if (log.isDebugEnabled()) {
        log.debug("Iterating through Schema objects:");
    }
    int i = 0;
    for (DbObject dbo : getSchema()) {
        i++;
        if (log.isDebugEnabled()) {
            // Log the object's toString() - indented for clarity.
            log.debug("    " + dbo);
        }
    }
    if (log.isDebugEnabled()) {
        log.debug("Schema object contains " + i + " objects.");
    }
}

19 View Complete Implementation : ScenarioRenameCreateShuffle.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
@Override
public ScenarioInstance createInstance(final EvaluatorContext ctx, Operation operation) {
    /**
     * This scenario is triggered by a rename of a file matching
     * the pattern
     */
    if (operation instanceof RenameFileOperation) {
        RenameFileOperation r = (RenameFileOperation) operation;
        Matcher m = pattern.matcher(r.getTo());
        if (m.matches()) {
            if (logger.isDebugEnabled()) {
                logger.debug("New Scenario Rename Shuffle Create Instance strPattern:" + pattern);
            }
            ScenarioRenameCreateShuffleInstance instance = new ScenarioRenameCreateShuffleInstance();
            instance.setTimeout(timeout);
            instance.setRanking(ranking);
            return instance;
        }
    }
    // No not interested.
    return null;
}

19 View Complete Implementation : QuartzJobScheduler.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
@Override
public void unscheduleJob(final HBBaseDataCollector collector) {
    try {
        scheduler.unscheduleJob(new TriggerKey(getTriggerName(collector.getCollectorId())));
        if (logger.isDebugEnabled()) {
            logger.debug("HeartBeat unscheduled job for collector: " + collector.getCollectorId());
        }
    } catch (SchedulerException e) {
        throw new RuntimeException("Heartbeat failed to unschedule job for collector: " + collector.getCollectorId(), e);
    }
}

19 View Complete Implementation : AlfrescoImapServer.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
public void shutdown() {
    if (serverImpl != null) {
        if (logger.isDebugEnabled()) {
            logger.debug("IMAP service stopping.");
        }
        serverImpl.stopService(null);
    }
    if (secureServerImpl != null) {
        if (logger.isDebugEnabled()) {
            logger.debug("IMAPS service stopping.");
        }
        secureServerImpl.stopService(null);
    }
}

19 View Complete Implementation : BitlyUrlShortenerImpl.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
@Override
public String shortenUrl(String longUrl) {
    if (log.isDebugEnabled()) {
        log.debug("Shortening URL: " + longUrl);
    }
    String shortUrl = longUrl;
    if (longUrl.length() > urlLength) {
        GetMethod getMethod = new GetMethod();
        getMethod.setPath("/v3/shorten");
        List<NameValuePair> args = new ArrayList<NameValuePair>();
        args.add(new NameValuePair("login", username));
        args.add(new NameValuePair("apiKey", apiKey));
        args.add(new NameValuePair("longUrl", longUrl));
        args.add(new NameValuePair("format", "txt"));
        getMethod.setQueryString(args.toArray(new NameValuePair[args.size()]));
        try {
            int resultCode = httpClient.executeMethod(getMethod);
            if (resultCode == 200) {
                shortUrl = getMethod.getResponseBodyreplacedtring();
            } else {
                log.warn("Failed to shorten URL " + longUrl + "  - response code == " + resultCode);
                log.warn(getMethod.getResponseBodyreplacedtring());
            }
        } catch (Exception ex) {
            log.error("Failed to shorten URL " + longUrl, ex);
        }
        if (log.isDebugEnabled()) {
            log.debug("URL " + longUrl + " has been shortened to " + shortUrl);
        }
    }
    return shortUrl.trim();
}

19 View Complete Implementation : CompoundCopyBehaviourCallback.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * The lowest common denominator applies here.  The properties are preplaceded to each
 * callback in turn.  The resulting map is then preplaceded to the next callback and so
 * on.  If any callback removes or alters properties, these will not be recoverable.
 *
 * @return          Returns the least properties replacedigned for the copy by any individual
 *                  callback handler
 */
public Map<QName, Serializable> getCopyProperties(QName clreplacedQName, CopyDetails copyDetails, Map<QName, Serializable> properties) {
    Map<QName, Serializable> copyProperties = new HashMap<QName, Serializable>(properties);
    for (CopyBehaviourCallback callback : callbacks) {
        Map<QName, Serializable> propsToCopy = callback.getCopyProperties(clreplacedQName, copyDetails, copyProperties);
        if (propsToCopy != copyProperties) {
            /*
                 * Collections.emptyMap() is a valid return from the callback so we need to ensure it
                 * is still mutable for the next iteration
                 */
            copyProperties = new HashMap<QName, Serializable>(propsToCopy);
        }
    }
    // Done
    if (logger.isDebugEnabled()) {
        logger.debug("Copy properties: \n" + "   " + copyDetails + "\n" + "   " + this + "\n" + "   Before: " + properties + "\n" + "   After:  " + copyProperties);
    }
    return copyProperties;
}

19 View Complete Implementation : IndexColumnsValidator.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
@Override
public void validate(DbObject reference, DbObject target, DiffContext ctx) {
    if (!(target instanceof Index)) {
        throw new AlfrescoRuntimeException("IndexColumnsValidator could be used only in context of index object but was: " + target.toString());
    }
    List<String> referenceColumnNames = ((Index) reference).getColumnNames();
    List<String> targetColumnNames = ((Index) target).getColumnNames();
    for (int i = 0; i < targetColumnNames.size(); i++) {
        String columnName = targetColumnNames.get(i);
        if (getPattern() != null && !getPattern().matcher(columnName).matches()) {
            if (log.isDebugEnabled()) {
                log.debug("Pattern [" + getPattern() + "] not matched.");
            }
            String message = I18NUtil.getMessage("system.schema_comp.name_validator", getPattern());
            ValidationResult result = new ValidationResult(new DbProperty(target, "columnNames", i), message);
            ctx.getComparisonResults().add(result);
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Pattern [" + getPattern() + "] matched OK.");
            }
        }
    }
    if (targetColumnNames.size() != referenceColumnNames.size()) {
        if (log.isDebugEnabled()) {
            log.debug("Number of columns in index " + target.getName() + "doesn't match expected result");
        }
        String message = I18NUtil.getMessage("system.schema_comp.index_columns_validator", targetColumnNames.size(), referenceColumnNames.size());
        ValidationResult result = new ValidationResult(new DbProperty(target, "columnNames"), message);
        ctx.getComparisonResults().add(result);
    } else {
        if (log.isDebugEnabled()) {
            log.debug("Number of columns is equivalent.");
        }
    }
}

19 View Complete Implementation : CompoundCopyBehaviourCallback.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Uses the ChildreplacedocCopyAction ordering to drive priority i.e. a vote
 * to copy will override a vote NOT to copy.
 *
 * @return          Returns the most lively choice of action
 */
public ChildreplacedocCopyAction getChildreplacedociationCopyAction(QName clreplacedQName, CopyDetails copyDetails, CopyChildreplacedociationDetails childreplacedocCopyDetails) {
    ChildreplacedocCopyAction bestAction = ChildreplacedocCopyAction.IGNORE;
    for (CopyBehaviourCallback callback : callbacks) {
        ChildreplacedocCopyAction action = callback.getChildreplacedociationCopyAction(clreplacedQName, copyDetails, childreplacedocCopyDetails);
        if (action.compareTo(bestAction) > 0) {
            // We've trumped the last best one
            bestAction = action;
        }
    }
    // Done
    if (logger.isDebugEnabled()) {
        logger.debug("Child replacedociation copy behaviour: " + bestAction + "\n" + "   " + childreplacedocCopyDetails + "\n" + "   " + copyDetails + "\n" + "   " + this);
    }
    return bestAction;
}

19 View Complete Implementation : AlfrescoImapHostManager.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Subscribes a user to a mailbox. The mailbox must exist locally and the user must have rights to modify it.
 * <p/>
 * This method serves SUBSCRIBE command of the IMAP protocol.
 *
 * @param user User making the request
 * @param mailbox String representation of a mailbox name.
 */
public void subscribe(GreenMailUser user, String mailbox) throws FolderException {
    try {
        AlfrescoImapUser alfrescoUser = new AlfrescoImapUser(user.getEmail(), user.getLogin(), user.getPreplacedword());
        imapService.subscribe(alfrescoUser, getUnqualifiedMailboxPattern(alfrescoUser, mailbox));
    } catch (Throwable e) {
        logger.debug(e.getMessage(), e);
        throw new FolderException(e.getMessage());
    }
}

19 View Complete Implementation : CompoundCopyBehaviourCallback.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Uses the  ChildreplacedocRecurseAction ordering to drive recursive copy behaviour.
 *
 * @return          Returns the most lively choice of action
 */
@Override
public ChildreplacedocRecurseAction getChildreplacedociationRecurseAction(QName clreplacedQName, CopyDetails copyDetails, CopyChildreplacedociationDetails childreplacedocCopyDetails) {
    ChildreplacedocRecurseAction bestAction = ChildreplacedocRecurseAction.RESPECT_RECURSE_FLAG;
    for (CopyBehaviourCallback callback : callbacks) {
        ChildreplacedocRecurseAction action = callback.getChildreplacedociationRecurseAction(clreplacedQName, copyDetails, childreplacedocCopyDetails);
        if (action.compareTo(bestAction) > 0) {
            // We've trumped the last best one
            bestAction = action;
        }
    }
    // Done
    if (logger.isDebugEnabled()) {
        logger.debug("Child replacedociation recursion behaviour: " + bestAction + "\n" + "   " + childreplacedocCopyDetails + "\n" + "   " + copyDetails + "\n" + "   " + this);
    }
    return bestAction;
}

19 View Complete Implementation : DefaultCacheFactory.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
private SimpleCache<K, V> createLocalCache(String cacheName) {
    int maxItems = maxItems(cacheName);
    boolean useMaxItems = useMaxItems(cacheName);
    int ttlSecs = ttlSeconds(cacheName);
    int maxIdleSeconds = maxIdleSeconds(cacheName);
    DefaultSimpleCache<K, V> cache = new DefaultSimpleCache<K, V>(maxItems, useMaxItems, ttlSecs, maxIdleSeconds, cacheName);
    if (log.isDebugEnabled()) {
        log.debug("Creating cache: " + cache);
    }
    return cache;
}

19 View Complete Implementation : AuthenticatorAuthzClientFactoryBean.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
@Override
public AuthzClient getObject() throws Exception {
    // The creation of the client can be disabled for testing or when the username/preplacedword authentication is not required,
    // for instance when Keycloak is configured for 'bearer only' authentication or Direct Access Grants are disabled.
    if (!enabled) {
        return null;
    }
    // Build default http client using the keycloak client builder.
    int conTimeout = idenreplacedyServiceConfig.getClientConnectionTimeout();
    int socTimeout = idenreplacedyServiceConfig.getClientSocketTimeout();
    HttpClient client = new HttpClientBuilder().establishConnectionTimeout(conTimeout, TimeUnit.MILLISECONDS).socketTimeout(socTimeout, TimeUnit.MILLISECONDS).build(this.idenreplacedyServiceConfig);
    // Add secret to credentials if needed.
    // AuthzClient configuration needs credentials with a secret even if the client in Keycloak is configured as public.
    Map<String, Object> credentials = idenreplacedyServiceConfig.getCredentials();
    if (credentials == null || !credentials.containsKey("secret")) {
        credentials = credentials == null ? new HashMap<>() : new HashMap<>(credentials);
        credentials.put("secret", "");
    }
    // Create default AuthzClient for authenticating users against keycloak
    String authServerUrl = idenreplacedyServiceConfig.getAuthServerUrl();
    String realm = idenreplacedyServiceConfig.getRealm();
    String resource = idenreplacedyServiceConfig.getResource();
    Configuration authzConfig = new Configuration(authServerUrl, realm, resource, credentials, client);
    AuthzClient authzClient = AuthzClient.create(authzConfig);
    if (logger.isDebugEnabled()) {
        logger.debug(" Created Keycloak AuthzClient");
        logger.debug(" Keycloak AuthzClient server URL: " + authzClient.getConfiguration().getAuthServerUrl());
        logger.debug(" Keycloak AuthzClient realm: " + authzClient.getConfiguration().getRealm());
        logger.debug(" Keycloak AuthzClient resource: " + authzClient.getConfiguration().getResource());
    }
    return authzClient;
}

19 View Complete Implementation : JodConverterSharedInstance.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
private Long parseStringForLong(String string) {
    Long result = null;
    try {
        long l = Long.parseLong(string);
        result = new Long(l);
    } catch (NumberFormatException nfe) {
        if (logger.isDebugEnabled()) {
            logger.debug("Cannot parse numerical value from " + string);
        }
    // else intentionally empty
    }
    return result;
}

19 View Complete Implementation : XPathContentWorkerSelector.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Execute the XPath statements, in order, against the doreplacedent.  Any statements that fail
 * to run will be ignored.
 */
public W getWorker(ContentReader reader) {
    if (!supportedMimetypes.contains(reader.getMimetype())) {
        return null;
    }
    W worker = null;
    InputStream is = null;
    String xpath = null;
    try {
        is = reader.getContentInputStream();
        Doreplacedent doc = doreplacedentBuilder.parse(is);
        // Execute the statements
        worker = processDoreplacedent(doc);
    } catch (Throwable e) {
        throw new ContentIOException("\n" + "Failed to XPaths against XML doreplacedent: \n" + "   Reader:   " + reader + "\n" + "   Selector: " + this, e);
    } finally {
        if (is != null) {
            try {
                is.close();
            } catch (IOException e) {
            }
        }
    }
    // Done
    if (logger.isDebugEnabled()) {
        logger.debug("\n" + "Chosen content worker for reader: \n" + "   Reader:       " + reader + "\n" + "   XPath:        " + xpath + "\n" + "   Worker:    " + worker);
    }
    return worker;
}

19 View Complete Implementation : ImportTimerProgress.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/*
     *  (non-Javadoc)
     * @see org.alfresco.service.cmr.view.ImporterProgress#error(java.lang.Throwable)
     */
public void error(Throwable e) {
    if (logger.isDebugEnabled()) {
        Date end = new Date();
        logger.debug("Import completed at " + end + " (" + end.getTime() + ")");
        logger.debug("Error occured at " + end + " (" + end.getTime() + ")");
        logger.debug("Exception: " + e.toString());
        dumpStats(end);
    }
}

19 View Complete Implementation : ScenarioDeleteRestore.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
@Override
public ScenarioInstance createInstance(final EvaluatorContext ctx, Operation operation) {
    /**
     * This scenario is triggered by a delete of a file matching
     * the pattern
     */
    if (operation instanceof DeleteFileOperation) {
        DeleteFileOperation c = (DeleteFileOperation) operation;
        Matcher m = pattern.matcher(c.getName());
        if (m.matches()) {
            if (logger.isDebugEnabled()) {
                logger.debug("New Scenario Delete Restore Shuffle Instance:" + c.getName());
            }
            ScenarioDeleteRestoreInstance instance = new ScenarioDeleteRestoreInstance();
            instance.setTimeout(timeout);
            instance.setRanking(ranking);
            return instance;
        }
    }
    // No not interested.
    return null;
}

19 View Complete Implementation : FormServiceImpl.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/*
     * @see org.alfresco.repo.forms.FormService#saveForm(org.alfresco.repo.forms.Item, org.alfresco.repo.forms.FormData)
     */
public Object saveForm(Item item, FormData data) {
    if (this.processorRegistry == null) {
        throw new FormException("FormProcessorRegistry has not been setup");
    }
    if (logger.isDebugEnabled())
        logger.debug("Saving form for item '" + item + "': " + data);
    FormProcessor processor = this.processorRegistry.getApplicableFormProcessor(item);
    if (processor == null) {
        throw new FormException("Failed to find appropriate FormProcessor to persist Form for item: " + item);
    } else {
        return processor.persist(item, data);
    }
}

19 View Complete Implementation : NoIndexSearchService.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/*
     * (non-Javadoc)
     * @see org.alfresco.service.cmr.search.SearchService#query(org.alfresco.service.cmr.search.SearchParameters)
     */
@Override
public ResultSet query(SearchParameters searchParameters) {
    if (s_logger.isDebugEnabled()) {
        s_logger.debug("query   searchParameters = " + searchParameters);
    }
    trace();
    try {
        return super.query(searchParameters);
    } catch (SearcherException e) {
        return new EmptyResultSet();
    } catch (QueryModelException e) {
        return new EmptyResultSet();
    } catch (AlfrescoRuntimeException e) {
        return new EmptyResultSet();
    }
}

19 View Complete Implementation : SlowContentStoreTest.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
@Test
public void writeThroughCacheResultsInFastReadFirstTime() {
    cachingStore.setCacheOnInbound(true);
    // This content will be cached on the way in
    cachingStore.getWriter(new ContentContext(null, "any-url")).putContent("Content written from " + getClreplaced().getSimpleName());
    // First read will hit cache
    TimedStoreReader storeReader = new TimedStoreReader();
    storeReader.execute();
    replacedertTrue("First read should be fast", storeReader.timeTakenMillis() < 100);
    logger.debug(String.format("First read took %ds", storeReader.timeTakenMillis()));
    replacedertEquals("Content written from " + getClreplaced().getSimpleName(), storeReader.content);
    // Subsequent reads will also hit the cache
    for (int i = 0; i < 5; i++) {
        storeReader = new TimedStoreReader();
        storeReader.execute();
        replacedertTrue("Subsequent reads should be fast", storeReader.timeTakenMillis() < 100);
        logger.debug(String.format("Cache read took %ds", storeReader.timeTakenMillis()));
        // The original cached content, still cached...
        replacedertEquals("Content written from " + getClreplaced().getSimpleName(), storeReader.content);
    }
}

19 View Complete Implementation : MetadataExtracterRegistry.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Register an instance of an extracter for use
 *
 * @param extracter an extracter
 */
public void register(MetadataExtracter extracter) {
    if (logger.isDebugEnabled()) {
        logger.debug("Registering metadata extracter: " + extracter);
    }
    extracterCacheWriteLock.lock();
    try {
        extracters.add(extracter);
        extracterCache.clear();
        embedderCache.clear();
    } finally {
        extracterCacheWriteLock.unlock();
    }
}

19 View Complete Implementation : AbstractAuditDAOImpl.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/*
     * alf_audit_entry
     */
public Long createAuditEntry(Long applicationId, long time, String username, Map<String, Serializable> values) {
    final Long usernameId;
    if (username != null) {
        usernameId = propertyValueDAO.getOrCreatePropertyValue(username).getFirst();
    } else {
        usernameId = null;
    }
    // Now persist the data values
    Long valuesId = null;
    if (values != null && values.size() > 0) {
        valuesId = propertyValueDAO.createProperty((Serializable) values);
    }
    // Create the audit entry
    AuditEntryEnreplacedy enreplacedy = createAuditEntry(applicationId, time, usernameId, valuesId);
    // Done
    if (logger.isDebugEnabled()) {
        logger.debug("Created new audit entry: \n" + "   Application: " + applicationId + "\n" + "   Time:        " + (new Date(time)) + "\n" + "   User:        " + username + "\n" + "   Result:      " + enreplacedy);
    }
    return enreplacedy.getId();
}

19 View Complete Implementation : RootElementNameContentWorkerSelector.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Performs a match of the root element name to find the correct content worker.
 */
public W getWorker(ContentReader reader) {
    if (!supportedMimetypes.contains(reader.getMimetype())) {
        return null;
    }
    W worker = null;
    InputStream is = null;
    String rootElementName = null;
    try {
        is = reader.getContentInputStream();
        SAXParser saxParser = saxParserFactory.newSAXParser();
        saxParser.parse(is, this);
    // No match possible
    } catch (RootElementFoundException e) {
        rootElementName = e.getElementName();
        worker = workersByRootElementName.get(rootElementName);
    } catch (Throwable e) {
        throw new ContentIOException("\n" + "Failed to extract root element from XML doreplacedent: \n" + "   Reader:   " + reader + "\n" + "   Selector: " + this, e);
    } finally {
        if (is != null) {
            try {
                is.close();
            } catch (Throwable e) {
            }
        }
    }
    // Done
    if (logger.isDebugEnabled()) {
        logger.debug("\n" + "Chosen content worker for reader: \n" + "   Reader:       " + reader + "\n" + "   Root Element: " + rootElementName + "\n" + "   Worker:       " + worker);
    }
    return worker;
}

19 View Complete Implementation : CompositePasswordEncoder.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 *  Encode a preplacedword using the specified encoderKey
 * @param encoderKey the encoder to use
 * @param rawPreplacedword  mandatory preplacedword
 * @param salt optional salt
 * @return the encoded preplacedword
 */
protected String encode(String encoderKey, String rawPreplacedword, Object salt) {
    ParameterCheck.mandatoryString("rawPreplacedword", rawPreplacedword);
    ParameterCheck.mandatoryString("encoderKey", encoderKey);
    Object encoder = encoders.get(encoderKey);
    if (encoder == null)
        throw new AlfrescoRuntimeException("Invalid encoder specified: " + encoderKey);
    if (encoder instanceof net.sf.acegisecurity.providers.encoding.PreplacedwordEncoder) {
        net.sf.acegisecurity.providers.encoding.PreplacedwordEncoder pEncoder = (net.sf.acegisecurity.providers.encoding.PreplacedwordEncoder) encoder;
        if (MD4_KEY.equals(encoderKey)) {
            // In the past MD4 preplacedword encoding didn't use a SALT
            salt = null;
        }
        if (logger.isDebugEnabled()) {
            logger.debug("Encoding using acegis PreplacedwordEncoder: " + encoderKey);
        }
        return pEncoder.encodePreplacedword(rawPreplacedword, salt);
    }
    if (encoder instanceof org.springframework.security.crypto.preplacedword.PreplacedwordEncoder) {
        org.springframework.security.crypto.preplacedword.PreplacedwordEncoder preplacedEncoder = (org.springframework.security.crypto.preplacedword.PreplacedwordEncoder) encoder;
        if (logger.isDebugEnabled()) {
            logger.debug("Encoding using spring PreplacedwordEncoder: " + encoderKey);
        }
        return preplacedEncoder.encode(rawPreplacedword);
    }
    throw new AlfrescoRuntimeException("Unsupported encoder specified: " + encoderKey);
}

19 View Complete Implementation : AlfrescoTransactionSupport.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Use as part of a debug statement
 *
 * @param service the service to report
 * @param bound true if the service was just bound; false if it was previously bound
 */
private static void logBoundService(Object service, boolean bound) {
    if (bound) {
        logger.debug("Bound service: \n" + "   transaction: " + getTransactionId() + "\n" + "   service: " + service);
    } else {
        logger.debug("Service already bound: \n" + "   transaction: " + getTransactionId() + "\n" + "   service: " + service);
    }
}

19 View Complete Implementation : AnnotatedBehaviourPostProcessor.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Register behaviours.
 *
 * @param bean      bean
 * @param beanName  bean name
 */
private void registerBehaviours(Object bean, String beanName) {
    if (bean.getClreplaced().isAnnotationPresent(BehaviourBean.clreplaced)) {
        BehaviourBean behaviourBean = bean.getClreplaced().getAnnotation(BehaviourBean.clreplaced);
        if (logger.isDebugEnabled()) {
            logger.debug("Annotated behaviour post processing for " + beanName);
        }
        Method[] methods = bean.getClreplaced().getMethods();
        for (Method method : methods) {
            if (method.isAnnotationPresent(Behaviour.clreplaced)) {
                registerBehaviour(behaviourBean, bean, beanName, method);
            }
        }
    }
}

19 View Complete Implementation : StandardQuotaStrategy.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
@Override
public boolean afterWritingCacheFile(long contentSizeBytes) {
    boolean keepNewFile = true;
    long maxFileSizeBytes = getMaxFileSizeBytes();
    if (maxFileSizeBytes > 0 && contentSizeBytes > maxFileSizeBytes) {
        keepNewFile = false;
    } else {
        // The file has just been written so update the usage stats.
        addUsageBytes(contentSizeBytes);
    }
    if (getCurrentUsageBytes() >= maxUsageBytes) {
        // Reached quota limit - time to aggressively recover some space to make sure that
        // new requests to cache a file are likely to be honoured.
        if (log.isDebugEnabled()) {
            log.debug("Usage has reached or exceeded quota limit, limit: " + maxUsageBytes + " bytes, current usage: " + getCurrentUsageBytes() + " bytes.");
        }
        signalAggressiveCleanerStart("quota (limit reached)");
    } else if (usageHasReached(cleanThresholdPct)) {
        // If usage has reached the clean threshold, start the cleaner
        if (log.isDebugEnabled()) {
            log.debug("Usage has reached " + cleanThresholdPct + "% - starting cached content cleaner.");
        }
        signalCleanerStart("quota (clean threshold)");
    }
    return keepNewFile;
}

19 View Complete Implementation : AbstractRoutingContentStore.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * @return  Returns a valid reader from one of the stores otherwise
 *          a {@link EmptyContentReader} is returned.
 */
public ContentReader getReader(String contentUrl) throws ContentIOException {
    ContentStore store = selectReadStore(contentUrl);
    if (store != null) {
        if (logger.isDebugEnabled()) {
            logger.debug("Getting reader from store: \n" + "   Content URL: " + contentUrl + "\n" + "   Store:       " + store);
        }
        return store.getReader(contentUrl);
    } else {
        if (logger.isDebugEnabled()) {
            logger.debug("Getting empty reader for content URL: " + contentUrl);
        }
        return new EmptyContentReader(contentUrl);
    }
}

19 View Complete Implementation : ExtenderImpl.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
public synchronized <E, M extends Trait> E getExtension(Extensible anExtensible, ExtensionPoint<E, M> point) {
    E extension = null;
    // consistency is checked at registration time
    @SuppressWarnings("unchecked")
    ExtensionFactory<E> factory = (ExtensionFactory<E>) pointFactories.get(point);
    if (factory != null) {
        ExtendedTrait<M> exTrait = anExtensible.getTrait(point.getTraitAPI());
        extension = exTrait.getExtension(point.getExtensionAPI());
        if (extension == null) {
            extension = exTrait.extend(point.getExtensionAPI(), factory);
            if (logger.isDebugEnabled()) {
                logger.debug("trait extension leak trace : " + System.idenreplacedyHashCode(extension) + " : " + System.idenreplacedyHashCode(exTrait) + " : " + System.idenreplacedyHashCode(extension));
            }
        }
    }
    return extension;
}

19 View Complete Implementation : AbstractPropertyBackedBean.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Releases any resources held by this component.
 *
 * @param isPermanent
 *            is the component being destroyed forever, i.e. should persisted values be removed? On server shutdown,
 *            this value would be <code>false</code>, whereas on the removal of a dynamically created instance, this
 *            value would be <code>true</code>.
 */
protected void destroy(boolean isPermanent) {
    if (this.runtimeState != RuntimeState.UNINITIALIZED) {
        boolean hadWriteLock = this.lock.isWriteLockedByCurrentThread();
        if (!hadWriteLock) {
            this.lock.readLock().unlock();
            this.lock.writeLock().lock();
        }
        try {
            if (this.runtimeState != RuntimeState.UNINITIALIZED) {
                logger.debug("destroy() stop state=" + runtimeState);
                stop(false);
                logger.debug("destroy() deregister " + isPermanent);
                this.registry.deregister(this, isPermanent);
                this.state = null;
                this.runtimeState = RuntimeState.UNINITIALIZED;
                logger.debug("destroy() done");
            }
        } finally {
            logger.debug("destroy() state=" + runtimeState);
            if (!hadWriteLock) {
                this.lock.readLock().lock();
                this.lock.writeLock().unlock();
            }
        }
    }
}

19 View Complete Implementation : AbstractContentWriter.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Create a channel that performs callbacks to the given listeners.
 *
 * @param directChannel the result of {@link #getDirectWritableChannel()}
 * @param listeners the listeners to call
 * @return Returns a channel that executes callbacks
 * @throws ContentIOException
 */
private WritableByteChannel getCallbackWritableChannel(WritableByteChannel directChannel, List<ContentStreamListener> listeners) throws ContentIOException {
    WritableByteChannel callbackChannel = null;
    if (directChannel instanceof FileChannel) {
        callbackChannel = getCallbackFileChannel((FileChannel) directChannel, listeners);
    } else {
        // introduce an advistor to handle the callbacks to the listeners
        ChannelCloseCallbackAdvise advise = new ChannelCloseCallbackAdvise(listeners);
        ProxyFactory proxyFactory = new ProxyFactory(directChannel);
        proxyFactory.addAdvice(advise);
        callbackChannel = (WritableByteChannel) proxyFactory.getProxy();
    }
    // done
    if (logger.isDebugEnabled()) {
        logger.debug("Created callback byte channel: \n" + "   original: " + directChannel + "\n" + "   new: " + callbackChannel);
    }
    return callbackChannel;
}

19 View Complete Implementation : FeedTaskProcessor.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
protected void addMissingFormats(String activityType, List<String> fmTemplates, List<String> templatesToAdd) {
    for (String templateToAdd : templatesToAdd) {
        int idx1 = templateToAdd.lastIndexOf(".");
        if (idx1 != -1) {
            int idx2 = templateToAdd.substring(0, idx1).lastIndexOf(".");
            if (idx2 != -1) {
                String templateFormat = templateToAdd.substring(idx2 + 1, idx1);
                boolean found = false;
                for (String fmTemplate : fmTemplates) {
                    if (fmTemplate.contains("." + templateFormat + ".")) {
                        found = true;
                    }
                }
                if (!found) {
                    if (logger.isDebugEnabled()) {
                        logger.debug("Add template '" + templateToAdd + "' for type '" + activityType + "'");
                    }
                    fmTemplates.add(templateToAdd);
                }
            }
        }
    }
}

19 View Complete Implementation : NodeLocatorServiceImpl.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * {@inheritDoc}
 */
@Override
public NodeRef getNode(String locatorName, NodeRef source, Map<String, Serializable> params) {
    NodeLocator locator = locators.get(locatorName);
    if (locator == null) {
        String msg = "No NodeLocator is registered with name: " + locatorName;
        throw new IllegalArgumentException(msg);
    }
    NodeRef node = locator.getNode(source, params);
    if (logger.isDebugEnabled()) {
        logger.debug("Node locator named '" + locatorName + "' found node: " + node);
    }
    return node;
}

19 View Complete Implementation : HBDataCollectorServiceImpl.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Listens for license changes.  If a license is change or removed, the heartbeat job is rescheduled.
 */
@Override
public synchronized void onLicenseChange(final LicenseDescriptor licenseDescriptor) {
    final boolean newEnabled = !licenseDescriptor.isHeartBeatDisabled();
    if (newEnabled != this.enabled) {
        if (logger.isDebugEnabled()) {
            logger.debug("HeartBeat enabled state change. Enabled=" + newEnabled);
        }
        setEnable(newEnabled);
        restartAllCollectorSchedules();
    }
}

19 View Complete Implementation : NodePropertyValue.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * @return Returns the persisted value, keying off the persisted value type
 */
private Serializable getPersistedValue() {
    switch(persistedType) {
        case NULL:
            return null;
        case BOOLEAN:
            return this.booleanValue;
        case LONG:
            return this.longValue;
        case FLOAT:
            return this.floatValue;
        case DOUBLE:
            return this.doubleValue;
        case STRING:
            // Oracle stores empty strings as 'null'...
            if (this.stringValue == null) {
                // We know that we stored a non-null string, but now it is null.
                // It can only mean one thing - Oracle
                if (loggerOracle.isDebugEnabled()) {
                    logger.debug("string_value is 'null'.  Forcing to empty String");
                }
                return NodePropertyValue.STRING_EMPTY;
            } else {
                return this.stringValue;
            }
        case SERIALIZABLE:
            return this.serializableValue;
        default:
            throw new AlfrescoRuntimeException("Unrecognised value type: " + persistedType);
    }
}

19 View Complete Implementation : AbstractRoutingContentStore.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * @return      Returns <tt>true</tt> if write is supported by any of the stores.
 */
public boolean isWriteSupported() {
    List<ContentStore> stores = getAllStores();
    boolean supported = false;
    for (ContentStore store : stores) {
        if (store.isWriteSupported()) {
            supported = true;
            break;
        }
    }
    // Done
    if (logger.isDebugEnabled()) {
        logger.debug("Writing " + (supported ? "is" : "is not") + " supported by at least one store.");
    }
    return supported;
}

19 View Complete Implementation : DeletedContentBackupCleanerListener.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
public void beforeDelete(ContentStore sourceStore, String contentUrl) throws ContentIOException {
    if (store.isContentUrlSupported(contentUrl)) {
        ContentContext context = new ContentContext(null, contentUrl);
        ContentReader reader = sourceStore.getReader(contentUrl);
        if (!reader.exists()) {
            // Nothing to copy over
            return;
        }
        // write the content into the target store
        ContentWriter writer = store.getWriter(context);
        // copy across
        writer.putContent(reader);
        // done
        if (logger.isDebugEnabled()) {
            logger.debug("Moved content before deletion: \n" + "   URL:    " + contentUrl + "\n" + "   Source: " + sourceStore + "\n" + "   Target: " + store);
        }
    } else {
        if (logger.isDebugEnabled()) {
            logger.debug("Content cannot be moved during deletion.  A backup will not be made: \n" + "   URL:    " + contentUrl + "\n" + "   Source: " + sourceStore + "\n" + "   Target: " + store);
        }
    }
}

19 View Complete Implementation : MetadataExtracterRegistry.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * @param       sourceMimetype The MIME type under examination
 * @return      Returns a set of extractors that will work for the given mimetype
 */
private List<MetadataExtracter> findBestExtracters(String sourceMimetype) {
    if (logger.isDebugEnabled()) {
        logger.debug("Finding extractors for " + sourceMimetype);
    }
    List<MetadataExtracter> extractors = new ArrayList<MetadataExtracter>(1);
    for (MetadataExtracter extractor : extracters) {
        if (!extractor.isSupported(sourceMimetype)) {
            // extraction not achievable
            if (logger.isDebugEnabled()) {
                logger.debug("Find unsupported: " + getName(extractor));
            }
            continue;
        }
        if (logger.isDebugEnabled()) {
            logger.debug("Find supported:   " + getName(extractor));
        }
        extractors.add(extractor);
    }
    if (logger.isDebugEnabled()) {
        logger.debug("Find returning:   " + extractors);
    }
    return extractors;
}

19 View Complete Implementation : EagerContentStoreCleaner.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Cleans up all newly-orphaned content
 */
@Override
public void afterCommit() {
    Set<String> urlsToDelete = TransactionalResourceHelper.getSet(KEY_POST_COMMIT_DELETION_URLS);
    // Debug
    if (logger.isDebugEnabled()) {
        logger.debug("Post-commit deletion of old content URLs: ");
        int count = 0;
        for (String contentUrl : urlsToDelete) {
            if (count == 10) {
                logger.debug("   " + (urlsToDelete.size() - 10) + " more ...");
            } else {
                logger.debug("   Deleting content URL: " + contentUrl);
            }
            count++;
        }
    }
    // Delete, including calling listeners
    for (String contentUrl : urlsToDelete) {
        deleteFromStores(contentUrl, false);
    }
}

19 View Complete Implementation : OpenOfficeContentNetworkFile.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Truncate or extend the file to the specified length
 *
 * @param size long
 * @exception IOException
 */
public void truncateFile(long size) throws IOException {
    // Chain to the standard truncate
    super.truncateFile(size);
    // Check for a truncate to zero length
    if (size == 0L) {
        m_truncateToZero = true;
        // DEBUG
        if (logger.isDebugEnabled())
            logger.debug("OpenOffice doreplacedent truncated to zero length, path=" + getName());
    }
}

19 View Complete Implementation : IdentityServiceRemoteUserMapper.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/*
     * (non-Javadoc)
     * @see org.alfresco.web.app.servlet.RemoteUserMapper#getRemoteUser(javax.servlet.http.HttpServletRequest)
     */
public String getRemoteUser(HttpServletRequest request) {
    try {
        if (logger.isTraceEnabled()) {
            logger.trace("Retrieving username from http request...");
        }
        if (!this.isEnabled) {
            if (logger.isDebugEnabled()) {
                logger.debug("IdenreplacedyServiceRemoteUserMapper is disabled, returning null.");
            }
            return null;
        }
        String headerUserId = extractUserFromHeader(request);
        if (headerUserId != null) {
            // Normalize the user ID taking into account case sensitivity settings
            String normalizedUserId = normalizeUserId(headerUserId);
            if (logger.isTraceEnabled()) {
                logger.trace("Returning userId: " + AuthenticationUtil.maskUsername(normalizedUserId));
            }
            return normalizedUserId;
        }
    } catch (Exception e) {
        logger.error("Failed to authenticate user using IdenreplacedyServiceRemoteUserMapper: " + e.getMessage(), e);
    }
    if (logger.isTraceEnabled()) {
        logger.trace("Could not identify a userId. Returning null.");
    }
    return null;
}

19 View Complete Implementation : AbstractImageMagickContentTransformerWorker.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * @see #transformInternal(File, String, File, String, TransformationOptions)
 */
public final void transform(ContentReader reader, ContentWriter writer, TransformationOptions options) throws Exception {
    // get mimetypes
    String sourceMimetype = getMimetype(reader);
    String targetMimetype = getMimetype(writer);
    // get the extensions to use
    MimetypeService mimetypeService = getMimetypeService();
    String sourceExtension = mimetypeService.getExtension(sourceMimetype);
    String targetExtension = mimetypeService.getExtension(targetMimetype);
    if (sourceExtension == null || targetExtension == null) {
        throw new AlfrescoRuntimeException("Unknown extensions for mimetypes: \n" + "   source mimetype: " + sourceMimetype + "\n" + "   source extension: " + sourceExtension + "\n" + "   target mimetype: " + targetMimetype + "\n" + "   target extension: " + targetExtension);
    }
    if (remoteTransformerClientConfigured()) {
        transformRemote(reader, writer, options, sourceMimetype, targetMimetype, sourceExtension, targetExtension);
    } else {
        transformLocal(reader, writer, options, sourceMimetype, targetMimetype, sourceExtension, targetExtension);
    }
    // done
    if (logger.isDebugEnabled()) {
        logger.debug("Transformation completed: \n" + "   source: " + reader + "\n" + "   target: " + writer + "\n" + "   options: " + options);
    }
}

19 View Complete Implementation : JodContentTransformer.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
@Override
public void afterPropertiesSet() {
    if (enabled) {
        super.afterPropertiesSet();
        if (remoteTransformerClientConfigured()) {
            Pair<Boolean, String> result = remoteTransformerClient.check(logger);
            Boolean isAvailable = result.getFirst();
            if (isAvailable != null && isAvailable) {
                String versionString = result.getSecond().trim();
                logger.debug("Using legacy JodCoverter: " + versionString);
            } else {
                String message = "Legacy JodConverter is not available for transformations. " + result.getSecond();
                if (isAvailable == null) {
                    logger.debug(message);
                } else {
                    logger.error(message);
                }
            }
        }
    }
}

19 View Complete Implementation : AuthorityBridgeDAOImpl.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/* (non-Javadoc)
     * @see org.alfresco.repo.security.authority.AbstractAuthorityBridgeDAO#selectDirectAuthoritiesForUser(java.lang.Long, java.lang.Long, java.lang.Long, java.lang.Long, java.lang.String)
     */
@Override
protected List<AuthorityBridgeLink> selectDirectAuthoritiesForUser(Long authorityContainerTypeQNameId, Long memberreplacedocQNameId, Long authorityNameQNameId, Long storeId, Long nodeId) {
    Long start = (logger.isDebugEnabled() ? System.currentTimeMillis() : null);
    AuthorityBridgeParametersEnreplacedy authorityBridgeParametersEnreplacedy = new AuthorityBridgeParametersEnreplacedy(authorityContainerTypeQNameId, memberreplacedocQNameId, authorityNameQNameId, storeId, nodeId);
    List<AuthorityBridgeLink> links = template.selectList(QUERY_SELECT_GET_DIRECT_AUTHORITIES_FOR_UESR, authorityBridgeParametersEnreplacedy);
    if (start != null) {
        logger.debug("Direct authority: " + links.size() + " in " + (System.currentTimeMillis() - start) + " msecs");
    }
    return links;
}

19 View Complete Implementation : AbstractScheduledAction.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Register with teh scheduler.
 *
 * @param scheduler Scheduler
 * @throws SchedulerException
 */
public void register(Scheduler scheduler) throws SchedulerException {
    JobDetail jobDetail = getJobDetail();
    Trigger trigger = getTrigger();
    if (s_logger.isDebugEnabled()) {
        s_logger.debug(("Registering job: " + jobDetail));
        s_logger.debug(("With trigger: " + trigger));
    }
    scheduler.scheduleJob(jobDetail, trigger);
}

19 View Complete Implementation : AlfrescoImapHostManager.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
/**
 * Returns an collection of mailboxes. Method searches mailboxes under mount points defined for a specific user.
 * Mount points include user's IMAP Virtualised Views and Email Archive Views. This method serves LIST command
 * of the IMAP protocol.
 *
 * @param user User making the request
 * @param mailboxPattern String name of a mailbox possible including a wildcard.
 * @return Collection of mailboxes matching the pattern.
 * @throws com.icegreen.greenmail.store.FolderException
 */
public Collection<MailFolder> listMailboxes(GreenMailUser user, String mailboxPattern) throws FolderException {
    try {
        AlfrescoImapUser alfrescoUser = new AlfrescoImapUser(user.getEmail(), user.getLogin(), user.getPreplacedword());
        return registerMailboxes(imapService.listMailboxes(alfrescoUser, getUnqualifiedMailboxPattern(alfrescoUser, mailboxPattern), false));
    } catch (Throwable e) {
        logger.debug(e.getMessage(), e);
        throw new FolderException(e.getMessage());
    }
}

19 View Complete Implementation : ConfigDataCache.java
Copyright GNU Lesser General Public License v3.0
Author : Alfresco
@Override
protected ConfigData buildCache(String tenantId) {
    if (logger.isDebugEnabled()) {
        logger.debug("Received request to rebuild config data for tenant: " + tenantId);
    }
    ConfigData configData = repoXMLConfigService.getRepoConfig(tenantId);
    if (!(configData instanceof ImmutableConfigData)) {
        throw new RuntimeException("ConfigData must be immutable for the cache.");
    }
    if (logger.isDebugEnabled()) {
        logger.debug("Rebuilt config data for tenant: " + tenantId + " (" + configData + ").");
    }
    return configData;
}