Commit f96a0568 authored by Mohamed Khalil Labidi's avatar Mohamed Khalil Labidi
Browse files

Change logging framework from log4j to SLF4J in SAL

parent 2a3fc6a8
lombok.log.fieldName = LOGGER
\ No newline at end of file
package org.activeeon.morphemic.application.deployment;
import lombok.extern.slf4j.Slf4j;
import org.activeeon.morphemic.service.TemporaryFilesHelper;
import org.activeeon.morphemic.service.Utils;
import org.apache.log4j.Logger;
import org.ow2.proactive.scheduler.common.job.JobVariable;
import org.ow2.proactive.scheduler.common.task.ScriptTask;
import org.ow2.proactive.scheduler.common.task.TaskVariable;
......@@ -16,10 +16,9 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@Slf4j
public class PAFactory {
private static final Logger LOGGER = Logger.getLogger(PAFactory.class);
private PAFactory() {
}
......
package org.activeeon.morphemic.application.deployment;
import lombok.extern.slf4j.Slf4j;
import org.activeeon.morphemic.service.SchedulerConnectionHelper;
import org.apache.log4j.Logger;
import org.ow2.proactive.scheduler.common.exception.*;
import org.ow2.proactive.scheduler.common.job.Job;
import org.ow2.proactive.scheduler.common.job.JobId;
......@@ -17,12 +17,11 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeoutException;
@Slf4j
public class PASchedulerGateway {
private RestSmartProxyImpl restSmartProxy;
private static final Logger LOGGER = Logger.getLogger(PASchedulerGateway.class);
/**
* Construct a gateway to the ProActive Scheduler
* @param paUrl ProActive URL (exp: http://try.activeeon.com:8080/)
......
package org.activeeon.morphemic.infrastructure.deployment;
import lombok.SneakyThrows;
import org.activeeon.morphemic.model.Credentials;
import lombok.extern.slf4j.Slf4j;
import org.activeeon.morphemic.model.PACloud;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.Validate;
import org.apache.http.client.utils.URIBuilder;
import org.apache.log4j.Logger;
import org.jboss.netty.handler.codec.http.HttpMethod;
import org.json.JSONArray;
import org.json.JSONTokener;
......@@ -22,14 +21,13 @@ import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Slf4j
public class PAConnectorIaasGateway {
private final String paURL;
private final String CONNECTOR_IAAS_PATH = "/connector-iaas";
private static final Logger LOGGER = Logger.getLogger(PAConnectorIaasGateway.class);
public PAConnectorIaasGateway(String paServerURL) {
this.paURL = paServerURL;
}
......
package org.activeeon.morphemic.infrastructure.deployment;
import lombok.extern.slf4j.Slf4j;
import org.activeeon.morphemic.service.RMConnectionHelper;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.log4j.Logger;
import org.ow2.proactive.resourcemanager.common.NSState;
import org.ow2.proactive.resourcemanager.common.event.RMNodeEvent;
import org.ow2.proactive.resourcemanager.common.event.RMNodeSourceEvent;
import org.ow2.proactive.resourcemanager.common.event.dto.RMStateFull;
import org.ow2.proactive.resourcemanager.exception.RMException;
import org.ow2.proactive.resourcemanager.exception.RMNodeException;
......@@ -21,6 +20,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.concurrent.*;
@Slf4j
public class PAResourceManagerGateway {
private RMRestInterface rmRestInterface;
......@@ -29,8 +29,6 @@ public class PAResourceManagerGateway {
static final int INTERVAL = 10000;
private static final Logger LOGGER = Logger.getLogger(PAResourceManagerGateway.class);
/**
* Get, in an asynchronous way, deployed nodes names
* @param nodeSource The name of the node source
......
package org.activeeon.morphemic.model;
import java.io.Serializable;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.*;
import java.util.Objects;
/**
* Representation of a BYON used by Cloudiator
......
package org.activeeon.morphemic.model;
import java.io.Serializable;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.sun.istack.NotNull;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.io.Serializable;
import java.util.Objects;
/**
* IpAddress
......
package org.activeeon.morphemic.model;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* Gets or Sets IpAddressType
......
package org.activeeon.morphemic.model;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* Gets or Sets IpVersion
......
package org.activeeon.morphemic.model;
import java.io.Serializable;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import javax.persistence.Embeddable;
import java.io.Serializable;
import java.util.Objects;
/**
* Credentials for remote access to the virtual machine. Typically, one of password or privateKey is set.
......
package org.activeeon.morphemic.model;
import java.io.Serializable;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import javax.persistence.Embeddable;
import javax.persistence.Embedded;
import java.io.Serializable;
import java.util.Objects;
/**
* Attributes defining this node
......
......@@ -3,8 +3,6 @@ package org.activeeon.morphemic.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import javax.management.BadStringOperationException;
import java.math.BigDecimal;
import java.util.Locale;
/**
......
package org.activeeon.morphemic.model;
import lombok.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
......
package org.activeeon.morphemic.service;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.apache.log4j.Logger;
import org.hibernate.CacheMode;
import org.hibernate.jpa.QueryHints;
......@@ -9,14 +9,13 @@ import javax.persistence.*;
import java.util.HashMap;
import java.util.Map;
@Slf4j
public class EntityManagerHelper {
private static final EntityManagerFactory emf;
private static final ThreadLocal<EntityManager> threadLocal;
private static final Logger LOGGER = Logger.getLogger(EntityManagerHelper.class);
static {
Map<String, String> persistenceConfiguration = new HashMap<>();
try {
......
......@@ -6,12 +6,11 @@ import com.fasterxml.jackson.dataformat.csv.CsvMapper;
import com.fasterxml.jackson.dataformat.csv.CsvSchema;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.activeeon.morphemic.model.GeoLocationData;
import org.apache.log4j.Logger;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
......@@ -20,12 +19,11 @@ import java.util.Map;
@Getter
@Setter
@Slf4j
public class GeoLocationUtils {
private final List<GeoLocationData> cloudsGeoLocationData;
private static final Logger LOGGER = Logger.getLogger(GeoLocationUtils.class);
public GeoLocationUtils() {
cloudsGeoLocationData = chargeCloudGLsDB();
LOGGER.debug("Clouds GeoLocation Database loaded successfully.");
......
package org.activeeon.morphemic.service;
import org.apache.log4j.Logger;
import lombok.extern.slf4j.Slf4j;
import org.jclouds.ec2.domain.InstanceType;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
@Slf4j
public class JCloudsInstancesUtils {
private static final Set<String> handledAWSInstanceTypes;
private static final Logger LOGGER = Logger.getLogger(JCloudsInstancesUtils.class);
static {
handledAWSInstanceTypes = new HashSet<>();
Arrays.stream(InstanceType.class.getFields()).forEach(field -> {
try {
handledAWSInstanceTypes.add(field.get(InstanceType.class).toString());
} catch (IllegalAccessException e) {
LOGGER.warn(e.getStackTrace());
LOGGER.warn(String.valueOf(e.getStackTrace()));
}
});
}
......
package org.activeeon.morphemic.service;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.activeeon.morphemic.infrastructure.deployment.PAConnectorIaasGateway;
import org.activeeon.morphemic.model.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;
@Slf4j
public class NodeCandidateUtils {
public PAConnectorIaasGateway connectorIaasGateway;
private final GeoLocationUtils geoLocationUtils;
private static final Logger LOGGER = Logger.getLogger(NodeCandidateUtils.class);
public NodeCandidateUtils(String paURL) {
connectorIaasGateway = new PAConnectorIaasGateway(paURL);
geoLocationUtils = new GeoLocationUtils();
......
package org.activeeon.morphemic.service;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.configuration2.Configuration;
import org.apache.commons.configuration2.PropertiesConfiguration;
import org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder;
......@@ -8,17 +9,15 @@ import org.apache.commons.configuration2.builder.fluent.PropertiesBuilderParamet
import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler;
import org.apache.commons.configuration2.convert.ListDelimiterHandler;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.Map;
@Slf4j
public class PersistenceConfiguration {
private static final ListDelimiterHandler DELIMITER = new DefaultListDelimiterHandler(';');
private static final Logger LOGGER = Logger.getLogger(PersistenceConfiguration.class);
public static String PERSISTENCE_URL = "sal.persistence.url";
public static String PERSISTENCE_USERNAME = "sal.persistence.username";
......
package org.activeeon.morphemic.service;
import org.apache.log4j.Logger;
import lombok.extern.slf4j.Slf4j;
import org.ow2.proactive.resourcemanager.exception.RMException;
import org.ow2.proactive.scheduler.common.exception.NotConnectedException;
import org.ow2.proactive_grid_cloud_portal.common.RMRestInterface;
import org.ow2.proactive_grid_cloud_portal.rm.client.RMRestClient;
import javax.security.auth.login.LoginException;
import java.security.KeyException;
import java.util.prefs.Preferences;
@Slf4j
public class RMConnectionHelper {
private static final Preferences userPreferences = Preferences.userRoot().node("USER_PREFERENCES");
private static String sessionPreferencesId;
private static final Logger LOGGER = Logger.getLogger(RMConnectionHelper.class);
private static final String RESOURCE_MANAGER_REST_PATH = "/rest";
private static String sessionId = "";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment