Examples of Device


Examples of net.sf.uadetector.internal.data.domain.Device

        b.setPatterns(patterns);
      }
    }

    // create device
    Device d = null;
    try {
      // build
      d = b.build();

      // check hash when option is set
View Full Code Here

Examples of net.sourceforge.wurfl.core.Device

        try {
            final RequestData requestData = requestUtil.getRequestData(request);

            final WURFLHolder wurfl = (WURFLHolder) ctx.getBean("wurflHolder");
            final WURFLManager manager = wurfl.getWURFLManager();
            Device device = manager.getDeviceForRequest(request);
            String deviceFolder = "default";
            if (device != null) {
                boolean isSmartPhone = BooleanUtils.toBoolean(device.getVirtualCapability("is_smartphone"));
                boolean isIPhoneOs = BooleanUtils.toBoolean(device.getVirtualCapability("is_iphone_os"));
                boolean isAndroid = BooleanUtils.toBoolean(device.getVirtualCapability("is_android"));
                if (isSmartPhone || isIPhoneOs || isAndroid) {
                    deviceFolder = "mobile";
                }
            }
            requestUtil.updateCurrentDevice(requestData, deviceFolder);
View Full Code Here

Examples of nz.co.abrahams.asithappens.storage.Device

        this.retrieveRWCommunity = retrieveRWCommunity;
    }
   
    public void setDevice(String deviceName, String community) throws UnknownHostException, SNMPException {
        if ( retrieveRWCommunity ) {
            device = new Device(deviceName, null, community, true);
            snmp = new PortsSelectorSNMP(device);
        }
        else {
            device = new Device(deviceName, community, null, false);
            snmp = new PortsSelectorSNMP(device);
        }
    }
View Full Code Here

Examples of nz.co.abrahams.asithappens.storage.Device

        deviceDAO.closeConnection();
       
    }
   
    public String retrieveCommunity(String deviceName) throws DBException {
        Device temporaryDevice;
       
        temporaryDevice = new Device(deviceName);
        if ( retrieveRWCommunity )
            return temporaryDevice.retrieveWriteCommunity();
        else
            return temporaryDevice.retrieveReadCommunity();
    }
View Full Code Here

Examples of nz.co.abrahams.asithappens.storage.Device

    }
   
    /** @return a Flow object corresponding to the next packet in the trace file */
    public Flow next() {
        Flow flow;
        Device sourceDevice;
        Device destinationDevice;
        IpAddressPrimitive source = null;
        IpAddressPrimitive destination = null;
        MacAddressPrimitive src = null;
        MacAddressPrimitive dst = null;
        int etherProtocol = -1;
        int ipProtocol = -1;
        int srcPort = -1;
        int dstPort = -1;
       
        try {
           
            /* Aligns the position of the stream at beginning of packet */
            in.nextPacket();
           
            /* Returns the name of the first header */
            String linkType = in.getLinkType();
            int length = (int)in.getPacketLength();
            long timestamp = in.getCaptureTimestamp().getTime();
           
            if (linkType.equals("Ethernet") == true) {
               
                dst = new MacAddressPrimitive();
                dst.setValue(in);
               
                src = new MacAddressPrimitive();
                src.setValue(in);
               
                etherProtocol = in.readUnsignedShort();
               
                // Now check if its IP protocol
                if (etherProtocol == 0x800) {
                    int version =       in.readBits(4);
                    int hlen =          in.readBits(4);
                    int precedence =    in.readBits(3);
                    //int delay =         in.readBits(1);
                    //int throughtput =   in.readBits(1);
                    //int reliability =   in.readBits(1);
                    //in.readBits(2);     // Reserved 2 bits
                   
                    //int ipLength =      in.readUnsignedShort();
                    //int id =            in.readUnsignedShort();
                   
                    //in.readBits(1);     // Reserved 1 flag bit
                   
                    //int doNotFragment = in.readBits(1);
                    //int moreFragments = in.readBits(1);
                   
                    in.readBits(32);
                    in.readBits(8);
                    int offset =        in.readBits(13);
                    int timeToLive =    in.readUnsignedByte();
                   
                    ipProtocol =    in.readUnsignedByte();
                    int checksum =      in.readUnsignedShort();
                   
                    source = new IpAddressPrimitive();
                    source.setValue(in);
                   
                    destination = new IpAddressPrimitive();
                    destination.setValue(in);
                   
                    // Skip all the options
                    if ( hlen > 5 )
                        in.readBits((hlen - 5) * 32);
                   
                    //logger.debug("Ethernet " + src + " -> " + dst);
                    //logger.debug("IP " + source + " -> " + destination);
                   
                    if (ipProtocol == 6) {
                        srcPort = in.readUnsignedShort();
                        dstPort = in.readUnsignedShort();
                        long seqNumber = in.readUnsignedInt();
                        long ackNumber = in.readUnsignedInt();
                       
                        //int ipOffset = in.readBits(4);
                        // reserved
                        //in.readBits(6);
                        //int flags = in.readBits(6);
                        //int window = in.readUnsignedShort();
                       
                        in.readBits(32);
                        if ( offset > 5 )
                            in.readBits((offset - 5) * 32);
                        logger.debug("TCP: " + source + "(" + srcPort + ") -> "
                                + destination + "(" + dstPort + ")");
                       
                    } else if (ipProtocol == 17) {
                        srcPort = in.readUnsignedShort();
                        dstPort = in.readUnsignedShort();
                       
                        //int udpLength = in.readUnsignedShort();
                        //int udpChecksum = in.readUnsignedShort();
                        in.readBits(32);
                        logger.debug("UDP: " + source + "(" + srcPort + ") -> "
                                + destination + "(" + dstPort + ")");
                       
                    } else { // For all other IP protocols display number
                        logger.debug(
                                "IP: " + source + " -> " + destination + " protocol=0x"
                                + Integer.toHexString(ipProtocol) );
                    }
                    sourceDevice = new Device(InetAddress.getByName(source.toString()), new EthernetAddress(src.toString()));
                    destinationDevice = new Device(InetAddress.getByName(destination.toString()), new EthernetAddress(dst.toString()));
                   
                    return new Flow(timestamp, sourceDevice, destinationDevice, etherProtocol, ipProtocol, srcPort, dstPort, length);
                   
                } else {
                    logger.debug("Ethernet " + src + " -> " + dst
                            + " Ethertype=0x"
                            + Integer.toHexString(etherProtocol) );
                    sourceDevice = new Device(new EthernetAddress(src.toString()));
                    destinationDevice = new Device(new EthernetAddress(dst.toString()));
                    return new Flow(timestamp, sourceDevice, destinationDevice, etherProtocol, length);
                }
            } else {
                logger.debug("Unsupported packet type: " + linkType);
                return next();
View Full Code Here

Examples of nz.co.abrahams.asithappens.storage.Device

     * @return               the collector created from the database definition
     */
    public ProcessorCiscoCollector retrieve(int sessionID) throws DBException, UnknownHostException, SNMPException {
        DeviceDAO deviceDAO;
        String name;
        Device device;
        ProcessorCiscoSNMP snmp;
        long pollInterval;
        int snmpIndex;
       
        name = (String)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_DEVICE, sessionID));
View Full Code Here

Examples of nz.co.abrahams.asithappens.storage.Device

     * @return               the collector created from the database definition
     */
    public ProcessorHRCollector retrieve(int sessionID) throws DBException, UnknownHostException, SNMPException {
        DeviceDAO deviceDAO;
        String name;
        Device device;
        ProcessorHRSNMP snmp;
        long pollInterval;
        int snmpIndex;
       
        name = (String)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_DEVICE, sessionID));
View Full Code Here

Examples of nz.co.abrahams.asithappens.storage.Device

     * @return               the collector created from the database definition
     */
    public MemoryUCDCollector retrieve(int sessionID) throws DBException, UnknownHostException, SNMPException {
        DeviceDAO deviceDAO;
        String name;
        Device device;
        MemoryUCDSNMP snmp;
        long pollInterval;
        int memoryType;
       
        name = (String)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_DEVICE, sessionID));
View Full Code Here

Examples of nz.co.abrahams.asithappens.storage.Device

     * @return               the collector created from the database definition
     */
    public MemoryCiscoCollector retrieve(int sessionID) throws DBException, UnknownHostException, SNMPException {
        DeviceDAO deviceDAO;
        String name;
        Device device;
        MemoryCiscoSNMP snmp;
        long pollInterval;
        int snmpIndex;
       
        name = (String)(DBUtil.retrieveSingleAttributeWithPK(connection, RETRIEVE_DEVICE, sessionID));
View Full Code Here

Examples of nz.co.abrahams.asithappens.storage.Device

        add(portsSelectorPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));
    }
   
    /** Creates a new bandwidth graph. */
    private void bandwidthButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bandwidthButtonActionPerformed
        Device device;
        int[] ifIndices;
        String[] ifDescriptions;
        String portString;
        BandwidthSNMP snmp;
        BandwidthCollector collector;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.