use of net.geoprism.registry.InvalidRegistryIdException in project geoprism-registry by terraframe.
the class VertexGeoObjectStrategy method constructFromGeoObjectOverTime.
@Override
public VertexServerGeoObject constructFromGeoObjectOverTime(GeoObjectOverTime goTime, boolean isNew) {
if (!isNew) {
VertexObject vertex = VertexServerGeoObject.getVertex(type, goTime.getUid());
if (vertex == null) {
InvalidRegistryIdException ex = new InvalidRegistryIdException();
ex.setRegistryId(goTime.getUid());
throw ex;
}
return new VertexServerGeoObject(type, vertex);
} else {
if (!RegistryIdService.getInstance().isIssuedId(goTime.getUid())) {
InvalidRegistryIdException ex = new InvalidRegistryIdException();
ex.setRegistryId(goTime.getUid());
throw ex;
}
VertexObject vertex = VertexServerGeoObject.newInstance(type);
return new VertexServerGeoObject(type, vertex);
}
}
use of net.geoprism.registry.InvalidRegistryIdException in project geoprism-registry by terraframe.
the class ServerGeoObjectService method getGeoObject.
public ServerGeoObjectIF getGeoObject(String uid, String typeCode) {
ServerGeoObjectType type = ServerGeoObjectType.get(typeCode);
this.permissionService.enforceCanRead(type.getOrganization().getCode(), type);
ServerGeoObjectStrategyIF strategy = this.getStrategy(type);
ServerGeoObjectIF object = strategy.getGeoObjectByUid(uid);
if (object == null) {
InvalidRegistryIdException ex = new InvalidRegistryIdException();
ex.setRegistryId(uid);
throw ex;
}
return object;
}
use of net.geoprism.registry.InvalidRegistryIdException in project geoprism-registry by terraframe.
the class VertexGeoObjectStrategy method constructFromGeoObject.
@Override
public VertexServerGeoObject constructFromGeoObject(GeoObject geoObject, boolean isNew) {
if (!isNew) {
VertexObject vertex = VertexServerGeoObject.getVertex(type, geoObject.getUid());
if (vertex == null) {
InvalidRegistryIdException ex = new InvalidRegistryIdException();
ex.setRegistryId(geoObject.getUid());
throw ex;
}
return new VertexServerGeoObject(type, vertex);
} else {
if (!RegistryIdService.getInstance().isIssuedId(geoObject.getUid())) {
InvalidRegistryIdException ex = new InvalidRegistryIdException();
ex.setRegistryId(geoObject.getUid());
throw ex;
}
VertexObject vertex = VertexServerGeoObject.newInstance(type);
return new VertexServerGeoObject(type, vertex);
}
}
Aggregations