[ 
https://issues.apache.org/jira/browse/QPID-6591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14586609#comment-14586609
 ] 

Rob Godfrey commented on QPID-6591:
-----------------------------------

I've not looked at the change in any detail, but I was looking at the 
VirtualHostPrinicpal class and had a few questions/observations:

----

{code}
    private static String VIRTUALHOST_SUBJECT_TEMPLATE = "virtualhost:%s-%s";
{code}
{code}
        _name = String.format(VIRTUALHOST_SUBJECT_TEMPLATE, 
virtualHost.getName(), virtualHost.getId());
{code}

Is there any real advantage here over just doing

{code}
        _name = "virtualhost:" + virtualHost.getName() + "-" + 
virtualHost.getId();
{code}

----

Why do this:

{code}
    @Override
    public int hashCode()
    {
        return Objects.hash(_virtualHost);
    }
{code}

rather than

{code}
    @Override
    public int hashCode()
    {
        return _virtualHost.hashCode();
    }
{code}

We can assert _virtualHost is not null as we perform operations on it in the 
constructor.

----

Similarly why

{code}
        return Objects.equals(_virtualHost, that._virtualHost);
{code}

rather than

{code}
        return _virtualHost.equals(that._virtualHost);
{code}



> [Java Broker] Add ability to generate a virtualhost specific log
> ----------------------------------------------------------------
>
>                 Key: QPID-6591
>                 URL: https://issues.apache.org/jira/browse/QPID-6591
>             Project: Qpid
>          Issue Type: New Feature
>          Components: Java Broker
>            Reporter: Alex Rudyy
>            Assignee: Alex Rudyy
>             Fix For: 6.0 [Java]
>
>
> We need the ability to write a separate log file for a virtualhost which 
> contains just the log events for related to the virtualhost.
> * Add a VirtualHostLogger model object (like BrokerLogger) which will be a 
> child of Virtualhost.  (As such it will be automatically propagated around a 
> HA group)
> * Add a VirtualHostFileLogger impl (like BrokerFileLogger impl)
> * Add a VirtualHostNameAndLevelFilter (like BrokerNameAndLevelFilter except 
> that it additionally filters for events whose subject has a 
> ConnectionPrincipal with a matching virtualhost). 
> * Like the Broker counterparts, these Objects must be 
> addable/removable/configurable dynamically.
> * ACL rule UPDATE VIRTUALHOST should be applied to these operations.
> * Include adding support for virtualhostloggers and virtualhostfilters to the 
> REST API
> * As VH can be stopped and started (or a HA node become active), the 
> implementation must be prepared to dynammically add and remove itself at run 
> time. 
> * Make sure housekeeping/queue running threads have appropriate Subject.  
> (Maybe add concept of a VirtualhostPrinicpal).
> Owing to limitations in the model framework code VirtualHostLogger and 
> BrokerLogger must be distinct, but there is nothing stopping their 
> implementations from sharing a implementation from a non-model object.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to