*/
public static ContextClusteringCommand getUpdateCommand(AbstractContext context,
Map excludedPropertyPatterns,
boolean includeAllProperties) {
UpdateContextCommand cmd = null;
if (context instanceof ConfigurationContext) {
cmd = new UpdateConfigurationContextCommand();
} else if (context instanceof ServiceGroupContext) {
ServiceGroupContext sgCtx = (ServiceGroupContext) context;
cmd = new UpdateServiceGroupContextCommand();
UpdateServiceGroupContextCommand updateSgCmd = (UpdateServiceGroupContextCommand) cmd;
updateSgCmd.setServiceGroupName(sgCtx.getDescription().getServiceGroupName());
updateSgCmd.setServiceGroupContextId(sgCtx.getId());
} else if (context instanceof ServiceContext) {
ServiceContext serviceCtx = (ServiceContext) context;
cmd = new UpdateServiceContextCommand();
UpdateServiceContextCommand updateServiceCmd = (UpdateServiceContextCommand) cmd;
String sgName =
serviceCtx.getServiceGroupContext().getDescription().getServiceGroupName();
updateServiceCmd.setServiceGroupName(sgName);
updateServiceCmd.setServiceGroupContextId(serviceCtx.getServiceGroupContext().getId());
updateServiceCmd.setServiceName(serviceCtx.getAxisService().getName());
}
if (cmd != null) {
cmd.setUniqueId(UUIDGenerator.getUUID());
fillProperties(cmd,
context,
excludedPropertyPatterns,
includeAllProperties);
if (cmd.isPropertiesEmpty()) {
cmd = null;
} else {
AckManager.addInitialAcknowledgement(cmd);
}
}