当前位置: 首页>>代码示例>>Java>>正文


Java HeaderFactory类代码示例

本文整理汇总了Java中javax.sip.header.HeaderFactory的典型用法代码示例。如果您正苦于以下问题:Java HeaderFactory类的具体用法?Java HeaderFactory怎么用?Java HeaderFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HeaderFactory类属于javax.sip.header包,在下文中一共展示了HeaderFactory类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeRequest

import javax.sip.header.HeaderFactory; //导入依赖的package包/类
public Request makeRequest(SipManager sipManager, long cseqNumber, int expiresTime) throws ParseException, InvalidArgumentException {

		AddressFactory addressFactory = sipManager.addressFactory;
		SipProvider sipProvider = sipManager.sipProvider;
		MessageFactory messageFactory = sipManager.messageFactory;
		HeaderFactory headerFactory = sipManager.headerFactory;
		// Create addresses and via header for the request
		Address fromAddress = addressFactory.createAddress("sip:"+ SipManager.sipUserName + "@"+ SipManager.registrarIp);
		fromAddress.setDisplayName(SipManager.sipUserName);
		Address toAddress = addressFactory.createAddress("sip:"	+ SipManager.sipUserName + "@"	+ SipManager.registrarIp);
		toAddress.setDisplayName(SipManager.sipUserName);
		Address contactAddress = sipManager.createContactAddress();
		ArrayList<ViaHeader> viaHeaders = sipManager.createViaHeader();
		URI requestURI = addressFactory.createAddress("sip:" + SipManager.registrarIp).getURI();
		// Build the request
		final Request request = messageFactory.createRequest(requestURI,
				Request.REGISTER, sipProvider.getNewCallId(),
				headerFactory.createCSeqHeader(cseqNumber, Request.REGISTER),
				headerFactory.createFromHeader(fromAddress, "c3ff411e"),
				headerFactory.createToHeader(toAddress, null), viaHeaders,
				headerFactory.createMaxForwardsHeader(70));
		// Add the contact header
		request.addHeader(headerFactory.createContactHeader(contactAddress));
		ExpiresHeader eh = headerFactory.createExpiresHeader(expiresTime);
		request.addHeader(eh);
		// Print the request
		System.out.println(request.toString());
		return request;
	}
 
开发者ID:SyMPHOnY-,项目名称:Smart-Home-Gateway,代码行数:30,代码来源:RegisterMessage.java

示例2: AuthenticationHelperImpl

import javax.sip.header.HeaderFactory; //导入依赖的package包/类
/**
 * Default constructor for the security manager. There is one Account manager. There is one
 * SipSecurity manager for every user name,
 *
 * @param sipStack -- our stack.
 * @param accountManager -- an implementation of the AccountManager interface.
 * @param headerFactory -- header factory.
 */
public AuthenticationHelperImpl(SIPTransactionStack sipStack, AccountManager accountManager,
        HeaderFactory headerFactory) {
    this.accountManager = accountManager;
    this.headerFactory = headerFactory;
    this.sipStack = sipStack;

    this.cachedCredentials = new CredentialsCache(((SIPTransactionStack) sipStack).getTimer());
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:17,代码来源:AuthenticationHelperImpl.java

示例3: generateChallenge

import javax.sip.header.HeaderFactory; //导入依赖的package包/类
public void generateChallenge(HeaderFactory headerFactory, Response response, String realm  ) {
    try {
        ProxyAuthenticateHeader proxyAuthenticate = headerFactory
                .createProxyAuthenticateHeader(DEFAULT_SCHEME);
        proxyAuthenticate.setParameter("realm", realm);
        proxyAuthenticate.setParameter("nonce", generateNonce());
        proxyAuthenticate.setParameter("opaque", "");
        proxyAuthenticate.setParameter("stale", "FALSE");
        proxyAuthenticate.setParameter("algorithm", DEFAULT_ALGORITHM);
        response.setHeader(proxyAuthenticate);
    } catch (Exception ex) {
        InternalErrorHandler.handleException(ex);
    }

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:16,代码来源:DigestServerAuthenticationHelper.java

示例4: addStatus

import javax.sip.header.HeaderFactory; //导入依赖的package包/类
protected void addStatus(HeaderFactory headerFactory, Request request) {
    try {
        Header extension = headerFactory.createHeader(EXTENSION_HDR,
                new Integer(counter++).toString());
        request.addHeader(extension);
    } catch (ParseException ex) {
        // do nothing
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:10,代码来源:MessageFlowHarness.java

示例5: generateChallenge

import javax.sip.header.HeaderFactory; //导入依赖的package包/类
public void generateChallenge(HeaderFactory headerFactory, Response response, String realm  ) {
    try {
        WWWAuthenticateHeader wwwAuthenticateHeader = headerFactory.createWWWAuthenticateHeader(DEFAULT_SCHEME);
        wwwAuthenticateHeader.setParameter("realm", realm);
        wwwAuthenticateHeader.setParameter("nonce", generateNonce());
        //wwwAuthenticateHeader.setParameter("opaque", "");
        //wwwAuthenticateHeader.setParameter("stale", "FALSE");
        wwwAuthenticateHeader.setParameter("algorithm", DEFAULT_ALGORITHM);
        response.setHeader(wwwAuthenticateHeader);
    } catch (Exception ex) {
        InternalErrorHandler.handleException(ex);
    }

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:15,代码来源:DigestServerAuthenticationWWWHelper.java

示例6: makeRequest

import javax.sip.header.HeaderFactory; //导入依赖的package包/类
public Request makeRequest(SipManager sipManager, long cseqNumber, int expiresTime) throws ParseException, InvalidArgumentException {

		AddressFactory addressFactory = sipManager.addressFactory;
		SipProvider sipProvider = sipManager.sipProvider;
		MessageFactory messageFactory = sipManager.messageFactory;
		HeaderFactory headerFactory = sipManager.headerFactory;
		
		// Create addresses and via header for the request
		Address fromAddress = addressFactory.createAddress("sip:"+ SipManager.sipUserName + "@"+ SipManager.registrarIp);
		fromAddress.setDisplayName(SipManager.sipUserName);
		Address toAddress = addressFactory.createAddress("sip:"	+ SipManager.sipUserName + "@"	+ SipManager.registrarIp);
		toAddress.setDisplayName(SipManager.sipUserName);
		Address contactAddress = sipManager.createContactAddress();
		ArrayList<ViaHeader> viaHeaders = sipManager.createViaHeader();
		URI requestURI = addressFactory.createAddress("sip:" + SipManager.registrarIp).getURI();
		
		// Build the request
		final Request request = messageFactory.createRequest(requestURI,
				Request.REGISTER, sipProvider.getNewCallId(),
				headerFactory.createCSeqHeader(cseqNumber, Request.REGISTER),
				headerFactory.createFromHeader(fromAddress, "c3ff411e"),
				headerFactory.createToHeader(toAddress, null), viaHeaders,
				headerFactory.createMaxForwardsHeader(70));
		
		// Add the contact header
		request.addHeader(headerFactory.createContactHeader(contactAddress));
		ExpiresHeader eh = headerFactory.createExpiresHeader(expiresTime);
		request.addHeader(eh);
		
		// Print the request
		System.out.println(request.toString());
		return request;
	}
 
开发者ID:SyMPHOnY-,项目名称:Smart-Home-Gateway,代码行数:34,代码来源:RegisterMessage.java

示例7: getAuthenticationHelper

import javax.sip.header.HeaderFactory; //导入依赖的package包/类
public AuthenticationHelper getAuthenticationHelper(
		AccountManager accountManager, HeaderFactory headerFactory) {
	return new AuthenticationHelperImpl(this, accountManager, headerFactory);
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:5,代码来源:SipStackImpl.java

示例8: getSecureAuthenticationHelper

import javax.sip.header.HeaderFactory; //导入依赖的package包/类
public AuthenticationHelper getSecureAuthenticationHelper(
		SecureAccountManager accountManager, HeaderFactory headerFactory) {
	return new AuthenticationHelperImpl(this, accountManager, headerFactory);
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:5,代码来源:SipStackImpl.java

示例9: TestCall

import javax.sip.header.HeaderFactory; //导入依赖的package包/类
public TestCall(String localTag, SipProvider sipProvider, HeaderFactory headerFactory, MessageFactory messageFactory) {
	this.localTag = localTag;
	this.sipProvider = sipProvider;
	this.messageFactory = messageFactory;
	this.headerFactory = headerFactory;
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:7,代码来源:TestCall.java

示例10: getHeaderFactory

import javax.sip.header.HeaderFactory; //导入依赖的package包/类
public HeaderFactory getHeaderFactory() {
    return headerFactory;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:SipConfiguration.java

示例11: setHeaderFactory

import javax.sip.header.HeaderFactory; //导入依赖的package包/类
/**
 * To use a custom HeaderFactory
 */
public void setHeaderFactory(HeaderFactory headerFactory) {
    this.headerFactory = headerFactory;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:7,代码来源:SipConfiguration.java

示例12: getAuthenticationHelper

import javax.sip.header.HeaderFactory; //导入依赖的package包/类
/**
 * Get the authentication helper.
 *
 *
 * @param accountManager -- account manager (for fetching credentials).
 * @param headerFactory -- header factory.
 *
 * @return - the authentication helper which can be used for generating the appropriate
 *         headers for handling authentication challenges for user agents.
 *
 * @since 2.0
 */
public AuthenticationHelper getAuthenticationHelper(AccountManager accountManager,
                                                    HeaderFactory headerFactory);
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:15,代码来源:SipStackExt.java

示例13: getSecureAuthenticationHelper

import javax.sip.header.HeaderFactory; //导入依赖的package包/类
/**
 * Get the authentication helper.
 *
 *
 * @param accountManager -- account manager (for fetching credentials).
 * @param headerFactory -- header factory.
 *
 * @return - the authentication helper which can be used for generating the appropriate
 *         headers for handling authentication challenges for user agents.
 *
 * @since 2.0
 */
public AuthenticationHelper getSecureAuthenticationHelper(SecureAccountManager accountManager,
                                                          HeaderFactory headerFactory);
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:15,代码来源:SipStackExt.java


注:本文中的javax.sip.header.HeaderFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。