Made every class that can be final final
This commit is contained in:
@ -24,7 +24,7 @@ import envoy.util.EnvoyLog;
|
||||
* @author Kai S. K. Engelbart
|
||||
* @since Envoy Server Standalone v0.1-alpha
|
||||
*/
|
||||
public class Startup {
|
||||
public final class Startup {
|
||||
|
||||
/**
|
||||
* Stores the configuration used for the whole server
|
||||
|
@ -14,7 +14,7 @@ import javax.persistence.Table;
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "configuration")
|
||||
public class ConfigItem {
|
||||
public final class ConfigItem {
|
||||
|
||||
@Id
|
||||
private String key;
|
||||
|
@ -28,7 +28,7 @@ import javax.persistence.NamedQuery;
|
||||
query = "SELECT g FROM Group g WHERE g.creationDate > :lastSeen AND :user MEMBER OF g.contacts"
|
||||
)
|
||||
})
|
||||
public class Group extends Contact {
|
||||
public final class Group extends Contact {
|
||||
|
||||
/**
|
||||
* Named query retrieving a group by name (parameter {@code :name}).
|
||||
|
@ -24,7 +24,7 @@ import envoy.data.Group;
|
||||
+ "OR m.status = envoy.data.Message$MessageStatus.READ AND m.readDate > :lastSeen "
|
||||
+ "OR m.lastStatusChangeDate > :lastSeen)"
|
||||
)
|
||||
public class GroupMessage extends Message {
|
||||
public final class GroupMessage extends Message {
|
||||
|
||||
/**
|
||||
* Named query retrieving pending group messages sent to a group containing a
|
||||
|
@ -19,7 +19,7 @@ import envoy.server.net.ConnectionManager;
|
||||
* @author Maximilian Käfer
|
||||
* @since Envoy Server Standalone v0.1-alpha
|
||||
*/
|
||||
public class PersistenceManager {
|
||||
public final class PersistenceManager {
|
||||
|
||||
private final EntityManager entityManager = Persistence.createEntityManagerFactory("envoy").createEntityManager();
|
||||
private final EntityTransaction transaction = entityManager.getTransaction();
|
||||
|
@ -12,7 +12,7 @@ import envoy.data.Config;
|
||||
* @author Leon Hofmeister
|
||||
* @since Envoy Server v0.2-beta
|
||||
*/
|
||||
public class ServerConfig extends Config {
|
||||
public final class ServerConfig extends Config {
|
||||
|
||||
private static ServerConfig config;
|
||||
|
||||
|
@ -36,7 +36,7 @@ import envoy.data.User.UserStatus;
|
||||
query = "SELECT u FROM User u WHERE (lower(u.name) LIKE lower(:searchPhrase) AND u <> :context AND :context NOT MEMBER OF u.contacts)"
|
||||
)
|
||||
})
|
||||
public class User extends Contact {
|
||||
public final class User extends Contact {
|
||||
|
||||
/**
|
||||
* Named query retrieving a user by name (parameter {@code :name}).
|
||||
|
@ -19,7 +19,7 @@ import envoy.server.processors.UserStatusChangeProcessor;
|
||||
* @author Kai S. K. Engelbart
|
||||
* @since Envoy Server Standalone v0.1-alpha
|
||||
*/
|
||||
public class ConnectionManager implements ISocketIdListener {
|
||||
public final class ConnectionManager implements ISocketIdListener {
|
||||
|
||||
/**
|
||||
* Contains all socket IDs that have not yet performed a handshake / acquired
|
||||
|
@ -25,7 +25,7 @@ import envoy.util.EnvoyLog;
|
||||
* @author Kai S. K. Engelbart
|
||||
* @since Envoy Server Standalone v0.1-alpha
|
||||
*/
|
||||
public class ObjectMessageProcessor implements IMessageProcessor {
|
||||
public final class ObjectMessageProcessor implements IMessageProcessor {
|
||||
|
||||
private final Set<ObjectProcessor<?>> processors;
|
||||
|
||||
|
@ -19,7 +19,7 @@ import envoy.util.SerializationUtils;
|
||||
* @author Kai S. K. Engelbart
|
||||
* @since Envoy Server Standalone v0.1-alpha
|
||||
*/
|
||||
public class ObjectMessageReader implements IMessageReader {
|
||||
public final class ObjectMessageReader implements IMessageReader {
|
||||
|
||||
private List<Message> completeMessages = new ArrayList<>();
|
||||
private Message nextMessage;
|
||||
|
@ -22,7 +22,7 @@ import envoy.util.SerializationUtils;
|
||||
* @author Kai S. K. Engelbart
|
||||
* @since Envoy Server Standalone v0.1-alpha
|
||||
*/
|
||||
public class ObjectWriteProxy {
|
||||
public final class ObjectWriteProxy {
|
||||
|
||||
private final WriteProxy writeProxy;
|
||||
|
||||
|
@ -17,7 +17,7 @@ import envoy.util.EnvoyLog;
|
||||
* @author Kai S. K. Engelbart
|
||||
* @since Envoy Server Standalone v0.1-alpha
|
||||
*/
|
||||
public class ContactOperationProcessor implements ObjectProcessor<ContactOperation> {
|
||||
public final class ContactOperationProcessor implements ObjectProcessor<ContactOperation> {
|
||||
|
||||
private static final ConnectionManager connectionManager = ConnectionManager.getInstance();
|
||||
private static final Logger logger = EnvoyLog.getLogger(ContactOperationProcessor.class);
|
||||
|
@ -18,7 +18,7 @@ import envoy.server.net.ObjectWriteProxy;
|
||||
* @author Maximilian Käfer
|
||||
* @since Envoy Server Standalone v0.1-beta
|
||||
*/
|
||||
public class GroupCreationProcessor implements ObjectProcessor<GroupCreation> {
|
||||
public final class GroupCreationProcessor implements ObjectProcessor<GroupCreation> {
|
||||
|
||||
private final PersistenceManager persistenceManager = PersistenceManager.getInstance();
|
||||
private final ConnectionManager connectionManager = ConnectionManager.getInstance();
|
||||
|
@ -23,7 +23,7 @@ import envoy.util.EnvoyLog;
|
||||
* @author Maximilian Käfer
|
||||
* @since Envoy Server Standalone v0.1-beta
|
||||
*/
|
||||
public class GroupMessageProcessor implements ObjectProcessor<GroupMessage> {
|
||||
public final class GroupMessageProcessor implements ObjectProcessor<GroupMessage> {
|
||||
|
||||
private static final ConnectionManager connectionManager = ConnectionManager.getInstance();
|
||||
private static final PersistenceManager persistenceManager = PersistenceManager.getInstance();
|
||||
|
@ -24,7 +24,7 @@ import envoy.util.EnvoyLog;
|
||||
* @author Maximilian Käfer
|
||||
* @since Envoy Server Standalone v0.1-beta
|
||||
*/
|
||||
public class GroupMessageStatusChangeProcessor implements ObjectProcessor<GroupMessageStatusChange> {
|
||||
public final class GroupMessageStatusChangeProcessor implements ObjectProcessor<GroupMessageStatusChange> {
|
||||
|
||||
private static final ConnectionManager connectionManager = ConnectionManager.getInstance();
|
||||
private static final PersistenceManager persistenceManager = PersistenceManager.getInstance();
|
||||
|
@ -14,7 +14,7 @@ import envoy.server.net.ObjectWriteProxy;
|
||||
* @author Maximilian Käfer
|
||||
* @since Envoy Server Standalone v0.1-beta
|
||||
*/
|
||||
public class GroupResizeProcessor implements ObjectProcessor<GroupResize> {
|
||||
public final class GroupResizeProcessor implements ObjectProcessor<GroupResize> {
|
||||
|
||||
private static final PersistenceManager persistenceManager = PersistenceManager.getInstance();
|
||||
private static final ConnectionManager connectionManager = ConnectionManager.getInstance();
|
||||
|
@ -17,7 +17,7 @@ import envoy.server.net.ObjectWriteProxy;
|
||||
* @author Maximilian Käfer
|
||||
* @since Envoy Server Standalone v0.1-alpha
|
||||
*/
|
||||
public class IDGeneratorRequestProcessor implements ObjectProcessor<IDGeneratorRequest> {
|
||||
public final class IDGeneratorRequestProcessor implements ObjectProcessor<IDGeneratorRequest> {
|
||||
|
||||
private static final long ID_RANGE = 200;
|
||||
|
||||
|
@ -18,7 +18,7 @@ import envoy.server.net.ObjectWriteProxy;
|
||||
* @author Leon Hofmeister
|
||||
* @since Envoy Server v0.2-beta
|
||||
*/
|
||||
public class IsTypingProcessor implements ObjectProcessor<IsTyping> {
|
||||
public final class IsTypingProcessor implements ObjectProcessor<IsTyping> {
|
||||
|
||||
private static final ConnectionManager connectionManager = ConnectionManager.getInstance();
|
||||
private static final PersistenceManager persistenceManager = PersistenceManager.getInstance();
|
||||
|
@ -23,7 +23,7 @@ import envoy.util.EnvoyLog;
|
||||
* @author Leon Hofmeister
|
||||
* @since Envoy Server v0.2-beta
|
||||
*/
|
||||
public class IssueProposalProcessor implements ObjectProcessor<IssueProposal> {
|
||||
public final class IssueProposalProcessor implements ObjectProcessor<IssueProposal> {
|
||||
|
||||
private static final Logger logger = EnvoyLog.getLogger(IssueProposalProcessor.class);
|
||||
|
||||
|
@ -23,7 +23,7 @@ import envoy.util.EnvoyLog;
|
||||
* @author Maximilian Käfer
|
||||
* @since Envoy Server Standalone v0.1-alpha
|
||||
*/
|
||||
public class MessageProcessor implements ObjectProcessor<Message> {
|
||||
public final class MessageProcessor implements ObjectProcessor<Message> {
|
||||
|
||||
private static final PersistenceManager persistenceManager = PersistenceManager.getInstance();
|
||||
private static final ConnectionManager connectionManager = ConnectionManager.getInstance();
|
||||
|
@ -19,7 +19,7 @@ import envoy.util.EnvoyLog;
|
||||
* @author Leon Hofmeister
|
||||
* @since Envoy Server Standalone v0.1-alpha
|
||||
*/
|
||||
public class MessageStatusChangeProcessor implements ObjectProcessor<MessageStatusChange> {
|
||||
public final class MessageStatusChangeProcessor implements ObjectProcessor<MessageStatusChange> {
|
||||
|
||||
private final ConnectionManager connectionManager = ConnectionManager.getInstance();
|
||||
private final PersistenceManager persistenceManager = PersistenceManager.getInstance();
|
||||
|
@ -15,7 +15,7 @@ import envoy.server.net.ObjectWriteProxy;
|
||||
* @author Leon Hofmeister
|
||||
* @since Envoy Server Standalone v0.1-beta
|
||||
*/
|
||||
public class NameChangeProcessor implements ObjectProcessor<NameChange> {
|
||||
public final class NameChangeProcessor implements ObjectProcessor<NameChange> {
|
||||
|
||||
private static final PersistenceManager persistenceManager = PersistenceManager.getInstance();
|
||||
|
||||
|
@ -18,7 +18,7 @@ import envoy.util.EnvoyLog;
|
||||
* @author Leon Hofmeister
|
||||
* @since Envoy Server v0.2-beta
|
||||
*/
|
||||
public class PasswordChangeRequestProcessor implements ObjectProcessor<PasswordChangeRequest> {
|
||||
public final class PasswordChangeRequestProcessor implements ObjectProcessor<PasswordChangeRequest> {
|
||||
|
||||
@Override
|
||||
public void process(PasswordChangeRequest event, long socketID, ObjectWriteProxy writeProxy) throws IOException {
|
||||
|
@ -13,7 +13,7 @@ import envoy.server.net.ObjectWriteProxy;
|
||||
* @author Leon Hofmeister
|
||||
* @since Envoy Server v0.2-beta
|
||||
*/
|
||||
public class ProfilePicChangeProcessor implements ObjectProcessor<ProfilePicChange> {
|
||||
public final class ProfilePicChangeProcessor implements ObjectProcessor<ProfilePicChange> {
|
||||
|
||||
@Override
|
||||
public void process(ProfilePicChange event, long socketID, ObjectWriteProxy writeProxy) throws IOException {}
|
||||
|
@ -20,7 +20,7 @@ import envoy.server.net.ObjectWriteProxy;
|
||||
* @author Maximilian Käfer
|
||||
* @since Envoy Server Standalone v0.1-alpha
|
||||
*/
|
||||
public class UserSearchProcessor implements ObjectProcessor<UserSearchRequest> {
|
||||
public final class UserSearchProcessor implements ObjectProcessor<UserSearchRequest> {
|
||||
|
||||
/**
|
||||
* Writes a list of contacts to the client containing all {@link Contact}s
|
||||
|
@ -19,7 +19,7 @@ import envoy.util.EnvoyLog;
|
||||
* @author Leon Hofmeister
|
||||
* @since Envoy Server Standalone v0.1-alpha
|
||||
*/
|
||||
public class UserStatusChangeProcessor implements ObjectProcessor<UserStatusChange> {
|
||||
public final class UserStatusChangeProcessor implements ObjectProcessor<UserStatusChange> {
|
||||
|
||||
private static ObjectWriteProxy writeProxy;
|
||||
|
||||
|
@ -19,7 +19,7 @@ import javax.crypto.spec.PBEKeySpec;
|
||||
* @author Kai S. K. Engelbart
|
||||
* @since Envoy Server Standalone v0.1-beta
|
||||
*/
|
||||
public class PasswordUtil {
|
||||
public final class PasswordUtil {
|
||||
|
||||
private static final int ITERATIONS = 1000;
|
||||
private static final int KEY_LENGTH = 64 * 8;
|
||||
|
@ -13,7 +13,7 @@ import java.util.regex.Pattern;
|
||||
* @author Kai S. K. Engelbart
|
||||
* @since Envoy Server Standalone v0.1-beta
|
||||
*/
|
||||
public class VersionUtil {
|
||||
public final class VersionUtil {
|
||||
|
||||
/**
|
||||
* The minimal client version compatible with this server.
|
||||
|
Reference in New Issue
Block a user