資源簡介
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個文件信息
評論
共有 條評論