Commit ac24abf9 authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade comandos para eventos de usersettings

parent 99ae4976
Loading
Loading
Loading
Loading
+41 −0
Original line number Diff line number Diff line
package es.redmic.commandslib.usersettings.commands;

/*-
 * #%L
 * commands-lib
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import es.redmic.commandslib.commands.Command;
import es.redmic.usersettingslib.dto.SelectionDTO;

public class ClearCommand extends Command {

	private SelectionDTO selection;

	public ClearCommand(SelectionDTO selection) {
		this.selection = selection;
	}

	public SelectionDTO getSelection() {
		return selection;
	}

	public void setSelection(SelectionDTO selection) {
		this.selection = selection;
	}
}
+40 −0
Original line number Diff line number Diff line
package es.redmic.commandslib.usersettings.commands;

/*-
 * #%L
 * commands-lib
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import es.redmic.commandslib.commands.Command;

public class DeleteSettingsCommand extends Command {

	private String settingsId;

	public DeleteSettingsCommand(String settingsId) {
		this.settingsId = settingsId;
	}

	public String getSettingsId() {
		return settingsId;
	}

	public void setSettingsId(String settingsId) {
		this.settingsId = settingsId;
	}
}
+41 −0
Original line number Diff line number Diff line
package es.redmic.commandslib.usersettings.commands;

/*-
 * #%L
 * commands-lib
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import es.redmic.commandslib.commands.Command;
import es.redmic.usersettingslib.dto.SelectionDTO;

public class DeselectCommand extends Command {

	private SelectionDTO selection;

	public DeselectCommand(SelectionDTO selection) {
		this.selection = selection;
	}

	public SelectionDTO getSelection() {
		return selection;
	}

	public void setSelection(SelectionDTO selection) {
		this.selection = selection;
	}
}
+49 −0
Original line number Diff line number Diff line
package es.redmic.commandslib.usersettings.commands;

/*-
 * #%L
 * commands-lib
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import java.util.UUID;

import es.redmic.commandslib.commands.Command;
import es.redmic.usersettingslib.dto.PersistenceDTO;
import es.redmic.usersettingslib.utils.SettingsUtil;

public class SaveSettingsCommand extends Command {

	private PersistenceDTO persistence;

	public SaveSettingsCommand(PersistenceDTO persistence) {

		if (persistence.getId() == null) {
			// Crea id único para settings cuando se trata de una nueva
			persistence.setId(SettingsUtil.generateId(UUID.randomUUID().toString()));
		}
		this.persistence = persistence;
	}

	public PersistenceDTO getPersistence() {
		return persistence;
	}

	public void setPersistence(PersistenceDTO persistence) {
		this.persistence = persistence;
	}
}
+49 −0
Original line number Diff line number Diff line
package es.redmic.commandslib.usersettings.commands;

/*-
 * #%L
 * commands-lib
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import java.util.UUID;

import es.redmic.commandslib.commands.Command;
import es.redmic.usersettingslib.dto.SelectionDTO;
import es.redmic.usersettingslib.utils.SettingsUtil;

public class SelectCommand extends Command {

	private SelectionDTO selection;

	public SelectCommand(SelectionDTO selection) {

		if (selection.getId() == null) {
			// Crea id único para settings cuando se trata de una nueva
			selection.setId(SettingsUtil.generateId(UUID.randomUUID().toString()));
		}
		this.selection = selection;
	}

	public SelectionDTO getSelection() {
		return selection;
	}

	public void setSelection(SelectionDTO selection) {
		this.selection = selection;
	}
}
Loading