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 */
019package org.apache.isis.extensions.secman.api.tenancy;
020
021import org.apache.isis.extensions.secman.api.IsisModuleExtSecmanApi;
022
023public interface ApplicationTenancy {
024
025    public static final int MAX_LENGTH_PATH = 255;
026    public static final int MAX_LENGTH_NAME = 40;
027    public static final int TYPICAL_LENGTH_NAME = 20;
028    
029    // -- DOMAIN EVENTS
030    
031    public static abstract class PropertyDomainEvent<T> extends IsisModuleExtSecmanApi.PropertyDomainEvent<ApplicationTenancy, T> {}
032    public static abstract class CollectionDomainEvent<T> extends IsisModuleExtSecmanApi.CollectionDomainEvent<ApplicationTenancy, T> {}
033    public static abstract class ActionDomainEvent extends IsisModuleExtSecmanApi.ActionDomainEvent<ApplicationTenancy> {}
034    
035    public static class AddUserDomainEvent extends ActionDomainEvent {}
036    public static class RemoveUserDomainEvent extends ActionDomainEvent {}
037    public static class AddChildDomainEvent extends ActionDomainEvent {}
038    public static class DeleteDomainEvent extends ActionDomainEvent {}
039    public static class RemoveChildDomainEvent extends ActionDomainEvent {}
040    public static class UpdateNameDomainEvent extends ActionDomainEvent {}
041    public static class UpdateParentDomainEvent extends ActionDomainEvent {}
042    
043    // -- MODEL
044    
045    default String title() {
046        return getName();
047    }
048    
049    public String getPath();
050
051    public String getName();
052    public void setName(String name);
053
054    public ApplicationTenancy getParent();
055    
056
057}