use of org.apache.qpid.server.logging.LogMessage in project qpid-broker-j by apache.
the class PortMessages method CLOSE.
/**
* Log a Port message of the Format:
* <pre>PRT-1003 : Close</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage CLOSE() {
String rawMessage = _messages.getString("CLOSE");
final String message = rawMessage;
return new LogMessage() {
@Override
public String toString() {
return message;
}
@Override
public String getLogHierarchy() {
return CLOSE_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode() {
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
use of org.apache.qpid.server.logging.LogMessage in project qpid-broker-j by apache.
the class QueueMessages method DROPPED.
/**
* Log a Queue message of the Format:
* <pre>QUE-1005 : Dropped : {0,number} messages, Depth : {1,number} bytes, {2,number} messages, Capacity : {3,number} bytes, {4,number} messages</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage DROPPED(Number param1, Number param2, Number param3, Number param4, Number param5) {
String rawMessage = _messages.getString("DROPPED");
final Object[] messageArguments = { param1, param2, param3, param4, param5 };
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage() {
@Override
public String toString() {
return message;
}
@Override
public String getLogHierarchy() {
return DROPPED_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode() {
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
use of org.apache.qpid.server.logging.LogMessage in project qpid-broker-j by apache.
the class QueueMessages method DELETED.
/**
* Log a Queue message of the Format:
* <pre>QUE-1002 : Deleted : ID: {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage DELETED(String param1) {
String rawMessage = _messages.getString("DELETED");
final Object[] messageArguments = { param1 };
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage() {
@Override
public String toString() {
return message;
}
@Override
public String getLogHierarchy() {
return DELETED_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode() {
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
use of org.apache.qpid.server.logging.LogMessage in project qpid-broker-j by apache.
the class QueueMessages method UNDERFULL.
/**
* Log a Queue message of the Format:
* <pre>QUE-1004 : Underfull : Size : {0,number} bytes, Resume Capacity : {1,number}, Messages : {2,number}, Message Capacity : {3,number}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage UNDERFULL(Number param1, Number param2, Number param3, Number param4) {
String rawMessage = _messages.getString("UNDERFULL");
final Object[] messageArguments = { param1, param2, param3, param4 };
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage() {
@Override
public String toString() {
return message;
}
@Override
public String getLogHierarchy() {
return UNDERFULL_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode() {
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
use of org.apache.qpid.server.logging.LogMessage in project qpid-broker-j by apache.
the class QueueMessages method OVERFULL.
/**
* Log a Queue message of the Format:
* <pre>QUE-1003 : Overfull : Size : {0,number} bytes, Capacity : {1,number}, Messages : {2,number}, Message Capacity : {3,number}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage OVERFULL(Number param1, Number param2, Number param3, Number param4) {
String rawMessage = _messages.getString("OVERFULL");
final Object[] messageArguments = { param1, param2, param3, param4 };
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage() {
@Override
public String toString() {
return message;
}
@Override
public String getLogHierarchy() {
return OVERFULL_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode() {
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
Aggregations