+
+ // expects a String in JSON format, with known fields to populate Topic object
+ public Topic ( String json ) {
+ JSONParser parser = new JSONParser();
+ JSONObject jsonObj;
+ try {
+ jsonObj = (JSONObject) parser.parse( json );
+ } catch ( ParseException pe ) {
+ logger.error( "Error parsing provisioning data: " + json );
+ this.setStatus( DmaapObject_Status.INVALID );
+ return;
+ }
+ this.setFqtn( (String) jsonObj.get( "fqtn" ) );
+ this.setTopicName( (String) jsonObj.get( "topicName" ) );
+ this.setTopicDescription( (String) jsonObj.get( "topicDescription" ));
+ this.setOwner( (String) jsonObj.get( "owner" ) );
+ //this.setLastMod();
+ this.setStatus( (String) jsonObj.get( "status" ) );
+ this.setReplicationCase( ReplicationType.Validator( (String) jsonObj.get( "replicationCase" ) ));
+ this.setFqtnStyle( FqtnType.Validator( (String) jsonObj.get( "fqtnStyle" ) ) );
+
+ }