first
commit
b97eb2f615
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>jnet</groupId>
|
||||
<artifactId>jNetLib</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
<exec.mainClass>jnet.lib.JNetLib</exec.mainClass>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-configuration2</artifactId>
|
||||
<version>2.15.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>1.9.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-crypto</artifactId>
|
||||
<version>6.2.8</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.snmp4j</groupId>
|
||||
<artifactId>snmp4j</artifactId>
|
||||
<version>3.13.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package jnet.lib;
|
||||
|
||||
import org.apache.commons.configuration2.Configuration;
|
||||
import org.apache.commons.configuration2.PropertiesConfiguration;
|
||||
import org.apache.commons.configuration2.builder.fluent.Configurations;
|
||||
import org.apache.commons.configuration2.ex.ConfigurationException;
|
||||
import org.apache.commons.configuration2.io.FileHandler;
|
||||
import java.io.File;
|
||||
import org.apache.commons.configuration2.io.FileBased;
|
||||
|
||||
public class ApacheConfig {
|
||||
|
||||
public static PropertiesConfiguration loadProperties() throws ConfigurationException {
|
||||
Configurations configs = new Configurations();
|
||||
File configFile = ResourceLoader.getFile("config.properties");
|
||||
return configs.properties(configFile);
|
||||
}
|
||||
|
||||
// Původní metoda pro FileBased (zachováváme pro přímé použití)
|
||||
public static void saveProperties(FileBased config) throws ConfigurationException {
|
||||
File configFile = ResourceLoader.getFile("config.properties");
|
||||
FileHandler handler = new FileHandler(config);
|
||||
handler.save(configFile);
|
||||
}
|
||||
|
||||
// NOVÁ metoda, která přijímá Configuration a zkontroluje, zda je FileBased
|
||||
public static void saveProperties(Configuration config) throws ConfigurationException {
|
||||
if (!(config instanceof FileBased)) {
|
||||
throw new ConfigurationException("Konfigurace nepodporuje ukládání do souboru.");
|
||||
}
|
||||
File configFile = ResourceLoader.getFile("config.properties");
|
||||
FileHandler handler = new FileHandler((FileBased) config);
|
||||
handler.save(configFile);
|
||||
}
|
||||
|
||||
// Druhá přetížená metoda pro FileBased se zadaným souborem
|
||||
public static void saveProperties(FileBased config, File file) throws ConfigurationException {
|
||||
FileHandler handler = new FileHandler(config);
|
||||
handler.save(file);
|
||||
}
|
||||
|
||||
// A přidej i verzi pro Configuration se souborem
|
||||
public static void saveProperties(Configuration config, File file) throws ConfigurationException {
|
||||
if (!(config instanceof FileBased)) {
|
||||
throw new ConfigurationException("Konfigurace nepodporuje ukládání do souboru.");
|
||||
}
|
||||
FileHandler handler = new FileHandler((FileBased) config);
|
||||
handler.save(file);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package jnet.lib;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.Date;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
||||
public class BuilddDate {
|
||||
|
||||
public static Date get() {
|
||||
Date d = null;
|
||||
Class<?> currentClass = new Object() {
|
||||
}.getClass().getEnclosingClass();
|
||||
URL resource = currentClass.getResource(currentClass.getSimpleName() + ".class");
|
||||
if (resource != null) {
|
||||
if (resource.getProtocol().equals("file")) {
|
||||
try {
|
||||
d = new Date(new File(resource.toURI()).lastModified());
|
||||
} catch (URISyntaxException ignored) {
|
||||
}
|
||||
} else if (resource.getProtocol().equals("jar")) {
|
||||
String path = resource.getPath();
|
||||
d = new Date(new File(path.substring(5, path.indexOf("!"))).lastModified());
|
||||
} else if (resource.getProtocol().equals("zip")) {
|
||||
String path = resource.getPath();
|
||||
File jarFileOnDisk = new File(path.substring(0, path.indexOf("!")));
|
||||
//long jfodLastModifiedLong = jarFileOnDisk.lastModified ();
|
||||
//Date jfodLasModifiedDate = new Date(jfodLastModifiedLong);
|
||||
try (JarFile jf = new JarFile(jarFileOnDisk)) {
|
||||
ZipEntry ze = jf.getEntry(path.substring(path.indexOf("!") + 2));//Skip the ! and the /
|
||||
long zeTimeLong = ze.getTime();
|
||||
Date zeTimeDate = new Date(zeTimeLong);
|
||||
d = zeTimeDate;
|
||||
} catch (IOException | RuntimeException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return d;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package jnet.lib;
|
||||
|
||||
import jnet.lib.object.Event;
|
||||
import java.util.Comparator;
|
||||
|
||||
public class EventComparator implements Comparator<Event> {
|
||||
|
||||
@Override
|
||||
public int compare(Event t1, Event t2) {
|
||||
/*
|
||||
int fromResult = Long.compare(t1.getFrom(), t2.getFrom());
|
||||
if (fromResult == 0) {
|
||||
return fromResult;
|
||||
}
|
||||
//return fromResult;
|
||||
|
||||
return Long.compare(t1.getTo(), t2.getTo());
|
||||
*/
|
||||
return Long.compare(t1.getStart(), t2.getStart());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
package jnet.lib;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class LogFile {
|
||||
|
||||
// nazev souboru
|
||||
private static final String outFile = "log";
|
||||
// zapisovat i log do console
|
||||
private static boolean consoleLog = true;
|
||||
// format datumu a casu
|
||||
private static String dateFormat = "dd.MM.YY HH:m:ss";
|
||||
// debug rezim
|
||||
private static boolean debug = false;
|
||||
|
||||
private static File out = new File(outFile);
|
||||
|
||||
private static final DateFormat df = new SimpleDateFormat(dateFormat);
|
||||
|
||||
private static void write(Object text, boolean line) {
|
||||
|
||||
try {
|
||||
if (!out.exists()) {
|
||||
out.createNewFile();
|
||||
}
|
||||
PrintWriter pwOut = new PrintWriter(new FileOutputStream(out, true), true);
|
||||
pwOut.print(df.format(new Date()));
|
||||
pwOut.write("\t");
|
||||
if (line) {
|
||||
pwOut.println(text);
|
||||
} else {
|
||||
pwOut.print(text);
|
||||
}
|
||||
pwOut.close();
|
||||
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(LogFile.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void printErr(String line) {
|
||||
String l = StringUtils.stripAccents(line);
|
||||
write("E\t" + l, true);
|
||||
if (consoleLog) {
|
||||
System.err.println(l);
|
||||
}
|
||||
}
|
||||
|
||||
public static void printInfo(String line) {
|
||||
String l = StringUtils.stripAccents(line);
|
||||
write("I\t" + l, true);
|
||||
if (consoleLog) {
|
||||
System.out.println(l);
|
||||
}
|
||||
}
|
||||
|
||||
public static void printDebug(String line) {
|
||||
String l = StringUtils.stripAccents(line);
|
||||
write("D\t" + l, true);
|
||||
if (debug) {
|
||||
if (consoleLog) {
|
||||
System.out.println(l);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
try {
|
||||
out.delete();
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(LogFile.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static void setDebug(boolean b) {
|
||||
debug = b;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package jnet.lib;
|
||||
|
||||
import java.util.Comparator;
|
||||
import jnet.lib.object.Site;
|
||||
|
||||
|
||||
public class MapComparator implements Comparator<Site> {
|
||||
|
||||
@Override
|
||||
public int compare(Site obj1, Site obj2) {
|
||||
return obj1.getName().compareTo(obj2.getName());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
package jnet.lib;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Message implements Serializable {
|
||||
|
||||
// S->C pozadavak na aktualizaci klienta
|
||||
public static final int CLIENT_UPDATE = 101;
|
||||
// S->C pozadavek na autorizaci
|
||||
public static final int AUTH_REQUEST = 102;
|
||||
// S->C autorizace uspesna
|
||||
public static final int AUTH_OK = 103;
|
||||
// S->C autorizace selhala
|
||||
public static final int AUTH_FAIL = 104;
|
||||
// S->C server odesila novy seznam pripojenych klientu
|
||||
public static final int ONLINE_CLIENTS = 105;
|
||||
// S->C odesila seznam vsech site
|
||||
public static final int SITE_LIST = 106;
|
||||
// S->C nová mapa
|
||||
public static int SITE_NEW = 107;
|
||||
// S->C zmena online stavu node
|
||||
public static int NODE_STATUS_CHANGE = 108;
|
||||
// S->C nastaveni serveru
|
||||
public static int SERVER_CONFIG = 109;
|
||||
// S->C server uptime
|
||||
public static int SERVER_UPTIME_RESULT = 110;
|
||||
// S->C informace o prihlasenem uzivateli
|
||||
public static final int USER_INFO = 111;
|
||||
// S->C seznam object type
|
||||
public static final int NODE_ICON_LIST = 112;
|
||||
// S->C seznam uzivatelu
|
||||
public static final int USER_LIST = 113;
|
||||
// S->C novy uzivatel - pokyn k aktualizaci tabulky
|
||||
public static int USER_REFRESH = 114;
|
||||
// S->C nova ikona - pokyn k aktualizaci tabulky
|
||||
public static final int NODE_ICON_REFRESH = 115;
|
||||
// S->C seznam udalost
|
||||
public static final int EVENT_LIST = 116;
|
||||
// S->C nova udalost
|
||||
public static final int EVENT_NEW = 117;
|
||||
// S->C aktualizace udalost
|
||||
public static final int EVENT_UPDATE = 118;
|
||||
// S->C aktualizace pozice
|
||||
public static final int NODE_CHANGE_POSITION = 119;
|
||||
// S->C novy node
|
||||
public static final int NODE_NEW = 120;
|
||||
// S->C nastaveni zamku mapy
|
||||
public static final int SITE_LOCK = 121;
|
||||
// S->C odebrani node
|
||||
public static final int NODE_REMOVE = 122;
|
||||
// S->C node update
|
||||
public static final int NODE_UPDATE = 123;
|
||||
// S->C seznam snmp profilu
|
||||
public static final int SNMP_PROFILE_LIST = 124;
|
||||
// S->C snmp test
|
||||
public static final int SNMP_TEST_RESULT = 125;
|
||||
// S->C SNMP dotaz info zarizeni
|
||||
public static final int NODE_SNMP_INFO_RESULT = 126;
|
||||
// S->C SNMP dotaz interface zarizeni
|
||||
public static final int NODE_SNMP_INTERFACE_RESULT = 127;
|
||||
// S->C nove spojeni objektu
|
||||
public static final int NODE_CONNECTION_ADD = 128;
|
||||
// S->C uprava node connection
|
||||
public static final int NODE_CONNECTION_CHANGE = 129;
|
||||
// S->C dotaz z dialogu connection na interface node
|
||||
public static final int NODE_CONNECTION_SNMP_INTERFACE_RESULT = 130;
|
||||
// S->C seznam snmp sablon
|
||||
public static final int SNMP_TEMPLATE_LIST = 131;
|
||||
// S->C seznam snmp value map
|
||||
public static final int SNMP_TEMPLATE_VALUE_MAP_LIST = 132;
|
||||
// S->C snmp probe hodnota
|
||||
public static final int SNMP_PROBE_VALUE = 133;
|
||||
// S->C data z traffic monitoru
|
||||
public static final int NODE_CONNECTION_TRAFFIC = 134;
|
||||
// S->C informace o smazenem connection
|
||||
public static final int NODE_CONNECTION_REMOVE = 135;
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
|
||||
// C->S verze klienta
|
||||
public static final int CLIENT_TYPE = 501;
|
||||
// C->S autorizacni data
|
||||
public static final int AUTH_DATA = 502;
|
||||
// C->S pridani mapy
|
||||
public static final int SITE_ADD = 503;
|
||||
// C-S pridani uzivatele
|
||||
public static final int USER_ADD = 504;
|
||||
// C->S editace uzivatele
|
||||
public static final int USER_EDIT = 505;
|
||||
// C->S uprava nastaveni serveru
|
||||
public static final int SERVER_CONFIG_EDIT = 506;
|
||||
// C->S pokyn k restartu serveru
|
||||
public static final int SERVER_RESTART = 507;
|
||||
// C->S nova ikona zařízení
|
||||
public static final int NODE_ICON_NEW = 508;
|
||||
// C->S smazani mapy
|
||||
public static final int SITE_DELETE = 509;
|
||||
// C->S presun node
|
||||
public static final int NODE_POSITION_CHANGE = 510;
|
||||
// C->S novy node
|
||||
public static final int NODE_ADD = 511;
|
||||
// C->S node edit
|
||||
public static final int NODE_CHANGE = 512;
|
||||
// C->S node connection novy
|
||||
public static final int NODE_CONNECTION_NEW = 513;
|
||||
// C->S nastaveni zamku mapy
|
||||
public static final int SITE_SET_LOCK = 514;
|
||||
// C->S smazani node
|
||||
public static final int NODE_DELETE = 515;
|
||||
// C->S snmp test
|
||||
public static final int SNMP_TEST = 516;
|
||||
// C->S dotaz na uptime
|
||||
public static final int SERVER_UPTIME = 517;
|
||||
// C->S SNMP dotaz info zarizeni
|
||||
public static final int NODE_SNMP_INFO = 518;
|
||||
// C->S SNMP dotaz interface zarizeni
|
||||
public static final int NODE_SNMP_INTERFACE = 519;
|
||||
// C->S přesun node na jinou mapu
|
||||
public static final int NODE_MOVE_TO_SITE = 520;
|
||||
// C->S uprava node spojeni
|
||||
public static final int NODE_CONNECTION_EDIT = 521;
|
||||
// C->S dotaz z dialogu connection na interface node
|
||||
public static final int NODE_CONNECTION_SNMP_INTERFACE = 522;
|
||||
// C->S nova node probe
|
||||
public static final int NODE_PROBE_NEW = 523;
|
||||
// C->S odstraneni connection
|
||||
public static final int NODE_CONNECTION_DELETE = 524;
|
||||
|
||||
|
||||
// C->S uprava node probe
|
||||
public static final int NODE_PROBE_EDIT = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int type;
|
||||
private Object message;
|
||||
|
||||
public Message(int type, Object message) {
|
||||
this.type = type;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public void setMsg(Object message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public Object getMsg() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package jnet.lib;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Detekce operačního systému – rozlišení Windows vs. Debian (případně jiný).
|
||||
*/
|
||||
public class OSDetector {
|
||||
|
||||
public enum OS {
|
||||
WINDOWS,
|
||||
DEBIAN,
|
||||
OTHER
|
||||
}
|
||||
|
||||
/**
|
||||
* Vrátí aktuální operační systém.
|
||||
*/
|
||||
public static OS detect() {
|
||||
if (isWindows()) {
|
||||
return OS.WINDOWS;
|
||||
}
|
||||
if (isDebian()) {
|
||||
return OS.DEBIAN;
|
||||
}
|
||||
return OS.OTHER;
|
||||
}
|
||||
|
||||
/**
|
||||
* Je systém Windows?
|
||||
*/
|
||||
public static boolean isWindows() {
|
||||
String osName = System.getProperty("os.name").toLowerCase();
|
||||
return osName.contains("windows");
|
||||
}
|
||||
|
||||
/**
|
||||
* Je systém Debian? (čistý Debian, nikoli deriváty jako Ubuntu)
|
||||
*/
|
||||
public static boolean isDebian() {
|
||||
// Detekce podle /etc/os-release, aby se odlišil Debian od ostatních distribucí.
|
||||
Path osRelease = Paths.get("/etc/os-release");
|
||||
if (!Files.isRegularFile(osRelease)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
List<String> lines = Files.readAllLines(osRelease);
|
||||
for (String line : lines) {
|
||||
// Hledáme řádek "ID=debian"
|
||||
if (line.startsWith("ID=")) {
|
||||
String value = line.substring(3).replaceAll("^\"|\"$", "").trim();
|
||||
return "debian".equalsIgnoreCase(value);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// Soubor existuje, ale nepodařilo se přečíst – nebudeme riskovat.
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package jnet.lib;
|
||||
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Hash hesla a jeho kontrola
|
||||
* vyžaduje knihovnu spring-security-crypto-5.8.0.jar a apache-commons-logging-1.2.jar
|
||||
* @author cucky
|
||||
*/
|
||||
public class PasswordHashing {
|
||||
|
||||
|
||||
public static String hash(String string){
|
||||
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||
return passwordEncoder.encode(string);
|
||||
}
|
||||
|
||||
public static boolean verify(String rawPassword, String hashedPassword){
|
||||
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||
return passwordEncoder.matches(rawPassword, hashedPassword);
|
||||
}
|
||||
|
||||
// public static String hash(String password){
|
||||
// Argon2 argon2 = Argon2Factory.create();
|
||||
// String hash = argon2.hash(10, 65536, 1, password);
|
||||
// return hash;
|
||||
// }
|
||||
//
|
||||
// public static boolean verify(String rawPassword, String hashedPassword){
|
||||
// Argon2 argon2 = Argon2Factory.create();
|
||||
// return argon2.verify(hashedPassword, rawPassword);
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package jnet.lib;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class ResourceLoader {
|
||||
|
||||
/**
|
||||
* Vrátí objekt File pro zadanou relativní cestu.
|
||||
* Nejprve hledá vedle JARu / v pracovním adresáři.
|
||||
* Pokud nenajde, hledá v adresářové struktuře projektu (pro vývoj v IDE).
|
||||
*/
|
||||
public static File getFile(String relativePath) {
|
||||
// 1. Produkční cesta (přímo vedle JARu / v kořeni spuštění)
|
||||
File prodFile = new File(relativePath);
|
||||
if (prodFile.exists()) {
|
||||
return prodFile;
|
||||
}
|
||||
|
||||
// 2. Vývojářská cesta pro IDE (NetBeans spouští projekt z kořene jNetServer/)
|
||||
File ideFile = new File("src/main/resources", relativePath);
|
||||
if (ideFile.exists()) {
|
||||
return ideFile;
|
||||
}
|
||||
|
||||
// Pokud soubor nikde neexistuje, vrátí původní cestu (vyhodí standardní chybu v aplikaci)
|
||||
return prodFile;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package jnet.lib;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Status implements Serializable {
|
||||
|
||||
public static final int NA = 0;
|
||||
public static final int OK = 1;
|
||||
public static final int WARNING = 2;
|
||||
public static final int OFFLINE = 3;
|
||||
|
||||
public static String getStatusName(int id) {
|
||||
switch (id) {
|
||||
case OK:
|
||||
return "Online";
|
||||
case WARNING:
|
||||
return "Varování";
|
||||
case OFFLINE:
|
||||
return "Offline";
|
||||
default:
|
||||
return "N/A";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
public class DeviceInfo implements Serializable{
|
||||
|
||||
private String sysName;
|
||||
private String sysDescr;
|
||||
private String sysUptime;
|
||||
private String sysContact;
|
||||
private String sysLocation;
|
||||
private String sysObjectID;
|
||||
|
||||
public DeviceInfo(String sysName, String sysDescr, String sysUptime, String sysContact, String sysLocation, String sysObjectID) {
|
||||
this.sysName = sysName;
|
||||
this.sysDescr = sysDescr;
|
||||
this.sysUptime = sysUptime;
|
||||
this.sysContact = sysContact;
|
||||
this.sysLocation = sysLocation;
|
||||
this.sysObjectID = sysObjectID;
|
||||
}
|
||||
|
||||
public String getSysName() {
|
||||
return sysName;
|
||||
}
|
||||
|
||||
public void setSysName(String sysName) {
|
||||
this.sysName = sysName;
|
||||
}
|
||||
|
||||
public String getSysDescr() {
|
||||
return sysDescr;
|
||||
}
|
||||
|
||||
public void setSysDescr(String sysDescr) {
|
||||
this.sysDescr = sysDescr;
|
||||
}
|
||||
|
||||
public String getSysUptime() {
|
||||
return sysUptime;
|
||||
}
|
||||
|
||||
public void setSysUptime(String sysUptime) {
|
||||
this.sysUptime = sysUptime;
|
||||
}
|
||||
|
||||
public String getSysContact() {
|
||||
return sysContact;
|
||||
}
|
||||
|
||||
public void setSysContact(String sysContact) {
|
||||
this.sysContact = sysContact;
|
||||
}
|
||||
|
||||
public String getSysLocation() {
|
||||
return sysLocation;
|
||||
}
|
||||
|
||||
public void setSysLocation(String sysLocation) {
|
||||
this.sysLocation = sysLocation;
|
||||
}
|
||||
|
||||
public String getSysObjectID() {
|
||||
return sysObjectID;
|
||||
}
|
||||
|
||||
public void setSysObjectID(String sysObjectID) {
|
||||
this.sysObjectID = sysObjectID;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
public class Event implements Serializable{
|
||||
|
||||
private long id;
|
||||
private int node;
|
||||
private int status;
|
||||
private long start;
|
||||
private long end;
|
||||
private int duration;
|
||||
|
||||
public Event(long id, int node, int status, long start) {
|
||||
this.id = id;
|
||||
this.node = node;
|
||||
this.start = start;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Event(long id, int node, int status, long start, long end, int duration) {
|
||||
this.id = id;
|
||||
this.node = node;
|
||||
this.status = status;
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getNode() {
|
||||
return node;
|
||||
}
|
||||
|
||||
public void setNode(int node) {
|
||||
this.node = node;
|
||||
}
|
||||
|
||||
public long getStart() {
|
||||
return start;
|
||||
}
|
||||
|
||||
public void setStart(long start) {
|
||||
this.start = start;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public long getEnd() {
|
||||
return end;
|
||||
}
|
||||
|
||||
public void setEnd(long end) {
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setDuration(int duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Interface implements Serializable {
|
||||
|
||||
private int id;
|
||||
private String description;
|
||||
private String operStatus;
|
||||
private String speed;
|
||||
private String type;
|
||||
private String macAddress;
|
||||
private String adminStatus;
|
||||
private String lastChangeTime;
|
||||
|
||||
public Interface(int id, String description, String operStatus, String speed, String type, String macAddress, String adminStatus, String lastChangeTime) {
|
||||
this.id = id;
|
||||
this.description = description;
|
||||
this.operStatus = operStatus;
|
||||
this.speed = speed;
|
||||
this.type = type;
|
||||
this.macAddress = macAddress;
|
||||
this.adminStatus = adminStatus;
|
||||
this.lastChangeTime = lastChangeTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Interface ID: " + id + "\n"
|
||||
+ "Description: " + description + "\n"
|
||||
+ "Operational Status: " + operStatus + "\n"
|
||||
+ "Speed: " + speed + "\n"
|
||||
+ "Type: " + type + "\n"
|
||||
+ "MAC Address: " + macAddress + "\n"
|
||||
+ "Administrative Status: " + adminStatus + "\n"
|
||||
+ "Last Link Change: " + lastChangeTime + "\n";
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getOperStatus() {
|
||||
return operStatus;
|
||||
}
|
||||
|
||||
public void setOperStatus(String operStatus) {
|
||||
this.operStatus = operStatus;
|
||||
}
|
||||
|
||||
public String getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed(String speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getMacAddress() {
|
||||
return macAddress;
|
||||
}
|
||||
|
||||
public void setMacAddress(String macAddress) {
|
||||
this.macAddress = macAddress;
|
||||
}
|
||||
|
||||
public String getAdminStatus() {
|
||||
return adminStatus;
|
||||
}
|
||||
|
||||
public void setAdminStatus(String adminStatus) {
|
||||
this.adminStatus = adminStatus;
|
||||
}
|
||||
|
||||
public String getLastChangeTime() {
|
||||
return lastChangeTime;
|
||||
}
|
||||
|
||||
public void setLastChangeTime(String lastChangeTime) {
|
||||
this.lastChangeTime = lastChangeTime;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,353 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Node implements Serializable {
|
||||
|
||||
public static final int NODE_DEVICE = 1;
|
||||
public static final int NODE_MAP = 2;
|
||||
public static final int NODE_STATIC = 3;
|
||||
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
private int siteId;
|
||||
private int x;
|
||||
private int y;
|
||||
private int type; // 1 = device, 2 = map, 3 = static object
|
||||
private String ip;
|
||||
private int icon;
|
||||
private int status;
|
||||
private boolean ping;
|
||||
private String user;
|
||||
private String password;
|
||||
private String description;
|
||||
private String location;
|
||||
private int snmpProfile;
|
||||
private boolean winbox;
|
||||
private String winboxPort;
|
||||
private boolean ssh;
|
||||
private String sshPort;
|
||||
private boolean web;
|
||||
private String webPort;
|
||||
private int webVerze;
|
||||
private boolean telnet;
|
||||
private String telnetPort;
|
||||
private boolean sms;
|
||||
private String smsPort;
|
||||
private int smsVerze;
|
||||
private int siteLink; // kdyz typ=2 zde je id mapy na ktery odkazuje
|
||||
private List<NodeProbe> probe;
|
||||
private int deviceType;
|
||||
|
||||
public Node(int id, String name, int siteId, int x, int y, int type, int icon, String ip, String user, String password, String description, String location, int snmpProfile, int status, boolean ping, boolean winbox, String winboxPort, boolean ssh, String sshPort, boolean web, String webPort, int webVersion, boolean telnet, String telnetPort, boolean sms, String smsPort, int smsVersion, int siteLink, List<NodeProbe> probe) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.siteId = siteId;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.type = type;
|
||||
this.icon = icon;
|
||||
this.deviceType = icon;
|
||||
this.ip = ip;
|
||||
this.user = user;
|
||||
this.password = password;
|
||||
this.description = description;
|
||||
this.location = location;
|
||||
this.snmpProfile = snmpProfile;
|
||||
this.status = status;
|
||||
this.ping = ping;
|
||||
this.winbox = winbox;
|
||||
this.winboxPort = winboxPort;
|
||||
this.ssh = ssh;
|
||||
this.sshPort = sshPort;
|
||||
this.web = web;
|
||||
this.webPort = webPort;
|
||||
this.webVerze = webVersion;
|
||||
this.telnet = telnet;
|
||||
this.telnetPort = telnetPort;
|
||||
this.sms = sms;
|
||||
this.smsPort = smsPort;
|
||||
this.smsVerze = smsVersion;
|
||||
this.siteLink = siteLink;
|
||||
this.probe = new ArrayList<>();
|
||||
this.probe = probe;
|
||||
}
|
||||
|
||||
public Node() {
|
||||
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setSiteId(int siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(int x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(int y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public boolean isPing() {
|
||||
return ping;
|
||||
}
|
||||
|
||||
public void setPing(boolean ping) {
|
||||
this.ping = ping;
|
||||
}
|
||||
|
||||
public String getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(String user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public int getSnmpProfile() {
|
||||
return snmpProfile;
|
||||
}
|
||||
|
||||
public void setSnmpProfile(int snmpProfile) {
|
||||
this.snmpProfile = snmpProfile;
|
||||
}
|
||||
|
||||
public boolean isWinbox() {
|
||||
return winbox;
|
||||
}
|
||||
|
||||
public void setWinbox(boolean winbox) {
|
||||
this.winbox = winbox;
|
||||
}
|
||||
|
||||
public String getWinboxPort() {
|
||||
return winboxPort;
|
||||
}
|
||||
|
||||
public void setWinboxPort(String winboxPort) {
|
||||
this.winboxPort = winboxPort;
|
||||
}
|
||||
|
||||
public boolean isSsh() {
|
||||
return ssh;
|
||||
}
|
||||
|
||||
public void setSsh(boolean ssh) {
|
||||
this.ssh = ssh;
|
||||
}
|
||||
|
||||
public String getSshPort() {
|
||||
return sshPort;
|
||||
}
|
||||
|
||||
public void setSshPort(String sshPort) {
|
||||
this.sshPort = sshPort;
|
||||
}
|
||||
|
||||
public boolean isWeb() {
|
||||
return web;
|
||||
}
|
||||
|
||||
public void setWeb(boolean web) {
|
||||
this.web = web;
|
||||
}
|
||||
|
||||
public String getWebPort() {
|
||||
return webPort;
|
||||
}
|
||||
|
||||
public void setWebPort(String webPort) {
|
||||
this.webPort = webPort;
|
||||
}
|
||||
|
||||
public int getWebVerze() {
|
||||
return webVerze;
|
||||
}
|
||||
|
||||
public void setWebVerze(int webVerze) {
|
||||
this.webVerze = webVerze;
|
||||
}
|
||||
|
||||
public boolean isTelnet() {
|
||||
return telnet;
|
||||
}
|
||||
|
||||
public void setTelnet(boolean telnet) {
|
||||
this.telnet = telnet;
|
||||
}
|
||||
|
||||
public String getTelnetPort() {
|
||||
return telnetPort;
|
||||
}
|
||||
|
||||
public void setTelnetPort(String telnetPort) {
|
||||
this.telnetPort = telnetPort;
|
||||
}
|
||||
|
||||
public boolean isSms() {
|
||||
return sms;
|
||||
}
|
||||
|
||||
public void setSms(boolean sms) {
|
||||
this.sms = sms;
|
||||
}
|
||||
|
||||
public String getSmsPort() {
|
||||
return smsPort;
|
||||
}
|
||||
|
||||
public void setSmsPort(String smsPort) {
|
||||
this.smsPort = smsPort;
|
||||
}
|
||||
|
||||
public int getSmsVerze() {
|
||||
return smsVerze;
|
||||
}
|
||||
|
||||
public void setSmsVerze(int smsVerze) {
|
||||
this.smsVerze = smsVerze;
|
||||
}
|
||||
|
||||
public int getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(int icon) {
|
||||
this.icon = icon;
|
||||
this.deviceType = icon;
|
||||
}
|
||||
|
||||
public int getSiteLink() {
|
||||
return siteLink;
|
||||
}
|
||||
|
||||
public void setSiteLink(int siteLink) {
|
||||
this.siteLink = siteLink;
|
||||
}
|
||||
|
||||
public List<NodeProbe> getProbe() {
|
||||
return probe;
|
||||
}
|
||||
|
||||
public void setProbe(List<NodeProbe> probe) {
|
||||
this.probe = probe;
|
||||
}
|
||||
|
||||
public int getDeviceType() {
|
||||
return deviceType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Node{"
|
||||
+ "id=" + id
|
||||
+ ", name='" + name + '\''
|
||||
+ ", siteId=" + siteId
|
||||
+ ", x=" + x
|
||||
+ ", y=" + y
|
||||
+ ", type=" + type
|
||||
+ ", icon=" + icon
|
||||
+ ", ip='" + ip + '\''
|
||||
+ ", status=" + status
|
||||
+ ", ping=" + ping
|
||||
+ ", user='" + user + '\''
|
||||
+ ", password='" + password + '\''
|
||||
+ ", description='" + description + '\''
|
||||
+ ", location='" + location + '\''
|
||||
+ ", snmpProfile=" + snmpProfile
|
||||
+ ", winbox=" + winbox
|
||||
+ ", winboxPort='" + winboxPort + '\''
|
||||
+ ", ssh=" + ssh
|
||||
+ ", sshPort='" + sshPort + '\''
|
||||
+ ", web=" + web
|
||||
+ ", webPort='" + webPort + '\''
|
||||
+ ", webVerze=" + webVerze
|
||||
+ ", telnet=" + telnet
|
||||
+ ", telnetPort='" + telnetPort + '\''
|
||||
+ ", sms=" + sms
|
||||
+ ", smsPort='" + smsPort + '\''
|
||||
+ ", smsVerze=" + smsVerze
|
||||
+ '}';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
public class NodeConnection implements Serializable{
|
||||
|
||||
public static final int TYPE_OTHER = 0;
|
||||
public static final int TYPE_GE = 1;
|
||||
public static final int TYPE_FE = 2;
|
||||
public static final int TYPE_E = 3;
|
||||
public static final int TYPE_10GE = 4;
|
||||
public static final int TYPE_100M_FIBER = 5;
|
||||
public static final int TYPE_1G_FIBER = 6;
|
||||
public static final int TYPE_10G_FIBER = 7;
|
||||
public static final int TYPE_WIRELESS = 8;
|
||||
public static final int TYPE_TUNEL = 9;
|
||||
public static final int TYPE_VLAN = 10;
|
||||
|
||||
private int id;
|
||||
private int nodeFrom;
|
||||
private int nodeTo;
|
||||
private int type;
|
||||
private boolean readTraffic;
|
||||
private int trafficNode;
|
||||
private int trafficIface;
|
||||
private int site;
|
||||
private long tx;
|
||||
private long rx;
|
||||
|
||||
public NodeConnection(int id, int site, int nodeFrom, int nodeTo, int type, boolean readTraffic, int trafficNode, int trafficIface) {
|
||||
this.id = id;
|
||||
this.site = site;
|
||||
this.nodeFrom = nodeFrom;
|
||||
this.nodeTo = nodeTo;
|
||||
this.type = type;
|
||||
this.readTraffic = readTraffic;
|
||||
this.trafficNode = trafficNode;
|
||||
this.trafficIface = trafficIface;
|
||||
}
|
||||
|
||||
public NodeConnection() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getNodeFrom() {
|
||||
return nodeFrom;
|
||||
}
|
||||
|
||||
public void setNodeFrom(int nodeFrom) {
|
||||
this.nodeFrom = nodeFrom;
|
||||
}
|
||||
|
||||
public int getNodeTo() {
|
||||
return nodeTo;
|
||||
}
|
||||
|
||||
public void setNodeTo(int nodeTo) {
|
||||
this.nodeTo = nodeTo;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public boolean isReadTraffic() {
|
||||
return readTraffic;
|
||||
}
|
||||
|
||||
public void setReadTraffic(boolean readTraffic) {
|
||||
this.readTraffic = readTraffic;
|
||||
}
|
||||
|
||||
public int getTrafficNode() {
|
||||
return trafficNode;
|
||||
}
|
||||
|
||||
public void setTrafficNode(int trafficNode) {
|
||||
this.trafficNode = trafficNode;
|
||||
}
|
||||
|
||||
public int getTrafficIface() {
|
||||
return trafficIface;
|
||||
}
|
||||
|
||||
public void setTrafficIface(int trafficIface) {
|
||||
this.trafficIface = trafficIface;
|
||||
}
|
||||
|
||||
public int getSite() {
|
||||
return site;
|
||||
}
|
||||
|
||||
public void setSite(int site) {
|
||||
this.site = site;
|
||||
}
|
||||
|
||||
public long getTx() {
|
||||
return tx;
|
||||
}
|
||||
|
||||
public void setTx(long tx) {
|
||||
this.tx = tx;
|
||||
}
|
||||
|
||||
public long getRx() {
|
||||
return rx;
|
||||
}
|
||||
|
||||
public void setRx(long rx) {
|
||||
this.rx = rx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,233 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import org.snmp4j.smi.Variable;
|
||||
|
||||
|
||||
public class NodeProbe implements Serializable {
|
||||
|
||||
|
||||
public static final String DATA_TYPE_INTEGER = "INTEGER";
|
||||
public static final String DATA_TYPE_COUNTER = "COUNTER";
|
||||
public static final String DATA_TYPE_GAUGE = "GAUGE";
|
||||
public static final String DATA_TYPE_TIMESTICK = "TIMETICKS";
|
||||
public static final String DATA_TYPE_IPADDRESS = "IPADDRESS";
|
||||
public static final String DATA_TYPE_STRING = "STRING";
|
||||
public static final String DATA_TYPE_OID = "OID";
|
||||
public static final String DATA_TYPE_NULL = "NULL";
|
||||
|
||||
public static final String CONVERSION_TYPE_NONE = "NONE";
|
||||
public static final String CONVERSION_TYPE_DIVIDE = "DIVIDE";
|
||||
public static final String CONVERSION_TYPE_MULTIPLY = "MULTIPLY";
|
||||
public static final String CONVERSION_TYPE_OFFSET = "OFFSET";
|
||||
public static final String CONVERSION_TYPE_EXPRESSION = "EXPRESSION";
|
||||
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
private String oid;
|
||||
private String dataType;
|
||||
private String conversionType;
|
||||
private double conversionValue;
|
||||
private String conversionExpression;
|
||||
private String unit;
|
||||
private int valueMap;
|
||||
private Variable value;
|
||||
private int interval;
|
||||
private int nodeId;
|
||||
private boolean viewOnMap;
|
||||
|
||||
public NodeProbe(int id, String name, String oid, String dataType, String conversionType, double conversionValue, String conversionExpression, String unit, int valueMap, int interval) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.oid = oid;
|
||||
this.dataType = dataType;
|
||||
this.conversionType = conversionType;
|
||||
this.conversionValue = conversionValue;
|
||||
this.unit = unit;
|
||||
this.valueMap = valueMap;
|
||||
this.interval = interval;
|
||||
this.viewOnMap = true;
|
||||
}
|
||||
|
||||
public NodeProbe() {
|
||||
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
public void setOid(String oid) {
|
||||
this.oid = oid;
|
||||
}
|
||||
|
||||
public String getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public void setDataType(String dataType) {
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public String getConversionType() {
|
||||
return conversionType;
|
||||
}
|
||||
|
||||
public void setConversionType(String conversionType) {
|
||||
this.conversionType = conversionType;
|
||||
}
|
||||
|
||||
public double getConversionValue() {
|
||||
return conversionValue;
|
||||
}
|
||||
|
||||
public void setConversionValue(double conversionValue) {
|
||||
this.conversionValue = conversionValue;
|
||||
}
|
||||
|
||||
public String getConversionExpression() {
|
||||
return conversionExpression;
|
||||
}
|
||||
|
||||
public void setConversionExpression(String conversionExpression) {
|
||||
this.conversionExpression = conversionExpression;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public int getValueMap() {
|
||||
return valueMap;
|
||||
}
|
||||
|
||||
public void setValueMap(int valueMap) {
|
||||
this.valueMap = valueMap;
|
||||
}
|
||||
|
||||
public Variable getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Variable value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getInterval() {
|
||||
return interval;
|
||||
}
|
||||
|
||||
public void setInterval(int interval) {
|
||||
this.interval = interval;
|
||||
}
|
||||
|
||||
public int getNodeId() {
|
||||
return nodeId;
|
||||
}
|
||||
|
||||
public void setNodeId(int nodeId) {
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public boolean isViewOnMap() {
|
||||
return viewOnMap;
|
||||
}
|
||||
|
||||
public void setViewOnMap(boolean viewOnMap) {
|
||||
this.viewOnMap = viewOnMap;
|
||||
}
|
||||
|
||||
public static class ValueMap {
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
private List<Item> item;
|
||||
|
||||
public ValueMap(int id, String name, List<Item> item) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static class Item {
|
||||
|
||||
int id;
|
||||
String rawValue;
|
||||
String mappedValue;
|
||||
|
||||
public Item(int id, String rawValue, String mappedValue) {
|
||||
this.id = id;
|
||||
this.rawValue = rawValue;
|
||||
this.mappedValue = mappedValue;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getRawValue() {
|
||||
return rawValue;
|
||||
}
|
||||
|
||||
public void setRawValue(String rawValue) {
|
||||
this.rawValue = rawValue;
|
||||
}
|
||||
|
||||
public String getMappedValue() {
|
||||
return mappedValue;
|
||||
}
|
||||
|
||||
public void setMappedValue(String mappedValue) {
|
||||
this.mappedValue = mappedValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
public class NodeState implements Serializable{
|
||||
|
||||
private int id;
|
||||
private int state;
|
||||
|
||||
public NodeState(int id, int state) {
|
||||
this.id = id;
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
public class ObjectType implements Serializable{
|
||||
|
||||
int id;
|
||||
String name;
|
||||
String imgStr;
|
||||
|
||||
public ObjectType(int id, String name, String imgStr) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.imgStr = imgStr;
|
||||
}
|
||||
|
||||
public ObjectType(String name, String imgStr) {
|
||||
this.name = name;
|
||||
this.imgStr = imgStr;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getImgStr() {
|
||||
return imgStr;
|
||||
}
|
||||
|
||||
public void setImgStr(String imgStr) {
|
||||
this.imgStr = imgStr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
public class OnlineClients implements Serializable{
|
||||
|
||||
public static final int PLATFORM_PC = 1;
|
||||
public static final int PLATFORM_MOBILE = 2;
|
||||
|
||||
private String id;
|
||||
private String username;
|
||||
private String ip;
|
||||
private String port;
|
||||
private int platform;
|
||||
|
||||
public OnlineClients(String id, String username, String ip, String port, int platform) {
|
||||
this.id = id;
|
||||
this.username = username;
|
||||
this.ip = ip;
|
||||
this.port = port;
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public int getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
public void setPlatform(int platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(String port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ServerConfig implements Serializable {
|
||||
|
||||
private int pingRepeat;
|
||||
private int pingAttempt;
|
||||
private int pingTimeout;
|
||||
private int instabilityAttempt;
|
||||
private int instabilityLimit;
|
||||
private boolean debug;
|
||||
|
||||
public ServerConfig(int pingRepeat, int pingAttempt, int pingTimeout, int instabilityAttempt, int instabilityLimit, boolean debug) {
|
||||
this.pingRepeat = pingRepeat;
|
||||
this.pingAttempt = pingAttempt;
|
||||
this.pingTimeout = pingTimeout;
|
||||
this.instabilityAttempt = instabilityAttempt;
|
||||
this.instabilityLimit = instabilityLimit;
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
public int getPingRepeat() {
|
||||
return pingRepeat;
|
||||
}
|
||||
|
||||
public void setPingRepeat(int pingRepeat) {
|
||||
this.pingRepeat = pingRepeat;
|
||||
}
|
||||
|
||||
public int getPingAttempt() {
|
||||
return pingAttempt;
|
||||
}
|
||||
|
||||
public void setPingAttempt(int pingAttempt) {
|
||||
this.pingAttempt = pingAttempt;
|
||||
}
|
||||
|
||||
public int getPingTimeout() {
|
||||
return pingTimeout;
|
||||
}
|
||||
|
||||
public void setPingTimeout(int pingTimeout) {
|
||||
this.pingTimeout = pingTimeout;
|
||||
}
|
||||
|
||||
public int getInstabilityAttempt() {
|
||||
return instabilityAttempt;
|
||||
}
|
||||
|
||||
public void setInstabilityAttempt(int instabilityAttempt) {
|
||||
this.instabilityAttempt = instabilityAttempt;
|
||||
}
|
||||
|
||||
public int getInstabilityLimit() {
|
||||
return instabilityLimit;
|
||||
}
|
||||
|
||||
public void setInstabilityLimit(int instabilityLimit) {
|
||||
this.instabilityLimit = instabilityLimit;
|
||||
}
|
||||
|
||||
public boolean isDebug() {
|
||||
return debug;
|
||||
}
|
||||
|
||||
public void setDebug(boolean debug) {
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import jnet.lib.Status;
|
||||
|
||||
public class Site implements Serializable {
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
private boolean lock;
|
||||
private List<Node> node;
|
||||
private List<NodeConnection> nodeConnection;
|
||||
|
||||
public Site(int id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.lock = false;
|
||||
this.node = new ArrayList<>();
|
||||
this.nodeConnection = new ArrayList<>();
|
||||
}
|
||||
|
||||
public Site(int id, String name, boolean lock, List<Node> node, List<NodeConnection> nodeConnection) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.lock = lock;
|
||||
this.node = node;
|
||||
this.nodeConnection = nodeConnection;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public boolean isLock() {
|
||||
return lock;
|
||||
}
|
||||
|
||||
public void setLock(boolean lock) {
|
||||
this.lock = lock;
|
||||
}
|
||||
|
||||
public List<Node> getNode() {
|
||||
return node;
|
||||
}
|
||||
|
||||
public void setNode(ArrayList<Node> node) {
|
||||
this.node = node;
|
||||
}
|
||||
|
||||
public List<NodeConnection> getNodeConnection() {
|
||||
return nodeConnection;
|
||||
}
|
||||
|
||||
public void setNodeConnection(List<NodeConnection> nodeConnection) {
|
||||
this.nodeConnection = nodeConnection;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getSiteState() {
|
||||
for (Node n : node) {
|
||||
if (n != null && n.getStatus() == Status.OFFLINE) {
|
||||
return Status.OFFLINE;
|
||||
}
|
||||
}
|
||||
for (Node n : node) {
|
||||
if (n != null && n.getStatus() == Status.WARNING) {
|
||||
return Status.WARNING;
|
||||
}
|
||||
}
|
||||
for (Node n : node) {
|
||||
if (n != null && n.getStatus() == Status.OK) {
|
||||
return Status.OK;
|
||||
}
|
||||
}
|
||||
return Status.NA; // Status.OK zde představuje ONLINE
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
import org.snmp4j.mp.SnmpConstants;
|
||||
|
||||
|
||||
public class SnmpProfile implements Serializable {
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
private int version;
|
||||
private String port;
|
||||
private String communityRead;
|
||||
private String communityWrite;
|
||||
|
||||
private static final int version1 = SnmpConstants.version1;
|
||||
private static final int version2c = SnmpConstants.version2c;
|
||||
private static final int version3 = SnmpConstants.version3;
|
||||
|
||||
|
||||
public SnmpProfile(int id, String name, int version, String port, String communityRead, String communityWrite) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.version = version;
|
||||
this.port = port;
|
||||
this.communityRead = communityRead;
|
||||
this.communityWrite = communityWrite;
|
||||
}
|
||||
|
||||
public SnmpProfile() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(String port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getCommunityRead() {
|
||||
return communityRead;
|
||||
}
|
||||
|
||||
public void setCommunityRead(String communityRead) {
|
||||
this.communityRead = communityRead;
|
||||
}
|
||||
|
||||
public String getCommunityWrite() {
|
||||
return communityWrite;
|
||||
}
|
||||
|
||||
public void setCommunityWrite(String communityWrite) {
|
||||
this.communityWrite = communityWrite;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
import org.snmp4j.smi.Variable;
|
||||
|
||||
|
||||
public class SnmpResult implements Serializable {
|
||||
private final int taskId;
|
||||
private final String oid;
|
||||
private final Variable value;
|
||||
private final String error;
|
||||
private final boolean success;
|
||||
|
||||
public SnmpResult(int taskId, String oid, Variable value, String error, boolean success) {
|
||||
this.taskId = taskId;
|
||||
this.oid = oid;
|
||||
this.value = value;
|
||||
this.error = error;
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public int getTaskId() { return taskId; }
|
||||
public String getOid() { return oid; }
|
||||
public Variable getValue() { return value; }
|
||||
public String getError() { return error; }
|
||||
public boolean isSuccess() { return success; }
|
||||
}
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class SnmpTemplate implements Serializable {
|
||||
|
||||
|
||||
public static final String DATA_TYPE_INTEGER = "INTEGER";
|
||||
public static final String DATA_TYPE_COUNTER = "COUNTER";
|
||||
public static final String DATA_TYPE_GAUGE = "GAUGE";
|
||||
public static final String DATA_TYPE_TIMESTICK = "TIMETICKS";
|
||||
public static final String DATA_TYPE_IPADDRESS = "IPADDRESS";
|
||||
public static final String DATA_TYPE_STRING = "STRING";
|
||||
public static final String DATA_TYPE_OID = "OID";
|
||||
public static final String DATA_TYPE_NULL = "NULL";
|
||||
|
||||
public static final String CONVERSION_TYPE_NONE = "NONE";
|
||||
public static final String CONVERSION_TYPE_DIVIDE = "DIVIDE";
|
||||
public static final String CONVERSION_TYPE_MULTIPLY = "MULTIPLY";
|
||||
public static final String CONVERSION_TYPE_OFFSET = "OFFSET";
|
||||
public static final String CONVERSION_TYPE_EXPRESSION = "EXPRESSION";
|
||||
|
||||
|
||||
private int id;
|
||||
private int deviceType;
|
||||
private String name;
|
||||
private String oid;
|
||||
private String dataType;
|
||||
private String conversionType;
|
||||
private double conversionValue;
|
||||
private String conversionExpression;
|
||||
private String unit;
|
||||
private int valueMapId;
|
||||
private String description;
|
||||
|
||||
public SnmpTemplate(int id, int deviceType, String name, String oid, String dataType, String conversionType, double conversionValue, String conversionExpression, String unit, int valueMapId, String description) {
|
||||
this.id = id;
|
||||
this.deviceType = deviceType;
|
||||
this.name = name;
|
||||
this.oid = oid;
|
||||
this.dataType = dataType;
|
||||
this.conversionType = conversionType;
|
||||
this.conversionValue = conversionValue;
|
||||
this.conversionExpression = conversionExpression;
|
||||
this.unit = unit;
|
||||
this.valueMapId = valueMapId;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getDeviceType() {
|
||||
return deviceType;
|
||||
}
|
||||
|
||||
public void setDeviceType(int deviceType) {
|
||||
this.deviceType = deviceType;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
public void setOid(String oid) {
|
||||
this.oid = oid;
|
||||
}
|
||||
|
||||
public String getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public void setDataType(String dataType) {
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public String getConversionType() {
|
||||
return conversionType;
|
||||
}
|
||||
|
||||
public void setConversionType(String conversionType) {
|
||||
this.conversionType = conversionType;
|
||||
}
|
||||
|
||||
public double getConversionValue() {
|
||||
return conversionValue;
|
||||
}
|
||||
|
||||
public void setConversionValue(double conversionValue) {
|
||||
this.conversionValue = conversionValue;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public int getValueMap() {
|
||||
return valueMapId;
|
||||
}
|
||||
|
||||
public void setValueMap(int valueMapId) {
|
||||
this.valueMapId = valueMapId;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getConversionExpression() {
|
||||
return conversionExpression;
|
||||
}
|
||||
|
||||
public void setConversionExpression(String conversionExpression) {
|
||||
this.conversionExpression = conversionExpression;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class SnmpValueMap implements Serializable{
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
private List<Item> item;
|
||||
|
||||
public SnmpValueMap(int id, String name, List<Item> item) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static class Item implements Serializable {
|
||||
|
||||
int id;
|
||||
String rawValue;
|
||||
String mappedValue;
|
||||
|
||||
public Item(int id, String rawValue, String mappedValue) {
|
||||
this.id = id;
|
||||
this.rawValue = rawValue;
|
||||
this.mappedValue = mappedValue;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getRawValue() {
|
||||
return rawValue;
|
||||
}
|
||||
|
||||
public void setRawValue(String rawValue) {
|
||||
this.rawValue = rawValue;
|
||||
}
|
||||
|
||||
public String getMappedValue() {
|
||||
return mappedValue;
|
||||
}
|
||||
|
||||
public void setMappedValue(String mappedValue) {
|
||||
this.mappedValue = mappedValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class TrafficData implements Serializable {
|
||||
|
||||
public final int deviceId;
|
||||
public final long inBps;
|
||||
public final long outBps;
|
||||
public final long timestamp;
|
||||
|
||||
public TrafficData(int deviceId, long inBps, long outBps, long timestamp) {
|
||||
this.deviceId = deviceId;
|
||||
this.inBps = inBps;
|
||||
this.outBps = outBps;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
package jnet.lib.object;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
public class User implements Serializable {
|
||||
|
||||
private int id;
|
||||
private String username;
|
||||
private String password;
|
||||
|
||||
private boolean addMap;
|
||||
private boolean removeMap;
|
||||
private boolean editMap;
|
||||
private boolean addObject;
|
||||
private boolean removeObject;
|
||||
private boolean editObject;
|
||||
private boolean editServer;
|
||||
|
||||
public User() {
|
||||
this.id = -1;
|
||||
this.username = "";
|
||||
this.password = "";
|
||||
this.addMap = false;
|
||||
this.removeMap = false;
|
||||
this.editMap = false;
|
||||
this.addObject = false;
|
||||
this.removeObject = false;
|
||||
this.editObject = false;
|
||||
this.editServer = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public User(int id, String username, String password, boolean addMap, boolean removeMap, boolean editMap, boolean addObject, boolean removeObject, boolean editObject, boolean editServer) {
|
||||
this.id = id;
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.addMap = addMap;
|
||||
this.removeMap = removeMap;
|
||||
this.editMap = editMap;
|
||||
this.addObject = addObject;
|
||||
this.removeObject = removeObject;
|
||||
this.editObject = editObject;
|
||||
this.editServer = editServer;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public boolean isAddMap() {
|
||||
return addMap;
|
||||
}
|
||||
|
||||
public void setAddMap(boolean addMap) {
|
||||
this.addMap = addMap;
|
||||
}
|
||||
|
||||
public boolean isRemoveMap() {
|
||||
return removeMap;
|
||||
}
|
||||
|
||||
public void setRemoveMap(boolean removeMap) {
|
||||
this.removeMap = removeMap;
|
||||
}
|
||||
|
||||
public boolean isEditMap() {
|
||||
return editMap;
|
||||
}
|
||||
|
||||
public void setEditMap(boolean editMap) {
|
||||
this.editMap = editMap;
|
||||
}
|
||||
|
||||
public boolean isAddObject() {
|
||||
return addObject;
|
||||
}
|
||||
|
||||
public void setAddObject(boolean addObject) {
|
||||
this.addObject = addObject;
|
||||
}
|
||||
|
||||
public boolean isRemoveObject() {
|
||||
return removeObject;
|
||||
}
|
||||
|
||||
public void setRemoveObject(boolean removeObject) {
|
||||
this.removeObject = removeObject;
|
||||
}
|
||||
|
||||
public boolean isEditObject() {
|
||||
return editObject;
|
||||
}
|
||||
|
||||
public void setEditObject(boolean editObject) {
|
||||
this.editObject = editObject;
|
||||
}
|
||||
|
||||
public boolean isEditServer() {
|
||||
return editServer;
|
||||
}
|
||||
|
||||
public void setEditServer(boolean editServer) {
|
||||
this.editServer = editServer;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue