Package de.calamanari.pk.util

  • Class Summary
    Class Description
    AbstractConsoleServer
    This abstract class can be sub-classed to easily create simple servers running on the console.
    Several TEMPLATE METHODs allow to define the concrete logic and to control the behavior in subclasses.
    AbstractThreadedSocketServer
    Abstract Threaded Socket server
    This is a threaded socket server, it can accept and process an arbitrary number of connections concurrently.
    A subclass only has to implement the concrete communication operations, the other stuff is handled by logic in the super classes (TEMPLATE METHOD pattern).
    AtomicFixedLengthBitVector
    AtomicFixedLengthBitVector is a fixed-size bit-vector implementation for concurrent access.
    AtomicFixedLengthBitVectorTest
    Test coverage for the bit vector
    BoxingUtils
    Convenient auto-boxing support, i.e. for arrays.
    BoxingUtilsTest  
    CharsetUtils
    This utility class provides support to work with characters of different character sets especially related to the encoded byte-length of their characters.
    CloneUtils
    Methods for cloning objects to ensure independent copies.
    CloseUtils
    Methods to simplify closing (chains of) resources and to make code less verbose.
    ExternalConsoleHandlerThread
    This thread observes an input stream from an external console and passes the data line by line to a given logger.
    ExternalProcessManager
    This class (singleton) helps to start and stop external java program instances.
    FileUtils
    Utilities methods for dealing with files
    IndexedTextFileAccessorTest
    IndexedTextFileAccessorTest - some tests for IndexedTextFileAccessor class
    JavaWrapperTypeTest  
    LambdaSupportLoggerProxy
    LambdaSupportLoggerProxy is a PROXY to easier support lambda expressions as arguments to the SLF4J-Logger's logging methods.
    LambdaSupportLoggerProxyTest  
    LogUtils
    Some utility methods related to java logging.
    OrbOfConfusion
    This class implements the "Orb Of Confusion" algorithm which performs a shuffled partition index transformation on an arbitrary range of positive numbers.
    Objective: Map bijectively any number of a given range to another number of the same range where the mappings are not easy to be guessed.
    ParallelFileInputStreamTest
    Parallel File Input Stream Test - tests for ParallelFileInputStream
    SimpleAccessManager
    Simple Access Manager is a trivial supplementary class simulating a kind of security system.
    Important:
    You should NEVER EVER implement your own security system, there are APIs for that which have been audited well.
    However in the current example there is a central flaw.
    Anyone getting a reference to the permissionsMap (via reflection) using setAccessible(true) can do just everything.
    SimpleScrambleCodec
    SimpleScrambleCodec scrambles/unscrambles text in a trivial way for demo purposes in several scenarios.
    TimeUtils
    Utility class to support some time computation.
  • Enum Summary
    Enum Description
    AbstractConsoleServer.ServerState
    States for a server's state machine
    Why so many states?
    JavaWrapperType
    This enum contains the known java primitives and their wrapper types as an easy lookup.
  • Exception Summary
    Exception Description
    ExternalProcessManagementException
    Exception to be thrown if the ExternalProcessManager detected problems handling the child process.
    FileAccessException
    Unchecked exception for wrapping Exceptions or indicating unexpected runtime issues when dealing with files.
    SimpleAccessException
    Indicates an access denial by the SimpleAccessManager
    SocketCommunicationException
    An IO-Exception to be thrown in case of socket communication issues that could not be handled otherwise.
    SocketPreparationException
    A Runtime Exception to be thrown if the socket preparation went wrong
    UnexpectedInterruptedException
    Unchecked exception to indicate to the caller that an operation was interrupted unexpectedly.