index
int64
repo_id
string
file_path
string
content
string
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerPlanListResponseDTO.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ChoreographerPlanListResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -739366261158339149L; private List<ChoreographerPlanResponseDTO> data; private long count; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ChoreographerPlanListResponseDTO() {} //------------------------------------------------------------------------------------------------- public ChoreographerPlanListResponseDTO(final List<ChoreographerPlanResponseDTO> data, final long count) { this.data = data; this.count = count; } //------------------------------------------------------------------------------------------------- public List<ChoreographerPlanResponseDTO> getData() { return data; } public long getCount() { return count; } //------------------------------------------------------------------------------------------------- public void setData(final List<ChoreographerPlanResponseDTO> data) { this.data = data; } public void setCount(final long count) { this.count = count; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerPlanRequestDTO.java
/******************************************************************************** * Copyright (c) 2020 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ChoreographerPlanRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 7757993756490969411L; private String name; private String firstActionName; private List<ChoreographerActionRequestDTO> actions; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ChoreographerPlanRequestDTO() {} //------------------------------------------------------------------------------------------------- public ChoreographerPlanRequestDTO(final String name, final String firstActionName, final List<ChoreographerActionRequestDTO> actions) { this.name = name; this.firstActionName = firstActionName; this.actions = actions; } //------------------------------------------------------------------------------------------------- public String getName() { return name; } public List<ChoreographerActionRequestDTO> getActions() { return actions; } public String getFirstActionName() { return firstActionName; } //------------------------------------------------------------------------------------------------- public void setName(final String name) { this.name = name; } public void setActions(final List<ChoreographerActionRequestDTO> actions) { this.actions = actions; } public void setFirstActionName(final String firstActionName) { this.firstActionName = firstActionName; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerPlanResponseDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ChoreographerPlanResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 6500716813277535148L; private long id; private String name; private String firstActionName; private List<ChoreographerActionResponseDTO> actions; private String createdAt; private String updatedAt; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ChoreographerPlanResponseDTO() {} //------------------------------------------------------------------------------------------------- public ChoreographerPlanResponseDTO(final long id, final String name, final String firstActionName, final List<ChoreographerActionResponseDTO> actions, final String createdAt, final String updatedAt) { this.id = id; this.name = name; this.firstActionName = firstActionName; this.actions = actions; this.createdAt = createdAt; this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- public long getId() { return id; } public String getName() { return name; } public String getFirstActionName() { return firstActionName; } public List<ChoreographerActionResponseDTO> getActions() { return actions; } public String getCreatedAt() { return createdAt; } public String getUpdatedAt() { return updatedAt; } //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setName(final String name) { this.name = name; } public void setFirstActionName(final String firstActionName) { this.firstActionName = firstActionName; } public void setActions(final List<ChoreographerActionResponseDTO> actions) { this.actions = actions; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerRunPlanRequestDTO.java
/******************************************************************************** * Copyright (c) 2020 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import eu.arrowhead.common.CommonConstants; public class ChoreographerRunPlanRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 270117099471203107L; private Long planId; private long quantity = 1; private boolean allowInterCloud = false; // if true, then providers (for steps and for executor's dependencies) can come from other clouds, too private boolean chooseOptimalExecutor = false; // if true, executor selection tries to minimalize inter-cloud connections (but executor selection takes longer) // notify URI parts private String notifyProtocol = CommonConstants.HTTP; // http or https private String notifyAddress; // if address is not set, then notify is disabled private int notifyPort = 80; private String notifyPath = ""; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public Long getPlanId() { return planId; } public long getQuantity() { return quantity; } public boolean isAllowInterCloud() { return allowInterCloud; } public boolean getChooseOptimalExecutor() { return chooseOptimalExecutor; } public String getNotifyProtocol() { return notifyProtocol; } public String getNotifyAddress() { return notifyAddress; } public int getNotifyPort() { return notifyPort; } public String getNotifyPath() { return notifyPath; } //------------------------------------------------------------------------------------------------- public void setPlanId(final Long planId) { this.planId = planId; } public void setQuantity(long quantity) { this.quantity = quantity; } public void setAllowInterCloud(final boolean allowInterCloud) { this.allowInterCloud = allowInterCloud; } public void setChooseOptimalExecutor(final boolean chooseOptimalExecutor) { this.chooseOptimalExecutor = chooseOptimalExecutor; } public void setNotifyProtocol(final String notifyProtocol) { this.notifyProtocol = notifyProtocol; } public void setNotifyAddress(final String notifyAddress) { this.notifyAddress = notifyAddress; } public void setNotifyPort(final int notifyPort) { this.notifyPort = notifyPort; } public void setNotifyPath(final String notifyPath) { this.notifyPath = notifyPath; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerRunPlanResponseDTO.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ChoreographerRunPlanResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 5685633104518742525L; private Long planId; private Long sessionId; private Long quantity; private ChoreographerSessionStatus status; private List<String> errorMessages = new ArrayList<>(); private boolean needInterCloud = false; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ChoreographerRunPlanResponseDTO() {} //------------------------------------------------------------------------------------------------- public ChoreographerRunPlanResponseDTO(final Long planId, final Long sessionId, final Long quantity, final ChoreographerSessionStatus status, final List<String> errorMessages, final boolean needInterCloud) { this.planId = planId; this.sessionId = sessionId; this.quantity = quantity; this.status = status; this.needInterCloud = needInterCloud; if (errorMessages != null) { this.errorMessages.addAll(errorMessages); } } //------------------------------------------------------------------------------------------------- public ChoreographerRunPlanResponseDTO(final long planId, final long sessionId, final long quantity, final boolean needInterCloud) { this(planId, sessionId, quantity, ChoreographerSessionStatus.INITIATED, null, needInterCloud); } //------------------------------------------------------------------------------------------------- public ChoreographerRunPlanResponseDTO(final Long planId, final Long quantity, final List<String> errorMessages, final boolean needInterCloud) { this(planId, null, quantity, ChoreographerSessionStatus.ABORTED, errorMessages, needInterCloud); } //------------------------------------------------------------------------------------------------- public Long getPlanId() { return planId; } public Long getSessionId() { return sessionId; } public Long getQuantity() { return quantity; } public ChoreographerSessionStatus getStatus() { return status; } public List<String> getErrorMessages() { return errorMessages; } public boolean getNeedInterCloud() { return needInterCloud; } //------------------------------------------------------------------------------------------------- public void setPlanId(final Long planId) { this.planId = planId; } public void setSessionId(final Long sessionId) { this.sessionId = sessionId; } public void setQuantity(final Long quantity) { this.quantity = quantity; } public void setStatus(final ChoreographerSessionStatus status) { this.status = status; } public void setErrorMessages(final List<String> errorMessages) { this.errorMessages = errorMessages; } public void setNeedInterCloud(final boolean needInterCloud) { this.needInterCloud = needInterCloud; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerServiceQueryFormDTO.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; public class ChoreographerServiceQueryFormDTO extends ServiceQueryFormDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 4310676705715417602L; private boolean localCloudOnly = false; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ChoreographerServiceQueryFormDTO() { super(); } //------------------------------------------------------------------------------------------------- public ChoreographerServiceQueryFormDTO(final ServiceQueryFormDTO queryForm, final boolean localCloudOnly) { super(); this.setServiceDefinitionRequirement(queryForm.getServiceDefinitionRequirement()); this.setInterfaceRequirements(queryForm.getInterfaceRequirements()); this.setSecurityRequirements(queryForm.getSecurityRequirements()); this.setMetadataRequirements(queryForm.getMetadataRequirements()); this.setVersionRequirement(queryForm.getVersionRequirement()); this.setMinVersionRequirement(queryForm.getMinVersionRequirement()); this.setMaxVersionRequirement(queryForm.getMaxVersionRequirement()); this.setPingProviders(queryForm.getPingProviders()); this.localCloudOnly = localCloudOnly; } //------------------------------------------------------------------------------------------------- public boolean isLocalCloudOnly() { return localCloudOnly; } //------------------------------------------------------------------------------------------------- public void setLocalCloudOnly(boolean localCloudOnly) { this.localCloudOnly = localCloudOnly; } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerSessionListResponseDTO.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ChoreographerSessionListResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -7507499084467118434L; private List<ChoreographerSessionResponseDTO> data; private long count; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ChoreographerSessionListResponseDTO() {} //------------------------------------------------------------------------------------------------- public ChoreographerSessionListResponseDTO(final List<ChoreographerSessionResponseDTO> data, final long count) { this.data = data; this.count = count; } //------------------------------------------------------------------------------------------------- public List<ChoreographerSessionResponseDTO> getData() { return data; } public long getCount() { return count; } //------------------------------------------------------------------------------------------------- public void setData(final List<ChoreographerSessionResponseDTO> data) { this.data = data; } public void setCount(final long count) { this.count = count; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerSessionResponseDTO.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ChoreographerSessionResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 6273263178560429948L; private long id; private long planid; private String planName; private ChoreographerSessionStatus status; private long quantityDone; private long quantityGoal; private long executionNumber; private String notifyUri; private String startedAt; private String updatedAt; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ChoreographerSessionResponseDTO() {}; //------------------------------------------------------------------------------------------------- public ChoreographerSessionResponseDTO(final long id, final long planid, final String planName, final ChoreographerSessionStatus status, final long quantityDone, final long quantityGoal, final long executionNumber, final String notifyUri, final String startedAt, final String updatedAt) { this.id = id; this.planid = planid; this.planName = planName; this.status = status; this.quantityDone = quantityDone; this.quantityGoal = quantityGoal; this.executionNumber = executionNumber; this.notifyUri = notifyUri; this.startedAt = startedAt; this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- public long getId() { return id; } public long getPlanid() { return planid; } public String getPlanName() { return planName; } public ChoreographerSessionStatus getStatus() { return status; } public long getQuantityDone() { return quantityDone; } public long getQuantityGoal() { return quantityGoal; } public long getExecutionNumber() { return executionNumber; } public String getNotifyUri() { return notifyUri; } public String getStartedAt() { return startedAt; } public String getUpdatedAt() { return updatedAt; } //------------------------------------------------------------------------------------------------ public void setId(final long id) { this.id = id; } public void setPlanid(final long planid) { this.planid = planid; } public void setPlanName(final String planName) { this.planName = planName; } public void setStatus(final ChoreographerSessionStatus status) { this.status = status; } public void setQuantityDone(final long quantityDone) { this.quantityDone = quantityDone; } public void setQuantityGoal(final long quantityGoal) { this.quantityGoal = quantityGoal; } public void setExecutionNumber(final long executionNumber) { this.executionNumber = executionNumber; } public void setNotifyUri(final String notifyUri) { this.notifyUri = notifyUri; } public void setStartedAt(final String startedAt) { this.startedAt = startedAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerSessionStatus.java
/******************************************************************************** * Copyright (c) 2020 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; public enum ChoreographerSessionStatus { INITIATED, RUNNING, ABORTED, DONE }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerSessionStepListResponseDTO.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ChoreographerSessionStepListResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -3871716187401370011L; private List<ChoreographerSessionStepResponseDTO> data; private long count; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ChoreographerSessionStepListResponseDTO() {} //------------------------------------------------------------------------------------------------- public ChoreographerSessionStepListResponseDTO(final List<ChoreographerSessionStepResponseDTO> data, final long count) { this.data = data; this.count = count; } //------------------------------------------------------------------------------------------------- public List<ChoreographerSessionStepResponseDTO> getData() { return data; } public long getCount() { return count; } //------------------------------------------------------------------------------------------------- public void setData(final List<ChoreographerSessionStepResponseDTO> data) { this.data = data; } public void setCount(final long count) { this.count = count; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerSessionStepResponseDTO.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import eu.arrowhead.common.dto.internal.ChoreographerSessionStepStatus; public class ChoreographerSessionStepResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -7338823471311785589L; private long id; private ChoreographerSessionResponseDTO session; private ChoreographerStepResponseDTO step; private ChoreographerExecutorResponseDTO executor; private ChoreographerSessionStepStatus status; private String message; private String startedAt; private String updatedAt; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ChoreographerSessionStepResponseDTO() {} //------------------------------------------------------------------------------------------------- public ChoreographerSessionStepResponseDTO(final long id, final ChoreographerSessionResponseDTO session, final ChoreographerStepResponseDTO step, final ChoreographerExecutorResponseDTO executor, final ChoreographerSessionStepStatus status, final String message, final String startedAt, final String updatedAt) { this.id = id; this.session = session; this.step = step; this.executor = executor; this.status = status; this.message = message; this.startedAt = startedAt; this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- public long getId() { return id; } public ChoreographerSessionResponseDTO getSession() { return session; } public ChoreographerStepResponseDTO getStep() { return step; } public ChoreographerExecutorResponseDTO getExecutor() { return executor; } public ChoreographerSessionStepStatus getStatus() { return status; } public String getMessage() { return message; } public String getStartedAt() { return startedAt; } public String getUpdatedAt() { return updatedAt; } //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setSession(final ChoreographerSessionResponseDTO session) { this.session = session; } public void setStep(final ChoreographerStepResponseDTO step) { this.step = step; } public void setExecutor(final ChoreographerExecutorResponseDTO executor) { this.executor = executor; } public void setStatus(final ChoreographerSessionStepStatus status) { this.status = status; } public void setMessage(final String message) { this.message = message; } public void setStartedAt(final String startedAt) { this.startedAt = startedAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerStepListResponseDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ChoreographerStepListResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -4221321354484821514L; private List<ChoreographerStepResponseDTO> data; private long count; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ChoreographerStepListResponseDTO() {} //------------------------------------------------------------------------------------------------- public ChoreographerStepListResponseDTO(final List<ChoreographerStepResponseDTO> data, final long count) { this.data = data; this.count = count; } //------------------------------------------------------------------------------------------------- public List<ChoreographerStepResponseDTO> getData() { return data; } public long getCount() { return count; } //------------------------------------------------------------------------------------------------- public void setData(final List<ChoreographerStepResponseDTO> data) { this.data = data; } public void setCount(final long count) { this.count = count; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerStepRequestDTO.java
/******************************************************************************** * Copyright (c) 2020 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.List; import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ChoreographerStepRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 3848344337979806809L; private String name; private Map<String,String> staticParameters; private Integer quantity; private ChoreographerServiceQueryFormDTO serviceRequirement; private List<String> nextStepNames; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public String getName() { return name; } public Map<String,String> getStaticParameters() { return staticParameters; } public Integer getQuantity() { return quantity; } public ChoreographerServiceQueryFormDTO getServiceRequirement() { return serviceRequirement; } public List<String> getNextStepNames() { return nextStepNames; } //------------------------------------------------------------------------------------------------- public void setName(final String name) { this.name = name; } public void setStaticParameters(final Map<String,String> staticParameters) { this.staticParameters = staticParameters; } public void setQuantity(final Integer quantity) { this.quantity = quantity; } public void setServiceRequirement(final ChoreographerServiceQueryFormDTO serviceRequirement) { this.serviceRequirement = serviceRequirement; } public void setNextStepNames(final List<String> nextStepNames) { this.nextStepNames = nextStepNames; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerStepResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(JsonInclude.Include.NON_NULL) public class ChoreographerStepResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 1643826656433118530L; private long id; private String name; private String serviceDefinition; private Integer minVersion; private Integer maxVersion; private Map<String,String> staticParameters; private int quantity; private ChoreographerServiceQueryFormDTO srTemplate; private List<String> nextStepNames; private String createdAt; private String updatedAt; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ChoreographerStepResponseDTO() {} //------------------------------------------------------------------------------------------------- public ChoreographerStepResponseDTO(final long id, final String name, final String serviceDefinition, final Integer minVersion, final Integer maxVersion, final Map<String, String> staticParameters, final int quantity, final ChoreographerServiceQueryFormDTO srTemplate, final List<String> nextStepNames, final String createdAt, final String updatedAt) { this.id = id; this.name = name; this.serviceDefinition = serviceDefinition; this.minVersion = minVersion; this.maxVersion = maxVersion; this.staticParameters = staticParameters; this.quantity = quantity; this.srTemplate = srTemplate; this.nextStepNames = nextStepNames; this.createdAt = createdAt; this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- public long getId() { return id; } public String getName() { return name; } public String getServiceDefinition() { return serviceDefinition; } public Integer getMinVersion() { return minVersion; } public Integer getMaxVersion() { return maxVersion; } public Map<String,String> getStaticParameters() { return staticParameters; } public int getQuantity() { return quantity; } public ChoreographerServiceQueryFormDTO getSrTemplate() { return srTemplate; } public List<String> getNextStepNames() { return nextStepNames; } public String getCreatedAt() { return createdAt; } public String getUpdatedAt() { return updatedAt; } //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setName(final String name) { this.name = name; } public void setServiceDefinition(final String serviceDefinition) { this.serviceDefinition = serviceDefinition; } public void setMinVersion(final Integer minVersion) { this.minVersion = minVersion; } public void setMaxVersion(final Integer maxVersion) { this.maxVersion = maxVersion; } public void setSrTemplate(final ChoreographerServiceQueryFormDTO srTemplate) { this.srTemplate = srTemplate; } public void setNextStepNames(final List<String> nextStepNames) { this.nextStepNames = nextStepNames; } public void setStaticParameters(final Map<String,String> staticParameters) { this.staticParameters = staticParameters; } public void setQuantity(final int quantity) { this.quantity = quantity; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerWorklogListResponseDTO.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ChoreographerWorklogListResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 6777984090689985303L; private List<ChoreographerWorklogResponseDTO> data; private long count; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ChoreographerWorklogListResponseDTO() {} //------------------------------------------------------------------------------------------------- public ChoreographerWorklogListResponseDTO(final List<ChoreographerWorklogResponseDTO> data, final long count) { this.data = data; this.count = count; } //------------------------------------------------------------------------------------------------- public List<ChoreographerWorklogResponseDTO> getData() { return data; } public long getCount() { return count; } //------------------------------------------------------------------------------------------------- public void setData(final List<ChoreographerWorklogResponseDTO> data) { this.data = data; } public void setCount(final long count) { this.count = count; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ChoreographerWorklogResponseDTO.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ChoreographerWorklogResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -1278815996356098724L; private long id; private String entryDate; private String planName; private String actionName; private String stepName; private Long sessionId; private Long executionNumber; private String message; private String exception; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ChoreographerWorklogResponseDTO() {} //------------------------------------------------------------------------------------------------- public ChoreographerWorklogResponseDTO(final long id, final String entryDate, final String planName, final String actionName, final String stepName, final Long sessionId, final Long executionNumber, final String message, final String exception) { this.id = id; this.entryDate = entryDate; this.planName = planName; this.actionName = actionName; this.stepName = stepName; this.sessionId = sessionId; this.executionNumber = executionNumber; this.message = message; this.exception = exception; } //------------------------------------------------------------------------------------------------- public long getId() { return id; } public String getEntryDate() { return entryDate; } public String getPlanName() { return planName; } public String getActionName() { return actionName; } public String getStepName() { return stepName; } public Long getSessionId() { return sessionId; } public Long getExecutionNumber() { return executionNumber; } public String getMessage() { return message; } public String getException() { return exception; } //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setEntryDate(final String entryDate) { this.entryDate = entryDate; } public void setPlanName(final String planName) { this.planName = planName; } public void setActionName(final String actionName) { this.actionName = actionName; } public void setStepName(final String stepName) { this.stepName = stepName; } public void setSessionId(final Long sessionId) { this.sessionId = sessionId; } public void setExecutionNumber(final Long executionNumber) { this.executionNumber = executionNumber; } public void setMessage(final String message) { this.message = message; } public void setException(final String exception) { this.exception = exception; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/CloudRequestDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.List; import java.util.Objects; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class CloudRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 7397917411719621910L; private String operator; private String name; private Boolean secure; private Boolean neighbor; private String authenticationInfo; private List<Long> gatekeeperRelayIds; private List<Long> gatewayRelayIds; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public String getOperator() { return operator; } public String getName() { return name; } public Boolean getSecure() { return secure; } public Boolean getNeighbor() { return neighbor; } public String getAuthenticationInfo() { return authenticationInfo; } public List<Long> getGatekeeperRelayIds() { return gatekeeperRelayIds; } public List<Long> getGatewayRelayIds() { return gatewayRelayIds; } //------------------------------------------------------------------------------------------------- public void setOperator(final String operator) { this.operator = operator; } public void setName(final String name) { this.name = name; } public void setSecure(final Boolean secure) { this.secure = secure; } public void setNeighbor(final Boolean neighbor) { this.neighbor = neighbor; } public void setAuthenticationInfo(final String authenticationInfo) { this.authenticationInfo = authenticationInfo; } public void setGatekeeperRelayIds(final List<Long> gatekeeperRelayIds) { this.gatekeeperRelayIds = gatekeeperRelayIds; } public void setGatewayRelayIds(final List<Long> gatewayRelayIds) { this.gatewayRelayIds = gatewayRelayIds; } //------------------------------------------------------------------------------------------------- @Override public int hashCode() { return Objects.hash(operator, name); } //------------------------------------------------------------------------------------------------- @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final CloudRequestDTO other = (CloudRequestDTO) obj; return Objects.equals(name, other.name) && Objects.equals(operator, other.operator); } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ConfigurationListResponseDTO.java
/******************************************************************************** * Copyright (c) 2021 {Lulea University of Technology} * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * {Lulea University of Technology} - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class ConfigurationListResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 2134548237626671292L; private long count; private List<ConfigurationResponseDTO> data; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ConfigurationListResponseDTO() { count = 0; data = new ArrayList<ConfigurationResponseDTO>(); } //------------------------------------------------------------------------------------------------- public ConfigurationListResponseDTO(final long count, final List<ConfigurationResponseDTO> data) { this.count = count; this.data = data; } //------------------------------------------------------------------------------------------------- public long getCount() { return count; } public List<ConfigurationResponseDTO> getData() { return data; } //------------------------------------------------------------------------------------------------- public void setCount(final long count) { this.count = count; } public void setData(final List<ConfigurationResponseDTO> data) { this.data = data; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ConfigurationRequestDTO.java
/******************************************************************************** * Copyright (c) 2021 {Lulea University of Technology} * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * {Lulea University of Technology} - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class ConfigurationRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 2121588217653461491L; private String systemName; private String fileName; private String contentType; private String data; //private String md5; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ConfigurationRequestDTO() {} //------------------------------------------------------------------------------------------------- public ConfigurationRequestDTO(final String systemName, final String fileName, final String contentType, final String data) { this.systemName = systemName; this.fileName = fileName; this.contentType = contentType; this.data = data; } //------------------------------------------------------------------------------------------------- public String getSystemName() { return systemName; } public String getFileName() { return fileName; } public String getContentType() { return contentType; } public String getData() { return data; } //------------------------------------------------------------------------------------------------- public void setSystemName(final String systemName) { this.systemName = systemName; } public void setFileName(final String fileName) { this.fileName = fileName; } public void setContentType(final String contentType) { this.contentType = contentType; } public void setData(final String data) { this.data = data; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ConfigurationResponseDTO.java
/******************************************************************************** * Copyright (c) 2021 {Lulea University of Technology} * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * {Lulea University of Technology} - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class ConfigurationResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 1231548247623961591L; private long id; private String systemName; private String fileName; private String contentType; private String data; private String createdAt; private String updatedAt; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ConfigurationResponseDTO() {} //------------------------------------------------------------------------------------------------- public ConfigurationResponseDTO(final long id, final String systemName, final String fileName, final String contentType, final String data, final String createdAt, final String updatedAt) { this.id = id; this.systemName = systemName; this.fileName = fileName; this.contentType = contentType; this.data = data; this.createdAt = createdAt; this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- public long getId() { return id; } public String getSystemName() { return systemName; } public String getFileName() { return fileName; } public String getContentType() { return contentType; } public String getData() { return data; } public String getCreatedAt() { return createdAt; } public String getUpdatedAt() { return updatedAt; } //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setSystemName(final String systemName) { this.systemName = systemName; } public void setFileName(final String fileName) { this.fileName = fileName; } public void setContentType(final String contentType) { this.contentType = contentType; } public void setData(final String data) { this.data = data; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ConfigurationSystemsListResponseDTO.java
/******************************************************************************** * Copyright (c) 2021 {Lulea University of Technology} * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * {Lulea University of Technology} - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ConfigurationSystemsListResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 2359853742228146773L; private int count; private List<String> systems = new ArrayList<>(); //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ConfigurationSystemsListResponseDTO() {} //------------------------------------------------------------------------------------------------- public ConfigurationSystemsListResponseDTO(final int count, final List<String> systems) { this.count = count; this.systems = systems; } //------------------------------------------------------------------------------------------------- public int getCount() { return count; } public List<String> getSystems() { return systems; } //------------------------------------------------------------------------------------------------- public void setCount(final int count) { this.count = count; } public void setSystems(final List<String> systems) { this.systems = systems; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/DataManagerOperationDTO.java
/******************************************************************************** * Copyright (c) 2020 {Lulea University of Technology} * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * {Lulea University of Technology} - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class DataManagerOperationDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 2528826741322136689L; private String op; private String serviceName; private String serviceType; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public DataManagerOperationDTO() {} //------------------------------------------------------------------------------------------------- public String getOp() { return op; } public String getServiceName() { return serviceName; } public String getServiceType() { return serviceType; } //------------------------------------------------------------------------------------------------- public void setOp(final String op) { this.op = new String(op); } public void setServiceName(final String serviceName) { this.serviceName = new String(serviceName); } public void setServiceType(final String serviceType) { this.serviceType = new String(serviceType); } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/DataManagerServicesResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 {Lulea University of Technology} * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * {Lulea University of Technology} - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class DataManagerServicesResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 2184859722224129210L; private List<String> services= new ArrayList<>(); //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public DataManagerServicesResponseDTO() {} //------------------------------------------------------------------------------------------------- public List<String> getServices() { return services; } //------------------------------------------------------------------------------------------------- public void setServices(final List<String> services) { this.services = services; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/DataManagerSystemsResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 {Lulea University of Technology} * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * {Lulea University of Technology} - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class DataManagerSystemsResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 1588856742128136289L; private List<String> systems = new ArrayList<>(); //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public DataManagerSystemsResponseDTO() {} //------------------------------------------------------------------------------------------------- public List<String> getSystems() { return systems; } //------------------------------------------------------------------------------------------------- public void setSystems(final List<String> systems) { this.systems = systems; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/DeviceQueryFormDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.HashMap; import java.util.Map; import org.springframework.util.Assert; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class DeviceQueryFormDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -2699823381165019336L; private String deviceNameRequirements; private String addressRequirement; private String macAddressRequirement; private Map<String,String> metadataRequirements; // if specified the whole content of the map must match private Integer versionRequirement; // if specified version must match private Integer minVersionRequirement; // if specified version must be equals or higher; ignored if versionRequirement is specified private Integer maxVersionRequirement; // if specified version must be equals or lower; ignored if versionRequirement is specified //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public DeviceQueryFormDTO() {} //------------------------------------------------------------------------------------------------- public String getDeviceNameRequirements() { return deviceNameRequirements; } public String getAddressRequirement() { return addressRequirement; } public String getMacAddressRequirement() { return macAddressRequirement; } public Map<String,String> getMetadataRequirements() { return metadataRequirements; } public Integer getVersionRequirement() { return versionRequirement; } public Integer getMinVersionRequirement() { return minVersionRequirement; } public Integer getMaxVersionRequirement() { return maxVersionRequirement; } //------------------------------------------------------------------------------------------------- public void setDeviceNameRequirements(final String deviceNameRequirements) { this.deviceNameRequirements = deviceNameRequirements; } public void setAddressRequirement(final String addressRequirement) { this.addressRequirement = addressRequirement; } public void setMacAddressRequirement(final String macAddressRequirement) { this.macAddressRequirement = macAddressRequirement; } public void setMetadataRequirements(final Map<String,String> metadataRequirements) { this.metadataRequirements = metadataRequirements; } public void setVersionRequirement(final Integer versionRequirement) { this.versionRequirement = versionRequirement; } public void setMinVersionRequirement(final Integer minVersionRequirement) { this.minVersionRequirement = minVersionRequirement; } public void setMaxVersionRequirement(final Integer maxVersionRequirement) { this.maxVersionRequirement = maxVersionRequirement; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- private DeviceQueryFormDTO(final Builder builder) { this.deviceNameRequirements = builder.deviceNameRequirements; this.addressRequirement = builder.addressRequirements; this.macAddressRequirement = builder.macAddressRequirement; this.metadataRequirements = builder.metadataRequirements; this.versionRequirement = builder.versionRequirement; this.minVersionRequirement = builder.minVersionRequirement; this.maxVersionRequirement = builder.maxVersionRequirement; } //================================================================================================= // nested classes //------------------------------------------------------------------------------------------------- public static class Builder { //================================================================================================= // members private final String deviceNameRequirements; private String addressRequirements; private String macAddressRequirement; private Map<String,String> metadataRequirements; private Integer versionRequirement; private Integer minVersionRequirement; private Integer maxVersionRequirement; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public Builder(final String deviceNameRequirements) { Assert.isTrue(deviceNameRequirements != null && !deviceNameRequirements.isBlank(), "deviceNameRequirements is null or blank."); this.deviceNameRequirements = deviceNameRequirements; } //------------------------------------------------------------------------------------------------- public Builder address(final String address) { this.addressRequirements = address; return this; } //------------------------------------------------------------------------------------------------- public Builder macAddress(final String macAddress) { this.macAddressRequirement = macAddress; return this; } //------------------------------------------------------------------------------------------------- public Builder metadata(final Map<String,String> metadataRequirements) { this.metadataRequirements = metadataRequirements; return this; } //------------------------------------------------------------------------------------------------- public Builder metadata(final String key, final String value) { Assert.isTrue(key != null && !key.isBlank(), "Key is null or blank"); if (this.metadataRequirements == null) { this.metadataRequirements = new HashMap<>(); } this.metadataRequirements.put(key, value); return this; } //------------------------------------------------------------------------------------------------- public Builder version(final Integer versionRequirement) { this.versionRequirement = versionRequirement; return this; } //------------------------------------------------------------------------------------------------- public Builder version(final Integer minVersionRequirement, final Integer maxVersionRequirement) { this.minVersionRequirement = minVersionRequirement; this.maxVersionRequirement = maxVersionRequirement; return this; } //------------------------------------------------------------------------------------------------- public DeviceQueryFormDTO build() { return new DeviceQueryFormDTO(this); } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/DeviceQueryResultDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class DeviceQueryResultDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -1822444510232108526L; private List<DeviceRegistryResponseDTO> deviceQueryData = null; private int unfilteredHits = 0; //================================================================================================= // constructors //------------------------------------------------------------------------------------------------- public DeviceQueryResultDTO() { this(new ArrayList<>(), 0); } //------------------------------------------------------------------------------------------------- public DeviceQueryResultDTO(final List<DeviceRegistryResponseDTO> deviceQueryData, final int unfilteredHits) { this.deviceQueryData = deviceQueryData; this.unfilteredHits = unfilteredHits; } //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public List<DeviceRegistryResponseDTO> getDeviceQueryData() { return deviceQueryData; } public int getUnfilteredHits() { return unfilteredHits; } //------------------------------------------------------------------------------------------------- public void setDeviceQueryData(final List<DeviceRegistryResponseDTO> deviceQueryData) { this.deviceQueryData = deviceQueryData; } public void setUnfilteredHits(final int unfilteredHits) { this.unfilteredHits = unfilteredHits; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import org.springframework.util.Assert; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public abstract class DeviceRegistryOnboardingResponseDTO extends DeviceRegistryResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -635438605292398404L; private CertificateCreationResponseDTO certificateResponse; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public DeviceRegistryOnboardingResponseDTO() {} //------------------------------------------------------------------------------------------------- public DeviceRegistryOnboardingResponseDTO(final long id, final DeviceResponseDTO device, final String endOfValidity, final Map<String, String> metadata, final int version, final String createdAt, final String updatedAt, final CertificateCreationResponseDTO certificateResponse) { super(id, device, endOfValidity, metadata, version, createdAt, updatedAt); this.certificateResponse = certificateResponse; } //------------------------------------------------------------------------------------------------- public void load(final DeviceRegistryResponseDTO dto) { Assert.notNull(dto, "DeviceRegistryResponseDTO must not be null"); setId(dto.getId()); setDevice(dto.getDevice()); setEndOfValidity(dto.getEndOfValidity()); setMetadata(dto.getMetadata()); setVersion(dto.getVersion()); setCreatedAt(dto.getCreatedAt()); setUpdatedAt(dto.getUpdatedAt()); } //------------------------------------------------------------------------------------------------- public CertificateCreationResponseDTO getCertificateResponse() { return certificateResponse; } //------------------------------------------------------------------------------------------------- public void setCertificateResponse(final CertificateCreationResponseDTO certificateResponse) { this.certificateResponse = certificateResponse; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithCsrRequestDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class DeviceRegistryOnboardingWithCsrRequestDTO extends DeviceRegistryRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -635438605292398404L; private String certificateSigningRequest; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public DeviceRegistryOnboardingWithCsrRequestDTO() {} //------------------------------------------------------------------------------------------------- public DeviceRegistryOnboardingWithCsrRequestDTO(final DeviceRequestDTO device, final String endOfValidity, final String certificateSigningRequest) { super(device, endOfValidity); this.certificateSigningRequest = certificateSigningRequest; } //------------------------------------------------------------------------------------------------- public DeviceRegistryOnboardingWithCsrRequestDTO(final String deviceName, final String macAddress, final String endOfValidity, final String certificateSigningRequest) { super(new DeviceRequestDTO(deviceName, macAddress), endOfValidity); this.certificateSigningRequest = certificateSigningRequest; } //------------------------------------------------------------------------------------------------- public DeviceRegistryOnboardingWithCsrRequestDTO(final DeviceRequestDTO device, final String endOfValidity, final Map<String, String> metadata, final Integer version, final String certificateSigningRequest) { super(device, endOfValidity, metadata, version); this.certificateSigningRequest = certificateSigningRequest; } //------------------------------------------------------------------------------------------------- public String getCertificateSigningRequest() { return certificateSigningRequest; } //------------------------------------------------------------------------------------------------- public void setCertificateSigningRequest(final String certificateSigningRequest) { this.certificateSigningRequest = certificateSigningRequest; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithCsrResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; public class DeviceRegistryOnboardingWithCsrResponseDTO extends DeviceRegistryOnboardingResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -33413025504583391L; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public DeviceRegistryOnboardingWithCsrResponseDTO() {} //------------------------------------------------------------------------------------------------- public DeviceRegistryOnboardingWithCsrResponseDTO(final long id, final DeviceResponseDTO device, final String endOfValidity, final Map<String, String> metadata, final int version, final String createdAt, final String updatedAt, final CertificateCreationResponseDTO certificateResponse) { super(id, device, endOfValidity, metadata, version, createdAt, updatedAt, certificateResponse); } // this class exist to keep the structure of <operation>RequestDTO, <operation>ResponseDTO }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithNameRequestDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class DeviceRegistryOnboardingWithNameRequestDTO extends DeviceRegistryRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -635438605292398404L; private CertificateCreationRequestDTO certificateCreationRequest; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public DeviceRegistryOnboardingWithNameRequestDTO() {} //------------------------------------------------------------------------------------------------- public DeviceRegistryOnboardingWithNameRequestDTO(final DeviceRequestDTO device, final String endOfValidity) { super(device, endOfValidity); } //------------------------------------------------------------------------------------------------- public DeviceRegistryOnboardingWithNameRequestDTO(final String deviceName, final String macAddress, final String endOfValidity) { super(new DeviceRequestDTO(deviceName, macAddress), endOfValidity); this.certificateCreationRequest = new CertificateCreationRequestDTO(deviceName); } //------------------------------------------------------------------------------------------------- public DeviceRegistryOnboardingWithNameRequestDTO(final DeviceRequestDTO device, final String endOfValidity, final Map<String, String> metadata, final Integer version) { super(device, endOfValidity, metadata, version); this.certificateCreationRequest = new CertificateCreationRequestDTO(Objects.requireNonNull(device).getDeviceName()); } //------------------------------------------------------------------------------------------------- public CertificateCreationRequestDTO getCertificateCreationRequest() { return certificateCreationRequest; } //------------------------------------------------------------------------------------------------- public void setCertificateCreationRequest(final CertificateCreationRequestDTO certificateCreationRequest) { this.certificateCreationRequest = certificateCreationRequest; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/DeviceRegistryOnboardingWithNameResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; public class DeviceRegistryOnboardingWithNameResponseDTO extends DeviceRegistryOnboardingResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -1590100066352889938L; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public DeviceRegistryOnboardingWithNameResponseDTO() {} //------------------------------------------------------------------------------------------------- public DeviceRegistryOnboardingWithNameResponseDTO(final long id, final DeviceResponseDTO device, final String endOfValidity, final Map<String, String> metadata, final int version, final String createdAt, final String updatedAt, final CertificateCreationResponseDTO certificateResponse) { super(id, device, endOfValidity, metadata, version, createdAt, updatedAt, certificateResponse); } // this class exist to keep the structure of <operation>RequestDTO, <operation>ResponseDTO }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/DeviceRegistryRequestDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class DeviceRegistryRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -635438605292398404L; private DeviceRequestDTO device; private String endOfValidity; private Map<String,String> metadata; private Integer version; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public DeviceRegistryRequestDTO() {} //------------------------------------------------------------------------------------------------- public DeviceRegistryRequestDTO(final DeviceRequestDTO device, final String endOfValidity) { this.device = device; this.endOfValidity = endOfValidity; } //------------------------------------------------------------------------------------------------- public DeviceRegistryRequestDTO(final DeviceRequestDTO device, final String endOfValidity, final Map<String, String> metadata, final Integer version) { this.device = device; this.endOfValidity = endOfValidity; this.metadata = metadata; this.version = version; } //------------------------------------------------------------------------------------------------- public DeviceRequestDTO getDevice() { return device; } public String getEndOfValidity() { return endOfValidity; } public Map<String,String> getMetadata() { return metadata; } public Integer getVersion() { return version; } //------------------------------------------------------------------------------------------------- public void setDevice(final DeviceRequestDTO device) { this.device = device; } public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } public void setMetadata(final Map<String,String> metadata) { this.metadata = metadata; } public void setVersion(final Integer version) { this.version = version; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/DeviceRegistryResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class DeviceRegistryResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -635438605292398404L; private long id; private DeviceResponseDTO device; private String endOfValidity; private Map<String,String> metadata; private int version; private String createdAt; private String updatedAt; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public DeviceRegistryResponseDTO() {} //------------------------------------------------------------------------------------------------- public DeviceRegistryResponseDTO(final long id, final DeviceResponseDTO device, final String endOfValidity, final Map<String, String> metadata, final int version, final String createdAt, final String updatedAt) { this.id = id; this.device = device; this.endOfValidity = endOfValidity; this.metadata = metadata; this.version = version; this.createdAt = createdAt; this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- public long getId() { return id; } public DeviceResponseDTO getDevice() { return device; } public String getEndOfValidity() { return endOfValidity; } public Map<String,String> getMetadata() { return metadata; } public int getVersion() { return version; } public String getCreatedAt() { return createdAt; } public String getUpdatedAt() { return updatedAt; } //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setDevice(final DeviceResponseDTO device) { this.device = device; } public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } public void setMetadata(final Map<String,String> metadata) { this.metadata = metadata; } public void setVersion(final int version) { this.version = version; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final DeviceRegistryResponseDTO that = (DeviceRegistryResponseDTO) o; return id == that.id && version == that.version && device.equals(that.device) && Objects.equals(endOfValidity, that.endOfValidity) && Objects.equals(metadata, that.metadata) && createdAt.equals(that.createdAt) && updatedAt.equals(that.updatedAt); } //------------------------------------------------------------------------------------------------- @Override public int hashCode() { return Objects.hash(id, device, endOfValidity, metadata, version, createdAt, updatedAt); } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/DeviceRequestDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class DeviceRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 3919207845374510215L; private String deviceName; private String address; private String macAddress; private String authenticationInfo; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public DeviceRequestDTO() {} //------------------------------------------------------------------------------------------------- public DeviceRequestDTO(final String deviceName, final String macAddress) { this.deviceName = deviceName; this.macAddress = macAddress; } //------------------------------------------------------------------------------------------------- public DeviceRequestDTO(final String deviceName, final String address, final String macAddress, final String authenticationInfo) { this.deviceName = deviceName; this.address = address; this.macAddress = macAddress; this.authenticationInfo = authenticationInfo; } //------------------------------------------------------------------------------------------------- public String getDeviceName() { return deviceName; } public String getAddress() { return address; } public String getMacAddress() { return macAddress; } public String getAuthenticationInfo() { return authenticationInfo; } //------------------------------------------------------------------------------------------------- public void setDeviceName(final String deviceName) { this.deviceName = deviceName; } public void setAddress(final String address) { this.address = address; } public void setMacAddress(final String macAddress) { this.macAddress = macAddress; } public void setAuthenticationInfo(final String authenticationInfo) { this.authenticationInfo = authenticationInfo; } //------------------------------------------------------------------------------------------------- @Override public int hashCode() { return Objects.hash(address, macAddress, deviceName); } //------------------------------------------------------------------------------------------------- @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final DeviceRequestDTO other = (DeviceRequestDTO) obj; return Objects.equals(address, other.address) && Objects.equals(macAddress, other.macAddress) && Objects.equals(deviceName, other.deviceName); } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/DeviceResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class DeviceResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 3919207845374510215L; private long id; private String deviceName; private String address; private String macAddress; private String authenticationInfo; private String createdAt; private String updatedAt; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public DeviceResponseDTO() {} //------------------------------------------------------------------------------------------------- public DeviceResponseDTO(final long deviceId, final String deviceName, final String address, final String macAddress, final String authenticationInfo, final String createdAt, final String upDatedAt) { this.id = deviceId; this.deviceName = deviceName; this.address = address; this.macAddress = macAddress; this.authenticationInfo = authenticationInfo; this.createdAt = createdAt; this.updatedAt = upDatedAt; } //------------------------------------------------------------------------------------------------- public long getId() { return id; } public String getDeviceName() { return deviceName; } public String getAddress() { return address; } public String getMacAddress() { return macAddress; } public String getAuthenticationInfo() { return authenticationInfo; } public String getUpdatedAt() { return updatedAt; } public String getCreatedAt() { return createdAt; } //------------------------------------------------------------------------------------------------- public void setId(final long sytemId) { this.id = sytemId; } public void setDeviceName(final String deviceName) { this.deviceName = deviceName; } public void setAddress(final String address) { this.address = address; } public void setMacAddress(final String macAddress) { this.macAddress = macAddress; } public void setAuthenticationInfo(final String authenticationInfo) { this.authenticationInfo = authenticationInfo; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- @Override public int hashCode() { return Objects.hash(address, macAddress, deviceName); } //------------------------------------------------------------------------------------------------- @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final DeviceResponseDTO other = (DeviceResponseDTO) obj; return Objects.equals(address, other.address) && Objects.equals(macAddress, other.macAddress) && Objects.equals(deviceName, other.deviceName); } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ErrorMessageDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import eu.arrowhead.common.exception.ArrowheadException; import eu.arrowhead.common.exception.ExceptionType; @JsonInclude(Include.NON_NULL) public class ErrorMessageDTO implements Serializable, ErrorWrapperDTO { //================================================================================================= // members private static final long serialVersionUID = -3104121879721369522L; private String errorMessage; private int errorCode; private ExceptionType exceptionType; private String origin; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ErrorMessageDTO() {} //------------------------------------------------------------------------------------------------- public ErrorMessageDTO(final ArrowheadException ex) { setError(ex); } //------------------------------------------------------------------------------------------------- public ErrorMessageDTO(final String errorMessage, final int errorCode, final ExceptionType exceptionType, final String origin) { setError(errorMessage, errorCode, exceptionType, origin); } //------------------------------------------------------------------------------------------------- public void setError(final String errorMessage, final int errorCode, final ExceptionType exceptionType, final String origin) { this.errorMessage = errorMessage; this.errorCode = errorCode; this.exceptionType = exceptionType; this.origin = origin; } //------------------------------------------------------------------------------------------------- public void setError(final ArrowheadException ex) { if (ex != null) { setError(ex.getMessage(), ex.getErrorCode(), ex.getExceptionType(), ex.getOrigin()); } } //------------------------------------------------------------------------------------------------- public String getErrorMessage() { return errorMessage; } public int getErrorCode() { return errorCode; } public ExceptionType getExceptionType() { return exceptionType; } public String getOrigin() { return origin; } //------------------------------------------------------------------------------------------------- public void setErrorMessage(final String errorMessage) { this.errorMessage = errorMessage; } public void setErrorCode(final int errorCode) { this.errorCode = errorCode; } public void setExceptionType(final ExceptionType exceptionType) { this.exceptionType = exceptionType; } public void setOrigin(final String origin) { this.origin = origin; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } //------------------------------------------------------------------------------------------------- @JsonIgnore @Override public boolean isError() { return true; } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ErrorWrapperDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; public interface ErrorWrapperDTO { //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public boolean isError(); }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/EventDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class EventDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 6788896769029136585L; private String eventType; private Map<String,String> metaData; private String payload; private String timeStamp; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public EventDTO() {} //------------------------------------------------------------------------------------------------- public EventDTO(final String eventType, final Map<String,String> metaData, final String payload, final String timeStamp) { this.eventType = eventType; this.metaData = metaData; this.payload = payload; this.timeStamp = timeStamp; } //------------------------------------------------------------------------------------------------- public String getEventType() { return eventType; } public Map<String,String> getMetaData() { return metaData; } public String getPayload() { return payload; } public String getTimeStamp() { return timeStamp; } //------------------------------------------------------------------------------------------------- public void setEventType(final String eventType) { this.eventType = eventType; } public void setMetaData( final Map<String,String> metaData ) { this.metaData = metaData; } public void setPayload(final String payload) { this.payload = payload; } public void setTimeStamp(final String timeStamp) { this.timeStamp = timeStamp; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/EventPublishRequestDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class EventPublishRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -5708154911939798799L; private String eventType; private SystemRequestDTO source; private Map<String,String> metaData; private String payload; private String timeStamp; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public EventPublishRequestDTO() {} //------------------------------------------------------------------------------------------------- public EventPublishRequestDTO(final String eventType, final SystemRequestDTO source, final Map<String,String> metaData, final String payload, final String timeStamp) { this.eventType = eventType; this.source = source; this.metaData = metaData; this.payload = payload; this.timeStamp = timeStamp; } //------------------------------------------------------------------------------------------------- public String getEventType() { return eventType; } public SystemRequestDTO getSource() { return source; } public Map<String,String> getMetaData() { return metaData; } public String getPayload() { return payload; } public String getTimeStamp() { return timeStamp; } //------------------------------------------------------------------------------------------------- public void setEventType(final String eventType) { this.eventType = eventType; } public void setSource(final SystemRequestDTO subscriberSystem) { this.source = subscriberSystem; } public void setMetaData(final Map<String,String> metaData) { this.metaData = metaData; } public void setPayload(final String payload) { this.payload = payload; } public void setTimeStamp(final String timeStamp) { this.timeStamp = timeStamp; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/EventTypeRequestDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class EventTypeRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 1177806380638957855L; private String eventTypeName; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public EventTypeRequestDTO() {} //------------------------------------------------------------------------------------------------- public EventTypeRequestDTO(final String eventTypeName) { this.eventTypeName = eventTypeName; } //------------------------------------------------------------------------------------------------- public String getEventTypeName() { return eventTypeName; } //------------------------------------------------------------------------------------------------- public void setEventTypeName(final String eventTypeName) { this.eventTypeName = eventTypeName; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/EventTypeResponseDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class EventTypeResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 6112584843302681040L; private long id; private String eventTypeName; private String createdAt; private String updatedAt; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public EventTypeResponseDTO() {} //------------------------------------------------------------------------------------------------- public EventTypeResponseDTO(final long id, final String eventTypeName, final String createdAt, final String updatedAt) { this.id = id; this.eventTypeName = eventTypeName; this.createdAt = createdAt; this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- public long getId() { return id; } public String getEventTypeName() { return eventTypeName; } public String getCreatedAt() { return createdAt; } public String getUpdatedAt() { return updatedAt; } //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setEventTypeName(final String eventTypeName) { this.eventTypeName = eventTypeName; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/IcmpPingRequestACK.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.UUID; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class IcmpPingRequestACK implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -7812241728073959599L; private String ackOk; private UUID externalMeasurementUuid; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public IcmpPingRequestACK() {} //------------------------------------------------------------------------------------------------- public String getAckOk() { return ackOk; } public UUID getExternalMeasurementUuid() { return externalMeasurementUuid; } //------------------------------------------------------------------------------------------------- public void setAckOk(final String ackOk) { this.ackOk = ackOk; } public void setExternalMeasurementUuid(final UUID externalMeasurementUuid) { this.externalMeasurementUuid = externalMeasurementUuid; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/IcmpPingRequestDTO.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class IcmpPingRequestDTO implements Serializable{ //================================================================================================= // members private static final long serialVersionUID = 8327872537376847255L; private String host; private Integer ttl; private Integer packetSize; private Long timeout; private Integer timeToRepeat; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public String getHost() { return host; } public Integer getTtl() { return ttl; } public Integer getPacketSize() { return packetSize; } public Long getTimeout() { return timeout; } public Integer getTimeToRepeat() { return timeToRepeat; } //------------------------------------------------------------------------------------------------- public void setHost(final String host) { this.host = host; } public void setTtl(final Integer ttl) { this.ttl = ttl; } public void setPacketSize(final Integer packetSize) { this.packetSize = packetSize; } public void setTimeout(final Long timeout) { this.timeout = timeout; } public void setTimeToRepeat(final Integer timeToRepeat) { this.timeToRepeat = timeToRepeat; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/IcmpPingResponseDTO.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class IcmpPingResponseDTO implements Serializable{ //================================================================================================= // members private static final long serialVersionUID = 7382047276356365361L; private boolean successFlag; private boolean timeoutFlag; private String errorMessage; private String throwable; private String host; private Integer size; private Integer rtt; private Integer ttl; private Long duration; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public IcmpPingResponseDTO() {} //------------------------------------------------------------------------------------------------- public boolean isSuccessFlag() { return successFlag; } public boolean isTimeoutFlag() { return timeoutFlag; } public String getErrorMessage() { return errorMessage; } public String getThrowable() { return throwable; } public String getHost() { return host; } public Integer getSize() { return size; } public Integer getRtt() { return rtt; } public Integer getTtl() { return ttl; } public Long getDuration() { return duration; } //------------------------------------------------------------------------------------------------- public void setSuccessFlag(final boolean successFlag) { this.successFlag = successFlag; } public void setTimeoutFlag(final boolean timeoutFlag) { this.timeoutFlag = timeoutFlag; } public void setErrorMessage(final String errorMessage) { this.errorMessage = errorMessage; } public void setThrowable(final String throwable) { this.throwable = throwable; } public void setHost(final String host) { this.host = host; } public void setSize(final Integer size) { this.size = size; } public void setRtt(final Integer rtt) { this.rtt = rtt; } public void setTtl(final Integer ttl) { this.ttl = ttl; } public void setDuration(final Long duration) { this.duration = duration; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/KeyPairDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class KeyPairDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 4141153476434846717L; private String keyAlgorithm; private String keyFormat; private String publicKey; private String privateKey; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public KeyPairDTO() {} //------------------------------------------------------------------------------------------------- public KeyPairDTO(final String keyAlgorithm, final String keyFormat, final String publicKey, final String privateKey) { this.keyAlgorithm = keyAlgorithm; this.keyFormat = keyFormat; this.publicKey = publicKey; this.privateKey = privateKey; } //------------------------------------------------------------------------------------------------- public String getKeyAlgorithm() { return keyAlgorithm; } public String getKeyFormat() { return keyFormat; } public String getPublicKey() { return publicKey; } public String getPrivateKey() { return privateKey; } //------------------------------------------------------------------------------------------------- public void setKeyAlgorithm(final String keyAlgorithm) { this.keyAlgorithm = keyAlgorithm; } public void setKeyFormat(final String keyFormat) { this.keyFormat = keyFormat; } public void setPublicKey(final String publicKey) { this.publicKey = publicKey; } public void setPrivateKey(final String privateKey) { this.privateKey = privateKey; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/OnboardingResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public abstract class OnboardingResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 1L; private ServiceEndpoint deviceRegistry; private ServiceEndpoint systemRegistry; private ServiceEndpoint serviceRegistry; private ServiceEndpoint orchestrationService; private CertificateCreationResponseDTO onboardingCertificate; private String intermediateCertificate; private String rootCertificate; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public OnboardingResponseDTO() {} //------------------------------------------------------------------------------------------------- public OnboardingResponseDTO(final ServiceEndpoint deviceRegistry, final ServiceEndpoint systemRegistry, final ServiceEndpoint serviceRegistry, final ServiceEndpoint orchestrationService, final CertificateCreationResponseDTO onboardingCertificate, final String intermediateCertificate, final String rootCertificate) { this.deviceRegistry = deviceRegistry; this.systemRegistry = systemRegistry; this.serviceRegistry = serviceRegistry; this.orchestrationService = orchestrationService; this.onboardingCertificate = onboardingCertificate; this.intermediateCertificate = intermediateCertificate; this.rootCertificate = rootCertificate; } //------------------------------------------------------------------------------------------------- public ServiceEndpoint getDeviceRegistry() { return deviceRegistry; } public ServiceEndpoint getSystemRegistry() { return systemRegistry; } public ServiceEndpoint getServiceRegistry() { return serviceRegistry; } public ServiceEndpoint getOrchestrationService() { return orchestrationService; } public CertificateCreationResponseDTO getOnboardingCertificate() { return onboardingCertificate; } public String getIntermediateCertificate() { return intermediateCertificate; } public String getRootCertificate() { return rootCertificate; } //------------------------------------------------------------------------------------------------- public void setDeviceRegistry(final ServiceEndpoint deviceRegistry) { this.deviceRegistry = deviceRegistry; } public void setSystemRegistry(final ServiceEndpoint systemRegistry) { this.systemRegistry = systemRegistry; } public void setServiceRegistry(final ServiceEndpoint serviceRegistry) { this.serviceRegistry = serviceRegistry; } public void setOrchestrationService(final ServiceEndpoint orchestrationService) { this.orchestrationService = orchestrationService; } public void setOnboardingCertificate(final CertificateCreationResponseDTO onboardingCertificate) { this.onboardingCertificate = onboardingCertificate; } public void setIntermediateCertificate(final String intermediateCertificate) { this.intermediateCertificate = intermediateCertificate; } public void setRootCertificate(final String rootCertificate) { this.rootCertificate = rootCertificate; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/OnboardingWithCsrRequestDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class OnboardingWithCsrRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -2753603721068210444L; private String certificateSigningRequest; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public String getCertificateSigningRequest() { return certificateSigningRequest; } //------------------------------------------------------------------------------------------------- public void setCertificateSigningRequest(final String certificateSigningRequest) { this.certificateSigningRequest = certificateSigningRequest; } //------------------------------------------------------------------------------------------------- @Override public int hashCode() { return Objects.hash(certificateSigningRequest); } //------------------------------------------------------------------------------------------------- @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final OnboardingWithCsrRequestDTO other = (OnboardingWithCsrRequestDTO) obj; return Objects.equals(certificateSigningRequest, other.certificateSigningRequest); } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/OnboardingWithCsrResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; public class OnboardingWithCsrResponseDTO extends OnboardingResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -1696423117054488L; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public OnboardingWithCsrResponseDTO() {} //------------------------------------------------------------------------------------------------- public OnboardingWithCsrResponseDTO(final ServiceEndpoint deviceRegistry, final ServiceEndpoint systemRegistry, final ServiceEndpoint serviceRegistry, final ServiceEndpoint orchestrationService, final CertificateCreationResponseDTO onboardingCertificate, final String intermediateCertificate, final String rootCertificate) { super(deviceRegistry, systemRegistry, serviceRegistry, orchestrationService, onboardingCertificate, intermediateCertificate, rootCertificate); } // this class exist to keep the structure of <operation>RequestDTO, <operation>ResponseDTO }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/OnboardingWithNameRequestDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class OnboardingWithNameRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -4222019369804191344L; private CertificateCreationRequestDTO creationRequestDTO; //================================================================================================= // constructors //------------------------------------------------------------------------------------------------- public OnboardingWithNameRequestDTO() {} //------------------------------------------------------------------------------------------------- public OnboardingWithNameRequestDTO(final CertificateCreationRequestDTO creationRequestDTO) { this.creationRequestDTO = creationRequestDTO; } //------------------------------------------------------------------------------------------------- public CertificateCreationRequestDTO getCreationRequestDTO() { return creationRequestDTO; } //------------------------------------------------------------------------------------------------- public void setCreationRequestDTO(final CertificateCreationRequestDTO creationRequestDTO) { this.creationRequestDTO = creationRequestDTO; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/OnboardingWithNameResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; public class OnboardingWithNameResponseDTO extends OnboardingResponseDTO { //================================================================================================= // members private static final long serialVersionUID = 6552636286038615996L; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public OnboardingWithNameResponseDTO() {} //------------------------------------------------------------------------------------------------- public OnboardingWithNameResponseDTO(final ServiceEndpoint deviceRegistry, final ServiceEndpoint systemRegistry, final ServiceEndpoint serviceRegistry, final ServiceEndpoint orchestrationService, final CertificateCreationResponseDTO onboardingCertificate, final String intermediateCertificate, final String rootCertificate) { super(deviceRegistry, systemRegistry, serviceRegistry, orchestrationService, onboardingCertificate, intermediateCertificate, rootCertificate); } // this class exist to keep the structure of <operation>RequestDTO, <operation>ResponseDTO }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/OrchestrationFlags.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.util.HashMap; import java.util.Map; import eu.arrowhead.common.CommonConstants; public class OrchestrationFlags extends HashMap<String,Boolean> { //================================================================================================= // members private static final long serialVersionUID = 5901365646769727914L; private static final Map<String,Flag> flagMap = initFlagMap(); //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public OrchestrationFlags() { super(Flag.values().length); for (final Flag flag : Flag.values()) { put(flag, false); } } //------------------------------------------------------------------------------------------------- public OrchestrationFlags(final Map<String,Boolean> map) { this(); if (map != null) { for (final Entry<String,Boolean> entry : map.entrySet()) { if (flagMap.containsKey(entry.getKey())) { put(flagMap.get(entry.getKey()), entry.getValue()); } } } } //------------------------------------------------------------------------------------------------- public Boolean put(final Flag flag, final Boolean value) { if (flag == null) { throw new IllegalArgumentException("Flag is null."); } final boolean validValue = (value == null ? false : value); return super.put(flag.getFlag(), validValue); } //------------------------------------------------------------------------------------------------- public boolean get(final Flag flag) { if (flag == null) { throw new IllegalArgumentException("Flag is null."); } return super.get(flag.getFlag()); } //------------------------------------------------------------------------------------------------- public boolean getOrDefault(final Flag flag, final boolean defaultValue) { if (flag == null) { throw new IllegalArgumentException("Flag is null."); } return super.getOrDefault(flag.getFlag(), defaultValue); } //------------------------------------------------------------------------------------------------- public boolean containsKey(final Flag flag) { if (flag == null) { return false; } return super.containsKey(flag.getFlag()); } //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- private static Map<String,Flag> initFlagMap() { final Map<String,Flag> result = new HashMap<>(Flag.values().length); result.put(CommonConstants.ORCHESTRATION_FLAG_MATCHMAKING, Flag.MATCHMAKING); result.put(CommonConstants.ORCHESTRATION_FLAG_METADATA_SEARCH, Flag.METADATA_SEARCH); result.put(CommonConstants.ORCHESTRATION_FLAG_ONLY_PREFERRED, Flag.ONLY_PREFERRED); result.put(CommonConstants.ORCHESTRATION_FLAG_PING_PROVIDERS, Flag.PING_PROVIDERS); result.put(CommonConstants.ORCHESTRATION_FLAG_OVERRIDE_STORE, Flag.OVERRIDE_STORE); result.put(CommonConstants.ORCHESTRATION_FLAG_TRIGGER_INTER_CLOUD, Flag.TRIGGER_INTER_CLOUD); result.put(CommonConstants.ORCHESTRATION_FLAG_EXTERNAL_SERVICE_REQUEST, Flag.EXTERNAL_SERVICE_REQUEST); result.put(CommonConstants.ORCHESTRATION_FLAG_ENABLE_INTER_CLOUD, Flag.ENABLE_INTER_CLOUD); result.put(CommonConstants.ORCHESTRATION_FLAG_ENABLE_QOS, Flag.ENABLE_QOS); result.put(CommonConstants.ORCHESTRATION_FLAG_ONLY_IP_ADDRESS_RESPONSE, Flag.ONLY_IP_ADDRESS_RESPONSE); result.put(CommonConstants.ORCHESTRATION_FLAG_ONLY_IPV4_ADDRESS_RESPONSE, Flag.ONLY_IPV4_ADDRESS_RESPONSE); result.put(CommonConstants.ORCHESTRATION_FLAG_ONLY_IPV6_ADDRESS_RESPONSE, Flag.ONLY_IPV6_ADDRESS_RESPONSE); return result; } //================================================================================================= // nested classes //------------------------------------------------------------------------------------------------- public enum Flag { //================================================================================================= // elements MATCHMAKING(CommonConstants.ORCHESTRATION_FLAG_MATCHMAKING), METADATA_SEARCH(CommonConstants.ORCHESTRATION_FLAG_METADATA_SEARCH), ONLY_PREFERRED(CommonConstants.ORCHESTRATION_FLAG_ONLY_PREFERRED), PING_PROVIDERS(CommonConstants.ORCHESTRATION_FLAG_PING_PROVIDERS), OVERRIDE_STORE(CommonConstants.ORCHESTRATION_FLAG_OVERRIDE_STORE), TRIGGER_INTER_CLOUD(CommonConstants.ORCHESTRATION_FLAG_TRIGGER_INTER_CLOUD), EXTERNAL_SERVICE_REQUEST(CommonConstants.ORCHESTRATION_FLAG_EXTERNAL_SERVICE_REQUEST), ENABLE_INTER_CLOUD(CommonConstants.ORCHESTRATION_FLAG_ENABLE_INTER_CLOUD), ENABLE_QOS(CommonConstants.ORCHESTRATION_FLAG_ENABLE_QOS), ONLY_IP_ADDRESS_RESPONSE(CommonConstants.ORCHESTRATION_FLAG_ONLY_IP_ADDRESS_RESPONSE), ONLY_IPV4_ADDRESS_RESPONSE(CommonConstants.ORCHESTRATION_FLAG_ONLY_IPV4_ADDRESS_RESPONSE), ONLY_IPV6_ADDRESS_RESPONSE(CommonConstants.ORCHESTRATION_FLAG_ONLY_IPV6_ADDRESS_RESPONSE); //================================================================================================= // members private final String flag; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public String getFlag() { return flag; } //------------------------------------------------------------------------------------------------- @Override public String toString() { return getFlag(); } //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- private Flag(final String flag) { this.flag = flag; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/OrchestrationFormRequestDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.springframework.util.Assert; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import eu.arrowhead.common.dto.shared.OrchestrationFlags.Flag; import eu.arrowhead.common.exception.BadPayloadException; public class OrchestrationFormRequestDTO implements Serializable { public static final String QOS_REQUIREMENT_MAXIMUM_RESPONSE_TIME_THRESHOLD = "qosMaxRespTimeThreshold"; // in milliseconds, it means the maximum value of the maximum response time public static final String QOS_REQUIREMENT_AVERAGE_RESPONSE_TIME_THRESHOLD = "qosAvgRespTime"; // in milliseconds, it means the maximum value of the average (mean) response time public static final String QOS_REQUIREMENT_JITTER_THRESHOLD = "qosJitterThreshold"; // in milliseconds, it mean the maximum acceptable jitter public static final String QOS_REQUIREMENT_MAXIMUM_RECENT_PACKET_LOSS = "qosMaxRecentPacketLoss"; // in percent, for example 20% is 20 public static final String QOS_REQUIREMENT_MAXIMUM_PACKET_LOSS = "qosMaxPacketLost"; // in percent public static final String QOS_COMMAND_EXCLUSIVITY = "qosExclusivity"; // in seconds //================================================================================================= // members private static final long serialVersionUID = 5875552294338921238L; private SystemRequestDTO requesterSystem; private CloudRequestDTO requesterCloud; private ServiceQueryFormDTO requestedService; private OrchestrationFlags orchestrationFlags = new OrchestrationFlags(); private List<PreferredProviderDataDTO> preferredProviders = new ArrayList<>(); private Map<String,String> commands = new HashMap<>(); private Map<String,String> qosRequirements = new HashMap<>(); //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public OrchestrationFormRequestDTO() {} //------------------------------------------------------------------------------------------------- public SystemRequestDTO getRequesterSystem() { return requesterSystem; } public CloudRequestDTO getRequesterCloud() { return requesterCloud; } public ServiceQueryFormDTO getRequestedService() { return requestedService; } public OrchestrationFlags getOrchestrationFlags() { return orchestrationFlags; } public List<PreferredProviderDataDTO> getPreferredProviders() { return preferredProviders; } public Map<String,String> getCommands() { return commands; } public Map<String,String> getQosRequirements() { return qosRequirements; } //------------------------------------------------------------------------------------------------- public void setRequesterSystem(final SystemRequestDTO requesterSystem) { this.requesterSystem = requesterSystem; } public void setRequesterCloud(final CloudRequestDTO requesterCloud) { this.requesterCloud = requesterCloud; } public void setRequestedService(final ServiceQueryFormDTO requestedService) { this.requestedService = requestedService; } public void setOrchestrationFlags(final Map<String,Boolean> orchestrationFlags) { this.orchestrationFlags = new OrchestrationFlags(orchestrationFlags); } //------------------------------------------------------------------------------------------------- public void setCommands(final Map<String,String> commands) { if (commands != null) { this.commands = commands; } } //------------------------------------------------------------------------------------------------- public void setPreferredProviders(final List<PreferredProviderDataDTO> preferredProviders) { if (preferredProviders != null) { this.preferredProviders = preferredProviders; } } //------------------------------------------------------------------------------------------------- public void setQosRequirements(final Map<String,String> qosRequirements) { if (qosRequirements != null) { this.qosRequirements = qosRequirements; } } //------------------------------------------------------------------------------------------------- public OrchestrationFormRequestDTO validateCrossParameterConstraints() { if (requestedService == null && orchestrationFlags.get(Flag.OVERRIDE_STORE)) { throw new BadPayloadException("Requested service can not be null when \"" + Flag.OVERRIDE_STORE + "\" is TRUE"); } if (requestedService == null && orchestrationFlags.get(Flag.TRIGGER_INTER_CLOUD)) { throw new BadPayloadException("Requested service can not be null when \"" + Flag.TRIGGER_INTER_CLOUD + "\" is TRUE"); } if (orchestrationFlags.get(Flag.ONLY_PREFERRED)) { for (final Iterator<PreferredProviderDataDTO> it = preferredProviders.iterator(); it.hasNext();) { final PreferredProviderDataDTO provider = it.next(); if (orchestrationFlags.get(Flag.ENABLE_INTER_CLOUD) && !provider.isValid()) { it.remove(); } else if (!provider.isLocal()) { it.remove(); } } if (preferredProviders.isEmpty()) { throw new BadPayloadException("There is no valid preferred provider, but \"" + Flag.ONLY_PREFERRED + "\" is set to true"); } } if (orchestrationFlags.get(Flag.ENABLE_QOS) && commands.containsKey(QOS_COMMAND_EXCLUSIVITY) && !orchestrationFlags.get(Flag.MATCHMAKING)) { throw new BadPayloadException("Exclusive service orchestration is only possible when \"" + Flag.MATCHMAKING + "\" is set to true"); } return this; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- private OrchestrationFormRequestDTO(final Builder builder) { this.requesterSystem = builder.requesterSystem; this.requesterCloud = builder.requesterCloud; this.requestedService = builder.requestedService; this.orchestrationFlags = builder.orchestrationFlags; this.preferredProviders = builder.preferredProviders; this.setCommands(builder.commands); this.setQosRequirements(builder.qosRequirements); } //================================================================================================= // nested classes //------------------------------------------------------------------------------------------------- public static class Builder { //================================================================================================= // members private final SystemRequestDTO requesterSystem; private CloudRequestDTO requesterCloud; private ServiceQueryFormDTO requestedService; private final OrchestrationFlags orchestrationFlags = new OrchestrationFlags(); private List<PreferredProviderDataDTO> preferredProviders = new ArrayList<>(); private Map<String,String> commands = new HashMap<>(); private Map<String,String> qosRequirements = new HashMap<>(); //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public Builder(final SystemRequestDTO requesterSystem) { Assert.notNull(requesterSystem, "requesterSystem is null."); this.requesterSystem = requesterSystem; } //------------------------------------------------------------------------------------------------- public Builder requesterCloud(final CloudRequestDTO requesterCloud) { this.requesterCloud = requesterCloud; return this; } //------------------------------------------------------------------------------------------------- public Builder requestedService(final ServiceQueryFormDTO requestedService) { this.requestedService = requestedService; return this; } //------------------------------------------------------------------------------------------------- public Builder flag(final Flag flag, final boolean value) { this.orchestrationFlags.put(flag, value); return this; } //------------------------------------------------------------------------------------------------- public Builder flags(final OrchestrationFlags flags) { this.orchestrationFlags.putAll(flags); return this; } //------------------------------------------------------------------------------------------------- public Builder preferredProviders(final PreferredProviderDataDTO... preferredProviders) { this.preferredProviders = preferredProviders == null || preferredProviders.length == 0 ? List.of() : Arrays.asList(preferredProviders); return this; } //------------------------------------------------------------------------------------------------- public Builder commands(final Map<String,String> commands) { this.commands = commands; return this; } //------------------------------------------------------------------------------------------------- public Builder command(final String key, final String value) { Assert.isTrue(key != null && !key.isBlank(), "Key is null or blank"); if (this.commands == null) { this.commands = new HashMap<>(); } this.commands.put(key, value); return this; } //------------------------------------------------------------------------------------------------- public Builder qosRequirements(final Map<String,String> qosRequirements) { this.qosRequirements = qosRequirements; return this; } //------------------------------------------------------------------------------------------------- public Builder qosRequirement(final String key, final String value) { Assert.isTrue(key != null && !key.isBlank(), "Key is null or blank"); if (this.qosRequirements == null) { this.qosRequirements = new HashMap<>(); } this.qosRequirements.put(key, value); return this; } //------------------------------------------------------------------------------------------------- public OrchestrationFormRequestDTO build() { return new OrchestrationFormRequestDTO(this).validateCrossParameterConstraints(); } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/OrchestrationResponseDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class OrchestrationResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -7019947320156696116L; protected List<OrchestrationResultDTO> response = new ArrayList<>(); //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public OrchestrationResponseDTO() {} //------------------------------------------------------------------------------------------------- public OrchestrationResponseDTO(final List<OrchestrationResultDTO> response) { this.response = response != null ? response : List.of(); } //------------------------------------------------------------------------------------------------- public List<OrchestrationResultDTO> getResponse() { return response; } //------------------------------------------------------------------------------------------------- public void setResponse(final List<OrchestrationResultDTO> response) { if (response != null) { this.response = response; } } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/OrchestrationResultDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.springframework.util.Assert; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class OrchestrationResultDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -8155568751654674141L; private SystemResponseDTO provider; private ServiceDefinitionResponseDTO service; private String serviceUri; private ServiceSecurityType secure; private Map<String,String> metadata; private List<ServiceInterfaceResponseDTO> interfaces; private Integer version; @JsonIgnore private QoSMeasurementAttributesFormDTO qosMeasurements; private Map<String,String> authorizationTokens; private List<OrchestratorWarnings> warnings = new ArrayList<>(); //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public OrchestrationResultDTO() {} //------------------------------------------------------------------------------------------------- public OrchestrationResultDTO(final SystemResponseDTO provider, final ServiceDefinitionResponseDTO service, final String serviceUri, final ServiceSecurityType secure, final Map<String,String> metadata, final List<ServiceInterfaceResponseDTO> interfaces, final Integer version, final Map<String,String> authorizationTokens, final List<OrchestratorWarnings> warnings) { Assert.notNull(provider, "provider is null."); Assert.notNull(service, "service is null."); Assert.isTrue(interfaces != null && !interfaces.isEmpty(), "interfaces is null or empty."); this.provider = provider; this.service = service; this.serviceUri = serviceUri; this.secure = secure; this.metadata = metadata; this.interfaces = interfaces; this.version = version; this.authorizationTokens = authorizationTokens; this.warnings = warnings; } //------------------------------------------------------------------------------------------------- public OrchestrationResultDTO(final SystemResponseDTO provider, final ServiceDefinitionResponseDTO service, final String serviceUri, final ServiceSecurityType secure, final Map<String,String> metadata, final List<ServiceInterfaceResponseDTO> interfaces, final Integer version) { this(provider, service, serviceUri, secure, metadata, interfaces, version, null, null); } //------------------------------------------------------------------------------------------------- public SystemResponseDTO getProvider() { return provider; } public ServiceDefinitionResponseDTO getService() { return service; } public String getServiceUri() { return serviceUri; } public ServiceSecurityType getSecure() { return secure; } public Map<String,String> getMetadata() { return metadata; } public List<ServiceInterfaceResponseDTO> getInterfaces() { return interfaces; } public Integer getVersion() { return version; } public QoSMeasurementAttributesFormDTO getQosMeasurements() { return qosMeasurements; } public Map<String,String> getAuthorizationTokens() { return authorizationTokens; } public List<OrchestratorWarnings> getWarnings() { return warnings; } //------------------------------------------------------------------------------------------------- public void setProvider(final SystemResponseDTO provider) { this.provider = provider; } public void setService(final ServiceDefinitionResponseDTO service) { this.service = service; } public void setServiceUri(final String serviceUri) { this.serviceUri = serviceUri; } public void setSecure(final ServiceSecurityType secure) { this.secure = secure; } public void setMetadata(final Map<String,String> metadata) { this.metadata = metadata; } public void setInterfaces(final List<ServiceInterfaceResponseDTO> interfaces) { this.interfaces = interfaces; } public void setVersion(final Integer version) { this.version = version; } public void setQosMeasurements(final QoSMeasurementAttributesFormDTO qosMeasurements) { this.qosMeasurements = qosMeasurements; } public void setAuthorizationTokens(final Map<String,String> authorizationTokens) { this.authorizationTokens = authorizationTokens; } public void setWarnings(final List<OrchestratorWarnings> warnings) { this.warnings = warnings; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/OrchestratorWarnings.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; public enum OrchestratorWarnings { FROM_OTHER_CLOUD, TTL_EXPIRING, TTL_EXPIRED, TTL_UNKNOWN, VIA_GATEWAY }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/PreferredProviderDataDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class PreferredProviderDataDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -6954138371746479685L; private SystemRequestDTO providerSystem; private CloudRequestDTO providerCloud; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public SystemRequestDTO getProviderSystem() { return providerSystem; } public CloudRequestDTO getProviderCloud() { return providerCloud; } //------------------------------------------------------------------------------------------------- public void setProviderSystem(final SystemRequestDTO providerSystem) { this.providerSystem = providerSystem; } public void setProviderCloud(final CloudRequestDTO providerCloud) { this.providerCloud = providerCloud; } //------------------------------------------------------------------------------------------------- @JsonIgnore public boolean isLocal() { return providerSystem != null && providerCloud == null; } //------------------------------------------------------------------------------------------------- @JsonIgnore public boolean isGlobal() { return providerCloud != null; } //------------------------------------------------------------------------------------------------- @JsonIgnore public boolean isValid() { return isLocal() || isGlobal(); } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } //------------------------------------------------------------------------------------------------- @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((providerCloud == null) ? 0 : providerCloud.hashCode()); result = prime * result + ((providerSystem == null) ? 0 : providerSystem.hashCode()); return result; } //------------------------------------------------------------------------------------------------- @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final PreferredProviderDataDTO other = (PreferredProviderDataDTO) obj; if (providerCloud == null) { if (other.providerCloud != null) { return false; } } else if (!providerCloud.equals(other.providerCloud)) { return false; } if (providerSystem == null) { if (other.providerSystem != null) { return false; } } else if (!providerSystem.equals(other.providerSystem)) { return false; } return true; } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/QoSMeasurementAttributesFormDTO.java
/******************************************************************************** * Copyright (c) 2020 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class QoSMeasurementAttributesFormDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -7212471265314450784L; private ServiceRegistryResponseDTO serviceRegistryEntry; private boolean isProviderAvailable = false; private String lastAccessAt; private Integer minResponseTime; private Integer maxResponseTime; private Integer meanResponseTimeWithTimeout; private Integer meanResponseTimeWithoutTimeout; private Integer jitterWithTimeout; private Integer jitterWithoutTimeout; private long sent; private long received; private long sentAll; private long receivedAll; private Integer lostPerMeasurementPercent; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public QoSMeasurementAttributesFormDTO() {} //------------------------------------------------------------------------------------------------- public QoSMeasurementAttributesFormDTO(final ServiceRegistryResponseDTO serviceRegistryEntry, final boolean isProviderAvailable, final String lastAccessAt, final Integer minResponseTime, final Integer maxResponseTime, final Integer meanResponseTimeWithTimeout, final Integer meanResponseTimeWithoutTimeout, final Integer jitterWithTimeout, final Integer jitterWithoutTimeout, final long sent, final long received, final long sentAll, final long receivedAll, final Integer lostPerMeasurementPercent) { this.serviceRegistryEntry = serviceRegistryEntry; this.isProviderAvailable = isProviderAvailable; this.lastAccessAt = lastAccessAt; this.minResponseTime = minResponseTime; this.maxResponseTime = maxResponseTime; this.meanResponseTimeWithTimeout = meanResponseTimeWithTimeout; this.meanResponseTimeWithoutTimeout = meanResponseTimeWithoutTimeout; this.jitterWithTimeout = jitterWithTimeout; this.jitterWithoutTimeout = jitterWithoutTimeout; this.sent = sent; this.received = received; this.sentAll = sentAll; this.receivedAll = receivedAll; this.lostPerMeasurementPercent = lostPerMeasurementPercent; } //------------------------------------------------------------------------------------------------- public ServiceRegistryResponseDTO getServiceRegistryEntry() { return serviceRegistryEntry; } public boolean isProviderAvailable() { return isProviderAvailable; } public String getLastAccessAt() { return lastAccessAt; } public Integer getMinResponseTime() { return minResponseTime; } public Integer getMaxResponseTime() { return maxResponseTime; } public Integer getMeanResponseTimeWithTimeout() { return meanResponseTimeWithTimeout; } public Integer getMeanResponseTimeWithoutTimeout() { return meanResponseTimeWithoutTimeout; } public Integer getJitterWithTimeout() { return jitterWithTimeout; } public Integer getJitterWithoutTimeout() { return jitterWithoutTimeout; } public long getSent() { return sent; } public long getReceived() { return received; } public long getSentAll() { return sentAll; } public long getReceivedAll() { return receivedAll; } public Integer getLostPerMeasurementPercent() { return lostPerMeasurementPercent; } //------------------------------------------------------------------------------------------------- public void setServiceRegistryEntry(final ServiceRegistryResponseDTO serviceRegistryEntry) { this.serviceRegistryEntry = serviceRegistryEntry; } public void setProviderAvailable(final boolean isProviderAvailable) { this.isProviderAvailable = isProviderAvailable; } public void setLastAccessAt(final String lastAccessAt) { this.lastAccessAt = lastAccessAt; } public void setMinResponseTime(final Integer minResponseTime) { this.minResponseTime = minResponseTime; } public void setMaxResponseTime(final Integer maxResponseTime) { this.maxResponseTime = maxResponseTime; } public void setMeanResponseTimeWithTimeout(final Integer meanResponseTimeWithTimeout) { this.meanResponseTimeWithTimeout = meanResponseTimeWithTimeout; } public void setMeanResponseTimeWithoutTimeout(final Integer meanResponseTimeWithoutTimeout) { this.meanResponseTimeWithoutTimeout = meanResponseTimeWithoutTimeout; } public void setJitterWithTimeout(final Integer jitterWithTimeout) { this.jitterWithTimeout = jitterWithTimeout; } public void setJitterWithoutTimeout(final Integer jitterWithoutTimeout) { this.jitterWithoutTimeout = jitterWithoutTimeout; } public void setLostPerMeasurementPercent(final Integer lostPerMeasurementPercent) { this.lostPerMeasurementPercent = lostPerMeasurementPercent; } public void setSent(final long sent) { this.sent = sent; } public void setReceived(final long received) { this.received = received; } public void setSentAll(final long sentAll) { this.sentAll = sentAll; } public void setReceivedAll(final long receivedAll) { this.receivedAll = receivedAll; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/QoSMeasurementStatus.java
/******************************************************************************** * Copyright (c) 2020 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; public enum QoSMeasurementStatus { NEW, PENDING, FINISHED; }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/QoSMeasurementType.java
/******************************************************************************** * Copyright (c) 2020 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; public enum QoSMeasurementType { PING, RELAY_ECHO; }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/QosMonitorEventType.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; public enum QosMonitorEventType { //================================================================================================= // elements RECEIVED_MONITORING_REQUEST, STARTED_MONITORING_MEASUREMENT, FINISHED_MONITORING_MEASUREMENT, INTERRUPTED_MONITORING_MEASUREMENT; }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SenML.java
/******************************************************************************** * Copyright (c) 2020 {Lulea University of Technology} * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * {Lulea University of Technology} - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; //https://tools.ietf.org/html/rfc8428 @JsonInclude(Include.NON_NULL) public class SenML implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 1339023819803990044L; public static final long RELATIVE_TIMESTAMP_INDICATOR = 268435456L; private String bn; private Double bt; private String bu; private Double bv; private Double bs; private Short bver; private String n; private String u; private Double v = null; private String vs = null; private Boolean vb = null; private String vd = null; private Double s = null; private Double t = null; private Double ut = null; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public String getBn() { return bn; } public Double getBt() { return bt; } public String getBu() { return bu; } public Double getBv() { return bv; } public Double getBs() { return bs; } public Short getBver() { return bver; } public String getN() { return n; } public String getU() { return u; } public Double getV() { return v; } public String getVs() { return vs; } public Boolean getVb() { return vb; } public String getVd() { return vd; } public Double getS() { return s; } public Double getT() { return t; } public Double getUt() { return ut; } //------------------------------------------------------------------------------------------------- public void setBn(final String bn) { this.bn = bn; } public void setBt(final Double bt) { this.bt = bt; } public void setBu(final String bu) { this.bu = bu; } public void setBv(final Double bv) { this.bv = bv; } public void setBs(final Double bs) { this.bs = bs; } public void setBver(final Short bver) { this.bver = bver; } public void setN(final String n) { this.n = n; } public void setU(final String u) { this.u = u; } public void setV(final Double v) { this.v = v; } public void setVs(final String vs) { this.vs = vs; } public void setVb(final Boolean vb) { this.vb = vb; } public void setVd(final String vd) { this.vd = vd; } public void setS(final Double s) { this.s = s; } public void setT(final Double t) { this.t = t; } public void setUt(final Double ut) { this.ut = ut; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ServiceDefinitionResponseDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class ServiceDefinitionResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -1087135064729428440L; private long id; private String serviceDefinition; private String createdAt; private String updatedAt; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ServiceDefinitionResponseDTO() {} //------------------------------------------------------------------------------------------------- public ServiceDefinitionResponseDTO(final long id, final String serviceDefinition, final String createdAt, final String updatedAt) { this.id = id; this.serviceDefinition = serviceDefinition; this.createdAt = createdAt; this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- public long getId() { return id; } public String getServiceDefinition() { return serviceDefinition; } public String getCreatedAt() { return createdAt; } public String getUpdatedAt() { return updatedAt; } //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setServiceDefinition(final String serviceDefinition) { this.serviceDefinition = serviceDefinition; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ServiceEndpoint.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.net.URI; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import eu.arrowhead.common.core.CoreSystemService; public class ServiceEndpoint implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -8766267910533700737L; private CoreSystemService service; private URI uri; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ServiceEndpoint() {} //------------------------------------------------------------------------------------------------- public ServiceEndpoint(final CoreSystemService service, final URI uri) { this.service = service; this.uri = uri; } //------------------------------------------------------------------------------------------------- public CoreSystemService getService() { return service; } public URI getUri() { return uri; } //------------------------------------------------------------------------------------------------- public void setService(final CoreSystemService service) { this.service = service; } public void setUri(final URI uri) { this.uri = uri; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ServiceInterfaceResponseDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class ServiceInterfaceResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -4538017334892117044L; private long id; private String interfaceName; private String createdAt; private String updatedAt; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ServiceInterfaceResponseDTO() {} //------------------------------------------------------------------------------------------------- public ServiceInterfaceResponseDTO(final long id, final String interfaceName, final String createdAt, final String updatedAt) { this.id = id; this.interfaceName = interfaceName; this.createdAt = createdAt; this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- public long getId() { return id; } public String getInterfaceName() { return interfaceName; } public String getCreatedAt() { return createdAt; } public String getUpdatedAt() { return updatedAt; } //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setInterfaceName(final String interfaceName) { this.interfaceName = interfaceName; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ServiceQueryFormDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.util.Assert; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ServiceQueryFormDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -2699823381165019336L; private String serviceDefinitionRequirement; private List<String> interfaceRequirements; // if specified at least one of the interfaces must match private List<ServiceSecurityType> securityRequirements; // if specified at least one of the types must match private Map<String,String> metadataRequirements; // if specified the whole content of the map must match private Integer versionRequirement; // if specified version must match private Integer minVersionRequirement; // if specified version must be equals or higher; ignored if versionRequirement is specified private Integer maxVersionRequirement; // if specified version must be equals or lower; ignored if versionRequirement is specified private List<AddressType> providerAddressTypeRequirements; // if specified one of the address types must match private boolean pingProviders = false; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ServiceQueryFormDTO() {} //------------------------------------------------------------------------------------------------- public String getServiceDefinitionRequirement() { return serviceDefinitionRequirement; } public List<String> getInterfaceRequirements() { return interfaceRequirements; } public List<ServiceSecurityType> getSecurityRequirements() { return securityRequirements; } public Map<String,String> getMetadataRequirements() { return metadataRequirements; } public Integer getVersionRequirement() { return versionRequirement; } public Integer getMinVersionRequirement() { return minVersionRequirement; } public Integer getMaxVersionRequirement() { return maxVersionRequirement; } public boolean getPingProviders() { return pingProviders; } public List<AddressType> getProviderAddressTypeRequirements() { return providerAddressTypeRequirements; } //------------------------------------------------------------------------------------------------- public void setServiceDefinitionRequirement(final String serviceDefinitionRequirement) { this.serviceDefinitionRequirement = serviceDefinitionRequirement; } public void setInterfaceRequirements(final List<String> interfaceRequirements) { this.interfaceRequirements = interfaceRequirements; } public void setSecurityRequirements(final List<ServiceSecurityType> securityRequirements) { this.securityRequirements = securityRequirements; } public void setMetadataRequirements(final Map<String,String> metadataRequirements) { this.metadataRequirements = metadataRequirements; } public void setVersionRequirement(final Integer versionRequirement) { this.versionRequirement = versionRequirement; } public void setMinVersionRequirement(final Integer minVersionRequirement) { this.minVersionRequirement = minVersionRequirement; } public void setMaxVersionRequirement(final Integer maxVersionRequirement) { this.maxVersionRequirement = maxVersionRequirement; } public void setPingProviders(final boolean pingProviders) { this.pingProviders = pingProviders; } public void setProviderAddressTypeRequirements(final List<AddressType> providerAddressTypeRequirements) { this.providerAddressTypeRequirements = providerAddressTypeRequirements; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- private ServiceQueryFormDTO(final Builder builder) { this.serviceDefinitionRequirement = builder.serviceDefinitionRequirement; this.interfaceRequirements = builder.interfaceRequirements; this.securityRequirements = builder.securityRequirements; this.metadataRequirements = builder.metadataRequirements; this.versionRequirement = builder.versionRequirement; this.minVersionRequirement = builder.minVersionRequirement; this.maxVersionRequirement = builder.maxVersionRequirement; this.pingProviders = builder.pingProviders; this.providerAddressTypeRequirements = builder.providerAddressTypeRequirements; } //================================================================================================= // nested classes //------------------------------------------------------------------------------------------------- public static class Builder { //================================================================================================= // members private final String serviceDefinitionRequirement; private List<String> interfaceRequirements; private List<ServiceSecurityType> securityRequirements; private Map<String,String> metadataRequirements; private Integer versionRequirement; private Integer minVersionRequirement; private Integer maxVersionRequirement; private List<AddressType> providerAddressTypeRequirements; private boolean pingProviders = false; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public Builder(final String serviceDefinitionRequirement) { Assert.isTrue(serviceDefinitionRequirement != null && !serviceDefinitionRequirement.isBlank(), "serviceDefinitionRequirement is null or blank."); this.serviceDefinitionRequirement = serviceDefinitionRequirement; } //------------------------------------------------------------------------------------------------- public Builder interfaces(final String... interfaceRequirements) { this.interfaceRequirements = interfaceRequirements == null || interfaceRequirements.length == 0 ? null : Arrays.asList(interfaceRequirements); return this; } //------------------------------------------------------------------------------------------------- public Builder security(final ServiceSecurityType... securityRequirements) { this.securityRequirements = securityRequirements == null || securityRequirements.length == 0 ? null : Arrays.asList(securityRequirements); return this; } //------------------------------------------------------------------------------------------------- public Builder security(final List<ServiceSecurityType> securityRequirements) { this.securityRequirements = securityRequirements; return this; } //------------------------------------------------------------------------------------------------- public Builder metadata(final Map<String,String> metadataRequirements) { this.metadataRequirements = metadataRequirements; return this; } //------------------------------------------------------------------------------------------------- public Builder metadata(final String key, final String value) { Assert.isTrue(key != null && !key.isBlank(), "Key is null or blank"); if (this.metadataRequirements == null) { this.metadataRequirements = new HashMap<>(); } this.metadataRequirements.put(key, value); return this; } //------------------------------------------------------------------------------------------------- public Builder version(final Integer versionRequirement) { this.versionRequirement = versionRequirement; return this; } //------------------------------------------------------------------------------------------------- public Builder version(final Integer minVersionRequirement, final Integer maxVersionRequirement) { this.minVersionRequirement = minVersionRequirement; this.maxVersionRequirement = maxVersionRequirement; return this; } //------------------------------------------------------------------------------------------------- public Builder pingProviders(final boolean pingProviders) { this.pingProviders = pingProviders; return this; } //------------------------------------------------------------------------------------------------- public Builder providerAddressTypes(final AddressType... addressTypes) { this.providerAddressTypeRequirements = addressTypes == null || addressTypes.length == 0 ? null : List.of(addressTypes); return this; } //------------------------------------------------------------------------------------------------- public Builder providerAddressTypes(final List<AddressType> addressTypes) { this.providerAddressTypeRequirements = addressTypes; return this; } //------------------------------------------------------------------------------------------------- public ServiceQueryFormDTO build() { return new ServiceQueryFormDTO(this); } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ServiceQueryFormListDTO.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ServiceQueryFormListDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 8818224363564234620L; private List<? extends ServiceQueryFormDTO> forms = new ArrayList<>(); //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ServiceQueryFormListDTO() {} //------------------------------------------------------------------------------------------------- public ServiceQueryFormListDTO(final List<? extends ServiceQueryFormDTO> forms) { if (forms != null) { this.forms = forms; } } //------------------------------------------------------------------------------------------------- public List<? extends ServiceQueryFormDTO> getForms() { return forms; } //------------------------------------------------------------------------------------------------- public void setForms(final List<? extends ServiceQueryFormDTO> forms) { if (forms != null) { this.forms = forms; } } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ServiceQueryResultDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class ServiceQueryResultDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -1822444510232108526L; private List<ServiceRegistryResponseDTO> serviceQueryData = new ArrayList<>(); private int unfilteredHits = 0; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public List<ServiceRegistryResponseDTO> getServiceQueryData() { return serviceQueryData; } public int getUnfilteredHits() { return unfilteredHits; } //------------------------------------------------------------------------------------------------- public void setServiceQueryData(final List<ServiceRegistryResponseDTO> serviceQueryData) { this.serviceQueryData = serviceQueryData; } public void setUnfilteredHits(final int unfilteredHits) { this.unfilteredHits = unfilteredHits; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ServiceQueryResultListDTO.java
/******************************************************************************** * Copyright (c) 2021 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class ServiceQueryResultListDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 2195971861730818293L; private List<ServiceQueryResultDTO> results = new ArrayList<>(); //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ServiceQueryResultListDTO() {} //------------------------------------------------------------------------------------------------- public ServiceQueryResultListDTO(final List<ServiceQueryResultDTO> results) { if (results != null) { this.results = results; } } //------------------------------------------------------------------------------------------------- public List<ServiceQueryResultDTO> getResults() { return results; } //------------------------------------------------------------------------------------------------- public void setResults(final List<ServiceQueryResultDTO> results) { if (results != null) { this.results = results; } } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ServiceRegistryRequestDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.List; import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class ServiceRegistryRequestDTO implements Serializable { //================================================================================================= // members public static final String KEY_RECOMMENDED_ORCHESTRATION_TIME = "recommendedOrchestrationTime"; // in seconds private static final long serialVersionUID = -3805773665976065056L; private String serviceDefinition; private SystemRequestDTO providerSystem; private String serviceUri; private String endOfValidity; private String secure; private Map<String,String> metadata; private Integer version; private List<String> interfaces; //================================================================================================= // constructors //------------------------------------------------------------------------------------------------- public ServiceRegistryRequestDTO() {} //------------------------------------------------------------------------------------------------- public ServiceRegistryRequestDTO(final String serviceDefinition, final SystemRequestDTO providerSystem, final String serviceUri, final String endOfValidity, final String secure, final List<String> interfaces) { this.serviceDefinition = serviceDefinition; this.providerSystem = providerSystem; this.serviceUri = serviceUri; this.endOfValidity = endOfValidity; this.secure = secure; this.interfaces = interfaces; } //------------------------------------------------------------------------------------------------- public ServiceRegistryRequestDTO(final String serviceDefinition, final SystemRequestDTO providerSystem, final String serviceUri, final String endOfValidity, final String secure, final Map<String, String> metadata, final Integer version, final List<String> interfaces) { this.serviceDefinition = serviceDefinition; this.providerSystem = providerSystem; this.serviceUri = serviceUri; this.endOfValidity = endOfValidity; this.secure = secure; this.metadata = metadata; this.version = version; this.interfaces = interfaces; } //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public String getServiceDefinition() { return serviceDefinition; } public SystemRequestDTO getProviderSystem() { return providerSystem; } public String getServiceUri() { return serviceUri; } public String getEndOfValidity() { return endOfValidity; } public String getSecure() { return secure; } public Map<String,String> getMetadata() { return metadata; } public Integer getVersion() { return version; } public List<String> getInterfaces() { return interfaces; } //------------------------------------------------------------------------------------------------- public void setServiceDefinition(final String serviceDefinition) { this.serviceDefinition = serviceDefinition; } public void setProviderSystem(final SystemRequestDTO providerSystem) { this.providerSystem = providerSystem; } public void setServiceUri(final String serviceUri) { this.serviceUri = serviceUri; } public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } public void setSecure(final String secure) { this.secure = secure; } public void setMetadata(final Map<String,String> metadata) { this.metadata = metadata; } public void setVersion(final Integer version) { this.version = version; } public void setInterfaces(final List<String> interfaces) { this.interfaces = interfaces; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ServiceRegistryResponseDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.List; import java.util.Map; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class ServiceRegistryResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -635438605292398404L; private long id; private ServiceDefinitionResponseDTO serviceDefinition; private SystemResponseDTO provider; private String serviceUri; private String endOfValidity; private ServiceSecurityType secure; private Map<String,String> metadata; private int version; private List<ServiceInterfaceResponseDTO> interfaces; private String createdAt; private String updatedAt; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public long getId() { return id; } public ServiceDefinitionResponseDTO getServiceDefinition() { return serviceDefinition; } public SystemResponseDTO getProvider() { return provider; } public String getServiceUri() { return serviceUri; } public String getEndOfValidity() { return endOfValidity; } public ServiceSecurityType getSecure() { return secure; } public Map<String,String> getMetadata() { return metadata; } public int getVersion() { return version; } public List<ServiceInterfaceResponseDTO> getInterfaces() { return interfaces; } public String getCreatedAt() { return createdAt; } public String getUpdatedAt() { return updatedAt; } //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setServiceDefinition(final ServiceDefinitionResponseDTO serviceDefinition) { this.serviceDefinition = serviceDefinition; } public void setProvider(final SystemResponseDTO provider) { this.provider = provider; } public void setServiceUri(final String serviceUri) { this.serviceUri = serviceUri; } public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } public void setSecure(final ServiceSecurityType secure) { this.secure = secure; } public void setMetadata(final Map<String,String> metadata) { this.metadata = metadata; } public void setVersion(final int version) { this.version = version; } public void setInterfaces(final List<ServiceInterfaceResponseDTO> interfaces) { this.interfaces = interfaces; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } //------------------------------------------------------------------------------------------------- @Override public int hashCode() { return Objects.hashCode(id); } //------------------------------------------------------------------------------------------------- @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final ServiceRegistryResponseDTO other = (ServiceRegistryResponseDTO) obj; if (id != other.id) { return false; } return true; } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/ServiceSecurityType.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; public enum ServiceSecurityType { NOT_SECURE, CERTIFICATE, TOKEN }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SigML.java
package eu.arrowhead.common.dto.shared; import java.io.Serializable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class SigML implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 7792814405188244770L; private Integer x; private String xs; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public SigML() {} //------------------------------------------------------------------------------------------------- public SigML(final Integer x) { this.x = x; } //------------------------------------------------------------------------------------------------- public SigML(final Integer x, final String xs) { this.x = x; this.xs = xs; } //------------------------------------------------------------------------------------------------- public Integer getX() { return x; } public String getXs() { return xs; } //------------------------------------------------------------------------------------------------- public void setX(final Integer x) { this.x = x; } public void setXs(final String xs) { this.xs = xs; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SubscriptionListResponseDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class SubscriptionListResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -677758800436027812L; private List<SubscriptionResponseDTO> data; private long count; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public SubscriptionListResponseDTO() {} //------------------------------------------------------------------------------------------------- public SubscriptionListResponseDTO(final List<SubscriptionResponseDTO> data, final long count) { this.data = data; this.count = count; } //------------------------------------------------------------------------------------------------- public List<SubscriptionResponseDTO> getData() { return data; } public long getCount() { return count; } //------------------------------------------------------------------------------------------------- public void setData(final List<SubscriptionResponseDTO> data) { this.data = data; } public void setCount(final long count) { this.count = count; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SubscriptionRequestDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import java.util.Set; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class SubscriptionRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -6411715397801888776L; private String eventType; private SystemRequestDTO subscriberSystem; private Map<String,String> filterMetaData; private String notifyUri; private boolean matchMetaData = false; private String startDate; private String endDate; private Set<SystemRequestDTO> sources; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public SubscriptionRequestDTO() {} //------------------------------------------------------------------------------------------------- public SubscriptionRequestDTO(final String eventType, final SystemRequestDTO subscriberSystem, final Map<String,String> filterMetaData, final String notifyUri, final boolean matchMetaData, final String startDate, final String endDate, final Set<SystemRequestDTO> sources ) { this.eventType = eventType; this.subscriberSystem = subscriberSystem; this.filterMetaData = filterMetaData; this.notifyUri = notifyUri; this.matchMetaData = matchMetaData; this.startDate = startDate; this.endDate = endDate; this.sources = sources; } //------------------------------------------------------------------------------------------------- public String getEventType() { return eventType; } public SystemRequestDTO getSubscriberSystem() { return subscriberSystem; } public Map<String,String> getFilterMetaData() { return filterMetaData; } public String getNotifyUri() { return notifyUri; } public boolean getMatchMetaData() { return matchMetaData; } public String getStartDate() { return startDate; } public String getEndDate() { return endDate; } public Set<SystemRequestDTO> getSources() { return sources; } //------------------------------------------------------------------------------------------------- public void setEventType(final String eventType) { this.eventType = eventType; } public void setSubscriberSystem(final SystemRequestDTO subscriberSystem) { this.subscriberSystem = subscriberSystem; } public void setFilterMetaData(final Map<String,String> filterMetaData) { this.filterMetaData = filterMetaData; } public void setNotifyUri(final String notifyUri) { this.notifyUri = notifyUri; } public void setMatchMetaData(final boolean matchMetaData) { this.matchMetaData = matchMetaData; } public void setStartDate(final String startDate) { this.startDate = startDate; } public void setEndDate(final String endDate) { this.endDate = endDate; } public void setSources(final Set<SystemRequestDTO> sources) { this.sources = sources; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SubscriptionResponseDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import java.util.Set; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class SubscriptionResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 3014273687545696205L; private long id; private EventTypeResponseDTO eventType; private SystemResponseDTO subscriberSystem; private Map<String,String> filterMetaData; private String notifyUri; private boolean matchMetaData; private String startDate; private String endDate; private Set<SystemResponseDTO> sources; private String createdAt; private String updatedAt; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public SubscriptionResponseDTO() {} //------------------------------------------------------------------------------------------------- public SubscriptionResponseDTO(final long id, final EventTypeResponseDTO eventType, final SystemResponseDTO subscriberSystem, final Map<String,String> filterMetaData, final String notifyUri, final boolean matchMetaData, final String startDate, final String endDate, final Set<SystemResponseDTO> sources, final String createdAt, final String updatedAt) { this.id = id; this.eventType = eventType; this.subscriberSystem = subscriberSystem; this.filterMetaData = filterMetaData; this.notifyUri = notifyUri; this.matchMetaData = matchMetaData; this.startDate = startDate; this.endDate = endDate; this.sources = sources; this.createdAt = createdAt; this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- public long getId() { return id; } public EventTypeResponseDTO getEventType() { return eventType; } public SystemResponseDTO getSubscriberSystem() { return subscriberSystem; } public Map<String,String> getFilterMetaData() { return filterMetaData; } public String getNotifyUri() { return notifyUri; } public boolean getMatchMetaData() { return matchMetaData; } public String getStartDate() { return startDate; } public String getEndDate() { return endDate; } public Set<SystemResponseDTO> getSources() { return sources; } public String getCreatedAt() { return createdAt; } public String getUpdatedAt() { return updatedAt; } //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setEventType(final EventTypeResponseDTO eventType) { this.eventType = eventType; } public void setSubscriberSystem(final SystemResponseDTO subscriberSystem) { this.subscriberSystem = subscriberSystem; } public void setFilterMetaData(final Map<String,String> filterMetaData) { this.filterMetaData = filterMetaData; } public void setNotifyUri(final String notifyUri) { this.notifyUri = notifyUri; } public void setMatchMetaData(final boolean matchMetaData) { this.matchMetaData = matchMetaData; } public void setStartDate(final String startDate) { this.startDate = startDate; } public void setEndDate(final String endDate) { this.endDate = endDate; } public void setSources(final Set<SystemResponseDTO> sources) { this.sources = sources; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SystemQueryFormDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.util.Assert; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class SystemQueryFormDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -2699823381165019336L; private String systemNameRequirements; private String deviceNameRequirements; private Map<String,String> metadataRequirements; // if specified the whole content of the map must match private Integer versionRequirement; // if specified version must match private Integer minVersionRequirement; // if specified version must be equals or higher; ignored if versionRequirement is specified private Integer maxVersionRequirement; // if specified version must be equals or lower; ignored if versionRequirement is specified private List<AddressType> addressTypeRequirements; // if specified one of the address types must match private boolean pingProviders = false; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public String getSystemNameRequirements() { return systemNameRequirements; } public String getDeviceNameRequirements() { return deviceNameRequirements; } public Map<String,String> getMetadataRequirements() { return metadataRequirements; } public Integer getVersionRequirement() { return versionRequirement; } public Integer getMinVersionRequirement() { return minVersionRequirement; } public Integer getMaxVersionRequirement() { return maxVersionRequirement; } public boolean getPingProviders() { return pingProviders; } public List<AddressType> getAddressTypeRequirements() { return addressTypeRequirements; } //------------------------------------------------------------------------------------------------- public void setSystemNameRequirements(final String systemNameRequirements) { this.systemNameRequirements = systemNameRequirements; } public void setDeviceNameRequirements(final String deviceNameRequirements) { this.deviceNameRequirements = deviceNameRequirements; } public void setMetadataRequirements(final Map<String,String> metadataRequirements) { this.metadataRequirements = metadataRequirements; } public void setVersionRequirement(final Integer versionRequirement) { this.versionRequirement = versionRequirement; } public void setMinVersionRequirement(final Integer minVersionRequirement) { this.minVersionRequirement = minVersionRequirement; } public void setMaxVersionRequirement(final Integer maxVersionRequirement) { this.maxVersionRequirement = maxVersionRequirement; } public void setPingProviders(final boolean pingProviders) { this.pingProviders = pingProviders; } public void setAddressTypeRequirements(final List<AddressType> addressTypeRequirements) { this.addressTypeRequirements = addressTypeRequirements; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- private SystemQueryFormDTO(final Builder builder) { this.systemNameRequirements = builder.systemNameRequirements; this.deviceNameRequirements = builder.deviceNameRequirements; this.metadataRequirements = builder.metadataRequirements; this.versionRequirement = builder.versionRequirement; this.minVersionRequirement = builder.minVersionRequirement; this.maxVersionRequirement = builder.maxVersionRequirement; this.addressTypeRequirements = builder.addressTypeRequirements; this.pingProviders = builder.pingProviders; } //================================================================================================= // nested classes public static class Builder { //================================================================================================= // members private final String systemNameRequirements; private String deviceNameRequirements; private Map<String,String> metadataRequirements; private Integer versionRequirement; private Integer minVersionRequirement; private Integer maxVersionRequirement; private List<AddressType> addressTypeRequirements; private boolean pingProviders = false; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public Builder(final String systemNameRequirements) { Assert.isTrue(systemNameRequirements != null && !systemNameRequirements.isBlank(), "systemNameRequirements is null or blank."); this.systemNameRequirements = systemNameRequirements; } //------------------------------------------------------------------------------------------------- public Builder deviceName(final String deviceNameRequirements) { this.deviceNameRequirements = deviceNameRequirements; return this; } //------------------------------------------------------------------------------------------------- public Builder metadata(final Map<String,String> metadataRequirements) { this.metadataRequirements = metadataRequirements; return this; } //------------------------------------------------------------------------------------------------- public Builder metadata(final String key, final String value) { Assert.isTrue(key != null && !key.isBlank(), "Key is null or blank"); if (this.metadataRequirements == null) { this.metadataRequirements = new HashMap<>(); } this.metadataRequirements.put(key, value); return this; } //------------------------------------------------------------------------------------------------- public Builder version(final Integer versionRequirement) { this.versionRequirement = versionRequirement; return this; } //------------------------------------------------------------------------------------------------- public Builder version(final Integer minVersionRequirement, final Integer maxVersionRequirement) { this.minVersionRequirement = minVersionRequirement; this.maxVersionRequirement = maxVersionRequirement; return this; } //------------------------------------------------------------------------------------------------- public Builder pingProviders(final boolean pingProviders) { this.pingProviders = pingProviders; return this; } //------------------------------------------------------------------------------------------------- public Builder providerAddressTypes(final AddressType... addressTypes) { this.addressTypeRequirements = addressTypes == null || addressTypes.length == 0 ? null : List.of(addressTypes); return this; } //------------------------------------------------------------------------------------------------- public Builder providerAddressTypes(final List<AddressType> addressTypes) { this.addressTypeRequirements = addressTypes; return this; } //------------------------------------------------------------------------------------------------- public SystemQueryFormDTO build() { return new SystemQueryFormDTO(this); } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SystemQueryResultDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class SystemQueryResultDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -1822444510232108526L; private List<SystemRegistryResponseDTO> systemQueryData = new ArrayList<>(); private int unfilteredHits = 0; //================================================================================================= // constructors //------------------------------------------------------------------------------------------------- public SystemQueryResultDTO() {} //------------------------------------------------------------------------------------------------- public SystemQueryResultDTO(final List<SystemRegistryResponseDTO> systemQueryData, final int unfilteredHits) { this.systemQueryData = systemQueryData; this.unfilteredHits = unfilteredHits; } //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public List<SystemRegistryResponseDTO> getSystemQueryData() { return systemQueryData; } public int getUnfilteredHits() { return unfilteredHits; } //------------------------------------------------------------------------------------------------- public void setSystemQueryData(final List<SystemRegistryResponseDTO> systemQueryData) { this.systemQueryData = systemQueryData; } public void setUnfilteredHits(final int unfilteredHits) { this.unfilteredHits = unfilteredHits; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import org.springframework.util.Assert; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public abstract class SystemRegistryOnboardingResponseDTO extends SystemRegistryResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 1L; private CertificateCreationResponseDTO certificateResponse; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public SystemRegistryOnboardingResponseDTO() {} //------------------------------------------------------------------------------------------------- public SystemRegistryOnboardingResponseDTO(final long id, final SystemResponseDTO system, final DeviceResponseDTO provider, final String endOfValidity, final Map<String, String> metadata, final int version, final String createdAt, final String updatedAt, final CertificateCreationResponseDTO certificateResponse) { super(id, system, provider, endOfValidity, metadata, version, createdAt, updatedAt); this.certificateResponse = certificateResponse; } //------------------------------------------------------------------------------------------------- public CertificateCreationResponseDTO getCertificateResponse() { return certificateResponse; } //------------------------------------------------------------------------------------------------- public void setCertificateResponse(final CertificateCreationResponseDTO certificateResponse) { this.certificateResponse = certificateResponse; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } //------------------------------------------------------------------------------------------------- public void load(final SystemRegistryResponseDTO dto) { Assert.notNull(dto, "SystemRegistryResponseDTO must not be null"); this.setId(dto.getId()); this.setProvider(dto.getProvider()); this.setSystem(dto.getSystem()); this.setMetadata(dto.getMetadata()); this.setEndOfValidity(dto.getEndOfValidity()); this.setCreatedAt(dto.getCreatedAt()); this.setUpdatedAt(dto.getUpdatedAt()); this.setVersion(dto.getVersion()); } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithCsrRequestDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class SystemRegistryOnboardingWithCsrRequestDTO extends SystemRegistryRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -635438605292398404L; private String certificateSigningRequest; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public SystemRegistryOnboardingWithCsrRequestDTO() {} //------------------------------------------------------------------------------------------------- public SystemRegistryOnboardingWithCsrRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity, final String certificateSigningRequest) { super(system, provider, endOfValidity); this.certificateSigningRequest = certificateSigningRequest; } //------------------------------------------------------------------------------------------------- public SystemRegistryOnboardingWithCsrRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity, final Map<String, String> metadata, final Integer version, final String certificateSigningRequest) { super(system, provider, endOfValidity, metadata, version); this.certificateSigningRequest = certificateSigningRequest; } //------------------------------------------------------------------------------------------------- public String getCertificateSigningRequest() { return certificateSigningRequest; } //------------------------------------------------------------------------------------------------- public void setCertificateSigningRequest(final String certificateSigningRequest) { this.certificateSigningRequest = certificateSigningRequest; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithCsrResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; public class SystemRegistryOnboardingWithCsrResponseDTO extends SystemRegistryOnboardingResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -5751934090192200480L; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public SystemRegistryOnboardingWithCsrResponseDTO() {} //------------------------------------------------------------------------------------------------- public SystemRegistryOnboardingWithCsrResponseDTO(final long id, final SystemResponseDTO system, final DeviceResponseDTO provider, final String endOfValidity, final Map<String, String> metadata, final int version, final String createdAt, final String updatedAt, final CertificateCreationResponseDTO certificateResponse) { super(id, system, provider, endOfValidity, metadata, version, createdAt, updatedAt, certificateResponse); } // this class exist to keep the structure of <operation>RequestDTO, <operation>ResponseDTO }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithNameRequestDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class SystemRegistryOnboardingWithNameRequestDTO extends SystemRegistryRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -635438605292398404L; private CertificateCreationRequestDTO certificateCreationRequest; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public SystemRegistryOnboardingWithNameRequestDTO() {} //------------------------------------------------------------------------------------------------- public SystemRegistryOnboardingWithNameRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity, final CertificateCreationRequestDTO certificateCreationRequest) { super(system, provider, endOfValidity); this.certificateCreationRequest = certificateCreationRequest; } //------------------------------------------------------------------------------------------------- public SystemRegistryOnboardingWithNameRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity, final Map<String, String> metadata, final Integer version, final CertificateCreationRequestDTO certificateCreationRequest) { super(system, provider, endOfValidity, metadata, version); this.certificateCreationRequest = certificateCreationRequest; } //------------------------------------------------------------------------------------------------- public CertificateCreationRequestDTO getCertificateCreationRequest() { return certificateCreationRequest; } //------------------------------------------------------------------------------------------------- public void setCertificateCreationRequest(final CertificateCreationRequestDTO certificateCreationRequest) { this.certificateCreationRequest = certificateCreationRequest; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SystemRegistryOnboardingWithNameResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; public class SystemRegistryOnboardingWithNameResponseDTO extends SystemRegistryOnboardingResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 5840472532749385568L; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public SystemRegistryOnboardingWithNameResponseDTO() {} //------------------------------------------------------------------------------------------------- public SystemRegistryOnboardingWithNameResponseDTO(final long id, final SystemResponseDTO system, final DeviceResponseDTO provider, final String endOfValidity, final Map<String, String> metadata, final int version, final String createdAt, final String updatedAt, final CertificateCreationResponseDTO certificateResponse) { super(id, system, provider, endOfValidity, metadata, version, createdAt, updatedAt, certificateResponse); } // this class exist to keep the structure of <operation>RequestDTO, <operation>ResponseDTO }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SystemRegistryRequestDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class SystemRegistryRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -635438605292398404L; private SystemRequestDTO system; private DeviceRequestDTO provider; private String endOfValidity; private Map<String,String> metadata; private Integer version; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public SystemRegistryRequestDTO() {} //------------------------------------------------------------------------------------------------- public SystemRegistryRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity) { this.system = system; this.provider = provider; this.endOfValidity = endOfValidity; } //------------------------------------------------------------------------------------------------- public SystemRegistryRequestDTO(final SystemRequestDTO system, final DeviceRequestDTO provider, final String endOfValidity, final Map<String, String> metadata, final Integer version) { this.system = system; this.provider = provider; this.endOfValidity = endOfValidity; this.metadata = metadata; this.version = version; } //------------------------------------------------------------------------------------------------- public SystemRequestDTO getSystem() { return system; } public DeviceRequestDTO getProvider() { return provider; } public String getEndOfValidity() { return endOfValidity; } public Map<String,String> getMetadata() { return metadata; } public Integer getVersion() { return version; } //------------------------------------------------------------------------------------------------- public void setSystem(final SystemRequestDTO system) { this.system = system; } public void setProvider(final DeviceRequestDTO provider) { this.provider = provider; } public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } public void setMetadata(final Map<String,String> metadata) { this.metadata = metadata; } public void setVersion(final Integer version) { this.version = version; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SystemRegistryResponseDTO.java
/******************************************************************************** * Copyright (c) 2020 FHB * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * FHB - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class SystemRegistryResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -635438605292398404L; private long id; private SystemResponseDTO system; private DeviceResponseDTO provider; private String endOfValidity; private Map<String,String> metadata; private int version; private String createdAt; private String updatedAt; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public SystemRegistryResponseDTO() {} //------------------------------------------------------------------------------------------------- public SystemRegistryResponseDTO(final long id, final SystemResponseDTO system, final DeviceResponseDTO provider, final String endOfValidity, final Map<String, String> metadata, final int version, final String createdAt, final String updatedAt) { this.id = id; this.system = system; this.provider = provider; this.endOfValidity = endOfValidity; this.metadata = metadata; this.version = version; this.createdAt = createdAt; this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- public long getId() { return id; } public SystemResponseDTO getSystem() { return system; } public DeviceResponseDTO getProvider() { return provider; } public String getEndOfValidity() { return endOfValidity; } public Map<String,String> getMetadata() { return metadata; } public int getVersion() { return version; } public String getCreatedAt() { return createdAt; } public String getUpdatedAt() { return updatedAt; } //------------------------------------------------------------------------------------------------- public void setId(final long id) { this.id = id; } public void setSystem(final SystemResponseDTO system) { this.system = system; } public void setProvider(final DeviceResponseDTO provider) { this.provider = provider; } public void setEndOfValidity(final String endOfValidity) { this.endOfValidity = endOfValidity; } public void setMetadata(final Map<String,String> metadata) { this.metadata = metadata; } public void setVersion(final int version) { this.version = version; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final SystemRegistryResponseDTO that = (SystemRegistryResponseDTO) o; return id == that.id && version == that.version && system.equals(that.system) && provider.equals(that.provider) && endOfValidity.equals(that.endOfValidity) && Objects.equals(metadata, that.metadata) && createdAt.equals(that.createdAt) && updatedAt.equals(that.updatedAt); } //------------------------------------------------------------------------------------------------- @Override public int hashCode() { return Objects.hash(id, system, provider, endOfValidity, metadata, version, createdAt, updatedAt); } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SystemRequestDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import java.util.Objects; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class SystemRequestDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = -4501767622271052194L; private String systemName; private String address; private Integer port; private String authenticationInfo; private Map<String,String> metadata; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public SystemRequestDTO() {} //------------------------------------------------------------------------------------------------- public SystemRequestDTO(final String systemName, final String address, final Integer port, final String authenticationInfo, final Map<String,String> metadata) { this.systemName = systemName; this.address = address; this.port = port; this.authenticationInfo = authenticationInfo; this.metadata = metadata; } //------------------------------------------------------------------------------------------------- public String getSystemName() { return systemName; } public String getAddress() { return address; } public Integer getPort() { return port; } public String getAuthenticationInfo() { return authenticationInfo; } public Map<String,String> getMetadata() { return metadata; } //------------------------------------------------------------------------------------------------- public void setSystemName(final String systemName) { this.systemName = systemName; } public void setAddress(final String address) { this.address = address; } public void setPort(final Integer port) { this.port = port; } public void setAuthenticationInfo(final String authenticationInfo) { this.authenticationInfo = authenticationInfo; } public void setMetadata(final Map<String,String> metadata) { this.metadata = metadata; } //------------------------------------------------------------------------------------------------- @Override public int hashCode() { return Objects.hash(address, port, systemName); } //------------------------------------------------------------------------------------------------- @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final SystemRequestDTO other = (SystemRequestDTO) obj; return Objects.equals(address, other.address) && Objects.equals(port, other.port) && Objects.equals(systemName, other.systemName); } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/SystemResponseDTO.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.io.Serializable; import java.util.Map; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @JsonInclude(Include.NON_NULL) public class SystemResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 2768149485270495101L; private long id; private String systemName; private String address; private int port; private String authenticationInfo; private Map<String,String> metadata; private String createdAt; private String updatedAt; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public SystemResponseDTO() {} //------------------------------------------------------------------------------------------------- public SystemResponseDTO(final long systemId, final String systemName, final String address, final int port, final String authenticationInfo, final Map<String,String> metadata, final String createdAt, final String updatedAt) { this.id = systemId; this.systemName = systemName; this.address = address; this.port = port; this.authenticationInfo = authenticationInfo; this.metadata = metadata; this.createdAt = createdAt; this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- public long getId() { return id; } public String getSystemName() { return systemName; } public String getAddress() { return address; } public int getPort() { return port; } public String getAuthenticationInfo() { return authenticationInfo; } public Map<String,String> getMetadata() { return metadata; } public String getUpdatedAt() { return updatedAt; } public String getCreatedAt() { return createdAt; } //------------------------------------------------------------------------------------------------- public void setId(final long sytemId) { this.id = sytemId; } public void setSystemName(final String systemName) { this.systemName = systemName; } public void setAddress(final String address) { this.address = address; } public void setPort(final int port) { this.port = port; } public void setAuthenticationInfo(final String authenticationInfo) { this.authenticationInfo = authenticationInfo; } public void setMetadata(final Map<String,String> metadata) { this.metadata = metadata; } public void setCreatedAt(final String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(final String updatedAt) { this.updatedAt = updatedAt; } //------------------------------------------------------------------------------------------------- @Override public int hashCode() { return Objects.hash(address, port, systemName); } //------------------------------------------------------------------------------------------------- @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final SystemResponseDTO other = (SystemResponseDTO) obj; return Objects.equals(address, other.address) && Objects.equals(port, other.port) && Objects.equals(systemName, other.systemName); } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/dto/shared/TimeManagerTimeResponseDTO.java
/******************************************************************************** * Copyright (c) 2021 Lulea University of Technology * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Lulea University of Technology - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.dto.shared; import java.util.Date; import java.util.TimeZone; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.Serializable; public class TimeManagerTimeResponseDTO implements Serializable { //================================================================================================= // members private static final long serialVersionUID = 1648756742138137282L; private long epoch; private long epochMs; private String tz; private boolean dst; private boolean trusted; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public TimeManagerTimeResponseDTO() {} //------------------------------------------------------------------------------------------------- public TimeManagerTimeResponseDTO(final String tz) { this.tz = tz; final Date date = new Date(); epochMs = date.getTime(); epoch = epochMs / 1000; dst = TimeZone.getTimeZone(this.tz).inDaylightTime(date); trusted = false; } //------------------------------------------------------------------------------------------------- public TimeManagerTimeResponseDTO(final String tz, final boolean trusted) { this.tz = tz; final Date date = new Date(); epochMs = date.getTime(); epoch = epochMs / 1000; dst = TimeZone.getTimeZone(this.tz).inDaylightTime(date); this.trusted = trusted; } //------------------------------------------------------------------------------------------------- public TimeManagerTimeResponseDTO(final long epoch, final String tz, final boolean trusted) { final Date date = new Date(epoch * 1000); this.epoch = epoch; this.epochMs = epoch * 1000; this.tz = tz; this.dst = TimeZone.getTimeZone(this.tz).inDaylightTime(date); this.trusted = trusted; } //------------------------------------------------------------------------------------------------- public TimeManagerTimeResponseDTO(final long epoch, final long epochMs, final String tz, final boolean dst, final boolean trusted) { this.epoch = epoch; this.epochMs = epochMs; this.tz = tz; this.dst = dst; this.trusted = trusted; } //------------------------------------------------------------------------------------------------- public long getEpoch() { return epoch; } public long getEpochMs() { return epochMs; } public String getTz() { return tz; } public boolean getDst() { return dst; } public boolean getTrusted() {return trusted; } //------------------------------------------------------------------------------------------------- public void setEpoch(final long epoch) { this.epoch = epoch; } public void setEpochMs(final long epochMs) { this.epochMs = epochMs; } public void setTz(final String tz) { this.tz = tz; } public void setDst(final boolean dst) { this.dst = dst; } public void setTrusted(final boolean trusted) { this.trusted = trusted; } //------------------------------------------------------------------------------------------------- @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (final JsonProcessingException ex) { return "toString failure"; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/exception/ArrowheadException.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.exception; @SuppressWarnings("serial") public class ArrowheadException extends RuntimeException { //================================================================================================= // members private ExceptionType exceptionType = ExceptionType.ARROWHEAD; //NOSONAR can't be final because derived class want to use the setter private final int errorCode; private final String origin; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public ArrowheadException(final String msg, final int errorCode, final String origin, final Throwable cause) { super(msg, cause); this.errorCode = errorCode; this.origin = origin; } //------------------------------------------------------------------------------------------------- public ArrowheadException(final String msg, final int errorCode, final String origin) { super(msg); this.errorCode = errorCode; this.origin = origin; } //------------------------------------------------------------------------------------------------- public ArrowheadException(final String msg, final int errorCode, final Throwable cause) { super(msg, cause); this.errorCode = errorCode; this.origin = null; } //------------------------------------------------------------------------------------------------- public ArrowheadException(final String msg, final int errorCode) { super(msg); this.errorCode = errorCode; this.origin = null; } //------------------------------------------------------------------------------------------------- public ArrowheadException(final String msg, final Throwable cause) { super(msg, cause); this.errorCode = 0; this.origin = null; } //------------------------------------------------------------------------------------------------- public ArrowheadException(final String msg) { super(msg); this.errorCode = 0; this.origin = null; } //------------------------------------------------------------------------------------------------- public ExceptionType getExceptionType() { return exceptionType; } public int getErrorCode() { return errorCode; } public String getOrigin() { return origin; } //------------------------------------------------------------------------------------------------- protected void setExceptionType(final ExceptionType exceptionType) { this.exceptionType = exceptionType; } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/exception/AuthException.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.exception; @SuppressWarnings("serial") public class AuthException extends ArrowheadException { //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public AuthException(final String msg, final int errorCode, final String origin, final Throwable cause) { super(msg, errorCode, origin, cause); this.setExceptionType(ExceptionType.AUTH); } //------------------------------------------------------------------------------------------------- public AuthException(final String msg, final int errorCode, final String origin) { super(msg, errorCode, origin); this.setExceptionType(ExceptionType.AUTH); } //------------------------------------------------------------------------------------------------- public AuthException(final String msg, final int errorCode, final Throwable cause) { super(msg, errorCode, cause); this.setExceptionType(ExceptionType.AUTH); } //------------------------------------------------------------------------------------------------- public AuthException(final String msg, final int errorCode) { super(msg, errorCode); this.setExceptionType(ExceptionType.AUTH); } //------------------------------------------------------------------------------------------------- public AuthException(final String msg, final Throwable cause) { super(msg, cause); this.setExceptionType(ExceptionType.AUTH); } //------------------------------------------------------------------------------------------------- public AuthException(final String msg) { super(msg); this.setExceptionType(ExceptionType.AUTH); } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/exception/BadPayloadException.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.exception; /** * Thrown if a resource receives a HTTP payload which have missing mandatory fields. */ @SuppressWarnings("serial") public class BadPayloadException extends ArrowheadException { //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public BadPayloadException(final String msg, final int errorCode, final String origin, final Throwable cause) { super(msg, errorCode, origin, cause); this.setExceptionType(ExceptionType.BAD_PAYLOAD); } //------------------------------------------------------------------------------------------------- public BadPayloadException(final String msg, final int errorCode, final String origin) { super(msg, errorCode, origin); this.setExceptionType(ExceptionType.BAD_PAYLOAD); } //------------------------------------------------------------------------------------------------- public BadPayloadException(final String msg, final int errorCode, final Throwable cause) { super(msg, errorCode, cause); this.setExceptionType(ExceptionType.BAD_PAYLOAD); } //------------------------------------------------------------------------------------------------- public BadPayloadException(final String msg, final int errorCode) { super(msg, errorCode); this.setExceptionType(ExceptionType.BAD_PAYLOAD); } //------------------------------------------------------------------------------------------------- public BadPayloadException(final String msg, final Throwable cause) { super(msg, cause); this.setExceptionType(ExceptionType.BAD_PAYLOAD); } //------------------------------------------------------------------------------------------------- public BadPayloadException(final String msg) { super(msg); this.setExceptionType(ExceptionType.BAD_PAYLOAD); } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/exception/DataNotFoundException.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.exception; @SuppressWarnings("serial") public class DataNotFoundException extends ArrowheadException { //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public DataNotFoundException(final String msg, final int errorCode, final String origin, final Throwable cause) { super(msg, errorCode, origin, cause); this.setExceptionType(ExceptionType.DATA_NOT_FOUND); } //------------------------------------------------------------------------------------------------- public DataNotFoundException(final String msg, final int errorCode, final String origin) { super(msg, errorCode, origin); this.setExceptionType(ExceptionType.DATA_NOT_FOUND); } //------------------------------------------------------------------------------------------------- public DataNotFoundException(final String msg, final int errorCode, final Throwable cause) { super(msg, errorCode, cause); this.setExceptionType(ExceptionType.DATA_NOT_FOUND); } //------------------------------------------------------------------------------------------------- public DataNotFoundException(final String msg, final int errorCode) { super(msg, errorCode); this.setExceptionType(ExceptionType.DATA_NOT_FOUND); } //------------------------------------------------------------------------------------------------- public DataNotFoundException(final String msg, final Throwable cause) { super(msg, cause); this.setExceptionType(ExceptionType.DATA_NOT_FOUND); } //------------------------------------------------------------------------------------------------- public DataNotFoundException(final String msg) { super(msg); this.setExceptionType(ExceptionType.DATA_NOT_FOUND); } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/exception/ExceptionType.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.exception; public enum ExceptionType { ARROWHEAD, AUTH, BAD_PAYLOAD, INVALID_PARAMETER, DATA_NOT_FOUND, TIMEOUT, GENERIC, UNAVAILABLE }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/exception/InvalidParameterException.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.exception; /** * Thrown if a service is called with not proper parameters. */ @SuppressWarnings("serial") public class InvalidParameterException extends ArrowheadException { //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public InvalidParameterException(final String msg, final int errorCode, final String origin, final Throwable cause) { super(msg, errorCode, origin, cause); this.setExceptionType(ExceptionType.INVALID_PARAMETER); } //------------------------------------------------------------------------------------------------- public InvalidParameterException(final String msg, final int errorCode, final String origin) { super(msg, errorCode, origin); this.setExceptionType(ExceptionType.INVALID_PARAMETER); } //------------------------------------------------------------------------------------------------- public InvalidParameterException(final String msg, final int errorCode, final Throwable cause) { super(msg, errorCode, cause); this.setExceptionType(ExceptionType.INVALID_PARAMETER); } //------------------------------------------------------------------------------------------------- public InvalidParameterException(final String msg, final int errorCode) { super(msg, errorCode); this.setExceptionType(ExceptionType.INVALID_PARAMETER); } //------------------------------------------------------------------------------------------------- public InvalidParameterException(final String msg, final Throwable cause) { super(msg, cause); this.setExceptionType(ExceptionType.INVALID_PARAMETER); } //------------------------------------------------------------------------------------------------- public InvalidParameterException(final String msg) { super(msg); this.setExceptionType(ExceptionType.INVALID_PARAMETER); } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/exception/TimeoutException.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.exception; @SuppressWarnings("serial") public class TimeoutException extends ArrowheadException { //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public TimeoutException(final String msg, final int errorCode, final String origin, final Throwable cause) { super(msg, errorCode, origin, cause); this.setExceptionType(ExceptionType.TIMEOUT); } //------------------------------------------------------------------------------------------------- public TimeoutException(final String msg, final int errorCode, final String origin) { super(msg, errorCode, origin); this.setExceptionType(ExceptionType.TIMEOUT); } //------------------------------------------------------------------------------------------------- public TimeoutException(final String msg, final int errorCode, final Throwable cause) { super(msg, errorCode, cause); this.setExceptionType(ExceptionType.TIMEOUT); } //------------------------------------------------------------------------------------------------- public TimeoutException(final String msg, final int errorCode) { super(msg, errorCode); this.setExceptionType(ExceptionType.TIMEOUT); } //------------------------------------------------------------------------------------------------- public TimeoutException(final String msg, final Throwable cause) { super(msg, cause); this.setExceptionType(ExceptionType.TIMEOUT); } //------------------------------------------------------------------------------------------------- public TimeoutException(final String msg) { super(msg); this.setExceptionType(ExceptionType.TIMEOUT); } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/exception/UnavailableServerException.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.exception; /** * Thrown when a HTTP request times out because the endpoint is not available. */ @SuppressWarnings("serial") public class UnavailableServerException extends ArrowheadException { //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public UnavailableServerException(final String msg, final int errorCode, final String origin, final Throwable cause) { super(msg, errorCode, origin, cause); this.setExceptionType(ExceptionType.UNAVAILABLE); } //------------------------------------------------------------------------------------------------- public UnavailableServerException(final String msg, final int errorCode, final String origin) { super(msg, errorCode, origin); this.setExceptionType(ExceptionType.UNAVAILABLE); } //------------------------------------------------------------------------------------------------- public UnavailableServerException(final String msg, final int errorCode, final Throwable cause) { super(msg, errorCode, cause); this.setExceptionType(ExceptionType.UNAVAILABLE); } //------------------------------------------------------------------------------------------------- public UnavailableServerException(final String msg, final int errorCode) { super(msg, errorCode); this.setExceptionType(ExceptionType.UNAVAILABLE); } //------------------------------------------------------------------------------------------------- public UnavailableServerException(final String msg, final Throwable cause) { super(msg, cause); this.setExceptionType(ExceptionType.UNAVAILABLE); } //------------------------------------------------------------------------------------------------- public UnavailableServerException(final String msg) { super(msg); this.setExceptionType(ExceptionType.UNAVAILABLE); } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/filter/ArrowheadFilter.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.filter; import java.io.IOException; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletResponse; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.web.filter.GenericFilterBean; import com.fasterxml.jackson.databind.ObjectMapper; import eu.arrowhead.common.CommonConstants; import eu.arrowhead.common.Utilities; import eu.arrowhead.common.dto.shared.ErrorMessageDTO; import eu.arrowhead.common.exception.ArrowheadException; public abstract class ArrowheadFilter extends GenericFilterBean { //================================================================================================= // members protected final Logger log = LogManager.getLogger(ArrowheadFilter.class); protected final ObjectMapper mapper = new ObjectMapper(); //================================================================================================= // methods //------------------------------------------------------------------------------------------------- @Override public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { chain.doFilter(request, response); } //================================================================================================= // assistant methods //------------------------------------------------------------------------------------------------- protected ArrowheadFilter() { log.info("{} is active", this.getClass().getSimpleName()); } //------------------------------------------------------------------------------------------------- protected void handleException(final ArrowheadException ex, final ServletResponse response) throws IOException { final HttpStatus status = Utilities.calculateHttpStatusFromArrowheadException(ex); final String origin = ex.getOrigin() == null ? CommonConstants.UNKNOWN_ORIGIN : ex.getOrigin(); log.debug("{} at {}: {}", ex.getClass().getName(), origin, ex.getMessage()); log.debug("Exception", ex); final ErrorMessageDTO dto = new ErrorMessageDTO(ex); if (ex.getErrorCode() <= 0) { dto.setErrorCode(status.value()); } sendError(status, dto, (HttpServletResponse) response); } //------------------------------------------------------------------------------------------------- protected void sendError(final HttpStatus status, final ErrorMessageDTO dto, final HttpServletResponse response) throws IOException { response.setContentType(MediaType.APPLICATION_JSON_VALUE); response.setStatus(status.value()); response.getWriter().print(mapper.writeValueAsString(dto)); response.getWriter().flush(); } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/filter
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/filter/thirdparty/CustomServletInputStream.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.filter.thirdparty; import javax.servlet.ReadListener; import javax.servlet.ServletInputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; /** * Third party code from: https://stackoverflow.com/a/54258488 * @author granadaCoder (https://stackoverflow.com/users/214977/granadacoder) * */ public class CustomServletInputStream extends ServletInputStream { //================================================================================================= // members private byte[] myBytes; private int lastIndexRetrieved = -1; private ReadListener readListener = null; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public CustomServletInputStream(final String s) { try { this.myBytes = s.getBytes(StandardCharsets.UTF_8.name()); } catch (final UnsupportedEncodingException ex) { throw new IllegalStateException("JVM did not support UTF-8", ex); } } //------------------------------------------------------------------------------------------------- public CustomServletInputStream(final byte[] inputBytes) { this.myBytes = inputBytes; } //------------------------------------------------------------------------------------------------- @Override public boolean isFinished() { return (lastIndexRetrieved == myBytes.length - 1); } //------------------------------------------------------------------------------------------------- @Override public boolean isReady() { // This implementation will never block // We also never need to call the readListener from this method, as this method will never return false return isFinished(); } //------------------------------------------------------------------------------------------------- @Override public void setReadListener(final ReadListener readListener) { this.readListener = readListener; if (!isFinished()) { try { readListener.onDataAvailable(); } catch (final IOException e) { readListener.onError(e); } } else { try { readListener.onAllDataRead(); } catch (final IOException e) { readListener.onError(e); } } } //------------------------------------------------------------------------------------------------- @Override public int read() throws IOException { int i; if (!isFinished()) { i = myBytes[lastIndexRetrieved + 1]; lastIndexRetrieved++; if (isFinished() && (readListener != null)) { try { readListener.onAllDataRead(); } catch (final IOException ex) { readListener.onError(ex); throw ex; } } return i; } else { return -1; } } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/filter
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/filter/thirdparty/MultiReadRequestWrapper.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.filter.thirdparty; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.stream.Collectors; import javax.servlet.ServletInputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; /** * Third party code from: https://stackoverflow.com/a/54258488 * @author granadaCoder (https://stackoverflow.com/users/214977/granadacoder) * */ public class MultiReadRequestWrapper extends HttpServletRequestWrapper { //================================================================================================= // members private final String body; //================================================================================================= // methods //------------------------------------------------------------------------------------------------- public MultiReadRequestWrapper(final HttpServletRequest request) throws IOException { super(request); body = request.getReader().lines().collect(Collectors.joining(System.lineSeparator())); } //------------------------------------------------------------------------------------------------- public String getCachedBody() { return body; } //------------------------------------------------------------------------------------------------- @Override public ServletInputStream getInputStream() throws IOException { return new CustomServletInputStream(body.getBytes()); } //------------------------------------------------------------------------------------------------- @Override public BufferedReader getReader() throws IOException { return new BufferedReader(new InputStreamReader(this.getInputStream())); } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/http/ArrowheadHttpClientResponseErrorHandler.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.http; import java.io.IOException; import java.net.URI; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.http.HttpMethod; import org.springframework.http.client.ClientHttpResponse; import org.springframework.stereotype.Component; import org.springframework.web.client.DefaultResponseErrorHandler; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import eu.arrowhead.common.Utilities; import eu.arrowhead.common.dto.shared.ErrorMessageDTO; import eu.arrowhead.common.exception.ArrowheadException; @Component public class ArrowheadHttpClientResponseErrorHandler extends DefaultResponseErrorHandler { //================================================================================================= // members private final Logger logger = LogManager.getLogger(HttpService.class); private final ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); //================================================================================================= // methods //------------------------------------------------------------------------------------------------- @Override public void handleError(final URI url, final HttpMethod method, final ClientHttpResponse response) throws IOException { ErrorMessageDTO dto; try { dto = mapper.readValue(response.getBody(), ErrorMessageDTO.class); } catch (final IOException ex) { logger.debug("Unable to deserialize error message: {}", ex.getMessage()); logger.debug("Exception: ", ex); logger.error("Request failed at {}, response status code: {}", url, response.getRawStatusCode()); throw new ArrowheadException("Unknown error occurred at " + url + ". Check log for possibly more information.", response.getRawStatusCode(), ex); } if (dto.getExceptionType() == null) { logger.error("Request failed at {}, response status code: {}", url, response.getRawStatusCode()); logger.error("Request failed, error message: {}", dto.getErrorMessage()); throw new ArrowheadException("Unknown error occurred at " + url + ". Check log for possibly more information.", response.getRawStatusCode()); } logger.debug("Error occured at {}. Returned with {}", url, response.getRawStatusCode()); logger.error("Request returned with {}: {}", dto.getExceptionType(), dto.getErrorMessage()); Utilities.createExceptionFromErrorMessageDTO(dto); } }
0
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common
java-sources/ai/aitia/arrowhead-core-common-essentials-java-spring/4.6.0.0/eu/arrowhead/common/http/ArrowheadResponseEntityExceptionHandler.java
/******************************************************************************** * Copyright (c) 2019 AITIA * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * AITIA - implementation * Arrowhead Consortia - conceptualization ********************************************************************************/ package eu.arrowhead.common.http; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.context.request.WebRequest; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; import eu.arrowhead.common.Utilities; import eu.arrowhead.common.dto.shared.ErrorMessageDTO; import eu.arrowhead.common.exception.ArrowheadException; @ControllerAdvice public class ArrowheadResponseEntityExceptionHandler extends ResponseEntityExceptionHandler { //================================================================================================= // members private Logger log = LogManager.getLogger(ArrowheadResponseEntityExceptionHandler.class); private static final HttpHeaders headers = new HttpHeaders(); static { headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE); } //================================================================================================= // methods //------------------------------------------------------------------------------------------------- @ExceptionHandler(ArrowheadException.class) public ResponseEntity<Object> handleArrowheadException(final ArrowheadException ex, final WebRequest request) { final String origin = ex.getOrigin() != null ? ex.getOrigin() : request.getContextPath(); final HttpStatus status = Utilities.calculateHttpStatusFromArrowheadException(ex); log.debug("{} at {}: {}", ex.getClass().getName(), origin, ex.getMessage()); log.debug("Exception", ex); final ErrorMessageDTO dto = new ErrorMessageDTO(ex); if (ex.getErrorCode() <= 0) { dto.setErrorCode(status.value()); } return handleExceptionInternal(ex, dto, headers, status, request); } }