Class SnapshotController
- java.lang.Object
-
- org.duracloud.duradmin.spaces.controller.SnapshotController
-
@Controller public class SnapshotController extends Object
- Author:
- Daniel Bernstein Date: Jan 27,2014
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description SnapshotController(ContentStoreManager contentStoreManager, DuracloudUserDetailsService userDetailsService, SnapshotTaskClientManager snapshotTaskClientManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringcreate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String spaceId, String storeId, String description)org.springframework.web.servlet.ModelAndViewget(String storeId, String spaceId)org.springframework.web.servlet.ModelAndViewgetContent(String storeId, String snapshotId, Integer page, String prefix)org.springframework.web.servlet.ModelAndViewgetHistory(String storeId, String snapshotId, Integer page, Boolean attachment, javax.servlet.http.HttpServletResponse response)StringgetRestore(String storeId, String snapshotId)StringgetRestoreByRestoreId(String storeId, String restoreId)StringgetSnapshot(String storeId, String snapshotId)protected GetSnapshotHistoryTaskResultgetSnapshotHistory(String snapshotId, Integer page, SnapshotTaskClient taskClient, int pageSize)StringgetSnapshotList(String storeId)StringgetSnapshotTotals(String storeId, String status)protected SnapshotTaskClientgetTaskClient(String storeId)protected StringgetUserEmail(String username)protected StringgetUsername(javax.servlet.http.HttpServletRequest request)StringrequestRestore(javax.servlet.http.HttpServletRequest request, String storeId, String snapshotId)Stringrestore(javax.servlet.http.HttpServletRequest request, String storeId, String snapshotId)StringrestoreSpaceId(javax.servlet.http.HttpServletRequest request, String storeId, String snapshotId)Returns the name of the restore space, if it exists, associated with a snapshot
-
-
-
Constructor Detail
-
SnapshotController
@Autowired(required=true) public SnapshotController(@Qualifier("contentStoreManager") ContentStoreManager contentStoreManager, @Qualifier("userDetailsSvc") DuracloudUserDetailsService userDetailsService, SnapshotTaskClientManager snapshotTaskClientManager)
-
-
Method Detail
-
create
@RequestMapping(value="/spaces/snapshot", method=POST) @ResponseBody public String create(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @RequestParam String spaceId, @RequestParam String storeId, @RequestParam String description) throws Exception- Throws:
Exception
-
getUsername
protected String getUsername(javax.servlet.http.HttpServletRequest request)
-
get
@RequestMapping(value="/spaces/snapshot", method=GET) public org.springframework.web.servlet.ModelAndView get(@RequestParam String storeId, @RequestParam String spaceId)
-
getSnapshotList
@RequestMapping(value="/spaces/snapshots/{storeId}", method=GET) @ResponseBody public String getSnapshotList(@PathVariable("storeId") String storeId)
-
getSnapshotTotals
@RequestMapping(value="/spaces/snapshots/totals/{storeId}", method=GET) @ResponseBody public String getSnapshotTotals(@PathVariable("storeId") String storeId, @RequestParam(value="status",required=false) String status)
-
getSnapshot
@RequestMapping(value="/spaces/snapshots/{storeId}/{snapshotId:.+}", method=GET) @ResponseBody public String getSnapshot(@PathVariable("storeId") String storeId, @PathVariable("snapshotId") String snapshotId) throws Exception- Throws:
Exception
-
getHistory
@RequestMapping(value="/spaces/snapshots/{storeId}/{snapshotId}/history", method=GET) public org.springframework.web.servlet.ModelAndView getHistory(@PathVariable("storeId") String storeId, @PathVariable("snapshotId") String snapshotId, @RequestParam(value="page",required=false) Integer page, @RequestParam(value="attachment",required=false,defaultValue="false") Boolean attachment, javax.servlet.http.HttpServletResponse response)
-
getSnapshotHistory
protected GetSnapshotHistoryTaskResult getSnapshotHistory(String snapshotId, Integer page, SnapshotTaskClient taskClient, int pageSize) throws ContentStoreException
- Throws:
ContentStoreException
-
getContent
@RequestMapping(value="/spaces/snapshots/{storeId}/{snapshotId}/content", method=GET) public org.springframework.web.servlet.ModelAndView getContent(@PathVariable("storeId") String storeId, @PathVariable("snapshotId") String snapshotId, @RequestParam(value="page",required=false) Integer page, @RequestParam(value="prefix",required=false) String prefix)
-
restoreSpaceId
@RequestMapping(value="/spaces/snapshots/{storeId}/{snapshotId}/restore-space-id", method=GET) @ResponseBody public String restoreSpaceId(javax.servlet.http.HttpServletRequest request, @PathVariable("storeId") String storeId, @PathVariable("snapshotId") String snapshotId) throws ExceptionReturns the name of the restore space, if it exists, associated with a snapshot- Parameters:
request-snapshotId-- Returns:
- Throws:
ParseExceptionException
-
getTaskClient
protected SnapshotTaskClient getTaskClient(String storeId) throws ContentStoreException
- Throws:
ContentStoreException
-
getRestore
@RequestMapping(value="/spaces/restores/{storeId}/by-snapshot/{snapshotId:.+}", method=GET) @ResponseBody public String getRestore(@PathVariable("storeId") String storeId, @PathVariable("snapshotId") String snapshotId)
-
getRestoreByRestoreId
@RequestMapping(value="/spaces/restores/{storeId}/{restoreId:.+}", method=GET) @ResponseBody public String getRestoreByRestoreId(@PathVariable("storeId") String storeId, @PathVariable("restoreId") String restoreId)
-
restore
@RequestMapping(value="/spaces/restores", method=POST) @ResponseBody public String restore(javax.servlet.http.HttpServletRequest request, @RequestParam String storeId, @RequestParam String snapshotId) throws Exception- Throws:
Exception
-
-