Package com.alibaba.json.bvt.parser

Examples of com.alibaba.json.bvt.parser.DefaultExtJSONParserTest_6$V1


  }

  public void persist(String directory) {
    MP3File mp3File = new MP3File(new File(directory + getFull()));
    ID3V1Tag tag1 = null;
    try {
      tag1 = mp3File.getID3V1Tag();
      if(tag1==null){
        tag1 = new ID3V1_0Tag();
      }
    } catch (ID3Exception e) {
      tag1 = new ID3V1_0Tag();
    }
    if(!"".equals(getTitle())) tag1.setTitle(getTitle());
    tag1.setAlbum(getAlbum());
    tag1.setArtist(getArtist());
    tag1.setComment(getComment());
    try {
      tag1.setGenre(Genre.lookupGenre(getGenre()));
    } catch (ID3Exception e) {
    }
    tag1.setYear(getYear());
    mp3File.setID3Tag(tag1);
    try {
      mp3File.sync();
    } catch (ID3Exception e) {
    }
View Full Code Here


  public String getComment() {
    return guard(tag1.getComment());
  }

  public String getGenre() {
    Genre genre = tag1.getGenre();
    if(genre!=null) return genre.toString();
    return "";
  }
View Full Code Here

    MP3File mp3File = new MP3File(file);
    try {
      tag1 = mp3File.getID3V1Tag();
      if(tag1==null){
        tag1 = new ID3V1_0Tag();
      }
    } catch (ID3Exception e) {
      tag1 = new ID3V1_0Tag();
    }
  }
View Full Code Here

    MP3File mp3File = new MP3File(new File(directory + getFull()));
    ID3V1Tag tag1 = null;
    try {
      tag1 = mp3File.getID3V1Tag();
      if(tag1==null){
        tag1 = new ID3V1_0Tag();
      }
    } catch (ID3Exception e) {
      tag1 = new ID3V1_0Tag();
    }
    if(!"".equals(getTitle())) tag1.setTitle(getTitle());
    tag1.setAlbum(getAlbum());
    tag1.setArtist(getArtist());
    tag1.setComment(getComment());
View Full Code Here

        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss.SSSZ");
        header.setTimestamp(formatter.format(new Date()));
        Holder<HeaderT> mtosiHeader = new Holder<HeaderT>(header);

        GetActiveAlarmsCountT mtosiBody = new GetActiveAlarmsCountT();
        mtosiBody.setFilter(new ActiveAlarmFilterT());

        // use polling method to obtain response
       
        System.out.println("Invoking getActiveAlarmsCountAsync using polling.");
        Response<GetActiveAlarmsCountResponseT> response =
View Full Code Here

        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss.SSSZ");
        header.setTimestamp(formatter.format(new Date()));
        Holder<HeaderT> mtosiHeader = new Holder<HeaderT>(header);

        GetActiveAlarmsT mtosiBody = new GetActiveAlarmsT();
        mtosiBody.setFilter(new ActiveAlarmFilterT());

        // use callback method to obtain response
       
        System.out.println("Invoking getActiveAlarmsAsync using callback.");
        AsyncAlarmHandler handler = new AsyncAlarmHandler();
View Full Code Here

    private List<AlarmT> alarms = new Vector<AlarmT>();

    public void addAlarm(int alarmID) {

        AlarmT alarm = new AlarmT();

        EventInformationT eventInfo = new EventInformationT();
        ProbableCauseT probableCause = new ProbableCauseT();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss.SSSZ");

        switch (alarmID % 2) {
        case 1:
            eventInfo.setNotificationId("0001239");
            eventInfo.setObjectType(ObjectTypeT.OT_EQUIPMENT);
            eventInfo.setObjectName(new NamingAttributesT());
            eventInfo.setOsTime(formatter.format(new Date()));
            eventInfo.setNeTime(formatter.format(new Date()));
            eventInfo.setEdgePointRelated(Boolean.FALSE);
            probableCause.setType("PROP_odd_probable_cause_type");
            alarm.setEventInfo(eventInfo);
            alarm.setIsClearable(false);
            alarm.setLayerRate("PROP_layer_rate_odd");
            alarm.setProbableCause(probableCause);
            alarm.setPerceivedSeverity("PROP_odd_perceived_severity");
            alarm.setServiceAffecting(ServiceAffectingT.SA_UNKNOWN);
            alarm.setRcaiIndicator(false);
            break;

        default:
            eventInfo.setNotificationId("9876543");
            eventInfo.setObjectType(ObjectTypeT.OT_OS);
            eventInfo.setObjectName(new NamingAttributesT());
            eventInfo.setOsTime(formatter.format(new Date()));
            eventInfo.setEdgePointRelated(Boolean.FALSE);
            probableCause.setType("PROP_even_probable_cause_type");
            alarm.setEventInfo(eventInfo);
            alarm.setIsClearable(true);
            alarm.setLayerRate("PROP_layer_rate_even");
            alarm.setProbableCause(probableCause);
            alarm.setPerceivedSeverity("PROP_even_perceived_severity");
            alarm.setServiceAffecting(ServiceAffectingT.SA_SERVICE_AFFECTING);
            alarm.setRcaiIndicator(false);
            break;

        }

        alarms.add(alarm);
View Full Code Here

        GetActiveAlarmsResponseT.ActiveAlarmList alarmList = new GetActiveAlarmsResponseT.ActiveAlarmList();
       
        Long requestedCount = mtosiHeader.value.getRequestedBatchSize();
        if (requestedCount != null) {
            for (int i = 0; i < requestedCount && alarms.size() > 0; i++) {
                AlarmT alarm = alarms.remove(0);
                alarmList.getActiveAlarm().add(alarm);
            }
            // Indicate to the caller if there are more alarms remaining.
            if (alarms.size() > 0) {
                mtosiHeader.value.setBatchSequenceEndOfReply(Boolean.FALSE);
View Full Code Here

        }

        int i = 0;
        for (AlarmT alarm : alarms) {
            System.out.println("Alarm #" + i++ + ":");
            EventInformationT eventInfo = alarm.getEventInfo();
            System.out.println("- Notification ID: " + eventInfo.getNotificationId());
            System.out.println("- Object type: " + eventInfo.getObjectType().value());
            System.out.println("- OS time: " + eventInfo.getOsTime());

            if (eventInfo.getNeTime() != null) {
                System.out.println("- NE time: " + eventInfo.getNeTime());
            }

            String layerRate = alarm.getLayerRate();
            if (layerRate != null) {
                System.out.println("- Layer/Rate: " + layerRate);
View Full Code Here

    public void addAlarm(int alarmID) {

        AlarmT alarm = new AlarmT();

        EventInformationT eventInfo = new EventInformationT();
        ProbableCauseT probableCause = new ProbableCauseT();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss.SSSZ");

        switch (alarmID % 2) {
        case 1:
            eventInfo.setNotificationId("0001239");
            eventInfo.setObjectType(ObjectTypeT.OT_EQUIPMENT);
            eventInfo.setObjectName(new NamingAttributesT());
            eventInfo.setOsTime(formatter.format(new Date()));
            eventInfo.setNeTime(formatter.format(new Date()));
            eventInfo.setEdgePointRelated(Boolean.FALSE);
            probableCause.setType("PROP_odd_probable_cause_type");
            alarm.setEventInfo(eventInfo);
            alarm.setIsClearable(false);
            alarm.setLayerRate("PROP_layer_rate_odd");
            alarm.setProbableCause(probableCause);
            alarm.setPerceivedSeverity("PROP_odd_perceived_severity");
            alarm.setServiceAffecting(ServiceAffectingT.SA_UNKNOWN);
            alarm.setRcaiIndicator(false);
            break;

        default:
            eventInfo.setNotificationId("9876543");
            eventInfo.setObjectType(ObjectTypeT.OT_OS);
            eventInfo.setObjectName(new NamingAttributesT());
            eventInfo.setOsTime(formatter.format(new Date()));
            eventInfo.setEdgePointRelated(Boolean.FALSE);
            probableCause.setType("PROP_even_probable_cause_type");
            alarm.setEventInfo(eventInfo);
            alarm.setIsClearable(true);
            alarm.setLayerRate("PROP_layer_rate_even");
            alarm.setProbableCause(probableCause);
View Full Code Here

TOP

Related Classes of com.alibaba.json.bvt.parser.DefaultExtJSONParserTest_6$V1

Copyright © 2018 www.massapicom. 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.