Skip to content
Draft
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { DotAssetService } from './dot-asset.service';
import { DotAssetCreateOptions } from '@dotcms/dotcms-models';

import { DotAssetService } from './dot-asset.service';

// TODO: fix this test, it not work as espected
xdescribe('DotAssetService', () => {
const fetchMock = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
DotCMSTempFile,
DotHttpErrorResponse
} from '@dotcms/dotcms-models';

import { fallbackErrorMessages } from '../../components/contenttypes-fields/dot-form/services/dot-upload.service';

export class DotAssetService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.dotcms.util.ReflectionUtils;
import com.dotmarketing.util.Config;
import com.liferay.util.StringPool;
import io.vavr.control.Try;
import java.util.concurrent.TimeUnit;

public class DotKeyLockManagerBuilder {
Expand Down Expand Up @@ -35,7 +36,9 @@ public static <R> DotKeyLockManager <R> newLockManager(final String lockManagerN
final int stripes = Config.getIntProperty(lockManagerName + DOTCMS_CONCURRENT_LOCK_STRIPES,
Config.getIntProperty(DOTCMS_CONCURRENT_LOCK_STRIPES,StripedLockImpl.DEFAULT_STRIPES));
final int time = Config.getIntProperty(lockManagerName + DOTCMS_CONCURRENT_LOCK_STRIPES_TIME, StripedLockImpl.DEFAULT_TIME);
final TimeUnit timeUnit = TimeUnit.valueOf(Config.getStringProperty(lockManagerName + DOTCMS_CONCURRENT_LOCK_STRIPES_TIMEUNIT, StripedLockImpl.DEFAULT_TU.name()));
final TimeUnit timeUnit = Try.of(()-> TimeUnit.valueOf(Config.getStringProperty(lockManagerName + DOTCMS_CONCURRENT_LOCK_STRIPES_TIMEUNIT,
StripedLockImpl.DEFAULT_TU.name())
)).getOrElse(StripedLockImpl.DEFAULT_TU);
return new StripedLockImpl<>(stripes, time, timeUnit);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.dotcms.security.apps;

import com.dotcms.security.apps.KeyStoreManager.KeyStoreCreatedEvent;
import com.dotcms.security.apps.KeyStoreManager.KeyStoreLoadedEvent;
import com.dotcms.security.apps.KeyStoreManager.KeyStoreSavedEvent;
import com.dotmarketing.business.CacheLocator;
import com.dotmarketing.util.Logger;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;

@ApplicationScoped
public class KeyStoreLifeCycleObserver {

final AppsCache appsCache = CacheLocator.getAppsCache();

public void onCreated(@Observes KeyStoreCreatedEvent event) {
Logger.info(this, "KeyStore created: " + event.getKeyStorePath());

}

public void onLoaded(@Observes KeyStoreLoadedEvent event) {
Logger.info(this, "KeyStore loaded with " + event.getEntryCount() + " entries");
}

public void onSaved(@Observes KeyStoreSavedEvent event) {
Logger.info(this, "KeyStore saved with " + event.getEntryCount() + " entries");
appsCache.flushSecret();
}
}

Loading
Loading