001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *
010 *        http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License.
018 */
019
020package org.apache.isis.core.metamodel.spec.feature;
021
022import java.util.List;
023
024import org.apache.isis.applib.Identifier;
025import org.apache.isis.applib.filter.Filter;
026import org.apache.isis.core.metamodel.spec.ActionType;
027import org.apache.isis.core.metamodel.spec.ObjectSpecification;
028
029public interface ObjectActionContainer {
030
031    /**
032     * Returns the action of the specified type with the specified signature.
033     */
034    ObjectAction getObjectAction(ActionType type, String id, List<ObjectSpecification> parameters);
035
036    /**
037     * Get the action object represented by the specified identity string.
038     * 
039     * <p>
040     * The identity string can be either fully specified with parameters (as per
041     * {@link Identifier#toNameParmsIdentityString()} or in abbreviated form (
042     * {@link Identifier#toNameIdentityString()}).
043     * 
044     * @see #getObjectAction(String)
045     */
046    ObjectAction getObjectAction(ActionType type, String id);
047
048    /**
049     * Get the action object represented by the specified identity string,
050     * irrespective of {@link ActionType}.
051     * 
052     * <p>
053     * The identity string can be either fully specified with parameters (as per
054     * {@link Identifier#toNameParmsIdentityString()} or in abbreviated form (
055     * {@link Identifier#toNameIdentityString()}).
056     * 
057     * @see #getObjectAction(ActionType, String)
058     */
059    ObjectAction getObjectAction(String id);
060
061    /**
062     * Returns an array of actions of the specified type, including or excluding
063     * contributed actions as required.
064     */
065    List<ObjectAction> getObjectActions(ActionType type, Contributed contributee, Filter<ObjectAction> filter);
066
067    List<ObjectAction> getObjectActions(List<ActionType> types, Contributed contributee, Filter<ObjectAction> filter);
068
069    List<ObjectAction> getObjectActions(Contributed contributee);
070
071    List<ObjectAction> getServiceActionsReturning(List<ActionType> type);
072
073
074}