expirestask.java

来自「First of all, the Applet-phone is a SIP 」· Java 代码 · 共 40 行

JAVA
40
字号
/******************************************************************************** Product of NIST/ITL Advanced Networking Technologies Division (ANTD)         ** Creator: O. Deruelle (deruelle@nist.gov)                                     ** Questions/Comments: nist-sip-dev@antd.nist.gov                               ********************************************************************************/package gov.nist.examples.pcc.registrar;import java.util.*;import javax.sip.header.*;import javax.sip.address.*;import gov.nist.examples.pcc.*;/** Class for removing the bindings after expires */public class ExpiresTask extends TimerTask {        private String key;    private ContactHeader contactHeader;    private RegistrationsTable registrationsTable;        /** Constructor       */       public ExpiresTask(String key,ContactHeader contactHeader,RegistrationsTable registrationsTable) {        this.registrationsTable=registrationsTable;        this.key=key;        this.contactHeader=contactHeader;    }       public void  run() {        Address address=contactHeader.getAddress();        javax.sip.address.URI cleanedUri=Registrar.getCleanUri(address.getURI() );        String contactURI=cleanedUri.toString();        registrationsTable.removeContact(key,contactHeader);        registrationsTable.expiresTaskTable.remove(contactURI);        CallLauncherDebug.println("ExpiresTask, run(), we  removed the contact: "+contactURI+        " for the user: "+key);        }    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?