aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-03-26 15:05:16 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-03-26 15:05:16 +1300
commit76d0088bbb6951dc845bc2b6d4945fdf6eb772f8 (patch)
treee4087115b4ee815a6e7208247eb3106016b77a0c
parentdbb56e3b500c624ef26cce8f8d1188fdef49f5e3 (diff)
downloadtraccar-server-76d0088bbb6951dc845bc2b6d4945fdf6eb772f8.tar.gz
traccar-server-76d0088bbb6951dc845bc2b6d4945fdf6eb772f8.tar.bz2
traccar-server-76d0088bbb6951dc845bc2b6d4945fdf6eb772f8.zip
TrackerServer class cleanup
-rw-r--r--src/org/traccar/TrackerServer.java30
1 files changed, 4 insertions, 26 deletions
diff --git a/src/org/traccar/TrackerServer.java b/src/org/traccar/TrackerServer.java
index 108688fb8..7e0a6f0c6 100644
--- a/src/org/traccar/TrackerServer.java
+++ b/src/org/traccar/TrackerServer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2014 Anton Tananaev (anton@traccar.org)
+ * Copyright 2012 - 2017 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,9 +29,6 @@ import org.jboss.netty.channel.group.DefaultChannelGroup;
import java.net.InetSocketAddress;
import java.nio.ByteOrder;
-/**
- * Tracker server
- */
public abstract class TrackerServer {
private final Bootstrap bootstrap;
@@ -49,7 +46,6 @@ public abstract class TrackerServer {
this.bootstrap = bootstrap;
this.protocol = protocol;
- // Set appropriate channel factory
if (bootstrap instanceof ServerBootstrap) {
bootstrap.setFactory(GlobalChannelFactory.getFactory());
} else if (bootstrap instanceof ConnectionlessBootstrap) {
@@ -69,22 +65,16 @@ public abstract class TrackerServer {
protected abstract void addSpecificHandlers(ChannelPipeline pipeline);
- /**
- * Server port
- */
- private Integer port;
+ private int port;
- public Integer getPort() {
+ public int getPort() {
return port;
}
- public void setPort(Integer port) {
+ public void setPort(int port) {
this.port = port;
}
- /**
- * Server listening interface
- */
private String address;
public String getAddress() {
@@ -95,17 +85,11 @@ public abstract class TrackerServer {
this.address = address;
}
- /**
- * Set endianness
- */
public void setEndianness(ByteOrder byteOrder) {
bootstrap.setOption("bufferFactory", new HeapChannelBufferFactory(byteOrder));
bootstrap.setOption("child.bufferFactory", new HeapChannelBufferFactory(byteOrder));
}
- /**
- * Opened channels
- */
private final ChannelGroup allChannels = new DefaultChannelGroup();
public ChannelGroup getChannelGroup() {
@@ -120,9 +104,6 @@ public abstract class TrackerServer {
return bootstrap.getPipelineFactory();
}
- /**
- * Start server
- */
public void start() {
InetSocketAddress endpoint;
if (address == null) {
@@ -143,9 +124,6 @@ public abstract class TrackerServer {
}
}
- /**
- * Stop server
- */
public void stop() {
ChannelGroupFuture future = getChannelGroup().close();
future.awaitUninterruptibly();