Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.8.2 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire.net
Class ServerTrafficCounter

    java.lang.Object
      org.jivesoftware.openfire.net.ServerTrafficCounter

    public class ServerTrafficCounter

extends Object

A ServerTrafficCounter counts the number of bytes read and written by the server. This includes client-server, server-server, external components and connection managers traffic. Note that traffic is monitored only for entities that are directly connected to the server. However, traffic generated by file transfers is not considered unless files were sent using the in-band method.

Author:
  Gaston Dombiak

Constructor Summary
`ServerTrafficCounter()`

Method Summary
`static void` | `incrementIncomingCounter(long delta)` Increments the counter of read bytes by delta.
`static void` | `incrementOutgoingCounter(long delta)` Increments the counter of written bytes by delta.
`static void` | `initStatistics()` Creates and adds statistics to statistic manager.
`static InputStream` | `wrapInputStream(InputStream originalStream)` Wraps the specified input stream to count the number of bytes that were read.
`static OutputStream` | `wrapOutputStream(OutputStream originalStream)` Wraps the specified output stream to count the number of bytes that were written.
`static ReadableByteChannel` | `wrapReadableChannel(ReadableByteChannel originalChannel)` Wraps the specified readable channel to count the number of bytes that were read.
`static WritableByteChannel` | `wrapWritableChannel(WritableByteChannel originalChannel)` Wraps the specified writable channel to count the number of bytes that were written.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ServerTrafficCounter

    public ServerTrafficCounter()

Method Detail

### initStatistics

    public static void initStatistics()

  Creates and adds statistics to statistic manager.

### wrapInputStream

    public static InputStream wrapInputStream(InputStream originalStream)

  Wraps the specified input stream to count the number of bytes that were read.

  Parameters:
    `originalStream` - the input stream to wrap.
  Returns:
    The wrapped input stream over the original stream.

### wrapOutputStream

    public static OutputStream wrapOutputStream(OutputStream originalStream)

  Wraps the specified output stream to count the number of bytes that were written.

  Parameters:
    `originalStream` - the output stream to wrap.
  Returns:
    The wrapped output stream over the original stream.

### wrapReadableChannel

    public static ReadableByteChannel wrapReadableChannel(ReadableByteChannel originalChannel)

  Wraps the specified readable channel to count the number of bytes that were read.

  Parameters:
    `originalChannel` - the readable byte channel to wrap.
  Returns:
    The wrapped readable channel over the original readable channel .

### wrapWritableChannel

    public static WritableByteChannel wrapWritableChannel(WritableByteChannel originalChannel)

  Wraps the specified writable channel to count the number of bytes that were written.

  Parameters:
    `originalChannel` - the writable byte channel to wrap.
  Returns:
    The wrapped writable channel over the original writable channel .

### incrementIncomingCounter

    public static void incrementIncomingCounter(long delta)

  Increments the counter of read bytes by delta.

  Parameters:
    `delta` - the delta of bytes that were read.

### incrementOutgoingCounter

    public static void incrementOutgoingCounter(long delta)

  Increments the counter of written bytes by delta.

  Parameters:
    `delta` - the delta of bytes that were written.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.8.2 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Jive Software.