001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.petstore.console.ops; 018 019import org.apache.juneau.http.response.*; 020import org.apache.juneau.petstore.console.*; 021import org.apache.juneau.rest.server.*; 022 023/** 024 * Operations: parent of the Jobs and Audit pages. {@code GET /console/ops} redirects to Jobs. 025 * 026 * <h5 class='section'>Example:</h5> 027 * <p class='bjava'> 028 * <ja>@Rest</ja>(path=<js>"/ops"</js>, children={JobsRest.<jk>class</jk>}) 029 * <jk>public class</jk> OpsRest <jk>extends</jk> PetstoreConsolePage { 030 * 031 * <ja>@RestGet</ja>(path=<js>"/"</js>) 032 * <jk>public</jk> SeeOther index(RestRequest <jv>req</jv>) { 033 * <jk>return new</jk> SeeOther().setLocation(<jv>req</jv>.getUriResolver().resolve(<js>"servlet:/jobs"</js>)); 034 * } 035 * } 036 * </p> 037 */ 038@Rest(path="/ops", title="Operations", children={JobsRest.class, AuditRest.class}) 039@SuppressWarnings({ 040 "java:S110" // Inheritance depth comes from the BasicRestServlet hierarchy, not this page. 041}) 042public class OpsRest extends PetstoreConsolePage { 043 044 private static final long serialVersionUID = 1L; 045 046 /** 047 * {@code GET /console/ops} redirects to the Jobs page. 048 * 049 * @param req The request. 050 * @return A 303 to {@code /console/ops/jobs}. 051 */ 052 @RestGet(path="/") 053 public SeeOther index(RestRequest req) { 054 return new SeeOther().setLocation(req.getUriResolver().resolve("servlet:/jobs")); 055 } 056}