|
| 1 | +/* |
| 2 | + * Copyright (c) 2009 LabKey Corporation |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +package org.labkey.remoteapi.security; |
| 18 | + |
| 19 | +import org.labkey.remoteapi.PostCommand; |
| 20 | + |
| 21 | +import org.json.JSONObject; |
| 22 | + |
| 23 | +/** |
| 24 | + * Rename a container on the server |
| 25 | + */ |
| 26 | +public class RenameContainerCommand extends PostCommand<RenameContainerResponse> { |
| 27 | + private String _name; |
| 28 | + private String _title; |
| 29 | + private boolean _addAlias = true; |
| 30 | + |
| 31 | + |
| 32 | + public RenameContainerCommand(String name, String title, boolean addAlias) |
| 33 | + { |
| 34 | + super("admin", "RenameContainer"); |
| 35 | + _name = name; |
| 36 | + _title = title; |
| 37 | + _addAlias = addAlias; |
| 38 | + } |
| 39 | + |
| 40 | + @Override |
| 41 | + public JSONObject getJsonObject() |
| 42 | + { |
| 43 | + JSONObject result = new JSONObject(); |
| 44 | + result.put("name", _name); |
| 45 | + result.put("title", _title); |
| 46 | + result.put("addAlias", _addAlias); |
| 47 | + |
| 48 | + return result; |
| 49 | + } |
| 50 | + |
| 51 | + public String getName() |
| 52 | + { |
| 53 | + return _name; |
| 54 | + } |
| 55 | + |
| 56 | + public void setName(String name) |
| 57 | + { |
| 58 | + _name = name; |
| 59 | + } |
| 60 | + |
| 61 | + public String getTitle() |
| 62 | + { |
| 63 | + return _title; |
| 64 | + } |
| 65 | + |
| 66 | + public void setTitle(String title) |
| 67 | + { |
| 68 | + _title = title; |
| 69 | + } |
| 70 | + |
| 71 | + public boolean isAddAlias() |
| 72 | + { |
| 73 | + return _addAlias; |
| 74 | + } |
| 75 | + |
| 76 | + public void setAddAlias(boolean addAlias) |
| 77 | + { |
| 78 | + _addAlias = addAlias; |
| 79 | + } |
| 80 | + |
| 81 | + @Override |
| 82 | + protected RenameContainerResponse createResponse(String text, int status, String contentType, JSONObject json) |
| 83 | + { |
| 84 | + return new RenameContainerResponse(text, status, contentType, json); |
| 85 | + } |
| 86 | + |
| 87 | +} |
0 commit comments