diff --git a/src/main/java/cactusServer/resources/InstancesRest.java b/src/main/java/cactusServer/resources/InstancesRest.java index 0d803e9..e01c351 100644 --- a/src/main/java/cactusServer/resources/InstancesRest.java +++ b/src/main/java/cactusServer/resources/InstancesRest.java @@ -93,34 +93,34 @@ // - @POST - @Produces(MediaType.APPLICATION_JSON) - public URIAddressedEntity create(@FormParam("name") String name, @FormParam("state") Instance.State state, @FormParam("stageModel") StageModel stageModel) { - IDAddressedEntity ae = Instances.getInstance().createInstance(name, state, stageModel); - return new URIAddressedEntity((INSTANCES_URI + "/" + ae.getId()), ae.getBody()); - } - - @Path("/{instanceId}/areas") - @POST - @Produces(MediaType.APPLICATION_JSON) - public URIAddressedEntity create(@PathParam("instanceId") String instanceId, @FormParam("name") String name, - @FormParam("region") Plain[] region, @FormParam("permissions") HashSet permissions) { - Instance instance = Instances.getInstance().getInstance(instanceId); - IDAddressedEntity ae = instance.createArea(name, region, permissions); - return new URIAddressedEntity((INSTANCES_URI + "/" + instanceId + "/areas/" + ae.getId()), ae.getBody()); - } - - @Path("/{instanceId}/objects") - @POST - @Produces(MediaType.APPLICATION_JSON) - public URIAddressedEntity create(@PathParam("instanceId") String instanceId, @FormParam("position") Position3D position, - @FormParam("velocity") Velocity3D velocity, @FormParam("angularVelocity") AngularVelocity3D angularVelocity, - @FormParam("angle") Angle angle, @FormParam("attribute") Attribute attribute, @FormParam("model") ObjectModel model) { - Instance instance = Instances.getInstance().getInstance(instanceId); - IDAddressedEntity ae = instance.createObject(position, velocity, angularVelocity, angle, attribute, model); - return new URIAddressedEntity((INSTANCES_URI + "/" + instanceId + "/objects/" + ae.getId()), ae.getBody()); - } - +// @POST +// @Produces(MediaType.APPLICATION_JSON) +// public URIAddressedEntity create(@FormParam("name") String name, @FormParam("state") Instance.State state, @FormParam("stageModel") StageModel stageModel) { +// IDAddressedEntity ae = Instances.getInstance().createInstance(name, state, stageModel); +// return new URIAddressedEntity((INSTANCES_URI + "/" + ae.getId()), ae.getBody()); +// } +// +// @Path("/{instanceId}/areas") +// @POST +// @Produces(MediaType.APPLICATION_JSON) +// public URIAddressedEntity create(@PathParam("instanceId") String instanceId, @FormParam("name") String name, +// @FormParam("region") Plain[] region, @FormParam("permissions") HashSet permissions) { +// Instance instance = Instances.getInstance().getInstance(instanceId); +// IDAddressedEntity ae = instance.createArea(name, region, permissions); +// return new URIAddressedEntity((INSTANCES_URI + "/" + instanceId + "/areas/" + ae.getId()), ae.getBody()); +// } +// +// @Path("/{instanceId}/objects") +// @POST +// @Produces(MediaType.APPLICATION_JSON) +// public URIAddressedEntity create(@PathParam("instanceId") String instanceId, @FormParam("position") Position3D position, +// @FormParam("velocity") Velocity3D velocity, @FormParam("angularVelocity") AngularVelocity3D angularVelocity, +// @FormParam("angle") Angle angle, @FormParam("attribute") Attribute attribute, @FormParam("model") ObjectModel model) { +// Instance instance = Instances.getInstance().getInstance(instanceId); +// IDAddressedEntity ae = instance.createObject(position, velocity, angularVelocity, angle, attribute, model); +// return new URIAddressedEntity((INSTANCES_URI + "/" + instanceId + "/objects/" + ae.getId()), ae.getBody()); +// } +// // @DELETE // @Path("/destroyInstance")