- if (!active) {
- try {
- sendReply(pluginReplySender, null, new ErrorResponse(400, "FCP Interface deactivated"));
- } catch (PluginNotFoundException pnfe1) {
- logger.log(Level.FINE, "Could not set error to plugin.", pnfe1);
- }
+ if (!active.get()) {
+ sendErrorReply(pluginReplySender, null, 503, "FCP Interface deactivated");
+ return;
+ }
+ AbstractSoneCommand command = commands.get(parameters.get("Message"));
+ if ((accessType == FredPluginFCP.ACCESS_FCP_RESTRICTED) && (((fullAccessRequired.get() == FullAccessRequired.WRITING) && command.requiresWriteAccess()) || (fullAccessRequired.get() == FullAccessRequired.ALWAYS))) {
+ sendErrorReply(pluginReplySender, null, 401, "Not authorized");
+ return;
+ }
+ if (command == null) {
+ sendErrorReply(pluginReplySender, null, 404, "Unrecognized Message: " + parameters.get("Message"));
+ return;
+ }
+ String identifier = parameters.get("Identifier");
+ if ((identifier == null) || (identifier.length() == 0)) {
+ sendErrorReply(pluginReplySender, null, 400, "Missing Identifier.");