* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
* ============LICENSE_END=========================================================
*/
import org.openecomp.aai.introspection.Loader;
import org.openecomp.aai.introspection.Version;
import org.openecomp.aai.schema.enums.ObjectMetadata;
+import org.openecomp.aai.serialization.db.EdgeType;
/**
* Given a URI this class returns an object, or series of nested objects
}
- /**
- * @{inheritDoc}
- */
- @Override
- public void processObject(Introspector obj, MultivaluedMap<String, String> uriKeys) {
-
- if (this.entityName == null) {
- this.topEntityName = obj.getDbName();
- this.topEntity = obj;
- }
- this.entityName = obj.getDbName();
- this.entity = obj;
- this.parentList = (List<Object>)this.previous.getValue(obj.getName());
- this.parentList.add(entity.getUnderlyingObject());
-
- for (String key : uriKeys.keySet()) {
- entity.setValue(key, uriKeys.getFirst(key));
- }
- try {
- if (relatedObjects.containsKey(entity.getObjectId())) {
- Introspector relatedObject = relatedObjects.get(entity.getObjectId());
- String nameProp = relatedObject.getMetadata(ObjectMetadata.NAME_PROPS);
- if (nameProp == null) {
- nameProp = "";
- }
- if (nameProp != null && !nameProp.equals("")) {
- String[] nameProps = nameProp.split(",");
- for (String prop : nameProps) {
- entity.setValue(prop, relatedObject.getValue(prop));
- }
- }
- }
- } catch (UnsupportedEncodingException e) {
- }
- this.previous = entity;
-
- }
-
- /**
- * @{inheritDoc}
- */
- @Override
- public void processContainer(Introspector obj, MultivaluedMap<String, String> uriKeys, boolean isFinalContainer) {
-
- this.previous = obj;
-
- if (this.entity != null) {
- this.entity.setValue(obj.getName(), obj.getUnderlyingObject());
- } else {
- this.entity = obj;
- this.topEntity = obj;
- }
-
- }
-
/**
* @{inheritDoc}
*/
public Loader getLoader() {
return this.loader;
}
+ @Override
+ public void processObject(Introspector obj, EdgeType type, MultivaluedMap<String, String> uriKeys)
+ throws AAIException {
+
+ if (this.entityName == null) {
+ this.topEntityName = obj.getDbName();
+ this.topEntity = obj;
+ }
+ this.entityName = obj.getDbName();
+ this.entity = obj;
+ this.parentList = (List<Object>)this.previous.getValue(obj.getName());
+ this.parentList.add(entity.getUnderlyingObject());
+
+ for (String key : uriKeys.keySet()) {
+ entity.setValue(key, uriKeys.getFirst(key));
+ }
+ try {
+ if (relatedObjects.containsKey(entity.getObjectId())) {
+ Introspector relatedObject = relatedObjects.get(entity.getObjectId());
+ String nameProp = relatedObject.getMetadata(ObjectMetadata.NAME_PROPS);
+ if (nameProp == null) {
+ nameProp = "";
+ }
+ if (nameProp != null && !nameProp.equals("")) {
+ String[] nameProps = nameProp.split(",");
+ for (String prop : nameProps) {
+ entity.setValue(prop, relatedObject.getValue(prop));
+ }
+ }
+ }
+ } catch (UnsupportedEncodingException e) {
+ }
+ this.previous = entity;
+ }
+ @Override
+ public void processContainer(Introspector obj, EdgeType type, MultivaluedMap<String, String> uriKeys,
+ boolean isFinalContainer) throws AAIException {
+ this.previous = obj;
+
+ if (this.entity != null) {
+ this.entity.setValue(obj.getName(), obj.getUnderlyingObject());
+ } else {
+ this.entity = obj;
+ this.topEntity = obj;
+ }
+ }
}