File Source: PingTargetManager.java

         /* 
    P/P   *  Method: org.apache.roller.weblogger.business.pings.PingTargetManager__static_init
          */
     1  /*
     2   * Licensed to the Apache Software Foundation (ASF) under one or more
     3   * contributor license agreements.  The ASF licenses this file to You
     4   * under the Apache License, Version 2.0 (the "License"); you may not
     5   * 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.  For additional information regarding
    15   * copyright in this work, please see the NOTICE file in the top level
    16   * directory of this distribution.
    17   */
    18  
    19  package org.apache.roller.weblogger.business.pings;
    20  
    21  import java.util.List;
    22  import org.apache.roller.weblogger.WebloggerException;
    23  import org.apache.roller.weblogger.pojos.PingTarget;
    24  import org.apache.roller.weblogger.pojos.Weblog;
    25  
    26  
    27  /**
    28   * Manages ping targets.
    29   *
    30   * @author <a href="mailto:anil@busybuddha.org">Anil Gangolli</a>
    31   */
    32  public interface PingTargetManager {
    33      
    34      
    35      /**
    36       * Store a ping target.
    37       *
    38       * @param pingTarget ping target data object.
    39       * @throws WebloggerException
    40       */
    41      public void savePingTarget(PingTarget pingTarget) throws WebloggerException;
    42      
    43      
    44      /**
    45       * Remove a ping target.
    46       *
    47       * @param id id of the ping target to be removed
    48       * @throws WebloggerException
    49       */
    50      public void removePingTarget(PingTarget pingTarget) throws WebloggerException;
    51      
    52      
    53      /**
    54       * Remove all custom targets (regardless of website).
    55       */
    56      public void removeAllCustomPingTargets() throws WebloggerException;
    57      
    58      
    59      /**
    60       * Retrieve a specific ping target by id.
    61       *
    62       * @param id id of the ping target to be retrieved.
    63       * @return the ping target whose id is specified.
    64       * @throws WebloggerException
    65       */
    66      public PingTarget getPingTarget(String id) throws WebloggerException;
    67      
    68      
    69      /**
    70       * Get a list of the common (shared) ping targets.
    71       * 
    72       * @return the list of common ping targets as a <code>List</code> of {@link PPingTarget objects
    73       * @throws WebloggerException
    74       */
    75      public List getCommonPingTargets() throws WebloggerException;
    76      
    77      
    78      /**
    79       * Get a list of the custom ping targets for the given website.
    80       * 
    81       * @param website the website whose custom targets should be returned.
    82       * @return the list of custom ping targets for the given website as a <code>List</code> of {@link PiPingTarget         objects
    83       * @throws WebloggerException
    84       */
    85      public List getCustomPingTargets(Weblog website) throws WebloggerException;
    86      
    87      
    88      /**
    89       * Check if the ping target has a name that is unique in the appropriate set.  If the ping target has no website id
    90       * (is common), then this checks if the name is unique amongst common targets, and if custom then unique amongst
    91       * custom targets. If the target has a non-null id, then it is allowed to have the same name as tha existing stored
    92       * target with the same id.
    93       *
    94       * @param pingTarget
    95       * @return true if the name is unique in the appropriate set (custom or common) ping targets.
    96       * @throws WebloggerException
    97       */
    98      public boolean isNameUnique(PingTarget pingTarget) throws WebloggerException;
    99      
   100      
   101      /**
   102       * Check if the url of the ping target is well-formed.  For this test, it must parse as a <code>java.net.URL</code>,
   103       * with protocol <code>http</code> and a non-empty <code>host</code> portion.
   104       *
   105       * @param pingTarget
   106       * @return true if the <code>pingUrl</code> property of the ping target is a well-formed url.
   107       * @throws WebloggerException
   108       */
   109      public boolean isUrlWellFormed(PingTarget pingTarget) throws WebloggerException;
   110      
   111      
   112      /**
   113       * Check if the host portion of the url of the ping target is known, meaning it is either a well-formed IP address
   114       * or a hostname that resolves from the server.  The ping target url must parse as a <code>java.net.URL</code> in
   115       * order for the hostname to be extracted for this test.  This will return false if that parsing fails.
   116       *
   117       * @param pingTarget
   118       * @return true if the <code>pingUrl</code> (is well-formed and) the <code>host</code> portion of the url of the
   119       *         ping target is a valid IP address or a hostname that can be resolved on the server.
   120       * @throws WebloggerException
   121       */
   122      public boolean isHostnameKnown(PingTarget pingTarget) throws WebloggerException;
   123      
   124      
   125      /**
   126       * Release all resources associated with Roller session.
   127       */
   128      public void release();
   129      
   130  }








SofCheck Inspector Build Version : 2.18479
PingTargetManager.java 2009-Jan-02 14:24:48
PingTargetManager.class 2009-Sep-04 03:12:30