This commit is contained in:
Justin Bertram 2021-05-24 11:51:14 -05:00
commit 07221abe21
4 changed files with 73 additions and 0 deletions

View File

@ -2817,4 +2817,20 @@ public interface AuditLogger extends BasicLogger {
@LogMessage(level = Logger.Level.INFO) @LogMessage(level = Logger.Level.INFO)
@Message(id = 601745, value = "User {0} is getting delay-before-dispatch property on target resource: {1} {2}", format = Message.Format.MESSAGE_FORMAT) @Message(id = 601745, value = "User {0} is getting delay-before-dispatch property on target resource: {1} {2}", format = Message.Format.MESSAGE_FORMAT)
void delayBeforeDispatch(String user, Object source, Object... args); void delayBeforeDispatch(String user, Object source, Object... args);
static void isInternal(Object source) {
LOGGER.isInternal(getCaller(), source);
}
@LogMessage(level = Logger.Level.INFO)
@Message(id = 601746, value = "User {0} is getting internal property on target resource: {1} {2}", format = Message.Format.MESSAGE_FORMAT)
void isInternal(String user, Object source, Object... args);
static void isAutoCreated(Object source) {
LOGGER.isAutoCreated(getCaller(), source);
}
@LogMessage(level = Logger.Level.INFO)
@Message(id = 601747, value = "User {0} is getting auto-created property on target resource: {1} {2}", format = Message.Format.MESSAGE_FORMAT)
void isAutoCreated(String user, Object source, Object... args);
} }

View File

@ -185,4 +185,22 @@ public interface AddressControl {
@Attribute(desc = "clear the duplicate ID cache for this address both from memory and from the journal") @Attribute(desc = "clear the duplicate ID cache for this address both from memory and from the journal")
boolean clearDuplicateIdCache() throws Exception; boolean clearDuplicateIdCache() throws Exception;
/**
* Returns whether this address was created automatically in response to client action.
*/
@Attribute(desc = "whether this address was created automatically in response to client action")
boolean isAutoCreated();
/**
* Returns whether this address was created for the broker's internal use.
*/
@Attribute(desc = "whether this address was created for the broker's internal use")
boolean isInternal();
/**
* Returns whether this address is temporary.
*/
@Attribute(desc = "whether this address is temporary")
boolean isTemporary();
} }

View File

@ -506,6 +506,30 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
return false; return false;
} }
@Override
public boolean isAutoCreated() {
if (AuditLogger.isEnabled()) {
AuditLogger.isAutoCreated(this.addressInfo);
}
return addressInfo.isAutoCreated();
}
@Override
public boolean isInternal() {
if (AuditLogger.isEnabled()) {
AuditLogger.isInternal(this.addressInfo);
}
return addressInfo.isInternal();
}
@Override
public boolean isTemporary() {
if (AuditLogger.isEnabled()) {
AuditLogger.isTemporary(this.addressInfo);
}
return addressInfo.isTemporary();
}
// Package protected --------------------------------------------- // Package protected ---------------------------------------------
// Protected ----------------------------------------------------- // Protected -----------------------------------------------------

View File

@ -158,6 +158,21 @@ public class AddressControlUsingCoreTest extends AddressControlTest {
return (boolean) proxy.invokeOperation("clearDuplicateIdCache"); return (boolean) proxy.invokeOperation("clearDuplicateIdCache");
} }
@Override
public boolean isAutoCreated() {
return (boolean) proxy.retrieveAttributeValue("autoCreated");
}
@Override
public boolean isInternal() {
return (boolean) proxy.retrieveAttributeValue("internal");
}
@Override
public boolean isTemporary() {
return (boolean) proxy.retrieveAttributeValue("temporary");
}
@Override @Override
public String sendMessage(Map<String, String> headers, public String sendMessage(Map<String, String> headers,
int type, int type,