Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
package org.apache.qpid.transport;
import static org.apache.qpid.transport.Connection.State.OPEN;
import static org.apache.qpid.transport.Connection.State.RESUMING;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.security.sasl.SaslClient;
import javax.security.sasl.SaslException;
import org.apache.qpid.configuration.CommonProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.qpid.configuration.ClientProperties;
import org.apache.qpid.properties.ConnectionStartProperties;
/**
* ClientDelegate
*
*/
public class ClientDelegate extends ConnectionDelegate
{
private static final Logger LOGGER = LoggerFactory.getLogger(ClientDelegate.class);
private final ConnectionSettings _connectionSettings;
public ClientDelegate(ConnectionSettings settings)
{
_connectionSettings = settings;
}
public void init(Connection conn, ProtocolHeader hdr)
{
if (!(hdr.getMajor() == 0 && hdr.getMinor() == 10))
{
conn.exception(new ProtocolVersionException(hdr.getMajor(), hdr.getMinor()));
}
}
@Override
public void connectionStart(Connection conn, ConnectionStart start)
{
Map clientProperties = new HashMap();
if(_connectionSettings.getClientProperties() != null)
{
clientProperties.putAll(_connectionSettings.getClientProperties());
}
clientProperties.put(ConnectionStartProperties.SESSION_FLOW, 1);
clientProperties.put(ConnectionStartProperties.PID, ConnectionStartProperties.getPID());
clientProperties.put(ConnectionStartProperties.PROCESS, System.getProperty(ClientProperties.PROCESS_NAME, "Qpid Java Client"));
clientProperties.put(ConnectionStartProperties.VERSION_0_10, CommonProperties.getReleaseVersion());
clientProperties.put(ConnectionStartProperties.PRODUCT, CommonProperties.getProductName());
clientProperties.put(ConnectionStartProperties.PLATFORM, ConnectionStartProperties.getPlatformInfo());
List