001/* 002 * Copyright 2009 Red Hat, Inc. 003 * Red Hat licenses this file to you under the Apache License, version 004 * 2.0 (the "License"); you may not use this file except in compliance 005 * with the License. You may obtain a copy of the License at 006 * http://www.apache.org/licenses/LICENSE-2.0 007 * Unless required by applicable law or agreed to in writing, software 008 * distributed under the License is distributed on an "AS IS" BASIS, 009 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 010 * implied. See the License for the specific language governing 011 * permissions and limitations under the License. 012 */ 013 014package org.hornetq.api.core.management; 015 016 017/** 018 * An AddressControl is used to manage an address. 019 * 020 * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a> 021 */ 022public interface AddressControl 023{ 024 // Attributes ---------------------------------------------------- 025 026 /** 027 * Returns the managed address. 028 */ 029 String getAddress(); 030 031 /** 032 * Returns the roles (name and permissions) associated to this address. 033 */ 034 Object[] getRoles() throws Exception; 035 036 /** 037 * Returns the roles (name and permissions) associated to this address 038 * using JSON serialization. 039 * <br> 040 * Java objects can be recreated from JSON serialization using {@link RoleInfo#from(String)}. 041 */ 042 String getRolesAsJSON() throws Exception; 043 044 /** 045 * Returns the names of the queues bound to this address. 046 */ 047 String[] getQueueNames() throws Exception; 048 049 /** 050 * Returns the number of pages used by this address. 051 */ 052 int getNumberOfPages() throws Exception; 053 054 boolean isPaging() throws Exception; 055 056 /** 057 * Returns the number of bytes used by each page for this address. 058 */ 059 long getNumberOfBytesPerPage() throws Exception; 060 061 /** 062 * Returns the names of all bindings (both queues and diverts) bound to this address 063 */ 064 String[] getBindingNames() throws Exception; 065 066 // Operations ---------------------------------------------------- 067 068}