Removed some ESH leftovers (#1468)

* Removed ESH leftovers

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
Christoph Weitkamp 2020-05-11 08:41:12 +02:00 committed by GitHub
parent ac1f4080e3
commit 178ffdf9c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 27 additions and 29 deletions

View File

@ -63,7 +63,7 @@ import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;
/**
* This is a default scope provider for stuff that is of general interest in an ESH-based solution.
* This is a default scope provider for stuff that is of general interest in an OH-based solution.
* Nonetheless, solutions are free to remove it and have more specific scope providers for their own purposes.
*
* @author Kai Kreuzer - Initial contribution
@ -94,7 +94,7 @@ public class DefaultScriptScopeProvider implements ScriptExtensionProvider {
elements.put("FilenameUtils", FilenameUtils.class);
elements.put("File", File.class);
// ESH types
// types
elements.put("IncreaseDecreaseType", IncreaseDecreaseType.class);
elements.put("DECREASE", IncreaseDecreaseType.DECREASE);
elements.put("INCREASE", IncreaseDecreaseType.INCREASE);

View File

@ -29,7 +29,7 @@ import org.openhab.core.io.console.ConsoleInterpreter;
import org.openhab.core.io.console.extensions.ConsoleCommandExtension;
/**
* This class wraps ESH ConsoleCommandExtensions to commands for Apache Karaf
* This class wraps OH ConsoleCommandExtensions to commands for Apache Karaf
*
* @author Markus Rathgeb - Initial contribution
* @author Henning Treu - implement help command

View File

@ -312,7 +312,7 @@ public class WebClientFactoryImpl implements HttpClientFactory, WebSocketFactory
private QueuedThreadPool createThreadPool(String consumerName, int minThreads, int maxThreads,
int keepAliveTimeout) {
QueuedThreadPool queuedThreadPool = new QueuedThreadPool(maxThreads, minThreads, keepAliveTimeout * 1000);
queuedThreadPool.setName("ESH-httpClient-" + consumerName);
queuedThreadPool.setName("OH-httpClient-" + consumerName);
queuedThreadPool.setDaemon(true);
return queuedThreadPool;
}

View File

@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
/**
* The user can configure multiple system Mqtt broker connections. This is realized via the OSGI service factory
* pattern.
* ESH requires a factory marker service, implemented in {@link MqttBrokerConnectionServiceInstanceMarker}.
* The framework requires a factory marker service, implemented in {@link MqttBrokerConnectionServiceInstanceMarker}.
* This service represents an instance of that factory and will initialize one MQTT broker connection with the given
* configuration and register it to the {@link MqttService}.
*

View File

@ -39,7 +39,7 @@ public interface QueryablePersistenceService extends PersistenceService {
* Returns a list of items that are stored in the persistence service
*
* This is returned as a string to allow the persistence service to return items that are no long available as an
* ESH {@link Item}.
* {@link Item}.
*
* @return list of strings of item names contained in the store. Not null.
*/

View File

@ -13,7 +13,7 @@
package org.openhab.core.auth;
/**
* Interface defining constants for roles within ESH.
* Interface defining constants for roles within the framework.
*
* @author Kai Kreuzer - Initial contribution
*/

View File

@ -54,7 +54,7 @@ import org.eclipse.jdt.annotation.Nullable;
* <li>Method {@code #refreshToken}
* </ul>
*
* Use case 4 - Client Credentials. This is used to get the AccessToken by purely the client credential (ESH).
* Use case 4 - Client Credentials. This is used to get the AccessToken by purely the client credential.
* <ul>
* <li>Method {@code #getAccessTokenByClientCredentials(String)}
* </ul>
@ -156,7 +156,7 @@ public interface OAuthClientService extends AutoCloseable {
/**
* Use case 2 - Resource Owner Password Credentials
* This is for when the username and password of the actual resource owner (user) is known to the client (ESH).
* This is for when the username and password of the actual resource owner (user) is known to the client.
*
* @param username of the user
* @param password of the user

View File

@ -35,7 +35,7 @@ import org.eclipse.jdt.annotation.Nullable;
@NonNullByDefault
public class ThreadFactoryBuilder {
private static final String DEFAULT_NAME_PREFIX = "ESH";
private static final String DEFAULT_NAME_PREFIX = "OH";
private @Nullable ThreadFactory wrappedThreadFactory;
private @Nullable String name;
@ -97,7 +97,7 @@ public class ThreadFactoryBuilder {
* The threads created by the {@link ThreadFactory} are named 'namePrefix-name-i', where i is an integer
* incremented with each new thread, initialized to 1. If set to null, threads are named 'name-i'.
* <p>
* Defaults to the name prefix 'ESH'. Setting a name prefix different than the default one is intended to be used by
* Defaults to the name prefix 'OH'. Setting a name prefix different than the default one is intended to be used by
* solutions integrating openHAB.
*
* @param namePrefix The name prefix (can be null)

View File

@ -86,8 +86,7 @@ public class EventHandler implements AutoCloseable {
}
} else {
logger.error(
"The handled OSGi event is invalid. Expect properties as string named 'type', 'payload' and 'topic'. "
+ "Received event properties are: {}",
"The handled OSGi event is invalid. Expect properties as string named 'type', 'payload' and 'topic'. Received event properties are: {}",
Arrays.toString(osgiEvent.getPropertyNames()));
}
}
@ -105,12 +104,12 @@ public class EventHandler implements AutoCloseable {
return;
}
final Event eshEvent = createESHEvent(eventFactory, type, payload, topic, source);
if (eshEvent == null) {
final Event event = createEvent(eventFactory, type, payload, topic, source);
if (event == null) {
return;
}
dispatchESHEvent(eventSubscribers, eshEvent);
dispatchEvent(eventSubscribers, event);
}
private Set<EventSubscriber> getEventSubscribers(String eventType) {
@ -127,21 +126,20 @@ public class EventHandler implements AutoCloseable {
return subscribers;
}
private @Nullable Event createESHEvent(final EventFactory eventFactory, final String type, final String payload,
private @Nullable Event createEvent(final EventFactory eventFactory, final String type, final String payload,
final String topic, final @Nullable String source) {
Event eshEvent = null;
Event event = null;
try {
eshEvent = eventFactory.createEvent(type, topic, payload, source);
event = eventFactory.createEvent(type, topic, payload, source);
} catch (Exception e) {
logger.error(
"Creation of ESH-Event failed, "
+ "because one of the registered event factories has thrown an exception: {}",
"Creation of Event failed, because one of the registered event factories has thrown an exception: {}",
e.getMessage(), e);
}
return eshEvent;
return event;
}
private synchronized void dispatchESHEvent(final Set<EventSubscriber> eventSubscribers, final Event event) {
private synchronized void dispatchEvent(final Set<EventSubscriber> eventSubscribers, final Event event) {
for (final EventSubscriber eventSubscriber : eventSubscribers) {
EventFilter filter = eventSubscriber.getEventFilter();
if (filter == null || filter.apply(event)) {

View File

@ -34,7 +34,7 @@ import org.osgi.service.event.EventHandler;
* The {@link OSGiEventManager} provides an OSGi based default implementation of the openHAB event bus.
*
* The OSGiEventHandler tracks {@link EventSubscriber}s and {@link EventFactory}s, receives OSGi events (by
* implementing the OSGi {@link EventHandler} interface) and dispatches the received OSGi events as ESH {@link Event}s
* implementing the OSGi {@link EventHandler} interface) and dispatches the received OSGi events as OH {@link Event}s
* to the {@link EventSubscriber}s if the provided filter applies.
*
* @author Stefan Bußweiler - Initial contribution

View File

@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
public abstract class AbstractWatchService {
/**
* Default logger for ESH Watch Services
* Default logger for Watch Services
*/
protected final Logger logger = LoggerFactory.getLogger(AbstractWatchService.class);

View File

@ -54,9 +54,9 @@ public class ThreadFactoryBuilderTest {
public void testWithDefaultNamePrefix() {
ThreadFactory threadFactory = ThreadFactoryBuilder.create().withName("hello").build();
assertThat(threadFactory.newThread(TEST_RUNNABLE).getName(), is("ESH-hello-1"));
assertThat(threadFactory.newThread(TEST_RUNNABLE).getName(), is("ESH-hello-2"));
assertThat(threadFactory.newThread(TEST_RUNNABLE).getName(), is("ESH-hello-3"));
assertThat(threadFactory.newThread(TEST_RUNNABLE).getName(), is("OH-hello-1"));
assertThat(threadFactory.newThread(TEST_RUNNABLE).getName(), is("OH-hello-2"));
assertThat(threadFactory.newThread(TEST_RUNNABLE).getName(), is("OH-hello-3"));
}
@Test
@ -143,6 +143,6 @@ public class ThreadFactoryBuilderTest {
.build();
Thread testThread = threadFactory.newThread(TEST_RUNNABLE);
assertThat(testThread.getName(), is("ESH-" + testThreadName));
assertThat(testThread.getName(), is("OH-" + testThreadName));
}
}