
pl.bristleback.server.bristle.actions.RemoteActionInformation Maven / Gradle / Ivy
// Bristleback plugin - Copyright (c) 2010 bristleback.googlecode.com
// ---------------------------------------------------------------------------
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by the
// Free Software Foundation; either version 3 of the License, or (at your
// option) any later version.
// This library is distributed in the hope that it will be useful,
// but without any warranty; without even the implied warranty of merchantability
// or fitness for a particular purpose.
// You should have received a copy of the GNU Lesser General Public License along
// with this program; if not, see .
// ---------------------------------------------------------------------------
package pl.bristleback.server.bristle.actions;
import org.apache.log4j.Logger;
import org.jwebsocket.api.WebSocketConnector;
import pl.bristleback.server.bristle.exceptions.BristleRuntimeException;
import pl.bristleback.server.bristle.exceptions.handlers.MissingRightsErrorHandler;
import java.util.Set;
/**
* This class encapsulates all information about action class.
*
* Created on: 2010-09-03 16:03:49
*
* @author Wojciech Niemiec
*/
public final class RemoteActionInformation {
private static Logger log = Logger.getLogger(RemoteActionInformation.class.getName());
private String actionName;
private Set requiredRights;
private RemoteAction action;
private boolean actionHandlingErrors;
public void handleMissingRightsError(WebSocketConnector connector) {
if (!actionHandlingErrors) {
throw new BristleRuntimeException("Action with name " + actionName + " cannot handle missing rights error");
}
((MissingRightsErrorHandler) action).handleMissingRightsError(requiredRights, connector);
}
public String getActionName() {
return actionName;
}
public RemoteAction getAction() {
return action;
}
public Set getRequiredRights() {
return requiredRights;
}
public void setActionName(String actionName) {
this.actionName = actionName;
}
public void setRequiredRights(Set requiredRights) {
this.requiredRights = requiredRights;
}
public void setAction(RemoteAction action) {
this.action = action;
}
public boolean isActionHandlingErrors() {
return actionHandlingErrors;
}
public void setActionHandlingErrors(boolean actionHandlingErrors) {
this.actionHandlingErrors = actionHandlingErrors;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy