use of org.apache.qpid.server.logging.LogMessage in project qpid-broker-j by apache.
the class HighAvailabilityMessages method PRIORITY_CHANGED.
/**
* Log a HighAvailability message of the Format:
* <pre>HA-1012 : Priority : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage PRIORITY_CHANGED(String param1) {
String rawMessage = _messages.getString("PRIORITY_CHANGED");
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 PRIORITY_CHANGED_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 ManagementConsoleMessages method CLOSE.
/**
* Log a ManagementConsole message of the Format:
* <pre>MNG-1008 : Close : User {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage CLOSE(String param1) {
String rawMessage = _messages.getString("CLOSE");
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 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 ManagementConsoleMessages method OPEN.
/**
* Log a ManagementConsole message of the Format:
* <pre>MNG-1007 : Open : User {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage OPEN(String param1) {
String rawMessage = _messages.getString("OPEN");
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 OPEN_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 ManagementConsoleMessages method SHUTTING_DOWN.
/**
* Log a ManagementConsole message of the Format:
* <pre>MNG-1003 : Shutting down : {0} : port {1,number,#}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage SHUTTING_DOWN(String param1, Number param2) {
String rawMessage = _messages.getString("SHUTTING_DOWN");
final Object[] messageArguments = { param1, param2 };
// 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 SHUTTING_DOWN_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 ManagementConsoleMessages method STARTUP.
/**
* Log a ManagementConsole message of the Format:
* <pre>MNG-1001 : {0} Management Startup</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage STARTUP(String param1) {
String rawMessage = _messages.getString("STARTUP");
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 STARTUP_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