@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getStreamProcessorArn() == null) ? 0 : getStreamProcessorArn().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode()); hashCode = prime * hashCode + ((getCreationTimestamp() == null) ? 0 : getCreationTimestamp().hashCode()); hashCode = prime * hashCode + ((getLastUpdateTimestamp() == null) ? 0 : getLastUpdateTimestamp().hashCode()); hashCode = prime * hashCode + ((getInput() == null) ? 0 : getInput().hashCode()); hashCode = prime * hashCode + ((getOutput() == null) ? 0 : getOutput().hashCode()); hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); hashCode = prime * hashCode + ((getSettings() == null) ? 0 : getSettings().hashCode()); return hashCode; }
public DescribeStreamProcessorResult unmarshall(JsonUnmarshallerContext context) throws Exception { DescribeStreamProcessorResult describeStreamProcessorResult = new DescribeStreamProcessorResult(); if (context.testExpression("Name", targetDepth)) { context.nextToken(); describeStreamProcessorResult.setName(context.getUnmarshaller(String.class).unmarshall(context)); describeStreamProcessorResult.setStreamProcessorArn(context.getUnmarshaller(String.class).unmarshall(context)); describeStreamProcessorResult.setStatus(context.getUnmarshaller(String.class).unmarshall(context)); describeStreamProcessorResult.setStatusMessage(context.getUnmarshaller(String.class).unmarshall(context)); describeStreamProcessorResult.setCreationTimestamp(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context)); describeStreamProcessorResult.setLastUpdateTimestamp(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context)); describeStreamProcessorResult.setInput(StreamProcessorInputJsonUnmarshaller.getInstance().unmarshall(context)); describeStreamProcessorResult.setOutput(StreamProcessorOutputJsonUnmarshaller.getInstance().unmarshall(context)); describeStreamProcessorResult.setRoleArn(context.getUnmarshaller(String.class).unmarshall(context)); describeStreamProcessorResult.setSettings(StreamProcessorSettingsJsonUnmarshaller.getInstance().unmarshall(context));
/** * Creates a StreamProcess if it doesn't exist already. Once the stream processor is created, it's started and then * described to know the result of the stream processor. */ public void process() { // Creates a stream processor if it doesn't already exist and start. try { final DescribeStreamProcessorResult result = describeStreamProcessor(); if (!result.getStatus().equals(StreamProcessorStatus.RUNNING.toString())) { startStreamProcessor(); } } catch (final ResourceNotFoundException e) { log.info("StreamProcessor with name : {} doesnt exist. Creating...", streamProcessorName); createStreamProcessor(); startStreamProcessor(); } // Describe the Stream Processor results to log the status. describeStreamProcessor(); }
public DescribeStreamProcessorResult unmarshall(JsonUnmarshallerContext context) throws Exception { DescribeStreamProcessorResult describeStreamProcessorResult = new DescribeStreamProcessorResult(); String name = reader.nextName(); if (name.equals("Name")) { describeStreamProcessorResult.setName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("StreamProcessorArn")) { describeStreamProcessorResult.setStreamProcessorArn(StringJsonUnmarshaller .getInstance() .unmarshall(context)); } else if (name.equals("Status")) { describeStreamProcessorResult.setStatus(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("StatusMessage")) { describeStreamProcessorResult.setStatusMessage(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("CreationTimestamp")) { describeStreamProcessorResult.setCreationTimestamp(DateJsonUnmarshaller .getInstance() .unmarshall(context)); } else if (name.equals("LastUpdateTimestamp")) { describeStreamProcessorResult.setLastUpdateTimestamp(DateJsonUnmarshaller .getInstance() .unmarshall(context)); } else if (name.equals("Input")) { describeStreamProcessorResult.setInput(StreamProcessorInputJsonUnmarshaller .getInstance() .unmarshall(context));
return false; DescribeStreamProcessorResult other = (DescribeStreamProcessorResult) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getStreamProcessorArn() == null ^ this.getStreamProcessorArn() == null) return false; if (other.getStreamProcessorArn() != null && other.getStreamProcessorArn().equals(this.getStreamProcessorArn()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getStatusMessage() == null ^ this.getStatusMessage() == null) return false; if (other.getStatusMessage() != null && other.getStatusMessage().equals(this.getStatusMessage()) == false) return false; if (other.getCreationTimestamp() == null ^ this.getCreationTimestamp() == null) return false; if (other.getCreationTimestamp() != null && other.getCreationTimestamp().equals(this.getCreationTimestamp()) == false) return false; if (other.getLastUpdateTimestamp() == null ^ this.getLastUpdateTimestamp() == null) return false; if (other.getLastUpdateTimestamp() != null && other.getLastUpdateTimestamp().equals(this.getLastUpdateTimestamp()) == false) return false; if (other.getInput() == null ^ this.getInput() == null) return false; if (other.getInput() != null && other.getInput().equals(this.getInput()) == false)
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getStreamProcessorArn() != null) sb.append("StreamProcessorArn: ").append(getStreamProcessorArn()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getStatusMessage() != null) sb.append("StatusMessage: ").append(getStatusMessage()).append(","); if (getCreationTimestamp() != null) sb.append("CreationTimestamp: ").append(getCreationTimestamp()).append(","); if (getLastUpdateTimestamp() != null) sb.append("LastUpdateTimestamp: ").append(getLastUpdateTimestamp()).append(","); if (getInput() != null) sb.append("Input: ").append(getInput()).append(","); if (getOutput() != null) sb.append("Output: ").append(getOutput()).append(","); if (getRoleArn() != null) sb.append("RoleArn: ").append(getRoleArn()).append(","); if (getSettings() != null) sb.append("Settings: ").append(getSettings()); sb.append("}"); return sb.toString();
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getStreamProcessorArn() == null) ? 0 : getStreamProcessorArn().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode()); hashCode = prime * hashCode + ((getCreationTimestamp() == null) ? 0 : getCreationTimestamp().hashCode()); hashCode = prime * hashCode + ((getLastUpdateTimestamp() == null) ? 0 : getLastUpdateTimestamp().hashCode()); hashCode = prime * hashCode + ((getInput() == null) ? 0 : getInput().hashCode()); hashCode = prime * hashCode + ((getOutput() == null) ? 0 : getOutput().hashCode()); hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); hashCode = prime * hashCode + ((getSettings() == null) ? 0 : getSettings().hashCode()); return hashCode; }
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: " + getName() + ","); if (getStreamProcessorArn() != null) sb.append("StreamProcessorArn: " + getStreamProcessorArn() + ","); if (getStatus() != null) sb.append("Status: " + getStatus() + ","); if (getStatusMessage() != null) sb.append("StatusMessage: " + getStatusMessage() + ","); if (getCreationTimestamp() != null) sb.append("CreationTimestamp: " + getCreationTimestamp() + ","); if (getLastUpdateTimestamp() != null) sb.append("LastUpdateTimestamp: " + getLastUpdateTimestamp() + ","); if (getInput() != null) sb.append("Input: " + getInput() + ","); if (getOutput() != null) sb.append("Output: " + getOutput() + ","); if (getRoleArn() != null) sb.append("RoleArn: " + getRoleArn() + ","); if (getSettings() != null) sb.append("Settings: " + getSettings()); sb.append("}"); return sb.toString();
if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getStreamProcessorArn() == null ^ this.getStreamProcessorArn() == null) return false; if (other.getStreamProcessorArn() != null && other.getStreamProcessorArn().equals(this.getStreamProcessorArn()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getStatusMessage() == null ^ this.getStatusMessage() == null) return false; if (other.getStatusMessage() != null && other.getStatusMessage().equals(this.getStatusMessage()) == false) return false; if (other.getCreationTimestamp() == null ^ this.getCreationTimestamp() == null) return false; if (other.getCreationTimestamp() != null && other.getCreationTimestamp().equals(this.getCreationTimestamp()) == false) return false; if (other.getLastUpdateTimestamp() == null ^ this.getLastUpdateTimestamp() == null) return false; if (other.getLastUpdateTimestamp() != null && other.getLastUpdateTimestamp().equals(this.getLastUpdateTimestamp()) == false) return false; if (other.getInput() == null ^ this.getInput() == null)
public DescribeStreamProcessorResult describeStreamProcessor() { final DescribeStreamProcessorResult describeStreamProcessorResult = rekognitionClient.describeStreamProcessor(new DescribeStreamProcessorRequest().withName(streamProcessorName)); log.info("Arn : {}", describeStreamProcessorResult.getStreamProcessorArn()); log.info("Input kinesisVideo stream : {} ", describeStreamProcessorResult.getInput().getKinesisVideoStream().getArn()); log.info("Output kinesisData stream {} ", describeStreamProcessorResult.getOutput().getKinesisDataStream().getArn()); log.info("RoleArn {} ", describeStreamProcessorResult.getRoleArn()); log.info("CollectionId {} ", describeStreamProcessorResult.getSettings().getFaceSearch().getCollectionId()); log.info("Status {} ", describeStreamProcessorResult.getStatus()); log.info("Status message {} ", describeStreamProcessorResult.getStatusMessage()); log.info("Creation timestamp {} ", describeStreamProcessorResult.getCreationTimestamp()); log.info("Last update timestamp {} ", describeStreamProcessorResult.getLastUpdateTimestamp()); return describeStreamProcessorResult; }