varId = statusVariable.substring(sep + 1, prefixVarId ? len - 1 : len); checkId(monId, "Monitorable ID part of the target"); checkId(varId, "Status Variable ID part of the target"); String action = st.nextToken().trim(); if (action.equalsIgnoreCase(READ)) { addToMask(READ_FLAG, READ); } else if (action.equalsIgnoreCase(RESET)) { addToMask(RESET_FLAG, RESET); } else if (action.equalsIgnoreCase(PUBLISH)) { addToMask(PUBLISH_FLAG, PUBLISH); } else if (action.equalsIgnoreCase(SWITCHEVENTS)) { addToMask(SWITCHEVENTS_FLAG, SWITCHEVENTS); } else if (action.toLowerCase().startsWith(STARTJOB)) { addToMask(STARTJOB_FLAG, STARTJOB); } else throw new IllegalArgumentException("Invalid action '" + action + "'");
/** * Get the action string associated with this permission. The actions are * returned in the following order: {@code read}, {@code reset}, * {@code publish}, {@code startjob}, {@code switchevents}. * * @return the allowed actions separated by commas, cannot be {@code null} */ public String getActions() { StringBuffer sb = new StringBuffer(); appendAction(sb, READ_FLAG, READ); appendAction(sb, RESET_FLAG, RESET); appendAction(sb, PUBLISH_FLAG, PUBLISH); appendAction(sb, STARTJOB_FLAG, STARTJOB); appendAction(sb, SWITCHEVENTS_FLAG, SWITCHEVENTS); return sb.toString(); }
/** * Determines if the specified permission is implied by this permission. * <p> * This method returns {@code false} if and only if at least one of the * following conditions are fulfilled for the specified permission: * <ul> * <li>it is not a {@code MonitorPermission}</li> * <li>it has a broader set of actions allowed than this one</li> * <li>it allows initiating time based monitoring jobs with a lower minimal * sampling interval</li> * <li>the target set of {@code Monitorable}s is not the same nor a subset * of the target set of {@code Monitorable}s of this permission</li> * <li>the target set of {@code StatusVariable}s is not the same nor a * subset of the target set of {@code StatusVariable}s of this permission</li> * </ul> * * @param p the permission to be checked * @return {@code true} if the given permission is implied by this * permission */ public boolean implies(Permission p) { if (!(p instanceof MonitorPermission)) return false; MonitorPermission other = (MonitorPermission) p; if ((mask & other.mask) != other.mask) return false; if ((other.mask & STARTJOB_FLAG) != 0 && minJobInterval > other.minJobInterval) return false; return implies(monId, prefixMonId, other.monId, other.prefixMonId) && implies(varId, prefixVarId, other.varId, other.prefixVarId); }
varId = statusVariable.substring(sep + 1, prefixVarId ? len - 1 : len); checkId(monId, "Monitorable ID part of the target"); checkId(varId, "Status Variable ID part of the target"); String action = st.nextToken().trim(); if (action.equalsIgnoreCase(READ)) { addToMask(READ_FLAG, READ); } else if (action.equalsIgnoreCase(RESET)) { addToMask(RESET_FLAG, RESET); } else if (action.equalsIgnoreCase(PUBLISH)) { addToMask(PUBLISH_FLAG, PUBLISH); } else if (action.equalsIgnoreCase(SWITCHEVENTS)) { addToMask(SWITCHEVENTS_FLAG, SWITCHEVENTS); } else if (action.toLowerCase().startsWith(STARTJOB)) { minJobInterval = 0; addToMask(STARTJOB_FLAG, STARTJOB); } else throw new IllegalArgumentException("Invalid action '" +
/** * Get the action string associated with this permission. The actions are * returned in the following order: <code>read</code>, <code>reset</code>, * <code>publish</code>, <code>startjob</code>, <code>switchevents</code>. * * @return the allowed actions separated by commas, cannot be * <code>null</code> */ public String getActions() { StringBuffer sb = new StringBuffer(); appendAction(sb, READ_FLAG, READ); appendAction(sb, RESET_FLAG, RESET); appendAction(sb, PUBLISH_FLAG, PUBLISH); appendAction(sb, STARTJOB_FLAG, STARTJOB); appendAction(sb, SWITCHEVENTS_FLAG, SWITCHEVENTS); return sb.toString(); }
varId = statusVariable.substring(sep + 1, prefixVarId ? len - 1 : len); checkId(monId, "Monitorable ID part of the target"); checkId(varId, "Status Variable ID part of the target"); String action = st.nextToken().trim(); if (action.equalsIgnoreCase(READ)) { addToMask(READ_FLAG, READ); } else if (action.equalsIgnoreCase(RESET)) { addToMask(RESET_FLAG, RESET); } else if (action.equalsIgnoreCase(PUBLISH)) { addToMask(PUBLISH_FLAG, PUBLISH); } else if (action.equalsIgnoreCase(SWITCHEVENTS)) { addToMask(SWITCHEVENTS_FLAG, SWITCHEVENTS); } else if (action.toLowerCase().startsWith(STARTJOB)) { addToMask(STARTJOB_FLAG, STARTJOB); } else throw new IllegalArgumentException("Invalid action '" + action + "'");
/** * Get the action string associated with this permission. The actions are * returned in the following order: {@code read}, {@code reset}, * {@code publish}, {@code startjob}, {@code switchevents}. * * @return the allowed actions separated by commas, cannot be {@code null} */ public String getActions() { StringBuffer sb = new StringBuffer(); appendAction(sb, READ_FLAG, READ); appendAction(sb, RESET_FLAG, RESET); appendAction(sb, PUBLISH_FLAG, PUBLISH); appendAction(sb, STARTJOB_FLAG, STARTJOB); appendAction(sb, SWITCHEVENTS_FLAG, SWITCHEVENTS); return sb.toString(); }
varId = statusVariable.substring(sep + 1, prefixVarId ? len - 1 : len); checkId(monId, "Monitorable ID part of the target"); checkId(varId, "Status Variable ID part of the target"); String action = st.nextToken().trim(); if (action.equalsIgnoreCase(READ)) { addToMask(READ_FLAG, READ); } else if (action.equalsIgnoreCase(RESET)) { addToMask(RESET_FLAG, RESET); } else if (action.equalsIgnoreCase(PUBLISH)) { addToMask(PUBLISH_FLAG, PUBLISH); } else if (action.equalsIgnoreCase(SWITCHEVENTS)) { addToMask(SWITCHEVENTS_FLAG, SWITCHEVENTS); } else if (action.toLowerCase().startsWith(STARTJOB)) { addToMask(STARTJOB_FLAG, STARTJOB); } else throw new IllegalArgumentException("Invalid action '" + action + "'");
/** * Get the action string associated with this permission. The actions are * returned in the following order: {@code read}, {@code reset}, * {@code publish}, {@code startjob}, {@code switchevents}. * * @return the allowed actions separated by commas, cannot be {@code null} */ @Override public String getActions() { StringBuilder sb = new StringBuilder(); appendAction(sb, READ_FLAG, READ); appendAction(sb, RESET_FLAG, RESET); appendAction(sb, PUBLISH_FLAG, PUBLISH); appendAction(sb, STARTJOB_FLAG, STARTJOB); appendAction(sb, SWITCHEVENTS_FLAG, SWITCHEVENTS); return sb.toString(); }
/** * Determines if the specified permission is implied by this permission. * <p> * This method returns {@code false} if and only if at least one of the * following conditions are fulfilled for the specified permission: * <ul> * <li>it is not a {@code MonitorPermission}</li> * <li>it has a broader set of actions allowed than this one</li> * <li>it allows initiating time based monitoring jobs with a lower minimal * sampling interval</li> * <li>the target set of {@code Monitorable}s is not the same nor a subset * of the target set of {@code Monitorable}s of this permission</li> * <li>the target set of {@code StatusVariable}s is not the same nor a * subset of the target set of {@code StatusVariable}s of this permission</li> * </ul> * * @param p the permission to be checked * @return {@code true} if the given permission is implied by this * permission */ public boolean implies(Permission p) { if (!(p instanceof MonitorPermission)) return false; MonitorPermission other = (MonitorPermission) p; if ((mask & other.mask) != other.mask) return false; if ((other.mask & STARTJOB_FLAG) != 0 && minJobInterval > other.minJobInterval) return false; return implies(monId, prefixMonId, other.monId, other.prefixMonId) && implies(varId, prefixVarId, other.varId, other.prefixVarId); }
varId = statusVariable.substring(sep + 1, prefixVarId ? len - 1 : len); checkId(monId, "Monitorable ID part of the target"); checkId(varId, "Status Variable ID part of the target"); String action = st.nextToken().trim(); if (action.equalsIgnoreCase(READ)) { addToMask(READ_FLAG, READ); } else if (action.equalsIgnoreCase(RESET)) { addToMask(RESET_FLAG, RESET); } else if (action.equalsIgnoreCase(PUBLISH)) { addToMask(PUBLISH_FLAG, PUBLISH); } else if (action.equalsIgnoreCase(SWITCHEVENTS)) { addToMask(SWITCHEVENTS_FLAG, SWITCHEVENTS); } else if (action.toLowerCase().startsWith(STARTJOB)) { addToMask(STARTJOB_FLAG, STARTJOB); } else throw new IllegalArgumentException("Invalid action '" + action + "'");
/** * Get the action string associated with this permission. The actions are * returned in the following order: {@code read}, {@code reset}, * {@code publish}, {@code startjob}, {@code switchevents}. * * @return the allowed actions separated by commas, cannot be {@code null} */ public String getActions() { StringBuffer sb = new StringBuffer(); appendAction(sb, READ_FLAG, READ); appendAction(sb, RESET_FLAG, RESET); appendAction(sb, PUBLISH_FLAG, PUBLISH); appendAction(sb, STARTJOB_FLAG, STARTJOB); appendAction(sb, SWITCHEVENTS_FLAG, SWITCHEVENTS); return sb.toString(); }
/** * Determines if the specified permission is implied by this permission. * <p> * This method returns {@code false} if and only if at least one of the * following conditions are fulfilled for the specified permission: * <ul> * <li>it is not a {@code MonitorPermission}</li> * <li>it has a broader set of actions allowed than this one</li> * <li>it allows initiating time based monitoring jobs with a lower minimal * sampling interval</li> * <li>the target set of {@code Monitorable}s is not the same nor a subset * of the target set of {@code Monitorable}s of this permission</li> * <li>the target set of {@code StatusVariable}s is not the same nor a * subset of the target set of {@code StatusVariable}s of this permission</li> * </ul> * * @param p the permission to be checked * @return {@code true} if the given permission is implied by this * permission */ public boolean implies(Permission p) { if (!(p instanceof MonitorPermission)) return false; MonitorPermission other = (MonitorPermission) p; if ((mask & other.mask) != other.mask) return false; if ((other.mask & STARTJOB_FLAG) != 0 && minJobInterval > other.minJobInterval) return false; return implies(monId, prefixMonId, other.monId, other.prefixMonId) && implies(varId, prefixVarId, other.varId, other.prefixVarId); }
varId = statusVariable.substring(sep + 1, prefixVarId ? len - 1 : len); checkId(monId, "Monitorable ID part of the target"); checkId(varId, "Status Variable ID part of the target"); String action = st.nextToken().trim(); if (action.equalsIgnoreCase(READ)) { addToMask(READ_FLAG, READ); } else if (action.equalsIgnoreCase(RESET)) { addToMask(RESET_FLAG, RESET); } else if (action.equalsIgnoreCase(PUBLISH)) { addToMask(PUBLISH_FLAG, PUBLISH); } else if (action.equalsIgnoreCase(SWITCHEVENTS)) { addToMask(SWITCHEVENTS_FLAG, SWITCHEVENTS); } else if (action.toLowerCase().startsWith(STARTJOB)) { minJobInterval = 0; addToMask(STARTJOB_FLAG, STARTJOB); } else throw new IllegalArgumentException("Invalid action '" +
/** * Get the action string associated with this permission. The actions are * returned in the following order: {@code read}, {@code reset}, * {@code publish}, {@code startjob}, {@code switchevents}. * * @return the allowed actions separated by commas, cannot be * {@code null} */ public String getActions() { StringBuffer sb = new StringBuffer(); appendAction(sb, READ_FLAG, READ); appendAction(sb, RESET_FLAG, RESET); appendAction(sb, PUBLISH_FLAG, PUBLISH); appendAction(sb, STARTJOB_FLAG, STARTJOB); appendAction(sb, SWITCHEVENTS_FLAG, SWITCHEVENTS); return sb.toString(); }
varId = statusVariable.substring(sep + 1, prefixVarId ? len - 1 : len); checkId(monId, "Monitorable ID part of the target"); checkId(varId, "Status Variable ID part of the target"); String action = st.nextToken().trim(); if (action.equalsIgnoreCase(READ)) { addToMask(READ_FLAG, READ); } else if (action.equalsIgnoreCase(RESET)) { addToMask(RESET_FLAG, RESET); } else if (action.equalsIgnoreCase(PUBLISH)) { addToMask(PUBLISH_FLAG, PUBLISH); } else if (action.equalsIgnoreCase(SWITCHEVENTS)) { addToMask(SWITCHEVENTS_FLAG, SWITCHEVENTS); } else if (action.toLowerCase().startsWith(STARTJOB)) { minJobInterval = 0; addToMask(STARTJOB_FLAG, STARTJOB); } else throw new IllegalArgumentException("Invalid action '" +
/** * Get the action string associated with this permission. The actions are * returned in the following order: {@code read}, {@code reset}, * {@code publish}, {@code startjob}, {@code switchevents}. * * @return the allowed actions separated by commas, cannot be * {@code null} */ public String getActions() { StringBuffer sb = new StringBuffer(); appendAction(sb, READ_FLAG, READ); appendAction(sb, RESET_FLAG, RESET); appendAction(sb, PUBLISH_FLAG, PUBLISH); appendAction(sb, STARTJOB_FLAG, STARTJOB); appendAction(sb, SWITCHEVENTS_FLAG, SWITCHEVENTS); return sb.toString(); }