mirror of
https://github.com/gmbrax/MediaManager-core.git
synced 2026-11-09 22:10:17 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
353fee5985 | ||
|
|
e56d86c0e5 |
@@ -84,10 +84,12 @@
|
|||||||
<version>4.32.0</version>
|
<version>4.32.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.xerial</groupId>
|
<groupId>io.zonky.test</groupId>
|
||||||
<artifactId>sqlite-jdbc</artifactId>
|
<artifactId>embedded-postgres</artifactId>
|
||||||
<version>3.44.1.0</version>
|
<version>2.2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.mediamanager;
|
package com.mediamanager;
|
||||||
|
|
||||||
import com.mediamanager.service.database.DatabaseManager;
|
|
||||||
import com.mediamanager.service.delegate.DelegateActionManager;
|
import com.mediamanager.service.delegate.DelegateActionManager;
|
||||||
import com.mediamanager.service.ipc.IPCManager;
|
import com.mediamanager.service.ipc.IPCManager;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
@@ -10,12 +9,12 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import com.mediamanager.service.database.SqliteDatabaseManager;
|
import com.mediamanager.service.database.LocalDatabaseManager;
|
||||||
|
|
||||||
public class MediaManagerApplication {
|
public class MediaManagerApplication {
|
||||||
private static final Logger logger = LogManager.getLogger(MediaManagerApplication.class);
|
private static final Logger logger = LogManager.getLogger(MediaManagerApplication.class);
|
||||||
private static Properties config;
|
private static Properties config;
|
||||||
private static DatabaseManager databaseManager;
|
private static LocalDatabaseManager databaseManager;
|
||||||
private static DelegateActionManager actionManager;
|
private static DelegateActionManager actionManager;
|
||||||
private static IPCManager ipcManager;
|
private static IPCManager ipcManager;
|
||||||
|
|
||||||
@@ -53,7 +52,7 @@ public class MediaManagerApplication {
|
|||||||
switch (mode) {
|
switch (mode) {
|
||||||
case LOCAL:
|
case LOCAL:
|
||||||
logger.info("Starting local database...");
|
logger.info("Starting local database...");
|
||||||
databaseManager = new SqliteDatabaseManager(config);
|
databaseManager = new LocalDatabaseManager(config);
|
||||||
break;
|
break;
|
||||||
case SERVER:
|
case SERVER:
|
||||||
throw new Exception("Server mode not yet implemented");
|
throw new Exception("Server mode not yet implemented");
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package com.mediamanager.service.database;
|
||||||
|
|
||||||
|
import io.zonky.test.db.postgres.embedded.EmbeddedPostgres;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
public class LocalDatabaseManager extends DatabaseManager {
|
||||||
|
private static final Logger logger = LogManager.getLogger(LocalDatabaseManager.class);
|
||||||
|
private EmbeddedPostgres embeddedPostgres;
|
||||||
|
|
||||||
|
public LocalDatabaseManager(Properties config) {
|
||||||
|
super(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() throws Exception {
|
||||||
|
logger.info("Initializing embedded PostgreSQL database...");
|
||||||
|
|
||||||
|
// Configurações específicas do modo local
|
||||||
|
String dataDir = configuration.getProperty("local.database.dir",
|
||||||
|
System.getProperty("user.home") + "/.mediamanager/db");
|
||||||
|
int port = Integer.parseInt(
|
||||||
|
configuration.getProperty("local.database.port", "54321")
|
||||||
|
);
|
||||||
|
|
||||||
|
// Cria diretório se não existir
|
||||||
|
Path dataPath = Paths.get(dataDir);
|
||||||
|
Files.createDirectories(dataPath);
|
||||||
|
logger.debug("Using data directory: {}", dataDir);
|
||||||
|
|
||||||
|
// Inicia o PostgreSQL embedded
|
||||||
|
logger.info("Starting embedded PostgreSQL on port {}", port);
|
||||||
|
embeddedPostgres = EmbeddedPostgres.builder()
|
||||||
|
.setDataDirectory(dataPath)
|
||||||
|
.setCleanDataDirectory(false) // Mantém dados
|
||||||
|
.setPort(port)
|
||||||
|
.start();
|
||||||
|
|
||||||
|
// Cria a conexão
|
||||||
|
this.connection = createConnection();
|
||||||
|
logger.info("Embedded database connection established successfully");
|
||||||
|
|
||||||
|
// Usa o método da classe pai para sanity checks
|
||||||
|
performSanityChecks();
|
||||||
|
logger.info("Database sanity checks passed successfully");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Connection createConnection() throws Exception {
|
||||||
|
if (embeddedPostgres == null) {
|
||||||
|
throw new IllegalStateException("Embedded PostgreSQL not started");
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Pega conexão do embedded
|
||||||
|
Connection conn = embeddedPostgres.getPostgresDatabase().getConnection();
|
||||||
|
logger.debug("Got connection from embedded PostgreSQL");
|
||||||
|
return conn;
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Failed to get embedded connection", e);
|
||||||
|
throw new Exception("Embedded connection failed: " + e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void close() {
|
||||||
|
// Primeiro fecha a conexão (método da classe pai)
|
||||||
|
super.close();
|
||||||
|
|
||||||
|
// Depois para o embedded
|
||||||
|
if (embeddedPostgres != null) {
|
||||||
|
try {
|
||||||
|
logger.info("Stopping embedded PostgreSQL...");
|
||||||
|
embeddedPostgres.close();
|
||||||
|
logger.info("Embedded PostgreSQL stopped successfully");
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Error stopping embedded PostgreSQL", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
package com.mediamanager.service.database;
|
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.DriverManager;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.sql.Statement;
|
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
public class SqliteDatabaseManager extends DatabaseManager {
|
|
||||||
private static final Logger logger = LogManager.getLogger(SqliteDatabaseManager.class);
|
|
||||||
|
|
||||||
|
|
||||||
private String connectionUrl;
|
|
||||||
|
|
||||||
public SqliteDatabaseManager(Properties config) {
|
|
||||||
super(config);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init() throws Exception {
|
|
||||||
|
|
||||||
logger.info("Initializing SQLite database...");
|
|
||||||
String dataDir = configuration.getProperty("database.dir",
|
|
||||||
System.getProperty("user.home") + "/.mediamanager/db");
|
|
||||||
String dbFilename = configuration.getProperty("database.filename", "mediamanager.db");
|
|
||||||
String driverClassName = configuration.getProperty("database.driver", "org.sqlite.JDBC");
|
|
||||||
try {
|
|
||||||
Class.forName(driverClassName);
|
|
||||||
}catch(ClassNotFoundException e) {
|
|
||||||
logger.error("Failed to load SQLite driver", e);
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
Path dataPath = Paths.get(dataDir);
|
|
||||||
if (!Files.exists(dataPath)) {
|
|
||||||
Files.createDirectories(dataPath);
|
|
||||||
logger.debug("Created database directory: {}", dataDir);
|
|
||||||
}
|
|
||||||
Path dbFile = dataPath.resolve(dbFilename);
|
|
||||||
this.connectionUrl = "jdbc:sqlite:" + dbFile.toAbsolutePath().toString();
|
|
||||||
logger.info("Database file path: {}", dbFile);
|
|
||||||
logger.info("Connection URL: {}", this.connectionUrl);
|
|
||||||
this.connection = createConnection();
|
|
||||||
configurePerformancePragmas();
|
|
||||||
performSanityChecks();
|
|
||||||
ensureSchemaExists();
|
|
||||||
logger.info("SQLite database initialized successfully");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Connection createConnection() throws Exception {
|
|
||||||
try {
|
|
||||||
// O driver org.xerial.sqlite-jdbc é carregado automaticamente aqui
|
|
||||||
Connection conn = DriverManager.getConnection(this.connectionUrl);
|
|
||||||
logger.debug("Got connection to SQLite file");
|
|
||||||
return conn;
|
|
||||||
} catch (SQLException e) {
|
|
||||||
logger.error("Failed to create SQLite connection", e);
|
|
||||||
throw new Exception("SQLite connection failed: " + e.getMessage(), e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void configurePerformancePragmas() throws SQLException {
|
|
||||||
try (Statement stmt = connection.createStatement()) {
|
|
||||||
|
|
||||||
stmt.execute("PRAGMA journal_mode=WAL;");
|
|
||||||
|
|
||||||
|
|
||||||
stmt.execute("PRAGMA foreign_keys=ON;");
|
|
||||||
|
|
||||||
|
|
||||||
stmt.execute("PRAGMA synchronous=NORMAL;");
|
|
||||||
|
|
||||||
stmt.execute("PRAGMA busy_timeout=5000;");
|
|
||||||
|
|
||||||
logger.debug("SQLite performance PRAGMAs applied (WAL, Synchronous, ForeignKeys).");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ensureSchemaExists() throws SQLException {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void close() {
|
|
||||||
|
|
||||||
super.close();
|
|
||||||
logger.info("SQLite resources released.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,9 +2,7 @@ package com.mediamanager.service.delegate;
|
|||||||
|
|
||||||
import com.google.protobuf.ByteString;
|
import com.google.protobuf.ByteString;
|
||||||
import com.mediamanager.protocol.TransportProtocol;
|
import com.mediamanager.protocol.TransportProtocol;
|
||||||
import com.mediamanager.service.delegate.handler.CloseHandler;
|
|
||||||
import com.mediamanager.service.delegate.handler.EchoHandler;
|
import com.mediamanager.service.delegate.handler.EchoHandler;
|
||||||
import com.mediamanager.service.delegate.handler.HeartbeatHandler;
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
@@ -25,8 +23,6 @@ public class DelegateActionManager {
|
|||||||
|
|
||||||
private void registerHandlers() {
|
private void registerHandlers() {
|
||||||
handlerRegistry.put("echo",new EchoHandler());
|
handlerRegistry.put("echo",new EchoHandler());
|
||||||
handlerRegistry.put("heartbeat",new HeartbeatHandler());
|
|
||||||
handlerRegistry.put("close", new CloseHandler());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start(){
|
public void start(){
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
package com.mediamanager.service.delegate.handler;
|
|
||||||
|
|
||||||
import com.google.protobuf.ByteString;
|
|
||||||
import com.google.protobuf.InvalidProtocolBufferException;
|
|
||||||
import com.mediamanager.protocol.TestProtocol.CloseCommand;
|
|
||||||
import com.mediamanager.protocol.TestProtocol.CloseResponse;
|
|
||||||
import com.mediamanager.protocol.TransportProtocol;
|
|
||||||
import com.mediamanager.service.delegate.ActionHandler;
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
|
|
||||||
public class CloseHandler implements ActionHandler {
|
|
||||||
private static final Logger logger = LogManager.getLogger(CloseHandler.class);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TransportProtocol.Response.Builder handle(ByteString requestPayload)
|
|
||||||
throws InvalidProtocolBufferException {
|
|
||||||
|
|
||||||
CloseCommand.parseFrom(requestPayload); // Valida
|
|
||||||
|
|
||||||
logger.info("Close command received - connection will close");
|
|
||||||
|
|
||||||
CloseResponse response = CloseResponse.newBuilder()
|
|
||||||
.setMessage("Connection closing. Goodbye!")
|
|
||||||
.build();
|
|
||||||
|
|
||||||
return TransportProtocol.Response.newBuilder()
|
|
||||||
.setPayload(ByteString.copyFrom(response.toByteArray()))
|
|
||||||
.setStatusCode(200)
|
|
||||||
.putHeaders("Connection", "close"); // ← Marca para fechar
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +1,17 @@
|
|||||||
package com.mediamanager.service.delegate.handler;
|
package com.mediamanager.service.delegate.handler;
|
||||||
|
|
||||||
import com.google.protobuf.ByteString;
|
import com.google.protobuf.ByteString;
|
||||||
import com.google.protobuf.InvalidProtocolBufferException;
|
|
||||||
import com.mediamanager.protocol.TestProtocol.EchoCommand; // ← Import
|
|
||||||
import com.mediamanager.protocol.TestProtocol.EchoResponse; // ← Import
|
|
||||||
import com.mediamanager.protocol.TransportProtocol;
|
import com.mediamanager.protocol.TransportProtocol;
|
||||||
import com.mediamanager.service.delegate.ActionHandler;
|
import com.mediamanager.service.delegate.ActionHandler;
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
|
|
||||||
public class EchoHandler implements ActionHandler {
|
public class EchoHandler implements ActionHandler {
|
||||||
private static final Logger logger = LogManager.getLogger(EchoHandler.class);
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TransportProtocol.Response.Builder handle(ByteString requestPayload)
|
public TransportProtocol.Response.Builder handle(ByteString requestPayload) {
|
||||||
throws InvalidProtocolBufferException { // ← Pode lançar exceção
|
String payloadText = requestPayload.toStringUtf8();
|
||||||
|
String responseText = "Server received: " + payloadText;
|
||||||
|
|
||||||
// 1. Parse Protobuf bytes → EchoCommand
|
|
||||||
EchoCommand command = EchoCommand.parseFrom(requestPayload);
|
|
||||||
|
|
||||||
logger.debug("Echo received: {}", command.getMessage());
|
|
||||||
|
|
||||||
// 2. Cria EchoResponse (Protobuf)
|
|
||||||
EchoResponse echoResponse = EchoResponse.newBuilder()
|
|
||||||
.setMessage(command.getMessage())
|
|
||||||
.setServerTimestamp(System.currentTimeMillis())
|
|
||||||
.build();
|
|
||||||
|
|
||||||
// 3. Serializa EchoResponse → bytes
|
|
||||||
ByteString responsePayload = ByteString.copyFrom(echoResponse.toByteArray());
|
|
||||||
|
|
||||||
// 4. Retorna Response
|
|
||||||
return TransportProtocol.Response.newBuilder()
|
return TransportProtocol.Response.newBuilder()
|
||||||
.setPayload(responsePayload)
|
.setPayload(ByteString.copyFromUtf8(responseText))
|
||||||
.setStatusCode(200);
|
.setStatusCode(200);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
package com.mediamanager.service.delegate.handler;
|
|
||||||
|
|
||||||
import com.google.protobuf.ByteString;
|
|
||||||
import com.google.protobuf.InvalidProtocolBufferException;
|
|
||||||
import com.mediamanager.protocol.TestProtocol.HeartbeatCommand;
|
|
||||||
import com.mediamanager.protocol.TestProtocol.HeartbeatResponse;
|
|
||||||
import com.mediamanager.protocol.TransportProtocol;
|
|
||||||
import com.mediamanager.service.delegate.ActionHandler;
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
|
|
||||||
public class HeartbeatHandler implements ActionHandler {
|
|
||||||
private static final Logger logger = LogManager.getLogger(HeartbeatHandler.class);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TransportProtocol.Response.Builder handle(ByteString requestPayload)
|
|
||||||
throws InvalidProtocolBufferException {
|
|
||||||
|
|
||||||
HeartbeatCommand command = HeartbeatCommand.parseFrom(requestPayload);
|
|
||||||
|
|
||||||
long serverTime = System.currentTimeMillis();
|
|
||||||
|
|
||||||
logger.debug("Heartbeat received. Client T1={}, Server T2={}",
|
|
||||||
command.getClientTimestamp(), serverTime);
|
|
||||||
|
|
||||||
HeartbeatResponse response = HeartbeatResponse.newBuilder()
|
|
||||||
.setClientTimestamp(command.getClientTimestamp()) // Echo T1
|
|
||||||
.setServerTimestamp(serverTime) // T2
|
|
||||||
.build();
|
|
||||||
|
|
||||||
return TransportProtocol.Response.newBuilder()
|
|
||||||
.setPayload(ByteString.copyFrom(response.toByteArray()))
|
|
||||||
.setStatusCode(200);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -185,7 +185,7 @@ public class IPCManager {
|
|||||||
// Nenhum cliente conectado no momento
|
// Nenhum cliente conectado no momento
|
||||||
// Dorme por um curto período antes de verificar novamente
|
// Dorme por um curto período antes de verificar novamente
|
||||||
// Isso evita consumir CPU desnecessariamente em um loop vazio
|
// Isso evita consumir CPU desnecessariamente em um loop vazio
|
||||||
Thread.sleep(1); // 1 milissegundos
|
Thread.sleep(100); // 100 milissegundos
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
@@ -223,16 +223,9 @@ public class IPCManager {
|
|||||||
logger.debug("Client {} handler thread started", clientId);
|
logger.debug("Client {} handler thread started", clientId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// LOOP: processa múltiplas requests na mesma conexão
|
|
||||||
while (channel.isOpen()) {
|
|
||||||
TransportProtocol.Request request = readRequest(channel);
|
TransportProtocol.Request request = readRequest(channel);
|
||||||
|
|
||||||
if (request == null) {
|
if (request != null) {
|
||||||
// Cliente desconectou gracefully
|
|
||||||
logger.info("Client {} disconnected (end of stream)", clientId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.info("Client {} sent request {}", clientId, request.getRequestId());
|
logger.info("Client {} sent request {}", clientId, request.getRequestId());
|
||||||
|
|
||||||
// Processa usando o DelegateActionManager
|
// Processa usando o DelegateActionManager
|
||||||
@@ -240,29 +233,17 @@ public class IPCManager {
|
|||||||
|
|
||||||
// Envia resposta de volta
|
// Envia resposta de volta
|
||||||
writeResponse(channel, response);
|
writeResponse(channel, response);
|
||||||
|
|
||||||
logger.info("Client {} response sent", clientId);
|
logger.info("Client {} response sent", clientId);
|
||||||
|
|
||||||
// Verifica se é comando CLOSE
|
|
||||||
String connectionHeader = response.getHeadersOrDefault("Connection", "");
|
|
||||||
if ("close".equals(connectionHeader)) {
|
|
||||||
logger.info("Client {} requested connection close", clientId);
|
|
||||||
break; // Sai do loop e fecha
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
|
||||||
if (channel.isOpen()) {
|
|
||||||
logger.error("IO error handling client {}", clientId, e);
|
|
||||||
} else {
|
} else {
|
||||||
logger.debug("Client {} connection closed by peer", clientId);
|
logger.warn("Client {} sent null message", clientId);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Unexpected error handling client {}", clientId, e);
|
logger.error("Error handling client {}", clientId, e);
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
if (channel.isOpen()) {
|
|
||||||
channel.close();
|
channel.close();
|
||||||
}
|
|
||||||
logger.debug("Client {} channel closed", clientId);
|
logger.debug("Client {} channel closed", clientId);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.error("Error closing client {} channel", clientId, e);
|
logger.error("Error closing client {} channel", clientId, e);
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
option java_package = "com.mediamanager.protocol";
|
|
||||||
option java_outer_classname = "TestProtocol";
|
|
||||||
|
|
||||||
package mediamanager.test;
|
|
||||||
|
|
||||||
message EchoCommand {
|
|
||||||
string message = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message EchoResponse {
|
|
||||||
string message = 1;
|
|
||||||
int64 server_timestamp = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message HeartbeatCommand {
|
|
||||||
int64 client_timestamp = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message HeartbeatResponse {
|
|
||||||
int64 client_timestamp = 1;
|
|
||||||
int64 server_timestamp = 2;
|
|
||||||
}
|
|
||||||
message CloseCommand {
|
|
||||||
// Vazio - apenas sinaliza fechamento
|
|
||||||
}
|
|
||||||
message CloseResponse {
|
|
||||||
string message = 1;
|
|
||||||
}
|
|
||||||
@@ -21,8 +21,7 @@ hibernate.format_sql=true
|
|||||||
ipc.pipe.name=mediamanager-pipe
|
ipc.pipe.name=mediamanager-pipe
|
||||||
ipc.pipe.path=/tmp/mediamanager
|
ipc.pipe.path=/tmp/mediamanager
|
||||||
ipc.buffer.size=8192
|
ipc.buffer.size=8192
|
||||||
runtype=local
|
|
||||||
ipc.socket.path=/tmp/mediamanager
|
ipc.socket.path=/tmp/mediamanager
|
||||||
|
runtype=local
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,17 +18,40 @@
|
|||||||
</Appenders>
|
</Appenders>
|
||||||
|
|
||||||
<Loggers>
|
<Loggers>
|
||||||
<Logger name="com.mediamanager" level="INFO" additivity="false">
|
<Logger name="com.mediamanager" level="debug" additivity="false">
|
||||||
<AppenderRef ref="Console"/>
|
<AppenderRef ref="Console"/>
|
||||||
<AppenderRef ref="FileAppender"/>
|
<AppenderRef ref="FileAppender"/>
|
||||||
</Logger>
|
</Logger>
|
||||||
|
|
||||||
<Logger name="org.hibernate" level="INFO" additivity="false">
|
<Logger name="org.hibernate" level="info" additivity="false">
|
||||||
<AppenderRef ref="Console"/>
|
<AppenderRef ref="Console"/>
|
||||||
<AppenderRef ref="FileAppender"/>
|
<AppenderRef ref="FileAppender"/>
|
||||||
</Logger>
|
</Logger>
|
||||||
|
|
||||||
<Root level="INFO">
|
<Logger name="io.zonky.test" level="INFO" additivity="false">
|
||||||
|
<AppenderRef ref="Console"/>
|
||||||
|
<AppenderRef ref="FileAppender"/>
|
||||||
|
</Logger>
|
||||||
|
|
||||||
|
<!-- PostgreSQL JDBC Driver -->
|
||||||
|
<Logger name="org.postgresql" level="WARN" additivity="false">
|
||||||
|
<AppenderRef ref="Console"/>
|
||||||
|
<AppenderRef ref="FileAppender"/>
|
||||||
|
</Logger>
|
||||||
|
|
||||||
|
<!-- Processo do PostgreSQL embedded -->
|
||||||
|
<Logger name="org.postgresql.embedded" level="INFO" additivity="false">
|
||||||
|
<AppenderRef ref="Console"/>
|
||||||
|
<AppenderRef ref="FileAppender"/>
|
||||||
|
</Logger>
|
||||||
|
|
||||||
|
<!-- HikariCP Connection Pool -->
|
||||||
|
<Logger name="com.zaxxer.hikari" level="INFO" additivity="false">
|
||||||
|
<AppenderRef ref="Console"/>
|
||||||
|
<AppenderRef ref="FileAppender"/>
|
||||||
|
</Logger>
|
||||||
|
|
||||||
|
<Root level="info">
|
||||||
<AppenderRef ref="Console"/>
|
<AppenderRef ref="Console"/>
|
||||||
<AppenderRef ref="FileAppender"/>
|
<AppenderRef ref="FileAppender"/>
|
||||||
</Root>
|
</Root>
|
||||||
|
|||||||
Reference in New Issue
Block a user