/** * All {@link Space}-related goals need to have a tenant configured. * @throws GoalConfigurationException if no tenant is specified */ protected void checkPreconditions() throws GoalConfigurationException { if(!this.getGoalContext().hasTenant()) throw new GoalConfigurationException("No tenant configured"); }
@Override protected void createGoal() { this.goal = new UploadGoal(); } }
@Override protected void createGoal() { this.goal = new SpaceCleanGoal(); } }
protected Application getApplicationContext() { return this.getGoalContext().getApplication(); }
public final void run() { try { this.execute(); } catch (GoalConfigurationException e) { log.error("Error while configuring " + this + ": " + e.getMessage(), e); } catch (GoalExecutionException e) { log.error("Error while executing " + this + ": " + e.getMessage(), e); } }
/** * Creates a {@link AbstractGoal} for the given {@link GoalType} and (@link GoalClient}. * @param _type */ public static AbstractGoal create(@NotNull GoalType _type, @NotNull GoalClient _client) throws IllegalStateException, IllegalArgumentException { final AbstractGoal goal = GoalFactory.create(_type); goal.setGoalClient(_client); return goal; } }
public String toString() { final StringBuffer b = new StringBuffer(); b.append("Goal [id=").append(this.getId()).append(", type=").append(this.getGoalType()); if(this.goalContext!=null) b.append(", ctx=").append(this.goalContext.toString()); b.append("]"); return b.toString(); }
@Override protected void executeTasks() throws Exception { final Space s = this.getGoalContext().getSpace(); final BackendConnector bc = BackendConnector.getInstance(); // Check that space exists if(!bc.isSpaceExisting(this.getGoalContext(), s)) throw new GoalExecutionException("Space with token [" + s.getSpaceToken() + "] does not exist", null); bc.cleanSpace(this.getGoalContext(), s); } }
@Override protected void executeTasks() throws Exception { final Space s = this.getGoalContext().getSpace(); final BackendConnector bc = BackendConnector.getInstance(); // Check that space exists if(!bc.isSpaceExisting(this.getGoalContext(), s)) throw new GoalExecutionException("Space with token [" + s.getSpaceToken() + "] does not exist", null); bc.deleteSpace(this.getGoalContext(), s); } }
/** * Evaluates the configuration setting {@link CoreConfiguration#APP_PREFIXES}. */ @Override protected void prepareExecution() throws GoalConfigurationException { super.prepareExecution(); }
public ReachabilityAnalyzer(GoalContext _ctx) { this.goalContext = _ctx; this.app_ctx = _ctx.getApplication(); }
@Override protected void createGoal() { this.goal = new BomGoal(); } }
@Override protected void createGoal() { this.goal = new CleanGoal(); } }
@Override protected void createGoal() { this.goal = new ReportGoal(); }
public void startGoal() throws GoalConfigurationException { if(this.exe!=null) this.exe.start(); }
/** * Simply calls {@AbstractAnalysisGoal#execute}. * <p> * CAN be overridden by subclasses. * * @return */ protected void executeGoal() throws Exception { this.goal.executeSync(); }
/** * Simply calls {@AbstractAnalysisGoal#execute}. * * CAN be overridden by subclasses. * @return */ protected void executeGoal() throws Exception { this.goal.executeSync(); } }
public static synchronized GoalExecutor getInstance() { if(instance==null) instance = new GoalExecutor(); return instance; }
public void addAppPaths(Set<Path> _paths) throws IllegalArgumentException { for(Path p: _paths) this.addAppPath(p); }
private void notifyObserver() { if(this.observer!=null) this.observer.callback(this); }