资源简介
tr069简单实现源码分享
代码片段和文件信息
package org.slive.tr069.control;
import org.slive.tr069.model.AbstractMethod;
/**
* ACS请求,CPE回复,并最终确认
* @author Slive
* @date 2013-5-15
*/
public class ACSConfirmMethod
{
private AbstractMethod requestMethod;
private AbstractMethod responseMethod;
private boolean confirm;
private long startTime;
private long endTime;
private int timeOut;
private object attachObj; // 日志或者标识
public ACSConfirmMethod(AbstractMethod requestMethod)
{
if (requestMethod == null)
{
throw new NullPointerException();
}
this.requestMethod = requestMethod;
this.confirm = false;
startTime = System.currentTimeMillis();
timeOut = 1000 * 60 * 10;
}
public ACSConfirmMethod(AbstractMethod requestMethod object attachObj)
{
this(requestMethod);
this.attachObj = attachObj;
}
public AbstractMethod getResponseMethod()
{
return responseMethod;
}
/**
* 注意:只能确认一次
* @param responseMethod
*/
public void setResponseMethod(AbstractMethod responseMethod)
{
if (responseMethod == null)
{
return;
}
if (!confirm && (requestMethod.getRequestId().equals(responseMethod.getRequestId())))
{
confirm = true;
this.responseMethod = responseMethod;
endTime = System.currentTimeMillis();
}
}
public AbstractMethod getRequestMethod()
{
return requestMethod;
}
/**
* 当请求的方法的ID和回复的方法的ID一致时,为已确认
* @return
*/
public boolean isConfirm()
{
return confirm;
}
public boolean isTimeOut()
{
if ((System.currentTimeMillis() - startTime) > timeOut)
{
return true;
}
else
{
return false;
}
}
public int getTimeOut()
{
return timeOut;
}
public void setTimeOut(int timeOut)
{
this.timeOut = timeOut;
}
public long getStartTime()
{
return startTime;
}
public long getEndTime()
{
return endTime;
}
/**
* 返回附加对象
* @return 返回null代表无附加信息
*/
public object getAttachObj()
{
return attachObj;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-05-30 11:51 org.slive.tr069.bundle\
文件 1014 2013-05-20 09:59 org.slive.tr069.bundle\.classpath
文件 683 2015-01-23 23:00 org.slive.tr069.bundle\.project
目录 0 2013-05-03 10:50 org.slive.tr069.bundle\.settings\
文件 395 2013-05-03 10:50 org.slive.tr069.bundle\.settings\org.eclipse.jdt.core.prefs
文件 123 2013-05-03 10:50 org.slive.tr069.bundle\.settings\org.eclipse.pde.core.prefs
目录 0 2013-05-03 10:50 org.slive.tr069.bundle\me
文件 677 2015-01-23 23:04 org.slive.tr069.bundle\me
目录 0 2015-02-03 21:41 org.slive.tr069.bundle\bin\
文件 432 2013-05-20 09:59 org.slive.tr069.bundle\build.properties
目录 0 2013-05-20 09:59 org.slive.tr069.bundle\lib\
文件 232771 2013-05-03 11:11 org.slive.tr069.bundle\lib\commons-codec-1.6.jar
文件 60686 2013-05-03 11:11 org.slive.tr069.bundle\lib\commons-logging-1.1.1.jar
文件 21776 2013-05-03 11:11 org.slive.tr069.bundle\lib\fluent-hc-4.2.5.jar
文件 433368 2013-05-03 11:11 org.slive.tr069.bundle\lib\httpclient-4.2.5.jar
文件 115625 2013-05-03 11:11 org.slive.tr069.bundle\lib\httpclient-cache-4.2.5.jar
文件 227275 2013-05-03 11:11 org.slive.tr069.bundle\lib\httpcore-4.2.4.jar
文件 26477 2013-05-03 11:11 org.slive.tr069.bundle\lib\httpmime-4.2.5.jar
文件 25689 2013-05-20 09:59 org.slive.tr069.bundle\lib\slf4j-api-1.6.2.jar
目录 0 2013-05-03 11:02 org.slive.tr069.bundle\src\
目录 0 2015-01-23 21:47 org.slive.tr069.bundle\src\org\
目录 0 2015-01-23 21:47 org.slive.tr069.bundle\src\org\slive\
目录 0 2015-01-23 21:47 org.slive.tr069.bundle\src\org\slive\tr069\
目录 0 2015-01-23 21:47 org.slive.tr069.bundle\src\org\slive\tr069\control\
文件 2563 2015-01-23 22:01 org.slive.tr069.bundle\src\org\slive\tr069\control\ACSConfirmMethod.java
文件 10853 2015-01-23 21:49 org.slive.tr069.bundle\src\org\slive\tr069\control\ACSProcessControl.java
文件 1464 2015-01-23 21:47 org.slive.tr069.bundle\src\org\slive\tr069\control\ACSProcessControlManager.java
文件 898 2015-01-23 22:02 org.slive.tr069.bundle\src\org\slive\tr069\control\DefaultInformHandleAdpter.java
文件 2547 2015-01-23 21:49 org.slive.tr069.bundle\src\org\slive\tr069\control\DefaultResponseHandleAdpter.java
文件 310 2015-01-23 21:47 org.slive.tr069.bundle\src\org\slive\tr069\control\IHandle.java
文件 4522 2015-01-23 22:04 org.slive.tr069.bundle\src\org\slive\tr069\control\IInformHandle.java
............此处省略119个文件信息
评论
共有 条评论