checkValidity("<CPD URI>", uri);
boolean isNew = false;
chanRegStore = ChannelRegistryStoreFactory.getChannelRegistryStoreImpl();
List<IChannelType> types = chanRegStore.getChannelTypes();
IChannelType chanType = null;
for(IChannelType type : types)
{
if (type.getCpdUri().equals(uri))
chanType = type;
}
if (chanType == null) // new one being defined
{
isNew = true;
chanType = chanRegStore.newChannelType(name, clazz, uri);
}
chanType.setDescription(description);
chanRegStore.saveChannelType(chanType);
return "The \"" + name + "\" channel type has been "
+ (isNew ? "added" : "updated") + " successfully.";
}