use of org.apache.qpid.server.logging.LogMessage in project qpid-broker-j by apache.
the class ChannelMessages method FLOW_ENFORCED.
/**
* Log a Channel message of the Format:
* <pre>CHN-1005 : Flow Control Enforced (Queue {0})</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage FLOW_ENFORCED(String param1) {
String rawMessage = _messages.getString("FLOW_ENFORCED");
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 FLOW_ENFORCED_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 ChannelMessages method FLOW_CONTROL_IGNORED.
/**
* Log a Channel message of the Format:
* <pre>CHN-1012 : Flow Control Ignored. Channel will be closed.</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage FLOW_CONTROL_IGNORED() {
String rawMessage = _messages.getString("FLOW_CONTROL_IGNORED");
final String message = rawMessage;
return new LogMessage() {
@Override
public String toString() {
return message;
}
@Override
public String getLogHierarchy() {
return FLOW_CONTROL_IGNORED_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 ChannelMessages method FLOW_REMOVED.
/**
* Log a Channel message of the Format:
* <pre>CHN-1006 : Flow Control Removed</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage FLOW_REMOVED() {
String rawMessage = _messages.getString("FLOW_REMOVED");
final String message = rawMessage;
return new LogMessage() {
@Override
public String toString() {
return message;
}
@Override
public String getLogHierarchy() {
return FLOW_REMOVED_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 ConfigStoreMessages method CLOSE.
/**
* Log a ConfigStore message of the Format:
* <pre>CFG-1003 : Closed</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 ConnectionMessages method OPEN.
/**
* Log a Connection message of the Format:
* <pre>CON-1001 : Open : Destination : {0}({1}) : Protocol Version : {2}[ : SSL][ : Client ID : {3}][ : Client Version : {4}][ : Client Product : {5}]</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage OPEN(String param1, String param2, String param3, String param4, String param5, String param6, boolean opt1, boolean opt2, boolean opt3, boolean opt4) {
String rawMessage = _messages.getString("OPEN");
StringBuffer msg = new StringBuffer();
// Split the formatted message up on the option values so we can
// rebuild the message based on the configured options.
String[] parts = rawMessage.split("\\[");
msg.append(parts[0]);
int end;
if (parts.length > 1) {
// Add Option : : SSL.
end = parts[1].indexOf(']');
if (opt1) {
msg.append(parts[1].substring(0, end));
}
// Use 'end + 1' to remove the ']' from the output
msg.append(parts[1].substring(end + 1));
// Add Option : : Client ID : {3}.
end = parts[2].indexOf(']');
if (opt2) {
msg.append(parts[2].substring(0, end));
}
// Use 'end + 1' to remove the ']' from the output
msg.append(parts[2].substring(end + 1));
// Add Option : : Client Version : {4}.
end = parts[3].indexOf(']');
if (opt3) {
msg.append(parts[3].substring(0, end));
}
// Use 'end + 1' to remove the ']' from the output
msg.append(parts[3].substring(end + 1));
// Add Option : : Client Product : {5}.
end = parts[4].indexOf(']');
if (opt4) {
msg.append(parts[4].substring(0, end));
}
// Use 'end + 1' to remove the ']' from the output
msg.append(parts[4].substring(end + 1));
}
rawMessage = msg.toString();
final Object[] messageArguments = { param1, param2, param3, param4, param5, param6 };
// 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;
}
};
}
Aggregations