001/* 002 * Copyright (c) 2009 The openGion Project. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 013 * either express or implied. See the License for the specific language 014 * governing permissions and limitations under the License. 015 */ 016package org.opengion.plugin.token; 017 018import org.opengion.fukurou.util.XHTMLTag; 019import org.opengion.hayabusa.common.HybsSystem; 020import org.opengion.hayabusa.html.AbstractCreateToken; 021 022/** 023 * サンプルとして、エンジンのURLCheckの機能をプラグインとして作成するパターンを作成します。 024 * ※URLCheck機能を使う場合は、このプラグインではなくlinkタグの機能を使ってください。 025 * 026 * @og.group 画面表示 027 * @og.rev 5.8.2.1 (2014/12/13) 028 * 029 * @version 5.0 030 * @author Takahashi Masakazu 031 * @since JDK5.0, 032 */ 033public class CreateToken_URLCheck extends AbstractCreateToken { 034 /** このプログラムのVERSION文字列を設定します。 {@value} */ 035 private static final String VERSION = "6.4.2.0 (2016/01/29)" ; 036 037 /** 038 * デフォルトコンストラクター 039 * 040 * @og.rev 6.4.2.0 (2016/01/29) PMD refactoring. Each class should declare at least one constructor. 041 */ 042 public CreateToken_URLCheck() { super(); } // これも、自動的に呼ばれるが、空のメソッドを作成すると警告されるので、明示的にしておきます。 043 044 /** 045 * トークン付のURLを返します。 046 * 通常はこのメソッドをオーバーライドします。 047 * 048 * @og.rev 6.1.1.0 (2015/01/17) 可変長配列にメソッドを統合。 049 * 050 * @param inURL トークンを付加するURL 051 * @param time 有効期限(millis) 052 * @param user ユーザ 053 * @param param パラメータ配列 054 * 055 * @return トークン付のURL 056 * @og.rtnNotNull 057 */ 058 @Override 059 public String generateURL( final String inURL, final long time, final String user, final String... param ){ 060 return XHTMLTag.addURLCheckKey( inURL, HybsSystem.URL_CHECK_KEY, null, time ); 061 } 062}