List of usage examples for org.joda.time.format DateTimeFormatter parseDateTime
public DateTime parseDateTime(String text)
From source file:com.brandboat.loader.lib.FileServerInfo.java
private String createUpsertSQL1() { DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss"); DateTime startTime = dtf.parseDateTime("2015-09-01 01:00:00"); final UpsertSQLBuilder sql = new UpsertSQLBuilder(); return sql.setServerId("SET1").setServerName("f12aofdcf01").setIsPrimary(true).setIsServerAlive(true) .setLoadDate(startTime).build(); }
From source file:com.brandboat.loader.lib.FileServerInfo.java
private String createUpsertSQL2() { DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss"); DateTime startTime = dtf.parseDateTime("2015-09-01 01:00:00"); final UpsertSQLBuilder sql = new UpsertSQLBuilder(); return sql.setServerId("SET1").setServerName("f12aofdcf02").setIsPrimary(false).setIsServerAlive(true) .setLoadDate(startTime).build(); }
From source file:com.brandboat.loader.lib.FileServerInfo.java
private String createUpsertSQL3() { DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss"); DateTime startTime = dtf.parseDateTime("2015-09-01 01:00:00"); final UpsertSQLBuilder sql = new UpsertSQLBuilder(); return sql.setServerId("SET2").setServerName("F12AOFDCF01").setIsPrimary(false).setIsServerAlive(true) .setLoadDate(startTime).build(); }
From source file:com.brandboat.loader.lib.FileServerInfo.java
private String createUpsertSQL4() { DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss"); DateTime startTime = dtf.parseDateTime("2015-09-01 01:00:00"); final UpsertSQLBuilder sql = new UpsertSQLBuilder(); return sql.setServerId("SET2").setServerName("F12AOFDCF02").setIsPrimary(true).setIsServerAlive(true) .setLoadDate(startTime).build(); }
From source file:com.brandboat.loader.lib.FileServerInfo.java
private String createUpsertSQL5() { DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss"); DateTime startTime = dtf.parseDateTime("2015-09-01 01:00:00"); final UpsertSQLBuilder sql = new UpsertSQLBuilder(); return sql.setServerId("SET3").setServerName("F12AOFDCF01").setIsPrimary(true).setIsServerAlive(true) .setLoadDate(startTime).build(); }
From source file:com.brandboat.loader.lib.FileServerInfo.java
private String createUpsertSQL6() { DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss"); DateTime startTime = dtf.parseDateTime("2015-09-01 01:00:00"); final UpsertSQLBuilder sql = new UpsertSQLBuilder(); return sql.setServerId("SET3").setServerName("F12AOFDCF02").setIsPrimary(false).setIsServerAlive(true) .setLoadDate(startTime).build(); }
From source file:com.bskyb.cg.environments.message.BaseMessageFormat.java
License:Apache License
protected DateTime parseDate(String datestring) throws java.text.ParseException, IndexOutOfBoundsException { DateTimeFormatter df = DateTimeFormat.forPattern(datePattern); DateTime d = new DateTime(); d = df.parseDateTime(datestring); return d;/* w w w.ja v a2s . com*/ }
From source file:com.celtris.exparse.utils.Conversion.java
License:Apache License
public static DateTime convertDateTime(String value, DateTimeFormatter dateTimeFormatter) { if (dateTimeFormatter == null) { try {// ww w.j a v a 2s .com return DateTime.parse(value); } catch (UnsupportedOperationException e) { throw new IllegalArgumentException(); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(); } } else { try { return dateTimeFormatter.parseDateTime(value); } catch (UnsupportedOperationException e) { throw new IllegalArgumentException(); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(); } } }
From source file:com.claresco.tinman.lrs.XapiStatement.java
License:Open Source License
/** * //ww w . j a va 2 s . c om * Constructor * * Params: * * */ public XapiStatement(XapiActor theActor, XapiVerb theVerb, XapiObject theObject, XapiResult theResult, XapiContext theContext, String theTimeStamp) { this.myID = UUID.randomUUID(); this.myActor = theActor; this.myVerb = theVerb; this.myObject = theObject; this.myResult = theResult; this.myContext = theContext; this.myTimeStampAsString = theTimeStamp; DateTimeFormatter theFormatter = ISODateTimeFormat.dateTimeParser(); if (theTimeStamp != null) { myTimeStamp = theFormatter.parseDateTime(theTimeStamp); } else { myTimeStamp = null; } this.isVoiding = myVerb.isVoided(); }
From source file:com.claresco.tinman.servlet.XapiCredentials.java
License:Open Source License
/** * Constructor /*w ww . ja v a 2 s . c o m*/ * * Params: * * */ public XapiCredentials(ArrayList<String> theScope, String theExpiry, boolean theHistorical, XapiPerson thePerson, ArrayList<String> theActivityIDs, String theRegistration, DateTime theReceivedTimestamp) throws XapiBadParamException { myScope = theScope; myHistorical = theHistorical; myPerson = thePerson; if (theRegistration != null) { myRegistration = UUID.fromString(theRegistration); } else { theRegistration = null; } myReceivedTimestamp = theReceivedTimestamp; DateTimeFormatter theFormatter = ISODateTimeFormat.dateTimeParser(); if (theExpiry != null) { myExpiry = theFormatter.parseDateTime(theExpiry); } else { // By default, 4 hours myExpiry = DateTime.now().plusHours(4); } for (String s : theActivityIDs) { myActivityIDs.add(new XapiIRI(s)); } populateAcceptedScope(); // Assign appropriate clearance based on its scope for (String scope : theScope) { if (!myAcceptedScope.contains(scope)) { throw new XapiBadParamException("Scope is not accepted"); } else { if (scope.equals("all")) { myReadStatementsClearance = true; myWriteStatementsClearance = true; myReadStateClearance = true; myWriteStateClearance = true; myDefineClearance = true; myReadProfileClearance = true; myWriteProfileClearance = true; myReadAnyoneStatementsClearance = true; } else if (scope.equals("all/read")) { myReadStatementsClearance = true; myReadAnyoneStatementsClearance = true; myReadStateClearance = true; myReadProfileClearance = true; } else if (scope.equals("profile")) { myReadProfileClearance = true; myWriteProfileClearance = true; } else if (scope.equals("state")) { myReadStateClearance = true; myWriteStateClearance = true; } else if (scope.equals("define")) { myDefineClearance = true; } else if (scope.equals("statements/read")) { myReadAnyoneStatementsClearance = true; myReadStatementsClearance = true; } else if (scope.equals("statements/read/mine")) { myReadStatementsClearance = true; } else if (scope.equals("statements/write")) { myWriteStatementsClearance = true; } } } }